Writer4LaTeX help content
git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@86 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
parent
22c38c3ff4
commit
559293a169
16 changed files with 878 additions and 120 deletions
|
@ -20,7 +20,7 @@
|
|||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Version 1.2 (2011-01-28)
|
||||
* Version 1.2 (2011-02-10)
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -33,7 +33,7 @@ public class ConverterFactory {
|
|||
|
||||
// Version information
|
||||
private static final String VERSION = "1.1.6";
|
||||
private static final String DATE = "2011-01-28";
|
||||
private static final String DATE = "2011-02-10";
|
||||
|
||||
/** Return the Writer2LaTeX version in the form
|
||||
* (major version).(minor version).(patch level)<br/>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Version 1.2 (2011-01-28)
|
||||
* Version 1.2 (2011-02-01)
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -82,6 +82,7 @@ public class FieldConverter extends ConverterHelper {
|
|||
private boolean bUsesOooref = false;
|
||||
private boolean bConvertZotero = false;
|
||||
private boolean bConvertJabRef = false;
|
||||
private boolean bIncludeOriginalCitations = false;
|
||||
private boolean bUseNatbib = false;
|
||||
|
||||
public FieldConverter(OfficeReader ofr, LaTeXConfig config, ConverterPalette palette) {
|
||||
|
@ -90,6 +91,7 @@ public class FieldConverter extends ConverterHelper {
|
|||
bUseHyperref = config.useHyperref() && !config.useTitleref() && !config.useOooref();
|
||||
bConvertZotero = config.useBibtex() && config.zoteroBibtexFiles().length()>0;
|
||||
bConvertJabRef = config.useBibtex() && config.jabrefBibtexFiles().length()>0;
|
||||
bIncludeOriginalCitations = config.includeOriginalCitations();
|
||||
bUseNatbib = config.useBibtex() && config.useNatbib();
|
||||
}
|
||||
|
||||
|
@ -695,6 +697,9 @@ public class FieldConverter extends ConverterHelper {
|
|||
public void handleReferenceMarkEnd(Element node, LaTeXDocumentPortion ldp, Context oc) {
|
||||
// Nothing to do, except to mark that this ends any Zotero/JabRef citation
|
||||
oc.setInZoteroJabRefText(false);
|
||||
if (bIncludeOriginalCitations) { // Protect space after comment
|
||||
ldp.append("{}");
|
||||
}
|
||||
}
|
||||
|
||||
/** <p>Process a reference mark (text:reference-mark or text:reference-mark-start tag)</p>
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*
|
||||
* Copyright: 2002-2010 by Henrik Just
|
||||
* Copyright: 2002-2011 by Henrik Just
|
||||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Version 1.2 (2010-10-30)
|
||||
* Version 1.2 (2011-02-01)
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -43,11 +43,13 @@ import writer2latex.latex.util.HeadingMap;
|
|||
*/
|
||||
public class InlineConverter extends ConverterHelper {
|
||||
|
||||
private boolean bIncludeOriginalCitations = false;
|
||||
private String sTabstop = "\\ \\ ";
|
||||
private boolean bHasPdfannotation = false;
|
||||
|
||||
public InlineConverter(OfficeReader ofr, LaTeXConfig config, ConverterPalette palette) {
|
||||
super(ofr,config,palette);
|
||||
bIncludeOriginalCitations = config.includeOriginalCitations();
|
||||
// Get custom code for tab stops
|
||||
if (config.getTabstop().length()>0) {
|
||||
sTabstop = config.getTabstop();
|
||||
|
@ -195,13 +197,16 @@ public class InlineConverter extends ConverterHelper {
|
|||
case Node.TEXT_NODE:
|
||||
String s = childNode.getNodeValue();
|
||||
if (s.length() > 0) {
|
||||
if (oc.isInZoteroJabRefText()) { // Comment out Zotero citations
|
||||
ldp.append("%");
|
||||
if (oc.isInZoteroJabRefText()) {
|
||||
if (bIncludeOriginalCitations) { // Include original citation as a comment
|
||||
ldp.append("%")
|
||||
.append(palette.getI18n().convert(s, false, oc.getLang()))
|
||||
.nl();
|
||||
}
|
||||
}
|
||||
else { // Normal text
|
||||
ldp.append(palette.getI18n().convert(s, false, oc.getLang()));
|
||||
}
|
||||
ldp.append(palette.getI18n().convert(s, false, oc.getLang()));
|
||||
if (oc.isInZoteroJabRefText()) { // End comment out
|
||||
ldp.nl();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Version 1.2 (2011-01-28)
|
||||
* Version 1.2 (2011-02-01)
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -48,7 +48,7 @@ public class LaTeXConfig extends writer2latex.base.ConfigBase {
|
|||
/////////////////////////////////////////////////////////////////////////
|
||||
// I. Define items needed by ConfigBase
|
||||
|
||||
protected int getOptionCount() { return 69; }
|
||||
protected int getOptionCount() { return 70; }
|
||||
protected String getDefaultConfigPath() { return "/writer2latex/latex/config/"; }
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
@ -146,39 +146,40 @@ public class LaTeXConfig extends writer2latex.base.ConfigBase {
|
|||
private static final int EXTERNAL_BIBTEX_FILES = 33;
|
||||
private static final int ZOTERO_BIBTEX_FILES = 34;
|
||||
private static final int JABREF_BIBTEX_FILES = 35;
|
||||
private static final int USE_NATBIB = 36;
|
||||
private static final int NATBIB_OPTIONS = 37;
|
||||
private static final int FORMATTING = 38;
|
||||
private static final int PAGE_FORMATTING = 39;
|
||||
private static final int OTHER_STYLES = 40;
|
||||
private static final int IMAGE_CONTENT = 41;
|
||||
private static final int TABLE_CONTENT = 42;
|
||||
private static final int TABLE_FIRST_HEAD_STYLE = 43;
|
||||
private static final int TABLE_HEAD_STYLE = 44;
|
||||
private static final int TABLE_FOOT_STYLE = 45;
|
||||
private static final int TABLE_LAST_FOOT_STYLE = 46;
|
||||
private static final int IGNORE_HARD_PAGE_BREAKS = 47;
|
||||
private static final int IGNORE_HARD_LINE_BREAKS = 48;
|
||||
private static final int IGNORE_EMPTY_PARAGRAPHS = 49;
|
||||
private static final int IGNORE_DOUBLE_SPACES = 50;
|
||||
private static final int ALIGN_FRAMES = 51;
|
||||
private static final int FLOAT_FIGURES = 52;
|
||||
private static final int FLOAT_TABLES = 53;
|
||||
private static final int FLOAT_OPTIONS = 54;
|
||||
private static final int FIGURE_SEQUENCE_NAME = 55;
|
||||
private static final int TABLE_SEQUENCE_NAME = 56;
|
||||
private static final int IMAGE_OPTIONS = 57;
|
||||
private static final int REMOVE_GRAPHICS_EXTENSION = 58;
|
||||
private static final int ORIGINAL_IMAGE_SIZE = 59;
|
||||
private static final int SIMPLE_TABLE_LIMIT = 60;
|
||||
private static final int NOTES = 61;
|
||||
private static final int METADATA = 62;
|
||||
private static final int TABSTOP = 63;
|
||||
private static final int WRAP_LINES_AFTER = 64;
|
||||
private static final int SPLIT_LINKED_SECTIONS = 65;
|
||||
private static final int SPLIT_TOPLEVEL_SECTIONS = 66;
|
||||
private static final int SAVE_IMAGES_IN_SUBDIR = 67;
|
||||
private static final int DEBUG = 68;
|
||||
private static final int INCLUDE_ORIGINAL_CITATIONS = 36;
|
||||
private static final int USE_NATBIB = 37;
|
||||
private static final int NATBIB_OPTIONS = 38;
|
||||
private static final int FORMATTING = 39;
|
||||
private static final int PAGE_FORMATTING = 40;
|
||||
private static final int OTHER_STYLES = 41;
|
||||
private static final int IMAGE_CONTENT = 42;
|
||||
private static final int TABLE_CONTENT = 43;
|
||||
private static final int TABLE_FIRST_HEAD_STYLE = 44;
|
||||
private static final int TABLE_HEAD_STYLE = 45;
|
||||
private static final int TABLE_FOOT_STYLE = 46;
|
||||
private static final int TABLE_LAST_FOOT_STYLE = 47;
|
||||
private static final int IGNORE_HARD_PAGE_BREAKS = 48;
|
||||
private static final int IGNORE_HARD_LINE_BREAKS = 49;
|
||||
private static final int IGNORE_EMPTY_PARAGRAPHS =50;
|
||||
private static final int IGNORE_DOUBLE_SPACES = 51;
|
||||
private static final int ALIGN_FRAMES = 52;
|
||||
private static final int FLOAT_FIGURES = 53;
|
||||
private static final int FLOAT_TABLES = 54;
|
||||
private static final int FLOAT_OPTIONS = 55;
|
||||
private static final int FIGURE_SEQUENCE_NAME = 56;
|
||||
private static final int TABLE_SEQUENCE_NAME = 57;
|
||||
private static final int IMAGE_OPTIONS = 58;
|
||||
private static final int REMOVE_GRAPHICS_EXTENSION = 59;
|
||||
private static final int ORIGINAL_IMAGE_SIZE = 60;
|
||||
private static final int SIMPLE_TABLE_LIMIT = 61;
|
||||
private static final int NOTES = 62;
|
||||
private static final int METADATA = 63;
|
||||
private static final int TABSTOP = 64;
|
||||
private static final int WRAP_LINES_AFTER = 65;
|
||||
private static final int SPLIT_LINKED_SECTIONS = 66;
|
||||
private static final int SPLIT_TOPLEVEL_SECTIONS = 67;
|
||||
private static final int SAVE_IMAGES_IN_SUBDIR = 68;
|
||||
private static final int DEBUG = 69;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// IV. Our options data
|
||||
|
@ -253,6 +254,7 @@ public class LaTeXConfig extends writer2latex.base.ConfigBase {
|
|||
options[EXTERNAL_BIBTEX_FILES] = new Option("external_bibtex_files","");
|
||||
options[ZOTERO_BIBTEX_FILES] = new Option("zotero_bibtex_files","");
|
||||
options[JABREF_BIBTEX_FILES] = new Option("jabref_bibtex_files","");
|
||||
options[INCLUDE_ORIGINAL_CITATIONS] = new BooleanOption("include_original_citations","false");
|
||||
options[USE_NATBIB] = new BooleanOption("use_natbib","false");
|
||||
options[NATBIB_OPTIONS] = new Option("natbib_options","");
|
||||
options[FORMATTING] = new IntegerOption("formatting","convert_basic") {
|
||||
|
@ -666,6 +668,7 @@ public class LaTeXConfig extends writer2latex.base.ConfigBase {
|
|||
public String externalBibtexFiles() { return options[EXTERNAL_BIBTEX_FILES].getString(); }
|
||||
public String zoteroBibtexFiles() { return options[ZOTERO_BIBTEX_FILES].getString(); }
|
||||
public String jabrefBibtexFiles() { return options[JABREF_BIBTEX_FILES].getString(); }
|
||||
public boolean includeOriginalCitations() { return ((BooleanOption) options[INCLUDE_ORIGINAL_CITATIONS]).getValue(); }
|
||||
public boolean useNatbib() { return ((BooleanOption) options[USE_NATBIB]).getValue(); }
|
||||
public String getNatbibOptions() { return options[NATBIB_OPTIONS].getString(); }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue