Zotero integration + EPUB split + a few other fixes
git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@76 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
parent
b415705e47
commit
2174e5cbf5
13 changed files with 2323 additions and 74 deletions
|
@ -20,7 +20,7 @@
|
|||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Version 1.2 (2010-10-04)
|
||||
* Version 1.2 (2010-10-30)
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -583,6 +583,8 @@ public class InlineConverter extends ConverterHelper {
|
|||
case LaTeXConfig.IGNORE: return;
|
||||
case LaTeXConfig.COMMENT:
|
||||
// Get the unformatted text of all paragraphs and insert each paragraph as a single comment
|
||||
Element creator = null;
|
||||
Element date = null;
|
||||
ldp.append("%").nl();
|
||||
Node child = node.getFirstChild();
|
||||
while (child!=null) {
|
||||
|
@ -591,8 +593,24 @@ public class InlineConverter extends ConverterHelper {
|
|||
traversePlainInlineText((Element)child, ldp, oc);
|
||||
ldp.nl();
|
||||
}
|
||||
else if (Misc.isElement(child, XMLString.DC_CREATOR)) {
|
||||
creator = (Element) child;
|
||||
}
|
||||
else if (Misc.isElement(child, XMLString.DC_DATE)) {
|
||||
date = (Element) child;
|
||||
}
|
||||
child = child.getNextSibling();
|
||||
}
|
||||
if (creator!=null) {
|
||||
ldp.append("%");
|
||||
traversePlainInlineText(creator, ldp, oc);
|
||||
ldp.nl();
|
||||
}
|
||||
if (date!=null) {
|
||||
ldp.append("%")
|
||||
.append(Misc.formatDate(ofr.getTextContent(date), palette.getI18n().getDefaultLanguage(), null))
|
||||
.nl();
|
||||
}
|
||||
return;
|
||||
case LaTeXConfig.PDFANNOTATION:
|
||||
bHasPdfannotation = true;
|
||||
|
@ -608,6 +626,8 @@ public class InlineConverter extends ConverterHelper {
|
|||
|
||||
// Get the unformatted text of all paragraphs, separated by spaces
|
||||
ldp.append(sCommand).append("{");
|
||||
Element creator = null;
|
||||
Element date = null;
|
||||
boolean bFirst = true;
|
||||
Node child = node.getFirstChild();
|
||||
while (child!=null) {
|
||||
|
@ -616,9 +636,24 @@ public class InlineConverter extends ConverterHelper {
|
|||
traversePlainInlineText((Element)child, ldp, oc);
|
||||
bFirst = false;
|
||||
}
|
||||
child = child.getNextSibling();
|
||||
|
||||
else if (Misc.isElement(child, XMLString.DC_CREATOR)) {
|
||||
creator = (Element) child;
|
||||
}
|
||||
else if (Misc.isElement(child, XMLString.DC_DATE)) {
|
||||
date = (Element) child;
|
||||
}
|
||||
child = child.getNextSibling();
|
||||
}
|
||||
if (creator!=null) {
|
||||
if (!bFirst) ldp.append(" - ");
|
||||
traversePlainInlineText(creator, ldp, oc);
|
||||
}
|
||||
if (date!=null) {
|
||||
if (creator!=null) ldp.append(", ");
|
||||
else if (!bFirst) ldp.append(" ");
|
||||
ldp.append(Misc.formatDate(ofr.getTextContent(date), palette.getI18n().getDefaultLanguage(), null));
|
||||
}
|
||||
|
||||
ldp.append("}");
|
||||
}
|
||||
|
||||
|
|
|
@ -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-03-26)
|
||||
* Version 1.2 (2010-10-30)
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -44,11 +44,11 @@ public abstract class I18n {
|
|||
// Configuration items
|
||||
protected LaTeXConfig config;
|
||||
protected ReplacementTrie stringReplace;
|
||||
protected boolean bGreekMath; // Use math mode for greek letters
|
||||
protected boolean bGreekMath; // Use math mode for Greek letters
|
||||
protected boolean bAlwaysUseDefaultLang; // Ignore sLang parameter to convert()
|
||||
|
||||
// Collected data
|
||||
protected String sDefaultLanguage; // The default iso language to use
|
||||
protected String sDefaultLanguage; // The default ISO language to use
|
||||
protected HashSet<String> languages = new HashSet<String>(); // All languages used
|
||||
|
||||
// **** Constructors ****
|
||||
|
@ -92,7 +92,7 @@ public abstract class I18n {
|
|||
public abstract void appendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl);
|
||||
|
||||
/** Apply a language language
|
||||
* @param style the OOo style to read attributesfrom
|
||||
* @param style the OOo style to read attributes from
|
||||
* @param bDecl true if declaration form is required
|
||||
* @param bInherit true if inherited properties should be used
|
||||
* @param ba the <code>BeforeAfter</code> to add LaTeX code to.
|
||||
|
@ -111,8 +111,16 @@ public abstract class I18n {
|
|||
/** Convert a string of characters into LaTeX
|
||||
* @param s the source string
|
||||
* @param bMathMode true if the string should be rendered in math mode
|
||||
* @param sLang the iso language of the string
|
||||
* @param sLang the ISO language of the string
|
||||
* @return the LaTeX string
|
||||
*/
|
||||
public abstract String convert(String s, boolean bMathMode, String sLang);
|
||||
|
||||
/** Get the default language (either the document language or the most used language)
|
||||
*
|
||||
* @param the default language
|
||||
*/
|
||||
public String getDefaultLanguage() {
|
||||
return sDefaultLanguage;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue