1 <html xmlns="http://www.w3.org/1999/xhtml">
3 <link rel="stylesheet" type="text/css" href="jabref_help.css"/>
7 <h1>OpenOffice/LibreOffice integration</h1>
11 <p>This feature offers an interface for inserting citations and formatting a Bibliography in an OpenOffice
12 or LibreOffice Writer document from JabRef.</p>
14 <p>Throughout this help document, whenever the name <i>OpenOffice</i>
15 is used, it can be interchanged with <i>LibreOffice</i>.</p>
17 <h2>Using the OpenOffice/LibreOffice interface</h2>
19 <p>To communicate with OpenOffice, JabRef must first connect to a running OpenOffice instance. You need to start
20 OpenOffice and enter your document before connecting from JabRef. JabRef needs to know the location of your
21 OpenOffice executable (<b>soffice.exe</b> on Windows, and <b>soffice</b> on other platforms), and the directory
22 where several OpenOffice jar files reside. If you connect by clicking the <b>Connect</b> button, JabRef will try
23 to automatically determine these locations. If this does not work, you need to connect using the <b>Manual
24 connect</b> button, which will open a window asking you for the needed locations.</p>
26 <p>After the connection has been established, you can insert citations by selecting one or more entries in JabRef and
27 using the <b>Push to OpenOffice</b> button in the dropdown menu of JabRef's toolbar, or by using the appropriate
28 button in the OpenOffice panel in the side pane. This will insert citations for the selected entries at the
29 current cursor position in the OpenOffice document, and update the bibliography to contain the full reference.</p>
31 <p><b>Note:</b> JabRef does not use OpenOffice's built-in bibliography system, because of the limitations of that
32 system. A document containing citations inserted from JabRef will not generally be compatible with other reference
33 managers such as Bibus and Zotero.</p>
35 <p>Two different types of citations can be inserted - either a citation in parenthesis, "(Author 2007)", or an in-text
36 citation, "Author (2007)". This distinction is only meaningful if author-year citations are used instead of numbered
37 citations, but the distinction will be preserved if you switch between the two styles.</p>
39 <p>If you modify entries in JabRef after inserting their citations into OpenOffice, you will need to synchronize the
40 bibliography. The <b>Sync OO bibliography</b> button will update all entries of the bibliography, provided their
41 BibTeX keys have not been altered (JabRef encodes the BibTeX key into the reference name for each citation to keep
42 track of which BibTeX key the original JabRef entry has).</p>
44 <h2>The style file</h2>
46 <p>To customize the citation style you need to select a style file, or use one of the default styles.
47 The style defines the format of citations and the format of the bibliography. You can use standard
48 JabRef export formatters to process entry fields before they are sent to OpenOffice. Through the style file, the
49 intention is to give as much flexibility in citation styles as possible. You can switch style files at any time,
50 and use the <b>Update</b> button to refresh your bibliography to follow the new style.</p>
51 <p>By clicking the <b>Select style</b> button you can bring up a window that allows selection of either the default
52 style or an external style file. If you want to create a new style based on the default, you can click the
53 <b>View</b> button to bring up the default style contents, which can be copied into a text editor and modified.</p>
54 <p>To choose an external style file, you have two options. Either you can choose a style file directly, or you can
55 set a style file directory. If you do the latter, you will see a list of styles from that directory (and
56 subdirectories), and can choose one from that list.</p>
58 <p>Here is an example style file:</p>
61 Example style file for JabRef-OpenOffice integration.
69 IsSortByPosition="false"
70 IsNumberEntries="false"
71 ReferenceParagraphFormat="Default"
72 ReferenceHeaderParagraphFormat="Heading 1"
75 AuthorField="author/editor"
80 AuthorLastSeparator=" & "
84 InTextYearSeparator=" "
87 BracketBeforeInList="["
88 BracketAfterInList="]"
89 CitationSeparator="; "
90 UniquefierSeparator=","
91 GroupedNumbersSeparator="-"
92 MinimumGroupingCount="3"
93 FormatCitations="false"
94 CitationCharacterFormat="Default"
95 MultiCiteChronological="false"
96 PageInfoSeparator="; "
99 article=\format[AuthorLastFirst,AuthorAbbreviator,AuthorAndsReplacer]{\author}
100 (<b>\year\uniq</b>). <i>\title</i>, \journal \volume\begin{pages} :
101 \format[FormatPagesForHTML]{\pages}\end{pages}.
103 book=\format[AuthorLastFirst,AuthorAbbreviator,AuthorAndsReplacer]{\author}\begin{editor}
104 \format[AuthorLastFirst,AuthorAbbreviator,AuthorAndsReplacer]{\editor} (Ed.)\end{editor},
105 <b>\year\uniq</b>. <i>\title</i>. \publisher, \address.
107 incollection=\format[AuthorLastFirst,AuthorAbbreviator,AuthorAndsReplacer]{\author}
108 (<b>\year\uniq</b>). <i>\title</i>. In: \format[AuthorLastFirst,
109 AuthorAbbreviator,AuthorAndsReplacer]{\editor} (Ed.), <i>\booktitle</i>, \publisher.
111 inbook=\format[AuthorLastFirst,AuthorAbbreviator,AuthorAndsReplacer]{\author}
112 (<b>\year\uniq</b>). <i>\chapter</i>. In: \format[AuthorLastFirst,
113 AuthorAbbreviator,AuthorAndsReplacer]{\editor} (Ed.), <i>\title</i>, \publisher.
115 phdthesis=\format[AuthorLastFirst,AuthorAbbreviator,AuthorAndsReplacer]{\author}
116 (<b>\year\uniq</b>). <i>\title</i>, \school.
118 default=\format[AuthorLastFirst,AuthorAbbreviator,AuthorAndsReplacer]{\author}
119 (<b>\year\uniq</b>). <i>\title</i>, \journal \volume\begin{pages} :
120 \format[FormatPagesForHTML]{\pages}\end{pages}.
124 <p>(Note that the layout for each entry type must be constrained to a single line in the style file - above, the lines
125 are broken up to improve readability.)</p>
127 <h3>Global properties</h3>
129 <p>The <b>PROPERTIES</b> section describes global properties for the bibliography.
130 The following table describes the available properties:</p>
132 <table border="1" rules="none" summary="Available Properties">
134 <td><b>Property</b></td>
136 <td><b>Default value</b></td>
137 <td><b>Description</b></td>
140 <td>IsNumberEntries</td>
142 <td><code>false</code></td>
143 <td>Determines the type of citations to use. If <code>true</code>, number citations will be
144 used. If <code>false</code>, author-year citations will be used.
148 <td>IsSortByPosition</td>
150 <td><code>false</code></td>
151 <td>Determines how the bibliography is sorted. If true, the entries
152 will be sorted according to the order in which they are cited. If false, the entries will be
153 sorted alphabetically by authors.
157 <td>ReferenceParagraphFormat</td>
159 <td><code>Default</code></td>
160 <td>Gives the name of the paragraph format to be used for the reference list. This format
161 must be defined in your OpenOffice document.
165 <td>ReferenceHeaderParagraphFormat</td>
167 <td><code>Heading 1</code></td>
168 <td>Gives the name of the paragraph format to be used for the headline of the reference list.
169 This format must be defined in your OpenOffice document.
175 <td><code>Bibliography</code></td>
176 <td>The text to enter as the headline of the reference list.</td>
180 <h3>Citation properties</h3>
182 <p>The <b>CITATION</b> section describes the format of the citation markers inserted into the text.</p>
184 <p>The following table gives a brief description of all the available citation properties. Properties that are not
185 given in the style file will keep their default value.</p>
187 <table border="1" rules="none" summary="Brief Description">
189 <td><b>Property</b></td>
191 <td><b>Default value</b></td>
192 <td><b>Description</b></td>
197 <td><code>author/editor</code></td>
198 <td>BibTeX field containing author names. Can specify fallback field, e.g. <code>author/editor</code></td>
201 <td>AuthorLastSeparator</td>
203 <td><code> & </code></td>
204 <td>Text inserted between the two last author names.</td>
207 <td>AuthorLastSeparatorInText</td>
210 <td>If specified, this propery overrides <code>AuthorLastSeparator</code> for in-text citations such as
211 <code>Smith & Jones (2001)</code>.
215 <td>AuthorSeparator</td>
217 <td><code>, </code></td>
218 <td>Text inserted between author names except the last two.</td>
221 <td>BracketAfter</td>
223 <td><code>]</code></td>
224 <td>The closing bracket of citations.</td>
227 <td>BracketAfterInList</td>
230 <td>The closing bracket for citation numbering in the reference list.</td>
233 <td>BracketBefore</td>
235 <td><code>[</code></td>
236 <td>The opening bracket of citations.</td>
239 <td>BracketBeforeInList</td>
242 <td>The opening bracket for citation numbering in the reference list.</td>
245 <td>CitationCharacterFormat</td>
247 <td><code>Default</code></td>
248 <td>If <code>FormatCitations</code> is set to <code>true</code>, the character format with the name
249 given by this property will be applied to citations. The character format must be defined in your
254 <td>CitationSeparator</td>
256 <td><code>; </code></td>
257 <td>Text inserted between items when a citation contains multiple entries, e.g. <code>[Smith 2001; Jones
263 <td><code> et al. </code></td>
264 <td>Text inserted after author names when not all authors are listed, e.g. <code>[Smith et al. 2001]</code></td>
267 <td>FormatCitations</td>
269 <td><code>false</code></td>
270 <td>Determines whether formatting should be applied to citations. If true, a character format will be
271 applied to the citations. The property <code>CitationCharacterFormat</code> controls which format
272 should be applied, and the given format must be defined in your OpenOffice document. Any font settings
273 and effects can be chosen within OpenOffice for your chosen character format.
277 <td>GroupedNumbersSeparator</td>
279 <td><code>-</code></td>
280 <td>Text inserted between numbers when numbered citations are grouped, e.g. <code>[4-6]</code></td>
283 <td>InTextYearSeparator</td>
285 <td>Single Space</td>
286 <td>Text inserted between author names and starting bracket before year in in-text citations.</td>
291 <td><code>true</code></td>
292 <td>If true, the "et al." string in citation markers is italicized.</td>
297 <td><code>3</code></td>
298 <td>The maximum number of authors to list in a citation that has appeared earlier in the document.</td>
301 <td>MaxAuthorsFirst</td>
303 <td><code>3</code></td>
304 <td>The maximum number of authors to list in a citation when appearing for the first time.</td>
307 <td>MinimumGroupingCount</td>
309 <td><code>3</code></td>
310 <td>The minimum number of consecutive entries a citation should contain before the numbers are grouped,
311 e.g. <code>[4-6]</code> vs. <code>[4; 5; 6]</code>.
315 <td>MultiCiteChronological</td>
317 <td><code>true</code></td>
318 <td>If <code>true</code>, multiple entries in the same citation are sorted chronologically, otherwise
319 they are sorted alphabetically.
323 <td>PageInfoSeparator</td>
325 <td><code>; </code></td>
326 <td>For citations with extra information, e.g. page numbers, this string is inserted between the year
327 (for author-year citations) or the citation number (for numbered citations) and the extra information.
328 E.g. the text between <code>2001</code> and <code>p. 301</code> in <code>[Smith 2001; p. 301]</code>.
332 <td>UniquefierSeparator</td>
334 <td><code>, </code></td>
335 <td>Text inserted between letters used to differentiate citations with similar authors and year. E.g.
336 the text between <code>a</code> and <code>b</code> in <code>[Smith 2001a, b]</code>.
342 <td><code>year</code></td>
343 <td>The BibTeX field to get publication year from.</td>
346 <td>YearSeparator</td>
348 <td>Single Space</td>
349 <td>Text inserted between author names and year in parenthesis citations such as <code>[Smith 2001]</code>.</td>
353 <p>If numbered entries are used, the <code>BracketBefore</code> and <code>BracketAfter</code> properties
354 are the most important - they define which characters the citation number is wrapped in. The citation is composed
356 <code>[BracketBefore][Number][BracketAfter]</code><br/>
357 where [Number] is the number of the citation, determined according to the ordering of the bibliography and/or
358 the position of the citation in the text. If a citation refers to several entries, these will be separated
359 by the string given in the property <code>CitationSeparator</code> (for instance, if <code>CitationSeparator</code>=;,
360 the citation could look like <code>[2;4;6]</code>). If two or more of the entries have a series of consecutive
361 numbers, the numbers can be grouped (for instance <code>[2-4]</code> for 2, 3 and 4 or <code>[2;5-7]</code> for
362 2, 5, 6 and 7). The property <code>GroupedNumbersSeparator</code> (default <code>-</code>) determines which string
363 separates the first and last
364 of the grouped numbers. The integer property <code>MinimumGroupingCount</code> (default 3) determines what number of
365 consecutive numbers is required before entries are grouped. If <code>MinimumGroupingCount</code>=3, the numbers
366 2 and 3 will not be grouped, while 2, 3, 4 will be. If <code>MinimumGroupingCount</code>=0, no grouping will be
367 done regardless of the number of consecutive numbers.
370 <p>If numbered entries are not used, author-year citations will be created based on the citation properties.
371 A parenthesis citation is composed as follows:<br/>
372 <code>[BracketBefore][Author][YearSeparator][Year][BracketAfter]</code><br/>
373 where [Author] is the result of looking up the field or fields given in the <code>AuthorField</code> property,
374 and formatting a list of authors. The list can contain up to <code>MaxAuthors</code> names - if more are present,
375 the list will be composed as the first author plus the text specified in the property <code>EtAlString</code>.
376 If the property <code>MaxAuthorsFirst</code> is given, it overrides <code>MaxAuthors</code> the first time each
377 citation appears in the text.</p>
379 <p>If several, slash-separated, fields are given in the <code>AuthorField</code> property, they will be looked up
380 successively if the first field is empty for the given BibTeX entry. In the example above, the "author" field will
381 be used, but if empty, the "editor" field will be used as a backup.</p>
383 <p>The names in the author list will be separated by the text given by the <code>AuthorSeparator</code>
384 property, except for the last two names, which will be separated by the text given by
385 <code>AuthorLastSeparator</code>.
386 If the property <code>AuthorLastSeparatorInText</code> is given, it overrides the former for citations of the
388 type. This makes it possible to get citations like <code>(Olsen & Jensen, 2008)</code> and <code>Olsen and
393 <p>[Year] is the result of looking up the field or fields given in the [YearField] property.</p>
395 <p>An in-text citation is composed as follows:<br/>
396 <code>[Author][InTextYearSeparator][BracketBefore][Year][BracketAfter]</code><br/>
397 where [Author] and [Year] are resolved in exactly the same way as for the parenthesis citations.
400 <p>If two different cited sources have the same authors and publication year, and author-year citations are used,
401 their markers will need modification in order to be distinguishable. This is done automatically by appending a
402 letter after the year for
403 each of the publications; 'a' for the first cited reference, 'b' for the next, and so on.
404 For instance, if the author "Olsen" has two cited papers from 2005, the citation markers will be modified to
405 <code>(Olsen, 2005a)</code> and <code>(Olsen, 2005b)</code>. In the bibliography
406 layout, the placement of the "uniquefier" letter is indicated explicitly by inserting the virtual field
407 <code>uniq</code>.</p>
409 <p>If several entries that have been "uniquefied" are cited together, they will be grouped in the citation
410 marker. For instance, of the two entries in the example above are cited together, the citation marker will
411 be <code>(Olsen, 2005a, b)</code> rather than <code>Olsen, 2005a; Olsen, 2005b)</code>. The grouped uniquefier
412 letters (a and b in our example) will be separated by the string specified by the <code>UniquefierSeparator</code>
416 <p>Author-year citations referring more than one entry will by default be sorted chronologically. If you wish them
417 to be sorted alphabetically, the citation property <code>MultiCiteChronological</code> should be set to
418 <code>false.</code>.</p>
421 <h3>Reference list layout</h3>
423 <p>The <b>LAYOUT</b> section describes how the bibliography entry for each entry type in JabRef
424 should appear. Each line should start with either the name of a BibTeX entry type, or the word
425 <code>default</code>, followed by a '='. The <code>default</code> layout will be used for all
426 entry types for which an explicit layout hasn't been given.</p>
428 <p>The remainder of each line defines the layout, with normal text and spaces appearing literally
429 in the bibliography entry. Information from the BibTeX entry is inserted by adding <code>\field</code> markers
430 with the appropriate field name (e.g. <code>\author</code> for inserting the author names). Formatting
431 information for the field can be included here, following JabRef's standard export layout syntax.
432 Refer to <a href="http://jabref.sourceforge.net/help/CustomExports.php">JabRef's documentation on custom export
434 for more information about which formatters are available.</p>
436 <p>If author-year citations are used, you have to explicitly specify the position of the "uniquefier" letter
437 that is added to distinguish similar-looking citations. This is done by including a marker for the virtual field
438 <code>uniq</code>, typically right after the year (as shown in the example style file). The <code>uniq</code>
439 field is automatically set correctly for each entry before its reference text is laid out.
442 <p>To indicate formatting in the bibliography, you can use the HTML-like tag pairs <b> </b>,
443 <i> </i>, <sup> </sup> and <sub> </sub> to specify bold text,
444 italic text, superscript and subscript, respectively.</p>
446 <p>If you are using numbered citations, the number for each entry will be automatically inserted at the start
447 of each entry in the reference list. By default, the numbers will be enclosed in the same brackets defined for
448 citations. The optional citation properties <code>BracketBeforeInList</code> and
449 <code>BracketAfterInList</code> override <code>BracketBefore</code> and <code>BracketAfter</code> if set. These
450 can be used if you want different types of brackets (or no brackets) in the reference list. Note that these need
451 not be brackets as such - they can be any combination of characters.</p>
453 <h2>Known issues</h2>
456 <li>Make sure to save your Writer document in OpenDocument format (odt). Saving to Word format will lose your
459 <li>There is currently no support for footnote based citations.</li>
460 <li>The cursor may be poorly positioned after inserting a citation.</li>
461 <li>Copy-pasting the example style file directly from this page can give an unparseable file. To avoid this, instead
462 download the example file from the link in the download section.