w2l log viewer improvements
git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@221 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
parent
cdca675509
commit
ceddd94461
7 changed files with 106 additions and 13 deletions
|
@ -2,6 +2,11 @@ Changelog for Writer2LaTeX version 1.4 -> 1.6
|
|||
|
||||
---------- version 1.5.2 ----------
|
||||
|
||||
[w2x] Bugfix: No longer include xmlns attribute on math nodes in HTML5
|
||||
|
||||
[w2l] Various improvements to the log viewer dialog: Reduced height to better accommodate small screen resolutions.
|
||||
Added checkbox to filter the LaTeX log to display only errors. Added help page and long tips.
|
||||
|
||||
[w2x] Changed export format for toolbar from XHTML+MathML to HTML5
|
||||
|
||||
[w2l] Added new option font to load font packages. It accepts a large number of standard font packages such as
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Version 1.6 (2014-10-29)
|
||||
* Version 1.6 (2014-11-20)
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -36,6 +36,7 @@ import java.net.URISyntaxException;
|
|||
import com.sun.star.awt.XDialog;
|
||||
import com.sun.star.uno.XComponentContext;
|
||||
|
||||
import org.openoffice.da.comp.w2lcommon.helper.DialogAccess;
|
||||
import org.openoffice.da.comp.w2lcommon.helper.DialogBase;
|
||||
|
||||
/** This class provides a uno component which displays logfiles
|
||||
|
@ -59,6 +60,7 @@ public class LogViewerDialog extends DialogBase
|
|||
|
||||
private String sBaseUrl = null;
|
||||
private String sLaTeXLog = null;
|
||||
private String sLaTeXErrors = null;
|
||||
private String sBibTeXLog = null;
|
||||
private String sMakeindexLog = null;
|
||||
|
||||
|
@ -71,6 +73,7 @@ public class LogViewerDialog extends DialogBase
|
|||
public void initialize() {
|
||||
if (sBaseUrl!=null) {
|
||||
sLaTeXLog = readTextFile(sBaseUrl+".log");
|
||||
sLaTeXErrors = errorFilter(sLaTeXLog);
|
||||
sBibTeXLog = readTextFile(sBaseUrl+".blg");
|
||||
sMakeindexLog = readTextFile(sBaseUrl+".ilg");
|
||||
setComboBoxText("LogContents",sLaTeXLog);
|
||||
|
@ -98,19 +101,27 @@ public class LogViewerDialog extends DialogBase
|
|||
// Implement XDialogEventHandler
|
||||
public boolean callHandlerMethod(XDialog xDialog, Object event, String sMethod) {
|
||||
if (sMethod.equals("ViewLaTeXLog")) {
|
||||
setComboBoxText("LogContents", sLaTeXLog);
|
||||
setComboBoxText("LogContents",
|
||||
getCheckBoxState("ErrorFilter")==DialogAccess.CHECKBOX_CHECKED ? sLaTeXErrors : sLaTeXLog);
|
||||
setControlEnabled("ErrorFilter",true);
|
||||
}
|
||||
else if (sMethod.equals("ViewBibTeXLog")) {
|
||||
setComboBoxText("LogContents", sBibTeXLog);
|
||||
setControlEnabled("ErrorFilter",false);
|
||||
}
|
||||
else if (sMethod.equals("ViewMakeindexLog")) {
|
||||
setComboBoxText("LogContents", sMakeindexLog);
|
||||
setControlEnabled("ErrorFilter",false);
|
||||
}
|
||||
else if (sMethod.equals("ErrorFilterChange")) {
|
||||
setComboBoxText("LogContents",
|
||||
getCheckBoxState("ErrorFilter")==DialogAccess.CHECKBOX_CHECKED ? sLaTeXErrors : sLaTeXLog);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public String[] getSupportedMethodNames() {
|
||||
String[] sNames = { "ViewLaTeXLog", "ViewBibTeXLog", "ViewMakeindexLog" };
|
||||
String[] sNames = { "ViewLaTeXLog", "ViewBibTeXLog", "ViewMakeindexLog", "ErrorFilterChange" };
|
||||
return sNames;
|
||||
}
|
||||
|
||||
|
@ -139,6 +150,32 @@ public class LogViewerDialog extends DialogBase
|
|||
}
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
// Extract errors from LaTeX log file only
|
||||
private String errorFilter(String log) {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
int nLen = log.length();
|
||||
int nIndex = 0;
|
||||
boolean bIncludeLines = false;
|
||||
while (nIndex<nLen) {
|
||||
int nNewline = log.indexOf('\n', nIndex);
|
||||
if (nNewline==-1) nNewline = nLen;
|
||||
if (nNewline-nIndex>1 && log.charAt(nIndex)=='!') {
|
||||
bIncludeLines = true;
|
||||
}
|
||||
else if (nNewline==nIndex) {
|
||||
if (bIncludeLines) {
|
||||
buf.append('\n');
|
||||
}
|
||||
bIncludeLines = false;
|
||||
}
|
||||
if (bIncludeLines) {
|
||||
buf.append(log.substring(nIndex,nNewline)).append('\n');
|
||||
}
|
||||
nIndex = nNewline+1;
|
||||
}
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -187,9 +187,10 @@ public class MathConverter extends ConverterHelper {
|
|||
if (onode.hasAttribute("xmlns:math")) {
|
||||
math.setAttribute("xmlns", onode.getAttribute("xmlns:math"));
|
||||
}
|
||||
else if (onode.hasAttribute("xmlns")) {
|
||||
else if (onode.hasAttribute("xmlns") && converter.nType!=XhtmlDocument.HTML5) {
|
||||
// Don't include xmlns attribute in HTML5
|
||||
math.setAttribute("xmlns", onode.getAttribute("xmlns"));
|
||||
}
|
||||
}
|
||||
if (bAllowDisplay && onode.hasAttribute("display")) {
|
||||
// Starting with version 4.2, LO exports display="block" for display equations
|
||||
// This is a good thing, but in XHTML we can unfortunately only allow this for
|
||||
|
|
|
@ -1,19 +1,23 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
|
||||
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="LogViewer" dlg:left="122" dlg:top="43" dlg:width="360" dlg:height="360" dlg:closeable="true" dlg:moveable="true" dlg:title="writer2latex Log Viewer">
|
||||
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="LogViewer" dlg:left="122" dlg:top="43" dlg:width="360" dlg:height="260" dlg:closeable="true" dlg:moveable="true" dlg:title="Writer2LaTeX Log Viewer">
|
||||
<dlg:bulletinboard>
|
||||
<dlg:radiogroup>
|
||||
<dlg:radio dlg:id="LaTeXOption" dlg:tab-index="0" dlg:left="10" dlg:top="10" dlg:width="100" dlg:height="12" dlg:value="View LaTeX log" dlg:checked="true">
|
||||
<dlg:radio dlg:id="LaTeXOption" dlg:tab-index="0" dlg:left="10" dlg:top="10" dlg:width="100" dlg:height="12" dlg:value="View LaTeX log" dlg:checked="true" dlg:help-url="org.openoffice.da.writer2latex.oxt:ViewLaTeXLog">
|
||||
<script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.UNO:ViewLaTeXLog" script:language="UNO"/>
|
||||
</dlg:radio>
|
||||
<dlg:radio dlg:id="BibTeXOption" dlg:tab-index="1" dlg:left="120" dlg:top="10" dlg:width="100" dlg:height="12" dlg:value="View BibTeX log">
|
||||
<dlg:radio dlg:id="BibTeXOption" dlg:tab-index="1" dlg:left="120" dlg:top="10" dlg:width="100" dlg:height="12" dlg:value="View BibTeX log" dlg:help-url="org.openoffice.da.writer2latex.oxt:ViewBibTeXLog">
|
||||
<script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.UNO:ViewBibTeXLog" script:language="UNO"/>
|
||||
</dlg:radio>
|
||||
<dlg:radio dlg:id="MakeindexOption" dlg:tab-index="2" dlg:left="230" dlg:top="10" dlg:width="100" dlg:height="12" dlg:value="View Makeindex log">
|
||||
<dlg:radio dlg:id="MakeindexOption" dlg:tab-index="2" dlg:left="230" dlg:top="10" dlg:width="100" dlg:height="12" dlg:value="View Makeindex log" dlg:help-url="org.openoffice.da.writer2latex.oxt:ViewMakeindexLog">
|
||||
<script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.UNO:ViewMakeindexLog" script:language="UNO"/>
|
||||
</dlg:radio>
|
||||
</dlg:radiogroup>
|
||||
<dlg:textfield dlg:id="LogContents" dlg:tab-index="3" dlg:left="10" dlg:top="26" dlg:width="340" dlg:height="300" dlg:hscroll="true" dlg:vscroll="true" dlg:multiline="true" dlg:value="asfg"/>
|
||||
<dlg:button dlg:id="CloseButton" dlg:tab-index="4" dlg:left="10" dlg:top="336" dlg:width="70" dlg:height="12" dlg:value="Close" dlg:button-type="ok"/>
|
||||
<dlg:textfield dlg:id="LogContents" dlg:tab-index="3" dlg:left="10" dlg:top="26" dlg:width="340" dlg:height="200" dlg:hscroll="true" dlg:vscroll="true" dlg:multiline="true" dlg:value="asfg"/>
|
||||
<dlg:checkbox dlg:id="ErrorFilter" dlg:tab-index="4" dlg:left="10" dlg:top="236" dlg:width="200" dlg:height="12" dlg:value="Only errors" dlg:checked="false" dlg:help-url="org.openoffice.da.writer2latex.oxt:ErrorFilter">
|
||||
<script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.UNO:ErrorFilterChange" script:language="UNO"/>
|
||||
</dlg:checkbox>
|
||||
<dlg:button dlg:id="CloseButton" dlg:tab-index="5" dlg:left="200" dlg:top="236" dlg:width="70" dlg:height="12" dlg:value="Close" dlg:button-type="ok"/>
|
||||
<dlg:button dlg:id="HelpButton" dlg:tab-index="6" dlg:left="280" dlg:top="236" dlg:width="70" dlg:height="12" dlg:value="Help" dlg:button-type="help" dlg:help-url="org.openoffice.da.writer2latex.oxt:LogViewer"/>
|
||||
</dlg:bulletinboard>
|
||||
</dlg:window>
|
|
@ -3,7 +3,8 @@
|
|||
<help_section application="writer2latex" id="w2l01_writer" title="Writer2LaTeX">
|
||||
<topic id="writer2latex/org.openoffice.da.writer2latex.oxt/introduction.xhp">Introduction</topic>
|
||||
<topic id="writer2latex/org.openoffice.da.writer2latex.oxt/menu.xhp">Menu and toolbar</topic>
|
||||
<topic id="writer2latex/org.openoffice.da.writer2latex.oxt/export.xhp">LaTeX Export</topic>
|
||||
<topic id="writer2latex/org.openoffice.da.writer2latex.oxt/export.xhp">LaTeX export</topic>
|
||||
<topic id="writer2latex/org.openoffice.da.writer2latex.oxt/logviewer.xhp">View log files</topic>
|
||||
<!--<topic id="writer2latex/org.openoffice.da.writer2latex.oxt/import.xhp">LaTeX import</topic>-->
|
||||
<node id="w2l01_writer_toolbar_configuration" title="Toolbar configuration">
|
||||
<topic id="writer2latex/org.openoffice.da.writer2latex.oxt/applications.xhp">Applications</topic>
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<helpdocument version="1.0">
|
||||
<meta>
|
||||
<topic id="writer2latex-logviewer" indexer="include">
|
||||
<title xml-lang="en-US">View log files</title>
|
||||
<filename>org.openoffice.da.writer2latex.oxt/logviewer.xhp</filename>
|
||||
</topic>
|
||||
</meta>
|
||||
<body>
|
||||
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2latex.oxt:LogViewer" id="bm_logviewer"/>
|
||||
<paragraph role="heading" level="1" xml-lang="en-US">View log files</paragraph>
|
||||
<paragraph role="paragraph" xml-lang="en-US">View the log files of the most recent LaTeX run of the
|
||||
current document.</paragraph>
|
||||
<section id="howtoget" xml-lang="en-US">
|
||||
Click the <emph>Log</emph>-button on the toolbar
|
||||
</section>
|
||||
|
||||
<paragraph role="paragraph" xml-lang="en-US">When the document is processed with LaTeX, a number of
|
||||
log files are generated. They contain error messages and other technical information about the conversion.
|
||||
Advanced users may use this for troubleshooting.</paragraph>
|
||||
|
||||
<paragraph role="heading" level="2" xml-lang="en-US">Log files</paragraph>
|
||||
|
||||
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2latex.oxt:ViewLaTeXLog" id="bm_viewlatexlog"/>
|
||||
<paragraph role="heading" level="3" xml-lang="en-US">View LaTeX log</paragraph>
|
||||
<paragraph role="paragraph" xml-lang="en-US"><ahelp hid="org.openoffice.da.writer2latex.oxt:ViewLaTeXLog" visibility="hidden">Select this to view the log of the latest LaTeX run</ahelp></paragraph>
|
||||
<paragraph role="paragraph" xml-lang="en-US">Select this to view the log of the latest LaTeX run.
|
||||
The log file can become quite long and difficult to read. If you only want to view error messages in the
|
||||
log, you can check <emph>Only errors</emph> at the bottom of the dialog.</paragraph>
|
||||
|
||||
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2latex.oxt:ErrorFilter" id="bm_errorfilter"/>
|
||||
<paragraph role="paragraph" xml-lang="en-US"><ahelp hid="org.openoffice.da.writer2latex.oxt:ErrorFilter" visibility="hidden">Check this if you only want to see error messages in the log file</ahelp></paragraph>
|
||||
|
||||
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2latex.oxt:ViewBibTeXLog" id="bm_viewbibtexlog"/>
|
||||
<paragraph role="heading" level="3" xml-lang="en-US">View BibTeX log</paragraph>
|
||||
<paragraph role="paragraph" xml-lang="en-US"><ahelp hid="org.openoffice.da.writer2latex.oxt:ViewBibTeXLog" visibility="hidden">Select this to view the log of the latest BibTeX run</ahelp></paragraph>
|
||||
<paragraph role="paragraph" xml-lang="en-US">Select this to view the log of the latest BibTeX run.</paragraph>
|
||||
|
||||
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2latex.oxt:ViewMakeindexLog" id="bm_viewmakeindexlog"/>
|
||||
<paragraph role="heading" level="3" xml-lang="en-US">View Makeindex log</paragraph>
|
||||
<paragraph role="paragraph" xml-lang="en-US"><ahelp hid="org.openoffice.da.writer2latex.oxt:ViewMakeindexLog" visibility="hidden">Select this to view the log of the latest Makeindex run</ahelp></paragraph>
|
||||
<paragraph role="paragraph" xml-lang="en-US">Select this to view the log of the latest Makeindex run.</paragraph>
|
||||
</body>
|
||||
</helpdocument>
|
|
@ -51,7 +51,8 @@
|
|||
|
||||
<paragraph role="paragraph" xml-lang="en-US"><ahelp hid="org.openoffice.da.writer2latex:ProcessDocument" visibility="hidden">Run LaTeX and display the result</ahelp></paragraph>
|
||||
|
||||
<paragraph role="heading" level="3" xml-lang="en-US">View Log files</paragraph>
|
||||
<paragraph role="heading" level="3" xml-lang="en-US"><link href="org.openoffice.da.writer2latex.oxt/logviewer.xhp"
|
||||
name="View log files">View Log files</link></paragraph>
|
||||
|
||||
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2latex:ViewLog" id="bm_viewlog"/>
|
||||
<paragraph role="paragraph" xml-lang="en-US">In case of any problems in the conversion process, you can view the log files created by
|
||||
|
|
Loading…
Add table
Reference in a new issue