Zotero support

git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@73 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
henrikjust 2010-10-13 06:29:04 +00:00
parent 4949e6a995
commit e2f5e3ed59
23 changed files with 634 additions and 151 deletions

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.2 (2010-10-01)
* Version 1.2 (2010-10-13)
*
*/
@ -33,7 +33,7 @@ public class ConverterFactory {
// Version information
private static final String VERSION = "1.1.5";
private static final String DATE = "2010-10-06";
private static final String DATE = "2010-10-13";
/** Return the Writer2LaTeX version in the form
* (major version).(minor version).(patch level)<br/>

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.2 (2010-03-29)
* Version 1.2 (2010-10-09)
*
*/
@ -340,7 +340,7 @@ public class DrawConverter extends ConverterHelper {
boolean bCommentOut = true;
String sHref = node.getAttribute(XMLString.XLINK_HREF);
if (node.hasAttribute(XMLString.XLINK_HREF) && !ofr.isInPackage(sHref)) {
if (sHref.length()>0 && !ofr.isInPackage(sHref)) {
// Linked image is not yet handled by ImageLoader. This is a temp.
// solution (will go away when ImageLoader is finished)
sFileName = ofr.fixRelativeLink(sHref);

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.2 (2010-10-06)
* Version 1.2 (2010-10-13)
*
*/
@ -136,7 +136,11 @@ public class FieldConverter extends ConverterHelper {
// Use natbib
if (bNeedNatbib) {
pack.append("\\usepackage{natbib}").nl();
pack.append("\\usepackage");
if (config.getNatbibOptions().length()>0) {
pack.append("[").append(config.getNatbibOptions()).append("]");
}
pack.append("{natbib}").nl();
}
// Export sequence declarations
@ -459,12 +463,12 @@ public class FieldConverter extends ConverterHelper {
// (we don't expect any errors and ignore them, if they happen anyway)
// Sort key (purpose? currently ignored)
boolean bSort = true;
/*boolean bSort = true;
try {
bSort = jo.getBoolean("sort");
}
catch (JSONException e) {
}
}*/
JSONArray citationItemsArray = null;
try { // The value is an array of objects, one for each source in this citation

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.2 (2010-10-04)
* Version 1.2 (2010-10-09)
*
*/
@ -48,7 +48,7 @@ public class LaTeXConfig extends writer2latex.base.ConfigBase {
/////////////////////////////////////////////////////////////////////////
// I. Define items needed by ConfigBase
protected int getOptionCount() { return 66; }
protected int getOptionCount() { return 67; }
protected String getDefaultConfigPath() { return "/writer2latex/latex/config/"; }
/////////////////////////////////////////////////////////////////////////
@ -145,37 +145,38 @@ public class LaTeXConfig extends writer2latex.base.ConfigBase {
private static final int BIBTEX_STYLE = 32;
private static final int EXTERNAL_BIBTEX_FILES = 33;
private static final int ZOTERO_BIBTEX_FILES = 34;
private static final int FORMATTING = 35;
private static final int PAGE_FORMATTING = 36;
private static final int OTHER_STYLES = 37;
private static final int IMAGE_CONTENT = 38;
private static final int TABLE_CONTENT = 39;
private static final int TABLE_FIRST_HEAD_STYLE = 40;
private static final int TABLE_HEAD_STYLE = 41;
private static final int TABLE_FOOT_STYLE = 42;
private static final int TABLE_LAST_FOOT_STYLE = 43;
private static final int IGNORE_HARD_PAGE_BREAKS = 44;
private static final int IGNORE_HARD_LINE_BREAKS = 45;
private static final int IGNORE_EMPTY_PARAGRAPHS = 46;
private static final int IGNORE_DOUBLE_SPACES = 47;
private static final int ALIGN_FRAMES = 48;
private static final int FLOAT_FIGURES = 49;
private static final int FLOAT_TABLES = 50;
private static final int FLOAT_OPTIONS = 51;
private static final int FIGURE_SEQUENCE_NAME = 52;
private static final int TABLE_SEQUENCE_NAME = 53;
private static final int IMAGE_OPTIONS = 54;
private static final int REMOVE_GRAPHICS_EXTENSION = 55;
private static final int ORIGINAL_IMAGE_SIZE = 56;
private static final int SIMPLE_TABLE_LIMIT = 57;
private static final int NOTES = 58;
private static final int METADATA = 59;
private static final int TABSTOP = 60;
private static final int WRAP_LINES_AFTER = 61;
private static final int SPLIT_LINKED_SECTIONS = 62;
private static final int SPLIT_TOPLEVEL_SECTIONS = 63;
private static final int SAVE_IMAGES_IN_SUBDIR = 64;
private static final int DEBUG = 65;
private static final int NATBIB_OPTIONS = 35;
private static final int FORMATTING = 36;
private static final int PAGE_FORMATTING = 37;
private static final int OTHER_STYLES = 38;
private static final int IMAGE_CONTENT = 39;
private static final int TABLE_CONTENT = 40;
private static final int TABLE_FIRST_HEAD_STYLE = 41;
private static final int TABLE_HEAD_STYLE = 42;
private static final int TABLE_FOOT_STYLE = 43;
private static final int TABLE_LAST_FOOT_STYLE = 44;
private static final int IGNORE_HARD_PAGE_BREAKS = 45;
private static final int IGNORE_HARD_LINE_BREAKS = 46;
private static final int IGNORE_EMPTY_PARAGRAPHS = 47;
private static final int IGNORE_DOUBLE_SPACES = 48;
private static final int ALIGN_FRAMES = 49;
private static final int FLOAT_FIGURES = 50;
private static final int FLOAT_TABLES = 51;
private static final int FLOAT_OPTIONS = 52;
private static final int FIGURE_SEQUENCE_NAME = 53;
private static final int TABLE_SEQUENCE_NAME = 54;
private static final int IMAGE_OPTIONS = 55;
private static final int REMOVE_GRAPHICS_EXTENSION = 56;
private static final int ORIGINAL_IMAGE_SIZE = 57;
private static final int SIMPLE_TABLE_LIMIT = 58;
private static final int NOTES = 59;
private static final int METADATA = 60;
private static final int TABSTOP = 61;
private static final int WRAP_LINES_AFTER = 62;
private static final int SPLIT_LINKED_SECTIONS = 63;
private static final int SPLIT_TOPLEVEL_SECTIONS = 64;
private static final int SAVE_IMAGES_IN_SUBDIR = 65;
private static final int DEBUG = 66;
/////////////////////////////////////////////////////////////////////////
// IV. Our options data
@ -249,6 +250,7 @@ public class LaTeXConfig extends writer2latex.base.ConfigBase {
options[BIBTEX_STYLE] = new Option("bibtex_style","plain");
options[EXTERNAL_BIBTEX_FILES] = new Option("external_bibtex_files","");
options[ZOTERO_BIBTEX_FILES] = new Option("zotero_bibtex_files","");
options[NATBIB_OPTIONS] = new Option("natbib_options","");
options[FORMATTING] = new IntegerOption("formatting","convert_basic") {
public void setString(String sValue) {
super.setString(sValue);
@ -659,6 +661,7 @@ public class LaTeXConfig extends writer2latex.base.ConfigBase {
public String bibtexStyle() { return options[BIBTEX_STYLE].getString(); }
public String externalBibtexFiles() { return options[EXTERNAL_BIBTEX_FILES].getString(); }
public String zoteroBibtexFiles() { return options[ZOTERO_BIBTEX_FILES].getString(); }
public String getNatbibOptions() { return options[NATBIB_OPTIONS].getString(); }
// Formatting options
public int formatting() { return ((IntegerOption) options[FORMATTING]).getValue(); }