The variable you need to hook into is reftex-cite-format
. Somewhere in my Emacs init file, I have this code:
(eval-after-load 'reftex-vars
'(progn
;; (also some other reftex-related customizations)
(setq reftex-cite-format
'((?\C-m . "\\cite[]{%l}")
(?f . "\\footcite[][]{%l}")
(?t . "\\textcite[]{%l}")
(?p . "\\parencite[]{%l}")
(?o . "\\citepr[]{%l}")
(?n . "\\nocite{%l}")))))
You should to add your desired commands to this list. The first element in each pair is the letter you want to press after C-c [
to select the given citation format. The empty square brackets denote optional arguments; RefTeX has variables to control whether it prompts your for those. And %l
is where the cite key goes.
(You could also set this variable via M-x customize-variable
, but I loathe that particular feature of Emacs.)
I'm not sure what the syntax of \blockcquote
is...if it has more non-optional arguments than just a cite key, RefTeX might not be able to fully support it (i.e., it inserts the command but you then have to move backwards to fill out other arguments).
There is no eprint
entry type. arXiv articles can be entered as article
or online
types. Article identifiers are represented by the eprinttype
and eprint
fields. Any arXiv subject classification should be entered in eprintclass
or its alias primaryclass
. The url
field is unnecessary as standard styles generate a link to the article from its identifiers.
Here are some (partial) arXiv entries from the documentation.
@Article{baez/article,
author = {Baez, John C. and Lauda, Aaron D.},
title = {Higher-Dimensional Algebra V: 2-Groups},
journaltitle= {Theory and Applications of Categories},
volume = {12},
version = {3},
date = {2004},
pages = {423--491},
urldate = {2006-10-01},
eprinttype = {arxiv},
eprint = {math/0307200v3}
}
@Online{baez/online,
hyphenation = {american},
author = {Baez, John C. and Lauda, Aaron D.},
title = {Higher-Dimensional Algebra V: 2-Groups},
version = {3},
date = {2004-10-27},
eprinttype = {arxiv},
eprint = {math/0307200v3}
}
@Online{wassenberg,
hyphenation = {american},
author = {Wassenberg, Jan and Sanders, Peter},
title = {Faster Radix Sort via Virtual Memory and Write-Combining},
version = {1},
date = {2010-08-17},
eprinttype = {arxiv},
eprintclass = {cs.DS},
eprint = {1008.2849v1}
}
Annotations and additional examples can be found in the biblatex-examples.bib
file. Further details can be found in section 3.10.7 of the biblatex manual.
Best Answer
I use Zotero and I found this workflow works well so far, let me know if you find a better way to get the same job done. The following workflow will provide
automated human-error-proof bibliography citation in LaTeX, or a road map for bibliogrpahy management and citation in PhD thesis
Workflow settings:
The below workflow makes use of Zotero citation manager +
biblatex
+Biber
backend + TexStudio as text editor in order to automate the whole process of bibliography citation in LaTeX, finally, without manual data entry which is prone to human error. Zotero is doing all of the heavy work of capturing citations from the web and nicely tagging them (I prefer all references to be in one folder for one project, so that tagging can be more efficiently utilized to find relevant entries). For differences between different packages and backends in LaTeX, this can be of help. TexStudio is easy to learn, and well documented, feature-full, intuitive, and supports bothbiblatex
andbiber
, you might want to read this blog for more info. But first, you have to tweak of all these tools in order to get there, and as follows:Zotero citation manager:
It is a versatile bibliography management tool. You should know how to use Zotero by reading the documentation and tutorials and assuming you have a data bank of all references in this open-source free software, you want now to export these entries into another file of
.bib
extension to be used bybiblatex
in LaTeX file. Keep Zotero backup folder at a different path from FireFox default.Download the
bibtex-citep.js
translator from hereAdd this file to
translators
folder of Zotero, to know this path in your platform, open Zotero -> Tools -> Options -> Advanced -> Files and Folders Tab, under Data Directory Locations (from here also you can custom a different path from Firefox to any safe location you like) -> Show Data Directory: this will show you the directory of Zotero if you forget where it is, then add the downloaded file of translator intotranslators
folderEdit
bibtex-citep.js
file using any text editor of your liking, I use NotePad++ and change two lines only as shown below, this will let you do copy and paste of thecitation key
only from within Zotero of particular reference(s) into LaTeX document without being surrounded by ad hoc markup strings:From Zotero options, go to Export tab and select
BibTex-citep
from drop down menu of Defualt Output Format, this step just to enable the use of Ctrl+Shift+C shortcut after hackingBibTex-citep
translator, no more. The export format will be, according to the update below, in the more elegantbiblatex
format.UPDATE
Zotero (version 4.0.17) has updated the export list and thankfully included the
BibLaTex
format (see image below). This means that the way to the big moment was greatly shortened, and you can happily skip all of the above steps.Now, here is the big moment, every time you want to cite a reference, all what you have to do, is to select that/those reference(s) and copy from within Zotero into the clipboard by pressing Ctrl+Shift+C and paste that into your LaTeX document in the text editor of your like, this will auto-magically generate the
citation key
which is unique to each data entry, do not waste your time generating your own, you will forget many of them after a while, let the keys be generated in silico, without introducing human error, the keys will be generated by combination ofauthor_title_year
and those keys are going to be identified bybiblatex
since they are the same in the.bib
file exported from Zotero; trust me open the file and see them by your own eyes.If you discover any typo or fields lacking in the bibliography always do the corrections from within Zotero and not from within the
.bib
file, as the latter would be always updated based on ever changing Zotero database. Therefore, it is very important to make sure that you export the most recent Zotero database before compiling your PDF. Additionally, if you want to do some formatting stuff to some words in your titles or anything else, e.g. species names, the radical way to do it, is from within Zotero itself once and for all, see my answer here, alternatively you have to do latex mark-up from within your exported.bib
file each time exported, which I don't think is an elegant solution.To export the
.bib
file, you select the whole database of Zotero and right click then chooseexport itmes
, selectBibLaTeX
format and not theBibTex-citep
orBibTex
, save the.bib
file in the path location where your.tex
file can identifyTexStudio Text Editor:
Options -> Configure TexStudio -> Build; change Default Bibliography to
biber
Options -> Configure TexStudio -> Build; change Default Compiler to
XeLaTeX
to support some fonts, otherwise keep the defaultAfter finishing your
.tex
file, compile by pressing F6+F11+F6 as shortcut to LaTeX typesetting, bibliographybiber
backend, and LaTeX typesetting againBiblatex customization:
This is the most difficult step and requires reading the manual to customize styles
I came up with the one style, originally taken from here with some tweak to get rid of some fields in exported
.bib
file inbibtex
format from Zotero, you can change it as you like, see the comments in the below codePlease note that I used
\begin{filecontents}{\jobname.bib}
to\end{filecontents}
of this code you don't need to do your own bibliography, but this is only to have a minimal working example (MWE) here in this post. Typically, what would you like to do in your own case is to uncomment this line, instead, to feedbiblatex
with your own.bib
file that was exported from Zotero;\addbibresource{C:/Users/Dropbox/phd/ref/Exported Items.bib}
Don't forget to press F6+F11+F6 in TexStudio to compile your PDF file. Done!
code:
Citation result of the MWE:
![enter image description here](https://i.stack.imgur.com/eRXSx.png)
Bibliography result of the MWE:![enter image description here](https://i.stack.imgur.com/qEk41.png)
Update: For Emacs Users
Still copying citation keys from Zotero is an irreducible act. You want to keep Zetoro database clean and uptodate and I don't think there is any need to keep another file or database updated other than that of Zotero's. So same as with TexStudio just fetch that reference from Zotero, copy it by CTRL+SHIFT+C (now in the clipboard) and yank it into Emacs CTRL+y like below:
Happy ZoteroBiblatexing!