Export
The Better BibTeX Configuration can be found under the regular Zotero preferences pane, tab ‘Better BibTeX’.
The configuration of Better BibTeX is a little baroque compared to the standard Zotero Bib(La)TeX exporters (which
only have hidden preferences). The defaults should just work, but here’s an attempt to describe what they do.
Making any change here will drop your entire export cache. This is usually not a problem unless you have a
really large library, but you can read about what is involved here.
BibTeX
Export unicode as plain-text latex commands (recommended)
default: yes
BibTeX has really spotty Unicode support, so you generally want this on. It will translate things like accented characters
to their equivalent LaTeX constructs on export.
Disregard name prefixes when sorting
default: no
Name handling is a lot more complex than I had ever thought it to be. A lot more complex. BibTeX has really limited ways of dealing with names with particles (van, von, de, etc). If you turn this on, BBT will add code to have van Gogh
sorted under Gogh
.
Export numeric edition as English-written ordinals
default: no
Try to convert a numeric edition value to English words during BibTeX exports
Add URLs to BibTeX export
default: no
Most BibTeX styles do not support DOI/URL fields. Of the styles that do support them, many forget to load the required ‘url’ package, so make sure to load it yourself. DOI and URL fields are so-called ‘verbatim’ fields, and without the ‘url’ package loaded compilation will likely fail.
Options:
- no
- in the ’note’ field
- in the ’note’ field, but assuming the ‘url’ package is not loaded
- in the ‘url’ field
- in the ‘url’ field, but assuming the ‘url’ package is not loaded
BibLaTeX
Export unicode as plain-text latex commands
default: no
BibLaTeX actually has really good Unicode support, so you generally want this off. But for some geezers such as me it is
simply more pleasing to have things like accented characters translated to their equivalent LaTeX constructs on export.
default: yes
Use the extended biber 2.7 format for names with particles - only works in BibLaTeX 3.5 or later.
This biblatex has a new (less ambiguous) way to store creator names. It’s technically
superior, but the LaTeX world moves slowly, so many people won’t have it yet. But if you’re an early adopter,
you can enable it here
Fields
Fields to omit from export (comma-separated)
default: <not set>
If there are some fields you don’t want in your bibtex files (such as note
for example), add a list of them here, separated by comma’s.
BibTeX/BibLaTeX
Export language as
default: langid
Export either langid, language or both fields based on the item language (if any).
Options:
When an item has both a DOI and a URL, export
default: both
Does what it says on the tin, really. If an item has both a DOI and an URL, you can choose to have them both exported, or either one of them. Note that for BibTeX,
you must load the url
package when you have doi
or url
fields. doi
and url
fields are so-called verbatim
fields with different escaping rules, and
BibTeX compilation will likely error out without the package loaded.
Options:
default: 0
Export JabRef-specific fields: timestamps, titles for attachments, and groups for each collection an item is part of. Note that having this on will disable caching in exports, which is really undesirable specifically for auto-exports.
Options:
- no
- for JabRef 3
- for JabRef 4
- for JabRef 5
Quick-Copy
Quick-Copy/drag-and-drop citations
default: LaTeX citation
Used for drag-and-drop/quick copy using Better BibTeX citation keys. In the Zotero “Export” pane, choose Better BibTeX Quick Copy
as the default export format for quick copy, and choose the desired format for the drag-and-drop citations here.
In the case of Eta templates, the selected items are available as it.items
. <%= JSON.stringify(it.items) %>
will show you the available data on the items.
Options:
- LaTeX citation
- Cite Keys
- Eta template
- GitBook
- org-ref citation
- org-ref v3 citation
- Org-mode select link
- Pandoc citation
- Roam Cite Key
- RTF Scan marker
- Zotero select link
- Jupyter notebook
- Jekyll cite
LaTeX command
default: cite
Used for drag-and-drop/quick copy citations in LaTeX
format. Set the desired LaTeX citation command here. If you set this to citep
,
drag-and-drop citations will yield \citep{key1,key2,...}
Surround Pandoc citations with brackets
default: no
Used for drag-and-drop/quick copy citations in Pandoc
format. You can use this option to select whether you want
to have these pandoc citations surrounded with brackets or not.
Org-mode select link
default: using Zotero item key
OrgMode to select items in your library
Options:
- using Zotero item key
- using Better BibTeX citation key
Zotero select link
default: using Zotero item key
Hyperlink to select items in your library
Options:
- using Zotero item key
- using Better BibTeX citation key
Eta template
default: <not set>
Used for drag-and-drop/quick copy citations in Build your own
format. This is going to get pretty technical, sorry.
You can paste a Eta template here. Inside the template, you will find an array it.items
, each of which is a serialized Zotero item.
To find out what an item looks like inside the template, export some items as BetterBibTeX JSON.
postscript
Miscellaneous
Automatically abbreviate journal title if none is set explicitly
default: no
If set, generates journal abbreviations on export using the Zotero journal abbreviator, according to the abbreviation style selected in the list below the checkbox.
Sort TeX/CSL output (useful if you use version control on the output):
default: citation key (slower on very large libraries)
BBT sorts the output for TeX and CSL exports to have the output be versioning-friendly.
Options:
- off (fastest)
- item creation order (plenty fast)
- citation key (slower on very large libraries)
Abbreviation style:
default: <not set>
Select the style for auto-abbreviation. Only applicable to Juris-M; in Zotero, the style for automatic
abbreviation is not configurable.
default: no
Generate quality reports for exported entries. These show up only in BibTeX and BibLaTeX report formats and indicate things like missing required fields and
duplicate citation keys.
default: yes
Some importers or Zotero extensions (such as the ShortDOI manager for example) create tags on items that are more for item management than that
they are descriptive of the item. When this is off, such tags will not be included in the export.
Apply title-casing to titles
default: yes
If you’re dead-set on ignoring both BibTeX/BibLaTeX best practice (see the BBT FAQ) and the Zotero recommendations on title/sentence casing, you can turn this off to suppress title casing for English items
Apply case-protection to capitalized words by enclosing them in braces
default: yes
If you’re dead-set on ignoring both BibTeX/BibLaTeX best practice (see the BBT FAQ) and the Zotero recommendations on title/sentence casing, you can turn this off to suppress automatic brace-protection for words with uppercase letters.
Cache
Retain export cache across upgrades
default: no
By default, BBT clears all caches whenever BBT or Zotero is upgraded. I can’t realistically predict whether a change in Zotero or BBT is going to affect the output generated for any given item, so to be sure you always have the latest export-affecting fixes, the caches are discarded when a new version of either is detected. If you have a very large library however, of which you regularly export significant portions, you might want to retain the cached items even if that does come with the risk that you get wrong output on export that has been fixed in the interim.
If you have this on, and you experience any problem that is not the cache getting dropped on upgrade, you must clear the cache and reproduce the problem. When you change this setting, as with any setting change, the cache will be dropped.
Enable caching for background exports
default: yes
Even though BBT exports happen in a separate thread, some work needs to be done before the background export can
start. Part of this work is preloading the cache. You can shorten the (blocking) preparation time by turning off
the cache, at the cost of longer export times.
Hidden preferences
The Better BibTeX Configuration can be found under the regular Zotero preferences pane, tab ‘Better BibTeX’.
The configuration of Better BibTeX is a little baroque compared to the standard Zotero Bib(La)TeX exporters (which
only have hidden preferences). The defaults should just work, but here’s an attempt to describe what they do.
Making any change here will drop your entire export cache. This is usually not a problem unless you have a
really large library, but you can read about what is involved here.
You can edit most Better BibTeX preferences through the Preferences window in Zotero. However, Better BibTeX supports additional hidden preferences. These settings are intended for more advanced use.
Zotero
To view the full list of Better BibTeX’s preferences, including many hidden preferences, go to the Advanced pane of the Zotero preferences and click “Config Editor”. Enter “better-bibtex” into the Filter field at the top of the list that comes up. Preferences that can be safely changed by users are described below.
The Better BibTeX hidden preferences are preceded by “extensions.zotero.translators.better-bibtex.”
ascii
default: <not set>
If you have unicode turned on you can still selectively replace some characters to plain-text commands; any characters entered here will always
be replaced by their LaTeX-command counterparts.
autoExportIdleWait
default: 10
Number of seconds to wait after your system goes idle before kicking off auto-exports.
default: yes
Support for EDTF dates in biblatex
charmap
default: <not set>
a JSON mapping from single character to raw LaTeX, to augment the default mapping; these will be applied when you export as ASCII. DO NOT edit this preferencedirectly,
but create a CSV (not semicolons) file named charmap.csv
in the zotero data directory under the better-bibtex
folder with columns unicode
(the source character),
text
(representation in LaTeX text mode, if any) and math
(representation in LaTeX math mode, if any, without dollar signs).
csquotes
default: <not set>
if you set csquotes
to a string of character pairs, each pair will be assumed to be the open and close parts of a pair and
will be replaced with a \\enquote{...}
construct.
git
default: config
Can be off
, config
or always
import
default: yes
Use BBTs importer instead of Zotero’s importer
importCitationKey
default: yes
On import, assign the existing citation key to the item being imported
importDetectURLs
default: yes
On import, detect URLs in non-standard bib(la)tex fields and import them as attachments
default: yes
On import, place all bib(la)tex field Zotero doesn’t have an existing field for in the Zotero extra
field of the item
importJabRefAbbreviations
default: yes
Expand journal abbreviations to the full journal name on import.
importJabRefStrings
default: yes
During import, replace titles matching a list of common @string definitions with the value of that @string
default: <not set>
On import, import note-like fields in this comma-separated list to the extra
field, unless the note has rich text.
importSentenceCaseQuoted
default: yes
During import, also sentence-case quoted parts of titles
importUnknownTexCommand
default: ignore
What to do when encountering a TeX command the parser does not know about. Please only use values:
ignore
: ignore the command entirely
tex
: import and mark as TeX code, so on re-export it will be output as-is
text
: import without marking it as TeX code, so on re-export it will be treated as regular text
itemObserverDelay
default: 5
I’ve had reports where Zotero notifies extensions that items have changed, but if BBT then actually
retrieves those same items, Zotero complains they “haven’t been saved yet”. Super. This preference sets
the number of microseconds BBT should wait after being notified before acting on the changed items.
mapMath
default: <not set>
Any characters entered here will prefer a math-mode LaTeX-command counterpart over a text-mode mapping, if a math-mode command is available.
mapText
default: <not set>
Any characters entered here will prefer a text-mode LaTeX-command counterpart over a math-mode, if a text-mode command is available.
packages
default: <not set>
Some LaTeX commands only work when certain packages are loaded. By default, BBT will export Bib(La)TeX that requires no extra packages, but
you can provide a comma-separated list here of packages to load to get higher fidelity export (for some admittedly niche characters).
Details of these packages and what they add can be found [here]({{ ref . “exporting/unicode.md” }}).
parseParticles
default: yes
Name particle handling. Only turn on when requested and we’re talking about it on github.
patchDates
default: dateadded=dateAdded, date-added=dateAdded, datemodified=dateModified, date-modified=dateModified
Import translators cannot set the date-added and date-modified of the items that are imported, they always get the current time as their date-added. BBT will leave fields it can’t map as
tex.[field]
in the extra
field of the item. If you enter a list of comma-separated field mappings here, like date-added = dateAdded, timestamp=dateModified
, BBT will offer a menu option
to remove them from the extra
field and set the corresponding date of the item to their values, assuming they can be parsed as simple dates (no circa and stuff).
postscript
default: <not set>
Snippet of javascript to run [after each entry generation]({{ ref . “exporting/scripting.md” }}).
postscriptOverride
default: <not set>
You can use a custom postscript per export directory:
- Edit the hidden preference
postscriptOverride
, and set it to a filename like postscript.js
- In the directory where you intend to export to, create a file called
postscript.js
(or whatever you set the preference to) and add the postscript you want there
- Export to that directory.
A postscript override will disable caching for that export.
preferencesOverride
default: <not set>
You can use custom preferences per export directory:
- Edit the hidden preference
preferencesOverride
, and set it to a filename like preferences.json
- In the directory where you intend to export to, create a file called
preferences.json
(or whatever you set the preference to), or called [bibfile you are exporting to].json
and add the desired preference overrides in the format {"override": { "preferences": {"skipFields": "note"} } }
. You can get your current preferences by exporting to BetterBibTeX JSON
and removing everything except config.preferences
, and renaming config
to override
.
- Export to that directory.
A preferences override will disable caching for that export.
rawImports
default: no
When you set this on, BBT will import bib files leaving any LaTeX commands as-is, and add the #LaTeX tag for raw re-exports.
rawLaTag
default: #LaTeX
When an item has this tag, all its fields will be assumed to hold raw LaTeX and will undergo no further transformation.
If you set this to *
, all items will be assumed to have raw LaTeX.
relativeFilePaths
default: no
When exporting a Bib(La)TeX file, if the attachments are stored anywhere under the directory the bibliography is exported to, use relative paths
to those attachments. Caching is disabled when this option is on, so it affects performance.
separatorList
default: and
Separator between list elements in list-type fields. You will need to add --listsep='|'
to your biber calls.
separatorNames
default: and
Separator between author names. You will need to add --namesep='|'
to your biber calls.
skipWords
default: a,ab,aboard,about,above,across,after,against,al,along,amid,among,an,and,anti,around,as,at,before,behind,below,beneath,beside,besides,between,beyond,but,by,d,da,das,de,del,dell,dello,dei,degli,della,dell,delle,dem,den,der,des,despite,die,do,down,du,during,ein,eine,einem,einen,einer,eines,el,en,et,except,for,from,gli,i,il,in,inside,into,is,l,la,las,le,les,like,lo,los,near,nor,of,off,on,onto,or,over,past,per,plus,round,save,since,so,some,sur,than,the,through,to,toward,towards,un,una,unas,under,underneath,une,unlike,uno,unos,until,up,upon,versus,via,von,while,with,within,without,yet,zu,zum
list of words to skip in title when generating citation keys
startupProgress
default: popup
Zotero takes a few seconds to start up, which is sometimes mistakenly attributed to BBT. BBT will tell you what phase the startup process is in (of Zotero and BBT) to
prevent support requests for something that I cannot change. Please only use values:
popup
: show a popup during startup
progressbar
: show a progressbar in the top of the frame
strings
default: <not set>
If you have externally maintained @string
vars paste them here and they will be resolved for subsequent imports. These should be entered as @string
declarations, such as @string{IEEE_J_PWRE = "{IEEE} Transactions on Power Electronics"}
, not just the var name.
stringsOverride
default: <not set>
You can use a custom @string list per export directory:
- Edit the hidden preference
stringstOverride
, and set it to a filename like strings.bib
- In the directory where you intend to export to, create a file called
strings.bib
(or whatever you set the preference to) and add the @string declarations you want there
- Export to that directory.
A strings override will disable caching for that export.
verbatimFields
default: url,doi,file,pdf,ids,eprint,/^verb[a-z]$/,groups,/^citeulike-linkout-[0-9]+$/, /^bdsk-url-[0-9]+$/, keywords
list of fields to treat as verbatim during import. If you’re importing e.g. Mendeley-generated BibTeX, which is out of spec in various ways, try removing file
from this list before import.
warnTitleCased
default: no
Both Zotero and BBT expect titles to be in sentence-case, but a lot of sites offer import data that is Title Cased. When exporting these titles to bib(la)tex you’re going
to get a lot of extra unwanted braces, because all these Title Cased words will look like proper nouns to BBTs own title-casing mechanism. When this setting is on, you will be warned
when you import/save items in Zotero with titles that look like they’re Title Cased, so that you can inspect/correct them.