Various work...
git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@51 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
parent
5311ac0b6b
commit
144b59f561
15 changed files with 368 additions and 126 deletions
|
@ -2,6 +2,10 @@ Changelog for Writer2LaTeX version 1.0 -> 1.2
|
|||
|
||||
---------- version 1.1.1 ----------
|
||||
|
||||
[w2x] Added two attribute style maps: "underline" and "overstrike"
|
||||
|
||||
[w2l] Style maps now (again) works in tables
|
||||
|
||||
[w2l] Bugfix: Font is now selected correctly in list labels
|
||||
|
||||
[w2x] New option formulas (values starmath, latex, image+starmath (default), image+latex)
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -16,11 +16,11 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*
|
||||
* Copyright: 2002-2009 by Henrik Just
|
||||
* Copyright: 2002-2019 by Henrik Just
|
||||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Version 1.2 (2009-05-01)
|
||||
* Version 1.2 (2010-03-12)
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -36,7 +36,6 @@ import com.sun.star.container.XNameAccess;
|
|||
import com.sun.star.document.XDocumentInfoSupplier;
|
||||
import com.sun.star.frame.XDesktop;
|
||||
import com.sun.star.lang.XComponent;
|
||||
import com.sun.star.lang.IllegalArgumentException;
|
||||
import com.sun.star.lang.XMultiServiceFactory;
|
||||
import com.sun.star.lang.XServiceInfo;
|
||||
import com.sun.star.lang.XServiceName;
|
||||
|
@ -46,9 +45,9 @@ import com.sun.star.uno.Type;
|
|||
import com.sun.star.uno.UnoRuntime;
|
||||
import com.sun.star.uno.XComponentContext;
|
||||
import com.sun.star.util.XChangesBatch;
|
||||
import com.sun.star.util.XMacroExpander;
|
||||
|
||||
import org.openoffice.da.comp.w2lcommon.helper.DialogBase;
|
||||
import org.openoffice.da.comp.w2lcommon.helper.MacroExpander;
|
||||
import org.openoffice.da.comp.w2lcommon.helper.PropertyHelper;
|
||||
import org.openoffice.da.comp.w2lcommon.helper.XPropertySetHelper;
|
||||
|
||||
|
@ -170,26 +169,6 @@ public abstract class OptionsDialogBase extends DialogBase implements
|
|||
//////////////////////////////////////////////////////////////////////////
|
||||
// Some private utility methods
|
||||
|
||||
// Perform macro extansion
|
||||
private String expandMacros(String s) {
|
||||
if (s.startsWith("vnd.sun.star.expand:")) {
|
||||
// The string contains a macro, usually as a result of using %origin% in the registry
|
||||
s = s.substring(20);
|
||||
Object expander = xContext.getValueByName("/singletons/com.sun.star.util.theMacroExpander");
|
||||
XMacroExpander xExpander = (XMacroExpander) UnoRuntime.queryInterface (XMacroExpander.class, expander);
|
||||
try {
|
||||
return xExpander.expandMacros(s);
|
||||
}
|
||||
catch (IllegalArgumentException e) {
|
||||
// Unknown macro name found, proceed and hope for the best
|
||||
return s;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
// Get the template name from the document with ui focus
|
||||
private String getTemplateName() {
|
||||
try {
|
||||
|
@ -419,8 +398,9 @@ public abstract class OptionsDialogBase extends DialogBase implements
|
|||
Object config = xNameAccess.getByName(sConfigNames[i]);
|
||||
XPropertySet xCfgProps = (XPropertySet)
|
||||
UnoRuntime.queryInterface(XPropertySet.class,config);
|
||||
filterData.put("ConfigURL",expandMacros(XPropertySetHelper.getPropertyValueAsString(xCfgProps,"ConfigURL")));
|
||||
filterData.put("TemplateURL",expandMacros(XPropertySetHelper.getPropertyValueAsString(xCfgProps,"TargetTemplateURL")));
|
||||
MacroExpander expander = new MacroExpander(xContext);
|
||||
filterData.put("ConfigURL",expander.expandMacros(XPropertySetHelper.getPropertyValueAsString(xCfgProps,"ConfigURL")));
|
||||
filterData.put("TemplateURL",expander.expandMacros(XPropertySetHelper.getPropertyValueAsString(xCfgProps,"TargetTemplateURL")));
|
||||
XPropertySetHelper.setPropertyValue(xProps,"ConfigName",sConfigNames[i]);
|
||||
bFound = true;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
/************************************************************************
|
||||
*
|
||||
* OptionsDialogBase.java
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License version 2.1, as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*
|
||||
* Copyright: 2002-2010 by Henrik Just
|
||||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Version 1.2 (2010-03-12)
|
||||
*
|
||||
*/
|
||||
|
||||
package org.openoffice.da.comp.w2lcommon.helper;
|
||||
|
||||
import com.sun.star.lang.IllegalArgumentException;
|
||||
import com.sun.star.uno.UnoRuntime;
|
||||
import com.sun.star.uno.XComponentContext;
|
||||
import com.sun.star.util.XMacroExpander;
|
||||
|
||||
public class MacroExpander {
|
||||
|
||||
private XMacroExpander xExpander;
|
||||
|
||||
/** Convenience wrapper class for the UNO Macro Expander singleton
|
||||
*
|
||||
* @param xContext the UNO component context from which "theMacroExpander" can be created
|
||||
*/
|
||||
public MacroExpander(XComponentContext xContext) {
|
||||
Object expander = xContext.getValueByName("/singletons/com.sun.star.util.theMacroExpander");
|
||||
xExpander = (XMacroExpander) UnoRuntime.queryInterface (XMacroExpander.class, expander);
|
||||
}
|
||||
|
||||
/** Expand macros in a string
|
||||
*
|
||||
* @param s the string
|
||||
* @return the expanded string
|
||||
*/
|
||||
public String expandMacros(String s) {
|
||||
if (xExpander!=null && s.startsWith("vnd.sun.star.expand:")) {
|
||||
// The string contains a macro, usually as a result of using %origin% in the registry
|
||||
s = s.substring(20);
|
||||
try {
|
||||
return xExpander.expandMacros(s);
|
||||
}
|
||||
catch (IllegalArgumentException e) {
|
||||
// Unknown macro name found, proceed and hope for the best
|
||||
return s;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -401,6 +401,7 @@ public final class ConfigurationDialog
|
|||
// Maybe add some info for Ubuntu users
|
||||
// sudo apt-get install texlive
|
||||
// sudo apt-get install texlive-xetex
|
||||
// sudo apt-get install texlive-latex-extra
|
||||
// sudo apt-get install tex4ht
|
||||
displayAutoConfigInfo(info.toString());
|
||||
changeApplication(xWindow);
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*
|
||||
* Copyright: 2002-2009 by Henrik Just
|
||||
* Copyright: 2002-2010 by Henrik Just
|
||||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Version 1.2 (2009-11-19)
|
||||
* Version 1.2 (2010-03-12)
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -34,6 +34,7 @@ import java.net.URISyntaxException;
|
|||
import com.sun.star.beans.PropertyValue;
|
||||
import com.sun.star.beans.XPropertyAccess;
|
||||
import com.sun.star.beans.XPropertySet;
|
||||
import com.sun.star.container.XNameAccess;
|
||||
import com.sun.star.frame.XController;
|
||||
import com.sun.star.frame.XFrame;
|
||||
import com.sun.star.frame.XModel;
|
||||
|
@ -46,6 +47,7 @@ import com.sun.star.ui.dialogs.XExecutableDialog;
|
|||
import com.sun.star.uno.UnoRuntime;
|
||||
import com.sun.star.uno.XComponentContext;
|
||||
|
||||
import org.openoffice.da.comp.w2lcommon.helper.MacroExpander;
|
||||
import org.openoffice.da.comp.w2lcommon.helper.MessageBox;
|
||||
import org.openoffice.da.comp.w2lcommon.helper.PropertyHelper;
|
||||
import org.openoffice.da.comp.w2lcommon.helper.RegistryHelper;
|
||||
|
@ -378,7 +380,16 @@ public final class Writer4LaTeX extends WeakBase
|
|||
case 5: filterData.put("ConfigURL","$(user)/writer2latex.xml");
|
||||
filterData.put("AutoCreate","true"); break;
|
||||
default:
|
||||
loadOption(xProps,filterData,"ConfigName","ConfigURL");
|
||||
// Get the actual URL from the registry
|
||||
String sConfigName = XPropertySetHelper.getPropertyValueAsString(xProps, "ConfigName");
|
||||
|
||||
Object configurations = XPropertySetHelper.getPropertyValue(xProps,"Configurations");
|
||||
XNameAccess xNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,configurations);
|
||||
Object config = xNameAccess.getByName(sConfigName);
|
||||
XPropertySet xCfgProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,config);
|
||||
|
||||
MacroExpander expander = new MacroExpander(m_xContext);
|
||||
filterData.put("ConfigURL",expander.expandMacros(XPropertySetHelper.getPropertyValueAsString(xCfgProps,"ConfigURL")));
|
||||
}
|
||||
|
||||
// Read the options
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*
|
||||
* Copyright: 2002-2008 by Henrik Just
|
||||
* Copyright: 2002-2010 by Henrik Just
|
||||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Version 1.0 (2008-11-23)
|
||||
* Version 1.2 (2010-03-12)
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -179,7 +179,9 @@ public class ParConverter extends StyleConverter {
|
|||
|
||||
// Add newline if *between* paragraphs
|
||||
if (!bLastInBlock) { ba.add("","\n"); }
|
||||
|
||||
|
||||
context.setVerbatim(false);
|
||||
|
||||
if (context.isInSimpleTable()) {
|
||||
if (config.formatting()!=LaTeXConfig.IGNORE_ALL) {
|
||||
// only character formatting!
|
||||
|
@ -191,6 +193,20 @@ public class ParConverter extends StyleConverter {
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (config.getParStyleMap().contains(ofr.getParStyles().getDisplayName(sName))) {
|
||||
// We have a style map in the configuration
|
||||
StyleMap sm = config.getParStyleMap();
|
||||
String sDisplayName = ofr.getParStyles().getDisplayName(sName);
|
||||
String sBefore = sm.getBefore(sDisplayName);
|
||||
String sAfter = sm.getAfter(sDisplayName);
|
||||
ba.add(sBefore, sAfter);
|
||||
// Add line breaks inside?
|
||||
if (sm.getLineBreak(sDisplayName)) {
|
||||
if (sBefore.length()>0) { ba.add("\n",""); }
|
||||
if (sAfter.length()>0 && !"}".equals(sAfter)) { ba.add("","\n"); }
|
||||
}
|
||||
if (sm.getVerbatim(sDisplayName)) { context.setVerbatim(true); }
|
||||
}
|
||||
else if (bNoTextPar && (config.formatting()==LaTeXConfig.CONVERT_BASIC || config.formatting()==LaTeXConfig.IGNORE_MOST) ) {
|
||||
// only alignment!
|
||||
StyleWithProperties style = ofr.getParStyle(sName);
|
||||
|
@ -251,7 +267,6 @@ public class ParConverter extends StyleConverter {
|
|||
StyleWithProperties style = ofr.getParStyle(sName);
|
||||
if (style==null) { return; }
|
||||
context.updateFormattingFromStyle(style);
|
||||
context.setVerbatim(styleMap.getVerbatim(sName));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*
|
||||
* Copyright: 2002-2009 by Henrik Just
|
||||
* Copyright: 2002-2010 by Henrik Just
|
||||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Version 1.2 (2009-12-15)
|
||||
* Version 1.2 (2010-03-12)
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -40,6 +40,7 @@ import org.w3c.dom.NodeList;
|
|||
import org.w3c.dom.Element;
|
||||
|
||||
import writer2latex.util.Misc;
|
||||
import writer2latex.office.FontDeclaration;
|
||||
import writer2latex.office.XMLString;
|
||||
import writer2latex.office.IndexMark;
|
||||
import writer2latex.office.ListCounter;
|
||||
|
@ -1725,7 +1726,86 @@ public class TextConverter extends ConverterHelper {
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// UTILITY METHODS
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Methods to query individual formatting properties (no inheritance)
|
||||
|
||||
// Does this style contain the bold attribute?
|
||||
private boolean isBold(StyleWithProperties style) {
|
||||
String s = style.getProperty(XMLString.FO_FONT_WEIGHT,false);
|
||||
return s!=null && "bold".equals(s);
|
||||
}
|
||||
|
||||
// Does this style contain the italics/oblique attribute?
|
||||
private boolean isItalics(StyleWithProperties style) {
|
||||
String s = style.getProperty(XMLString.FO_FONT_STYLE,false);
|
||||
return s!=null && !"normal".equals(s);
|
||||
}
|
||||
|
||||
// Does this style contain a fixed pitch font?
|
||||
private boolean isFixed(StyleWithProperties style) {
|
||||
String s = style.getProperty(XMLString.STYLE_FONT_NAME,false);
|
||||
String s2 = null;
|
||||
String s3 = null;
|
||||
if (s!=null) {
|
||||
FontDeclaration fd = (FontDeclaration) ofr.getFontDeclarations().getStyle(s);
|
||||
if (fd!=null) {
|
||||
s2 = fd.getFontFamilyGeneric();
|
||||
s3 = fd.getFontPitch();
|
||||
}
|
||||
}
|
||||
else {
|
||||
s = style.getProperty(XMLString.FO_FONT_FAMILY,false);
|
||||
s2 = style.getProperty(XMLString.STYLE_FONT_FAMILY_GENERIC,false);
|
||||
s3 = style.getProperty(XMLString.STYLE_FONT_PITCH,false);
|
||||
}
|
||||
if ("fixed".equals(s3)) { return true; }
|
||||
if ("modern".equals(s2)) { return true; }
|
||||
return false;
|
||||
}
|
||||
|
||||
// Does this style specify superscript?
|
||||
private boolean isSuperscript(StyleWithProperties style) {
|
||||
String sPos = style.getProperty(XMLString.STYLE_TEXT_POSITION,false);
|
||||
if (sPos==null) return false;
|
||||
if (sPos.startsWith("sub")) return false;
|
||||
if (sPos.startsWith("-")) return false;
|
||||
if (sPos.startsWith("0%")) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Does this style specify subscript?
|
||||
private boolean isSubscript(StyleWithProperties style) {
|
||||
String sPos = style.getProperty(XMLString.STYLE_TEXT_POSITION,false);
|
||||
if (sPos==null) return false;
|
||||
if (sPos.startsWith("sub")) return true;
|
||||
if (sPos.startsWith("-")) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Does this style specify underline?
|
||||
private boolean isUnderline(StyleWithProperties style) {
|
||||
String s;
|
||||
if (ofr.isOpenDocument()) {
|
||||
s = style.getProperty(XMLString.STYLE_TEXT_UNDERLINE_STYLE,false);
|
||||
}
|
||||
else {
|
||||
s = style.getProperty(XMLString.STYLE_TEXT_UNDERLINE,false);
|
||||
}
|
||||
return s!=null && !"none".equals(s);
|
||||
}
|
||||
|
||||
// Does this style specify overstrike?
|
||||
private boolean isOverstrike(StyleWithProperties style) {
|
||||
String s;
|
||||
if (ofr.isOpenDocument()) {
|
||||
s = style.getProperty(XMLString.STYLE_TEXT_LINE_THROUGH_STYLE,false);
|
||||
}
|
||||
else {
|
||||
s = style.getProperty(XMLString.STYLE_TEXT_CROSSING_OUT,false);
|
||||
}
|
||||
return s!=null && !"none".equals(s);
|
||||
}
|
||||
|
||||
/* apply hard formatting attribute style maps */
|
||||
private Element applyAttributes(Element node, StyleWithProperties style) {
|
||||
// Do nothing if we convert hard formatting
|
||||
|
@ -1733,11 +1813,13 @@ public class TextConverter extends ConverterHelper {
|
|||
// Do nothing if this is not an automatic style
|
||||
if (style==null) { return node; }
|
||||
if (!style.isAutomatic()) { return node; }
|
||||
node = applyAttribute(node,"bold",getTextSc().isBold(style));
|
||||
node = applyAttribute(node,"italics",getTextSc().isItalics(style));
|
||||
node = applyAttribute(node,"fixed",getTextSc().isFixed(style));
|
||||
node = applyAttribute(node,"superscript",getTextSc().isSuperscript(style));
|
||||
node = applyAttribute(node,"subscript",getTextSc().isSubscript(style));
|
||||
node = applyAttribute(node,"bold",isBold(style));
|
||||
node = applyAttribute(node,"italics",isItalics(style));
|
||||
node = applyAttribute(node,"fixed",isFixed(style));
|
||||
node = applyAttribute(node,"superscript",isSuperscript(style));
|
||||
node = applyAttribute(node,"subscript",isSubscript(style));
|
||||
node = applyAttribute(node,"underline",isUnderline(style));
|
||||
node = applyAttribute(node,"overstrike",isOverstrike(style));
|
||||
return node;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Version 1.2 (2010-02-14)
|
||||
* Version 1.2 (2010-03-12)
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -198,61 +198,6 @@ public class TextStyleConverter extends StyleWithPropertiesConverterHelper {
|
|||
cssText(style,props,bInherit);
|
||||
}
|
||||
|
||||
// Methods to query individual formatting properties (no inheritance)
|
||||
|
||||
// Does this style contain the bold attribute?
|
||||
public boolean isBold(StyleWithProperties style) {
|
||||
String s = style.getProperty(XMLString.FO_FONT_WEIGHT,false);
|
||||
return s!=null && "bold".equals(s);
|
||||
}
|
||||
|
||||
// Does this style contain the italics/oblique attribute?
|
||||
public boolean isItalics(StyleWithProperties style) {
|
||||
String s = style.getProperty(XMLString.FO_FONT_STYLE,false);
|
||||
return s!=null && !"normal".equals(s);
|
||||
}
|
||||
|
||||
// Does this style contain a fixed pitch font?
|
||||
public boolean isFixed(StyleWithProperties style) {
|
||||
String s = style.getProperty(XMLString.STYLE_FONT_NAME,false);
|
||||
String s2 = null;
|
||||
String s3 = null;
|
||||
if (s!=null) {
|
||||
FontDeclaration fd = (FontDeclaration) ofr.getFontDeclarations().getStyle(s);
|
||||
if (fd!=null) {
|
||||
s2 = fd.getFontFamilyGeneric();
|
||||
s3 = fd.getFontPitch();
|
||||
}
|
||||
}
|
||||
else {
|
||||
s = style.getProperty(XMLString.FO_FONT_FAMILY,false);
|
||||
s2 = style.getProperty(XMLString.STYLE_FONT_FAMILY_GENERIC,false);
|
||||
s3 = style.getProperty(XMLString.STYLE_FONT_PITCH,false);
|
||||
}
|
||||
if ("fixed".equals(s3)) { return true; }
|
||||
if ("modern".equals(s2)) { return true; }
|
||||
return false;
|
||||
}
|
||||
|
||||
// Does this style specify superscript?
|
||||
public boolean isSuperscript(StyleWithProperties style) {
|
||||
String sPos = style.getProperty(XMLString.STYLE_TEXT_POSITION,false);
|
||||
if (sPos==null) return false;
|
||||
if (sPos.startsWith("sub")) return false;
|
||||
if (sPos.startsWith("-")) return false;
|
||||
if (sPos.startsWith("0%")) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Does this style specify subscript?
|
||||
public boolean isSubscript(StyleWithProperties style) {
|
||||
String sPos = style.getProperty(XMLString.STYLE_TEXT_POSITION,false);
|
||||
if (sPos==null) return false;
|
||||
if (sPos.startsWith("sub")) return true;
|
||||
if (sPos.startsWith("-")) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// OpenDocument text properties
|
||||
// Text properties can be applied to text, paragraph, cell, graphic and
|
||||
|
|
|
@ -292,7 +292,7 @@ public class XhtmlDocument extends DOMDocument {
|
|||
|
||||
String[] sTemplateIds = config.templateIds().split(",");
|
||||
int nIdCount = sTemplateIds.length;
|
||||
if (nIdCount>0) sContentId = sTemplateIds[0].trim(); else sContentId = "content";
|
||||
if (nIdCount>0 && sTemplateIds[0].trim().length()>0) sContentId = sTemplateIds[0].trim(); else sContentId = "content";
|
||||
if (nIdCount>1) sHeaderId = sTemplateIds[1].trim(); else sHeaderId = "header";
|
||||
if (nIdCount>2) sFooterId = sTemplateIds[2].trim(); else sFooterId = "footer";
|
||||
if (nIdCount>3) sPanelId = sTemplateIds[3].trim(); else sPanelId = "panel";
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<!-- article.xml
|
||||
This is a configuration file for Writer4LaTeX.
|
||||
It contains a lot of style mappings, which correspond to
|
||||
the template LaTeX-article.stw.
|
||||
the template LaTeX-article.odt.
|
||||
Some definitions have been chosen for compatibility with tex4ht
|
||||
-->
|
||||
|
||||
|
@ -32,6 +32,10 @@
|
|||
<option name="bibtex_style" value="plain" />
|
||||
<option name="formatting" value="ignore_most" />
|
||||
<option name="page_formatting" value="ignore_all" />
|
||||
<option name="table_first_head_style" value="table first head" />
|
||||
<option name="table_head_style" value="table head" />
|
||||
<option name="table_foot_style" value="table foot" />
|
||||
<option name="table_last_foot_style" value="table last foot" />
|
||||
<option name="ignore_empty_paragraphs" value="true" />
|
||||
<option name="ignore_hard_page_breaks" value="false" />
|
||||
<option name="ignore_hard_line_breaks" value="false" />
|
||||
|
@ -65,15 +69,17 @@
|
|||
<heading-level-map writer-level="6" name="subparagraph" level="5" />
|
||||
</heading-map>
|
||||
|
||||
<!-- Defintions for \maketitle. At least one of the styles Title, Author, Date
|
||||
<!-- Defintions for \maketitle. At least one of the styles Title/title, Author, Date
|
||||
in any order will give correct results.
|
||||
Uses a predefined style from OOo for the title -->
|
||||
<style-map name="Title" class="paragraph" before="\title{" after="}" line-break="false" />
|
||||
<style-map name="title" class="paragraph" before="\title{" after="}" line-break="false" />
|
||||
<style-map name="author" class="paragraph" before="\author{" after="}" line-break="false" />
|
||||
<style-map name="date" class="paragraph" before="\date{" after="}" line-break="false" />
|
||||
<style-map name="Title" class="paragraph-block" next="author;date" before="" after="\maketitle" />
|
||||
<style-map name="author" class="paragraph-block" next="Title;date" before="" after="\maketitle" />
|
||||
<style-map name="date" class="paragraph-block" next="Title;author" before="" after="\maketitle" />
|
||||
<style-map name="title" class="paragraph-block" next="author;date" before="" after="\maketitle" />
|
||||
<style-map name="author" class="paragraph-block" next="Title;title;date" before="" after="\maketitle" />
|
||||
<style-map name="date" class="paragraph-block" next="Title;title;author" before="" after="\maketitle" />
|
||||
|
||||
<!-- Definitions for the abstract. The abstract can contain any number of paragraphs -->
|
||||
<style-map name="abstract title" class="paragraph" before="\renewcommand\abstractname{" after="}" line-break="false" />
|
||||
|
@ -103,6 +109,10 @@
|
|||
<style-map name="Quotations" class="paragraph-block" next="Quotations" before="\begin{quotation}" after="\end{quotation}" />
|
||||
<style-map name="Quotations" class="paragraph" before="" after="" />
|
||||
|
||||
<!-- quotation; using custom style -->
|
||||
<style-map name="quotation" class="paragraph-block" next="quotation" before="\begin{quotation}" after="\end{quotation}" />
|
||||
<style-map name="quotation" class="paragraph" before="" after="" />
|
||||
|
||||
<!-- verse -->
|
||||
<style-map name="verse" class="paragraph-block" next="verse" before="\begin{verse}" after="\end{verse}" />
|
||||
<style-map name="verse" class="paragraph" before="" after="" />
|
||||
|
@ -114,6 +124,16 @@
|
|||
<style-map name="Preformatted Text" class="paragraph-block" next="Preformatted Text" before="\begin{verbatim}" after="\end{verbatim}" />
|
||||
<style-map name="Preformatted Text" class="paragraph" before="" after="" verbatim="true" />
|
||||
|
||||
<!-- verbatim; using custom style -->
|
||||
<style-map name="verbatim" class="paragraph-block" next="verbatim" before="\begin{verbatim}" after="\end{verbatim}" />
|
||||
<style-map name="verbatim" class="paragraph" before="" after="" verbatim="true" />
|
||||
|
||||
<!-- definitions for multi page table support -->
|
||||
<style-map name="table first head" class="paragraph" before="" after="" />
|
||||
<style-map name="table head" class="paragraph" before="" after="" />
|
||||
<style-map name="table foot" class="paragraph" before="" after="" />
|
||||
<style-map name="table last foot" class="paragraph" before="" after="" />
|
||||
|
||||
<!-- Definitions for some standard OOo paragraph styles -->
|
||||
<style-map name="Text body" class="paragraph" before="" after="" />
|
||||
<style-map name="First line indent" class="paragraph" before="" after="" />
|
||||
|
@ -126,6 +146,7 @@
|
|||
<style-map name="obeylines-h" class="text" before="" after="" />
|
||||
<style-map name="verb" class="text" before="\verb|" after="|" verbatim="true" />
|
||||
<style-map name="Emphasis" class="text" before="\emph{" after="}" />
|
||||
<style-map name="emph" class="text" before="\emph{" after="}" />
|
||||
<style-map name="Strong Emphasis" class="text" before="\textbf{" after="}" />
|
||||
<style-map name="textrm" class="text" before="\textrm{" after="}" />
|
||||
<style-map name="textsf" class="text" before="\textsf{" after="}" />
|
||||
|
@ -158,13 +179,18 @@
|
|||
<style-map name="List Heading" class="paragraph" before="\item[" after="]" line-break="false" />
|
||||
<style-map name="List Contents" class="paragraph" before="" after="" />
|
||||
|
||||
<!-- Definitions for description list. Uses custom styles -->
|
||||
<style-map name="description item" class="paragraph-block" next="description item;description text" before="\begin{description}" after="\end{description}"/>
|
||||
<style-map name="description item" class="paragraph" before="\item[" after="]" line-break="false" />
|
||||
<style-map name="description text" class="paragraph" before="" after="" />
|
||||
|
||||
<!-- Definitions for itemize and enumerate -->
|
||||
<style-map name="itemize" class="paragraph" before="" after="" />
|
||||
<style-map name="enumerate" class="paragraph" before="" after="" />
|
||||
|
||||
<!-- Definitions for verbatim LaTeX code -->
|
||||
<style-map name="LaTeX" class="paragraph" before="" after="" verbatim="true" />
|
||||
<style-map name="LaTeX" class="text" before="" after="" verbatim="true" />
|
||||
<style-map name="LaTeX" class="text" before="" after="{}" verbatim="true" />
|
||||
|
||||
</config>
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<paragraph role="heading" level="2" xml-lang="en-US">Authoring LaTeX files with Writer4LaTeX</paragraph>
|
||||
<paragraph role="paragraph" xml-lang="en-US">You can use Writer4LaTeX in two different ways
|
||||
</paragraph>
|
||||
<list type="unordered" bullet="disc">
|
||||
<list type="unordered">
|
||||
<listitem>
|
||||
<paragraph role="paragraph" xml-lang="en-US">You can prepare your documents with Writer as you usually do,
|
||||
keeping a few
|
||||
|
@ -47,15 +47,67 @@
|
|||
This feature uses Eitan M. Gurari's excellent
|
||||
<link href="http://www.cse.ohio-state.edu/~gurari/TeX4ht/" name="Link to the TeX4ht Website">TeX4ht</link>
|
||||
system. Note however, that this feature doesn't make roundtrip
|
||||
editing %PRODUCTNAME Writer ↔ LaTeX is possible. The intended use of the import feature to make it possible to work on documents
|
||||
that were orginally authored in LaTeX.
|
||||
editing %PRODUCTNAME Writer ↔ LaTeX is possible. The intended use of the import feature to make documents
|
||||
that were originally authored in LaTeX.
|
||||
</paragraph>
|
||||
|
||||
<paragraph role="heading" level="2" xml-lang="en-US">Before you start</paragraph>
|
||||
<paragraph role="paragraph" xml-lang="en-US">Before you can use Writer4LaTeX, you need to
|
||||
<link href="org.openoffice.da.writer4latex.oxt/configuration.xhp" name="Configuration">configure</link> it.
|
||||
This requires that you have
|
||||
a working TeX installation on your system such as MikTeX for Windows or TeX Live for unix/linux.
|
||||
</paragraph>
|
||||
This requires that you have installed certain software on your system.</paragraph>
|
||||
<switch select="sys">
|
||||
<case select="WIN">
|
||||
<list type="unordered">
|
||||
<listitem>
|
||||
<paragraph role="paragraph" xml-lang="en-US">The LaTeX export filter Writer2LaTeX must be installed in %PRODUCTNAME.
|
||||
You can get this extension at
|
||||
<link href="http://extensions.services.openoffice.org/project/writer2latex" name="Writer2LaTeX download">http://extensions.services.openoffice.org/project/writer2latex</link>.</paragraph>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<paragraph role="paragraph" xml-lang="en-US">Writer4LaTeX needs a working LaTeX distribution including TeX4ht.
|
||||
MikTeX is recommended and can be downloaded from
|
||||
<link href="http://www.miktex.org" name="MikTeX download">http://www.miktex.org</link>.</paragraph>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<paragraph role="paragraph" xml-lang="en-US">Finally you should install viewers for PDF and PostScript files.
|
||||
Gsview is recommended and can be downloaded from
|
||||
<link href="http://pages.cs.wisc.edu/~ghost/gsview/" name="gsview download">http://pages.cs.wisc.edu/~ghost/gsview/</link>.
|
||||
Note that you have to install ghostscript as well (follow the links on the web site).</paragraph>
|
||||
</listitem>
|
||||
</list>
|
||||
</case>
|
||||
<case select="UNIX">
|
||||
<list type="unordered">
|
||||
<listitem>
|
||||
<paragraph role="paragraph" xml-lang="en-US">The LaTeX export filter Writer2LaTeX must be installed in %PRODUCTNAME.
|
||||
You can get this extension at
|
||||
<link href="http://extensions.services.openoffice.org/project/writer2latex" name="Writer2LaTeX download">http://extensions.services.openoffice.org/project/writer2latex</link>.</paragraph>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<paragraph role="paragraph" xml-lang="en-US">Writer4LaTeX needs a working LaTeX distribution which includes TeX4ht.
|
||||
<link href="http://www.tug.org/texlive/" name="TeX live">TeX live</link>
|
||||
is recommended and is available for most UNIX-like systems. The installation depends on your system.
|
||||
If you are using Debian or Ubuntu you can for example install the required packages by typing these commands from a terminal window:</paragraph>
|
||||
<paragraph role="code" xml-lang="en-US">sudo apt-get install texlive
|
||||
<br/>sudo apt-get install texlive-latex-extra
|
||||
<br/>sudo apt-get install texlive-xetex
|
||||
<br/>sudo apt-get install tex4ht</paragraph>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<paragraph role="paragraph" xml-lang="en-US">Finally you should install viewers for DVI, PDF and PostScript files.
|
||||
The viewers evince and okular can handle all formats and are recommended.
|
||||
You can also use a combination of the viewers xdvi, xpdf and ghostview.
|
||||
</paragraph>
|
||||
</listitem>
|
||||
</list>
|
||||
</case>
|
||||
<case select="MAC">
|
||||
<paragraph>Writer4LaTeX has not been tested on Mac OS X, but it should be possible to configure it manually
|
||||
if you have installed a LaTeX distribution and viewers for DVI, PDF and PostScript documents.</paragraph>
|
||||
<paragraph role="paragraph" xml-lang="en-US">You also need to install the LaTeX export filter Writer2LaTeX
|
||||
in %PRODUCTNAME. You can get this extension at
|
||||
<link href="http://extensions.services.openoffice.org/project/writer2latex" name="Writer2LaTeX download">http://extensions.services.openoffice.org/project/writer2latex</link>.</paragraph>
|
||||
</case>
|
||||
</switch>
|
||||
</body>
|
||||
</helpdocument>
|
|
@ -10,15 +10,15 @@
|
|||
<paragraph role="heading" level="1" xml-lang="en-US">Using the templates</paragraph>
|
||||
<paragraph role="heading" level="2" xml-lang="en-US">The article template</paragraph>
|
||||
<section id="howtoget" xml-lang="en-US">
|
||||
Choose <emph>File - New - Templates and Documents</emph>
|
||||
Choose <emph>File - New - Templates and Documents - Writer2LaTeX</emph>
|
||||
</section>
|
||||
<paragraph role="paragraph" xml-lang="en-US">This template contains a number of styles that corresponds to LaTeX code.
|
||||
If you use these styles and makes sure to use the configuration <emph>W4L: Article</emph> when you convert your document
|
||||
(this is selected automatically) with Writer2LaTeX, you will get a result that resembles a handwritten LaTeX file.
|
||||
Note that hard formatting and any other styles will be ignored. The available styles are summarized in the following tables.
|
||||
The use of italics in these tables indicates styles that are predefined in %PRODUCTNAME Writer.
|
||||
The names of these styles will be localized if you use a non-english version of %PRODUCTNAME.</paragraph>
|
||||
<paragraph role="heading" level="3">Paragraph styles</paragraph>
|
||||
</paragraph>
|
||||
<paragraph role="heading" level="3" xml-lang="en-US">Paragraph styles</paragraph>
|
||||
<paragraph role="heading" level="4" xml-lang="en-US">Title styles</paragraph>
|
||||
<table>
|
||||
<tablerow>
|
||||
<tablecell>
|
||||
|
@ -30,7 +30,7 @@
|
|||
</tablerow>
|
||||
<tablerow>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">Title</paragraph>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">title</paragraph>
|
||||
</tablecell>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">\title{...}</paragraph>
|
||||
|
@ -68,6 +68,11 @@
|
|||
<paragraph role="tablecontent" xml-lang="en-US">abstract environment</paragraph>
|
||||
</tablecell>
|
||||
</tablerow>
|
||||
</table>
|
||||
<paragraph role="paragraph">Note that also \maketitle is added at the end of a sequence of title, author and date.</paragraph>
|
||||
<paragraph role="heading" level="4" xml-lang="en-US">Heading styles</paragraph>
|
||||
<paragraph role="paragraph" xml-lang="en-US">Note that the names of the heading styles are localized in %PRODUCTNAME Writer</paragraph>
|
||||
<table>
|
||||
<tablerow>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">part</paragraph>
|
||||
|
@ -116,6 +121,9 @@
|
|||
<paragraph role="tablecontent" xml-lang="en-US">\subparagraph{...}</paragraph>
|
||||
</tablecell>
|
||||
</tablerow>
|
||||
</table>
|
||||
<paragraph role="heading" level="4" xml-lang="en-US">Other paragraph styles</paragraph>
|
||||
<table>
|
||||
<tablerow>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">flushleft</paragraph>
|
||||
|
@ -166,7 +174,7 @@
|
|||
</tablerow>
|
||||
<tablerow>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">Preformatted text</paragraph>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">verbatim</paragraph>
|
||||
</tablecell>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">verbatim environment</paragraph>
|
||||
|
@ -198,7 +206,7 @@
|
|||
</tablerow>
|
||||
<tablerow>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">List Heading</paragraph>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">description item</paragraph>
|
||||
</tablecell>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">description list (item label)</paragraph>
|
||||
|
@ -206,16 +214,65 @@
|
|||
</tablerow>
|
||||
<tablerow>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">List Contents</paragraph>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">description text</paragraph>
|
||||
</tablecell>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">description list (item text)</paragraph>
|
||||
</tablecell>
|
||||
</tablerow>
|
||||
<tablerow>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">LaTeX</paragraph>
|
||||
</tablecell>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">The text content of the paragraph is inserted as verbatim LaTeX code.</paragraph>
|
||||
</tablecell>
|
||||
</tablerow>
|
||||
</table>
|
||||
<paragraph role="paragraph">Note that also \maketitle is added at the end of a sequence of Title, author and date.</paragraph>
|
||||
<paragraph role="paragraph">For the verbatim environment, only characters available in the input encoding are accepted.
|
||||
Other characters are converted to question marks and other content is discarded, eg. footnotes.</paragraph>
|
||||
|
||||
<paragraph role="heading" level="4" xml-lang="en-US">Special paragraph styles for tables</paragraph>
|
||||
<paragraph role="paragraph" xml-lang="en-US">%PRODUCTNAME Writer supports multipage tables with repeating headers.
|
||||
LaTeX on the other hand also provides support for repeating foots and special header and foot on the first repspectively last
|
||||
page of the table. The article template provides four special paragraph styles to let you use these LaTeX features.
|
||||
Note that the special pagragraphs appear colored in %PRODUCTNAME Writer for clarity, but the colors will be removed in the export
|
||||
to LaTeX.</paragraph>
|
||||
<table>
|
||||
<tablerow>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">table first head</paragraph>
|
||||
</tablecell>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">Identifies a row to be used as first head in table</paragraph>
|
||||
</tablecell>
|
||||
</tablerow>
|
||||
<tablerow>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">table head</paragraph>
|
||||
</tablecell>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">Identifies a row to be used as head in table</paragraph>
|
||||
</tablecell>
|
||||
</tablerow>
|
||||
<tablerow>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">table foot</paragraph>
|
||||
</tablecell>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">Identifies a row to be used as foot in table</paragraph>
|
||||
</tablecell>
|
||||
</tablerow>
|
||||
<tablerow>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">table last foot</paragraph>
|
||||
</tablecell>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">Identifies a row to be used as last foot in table</paragraph>
|
||||
</tablecell>
|
||||
</tablerow>
|
||||
</table>
|
||||
|
||||
<paragraph role="heading" level="3">Text styles</paragraph>
|
||||
<table>
|
||||
<tablerow>
|
||||
|
@ -228,20 +285,12 @@
|
|||
</tablerow>
|
||||
<tablerow>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">Emphasis</paragraph>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">emph</paragraph>
|
||||
</tablecell>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">\emph{...}</paragraph>
|
||||
</tablecell>
|
||||
</tablerow>
|
||||
<tablerow>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">Strong Emphasis</paragraph>
|
||||
</tablecell>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">\textbf{...}</paragraph>
|
||||
</tablecell>
|
||||
</tablerow>
|
||||
<tablerow>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">textrm</paragraph>
|
||||
|
@ -393,6 +442,14 @@
|
|||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">{\Huge ...}</paragraph>
|
||||
</tablecell>
|
||||
<tablerow>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">LaTeX</paragraph>
|
||||
</tablecell>
|
||||
<tablecell>
|
||||
<paragraph role="tablecontent" xml-lang="en-US">The text content is inserted as verbatim LaTeX code.</paragraph>
|
||||
</tablecell>
|
||||
</tablerow>
|
||||
</tablerow>
|
||||
</table>
|
||||
<paragraph role="paragraph">For the \verb command, only characters available in the input encoding are accepted.
|
||||
|
|
Binary file not shown.
Loading…
Add table
Reference in a new issue