Integration with latex?
This is an old discussion that has not been active in a long time. Before commenting here, you should strongly consider starting a new discussion instead. If you think the content of this discussion is still relevant, you can link to it from your new discussion.
how do you register new .js translators with the export command?
It should show up automatically.
I produced a .sed script for post-processing of the zotero generated .bib file:
s/alpha/{$\\alpha$}/g
s/beta/{$\\beta$}/g
s/gamma/{$\\gamma$}/g
s/epsilon/{$\\epsilon$}/g
s/{a}/{\\"a}/g
s/{o}/{\\"o}/g
s/{AlCl3}/Al{C}l{$_3$}/
s/Br-1)x/Br{$^{-1})_x$}/g
s/NH3/NH{$_3$}/g
s/H2O/{H$_2$O}/g
My process was
(1) export library from zotero
(2) run the script on the zotero generated .bib file to produce a good .bib file that LaTex can read.
If I added a bunch of new references to my zotero library, it was easy to re-export and modify the new .bib file.
This got the job done, but I'm not sure if it was the most elegant solution.
In the Zotero style repository[1] there is an "Bibtex generic citation style"[2] which inserts the bibtex key in the document when holding shift. After installing it you probably have to edit the Zotero settings in Zotero -> Preferences -> Styles to ensure that Zotero is using this style. (I had to restart my Browser to make it work)
1. http://www.zotero.org/styles
2. http://www.zotero.org/styles/bibtex/dev?install=1
Thanks!
http://ubuntuforums.org/showthread.php?t=1710667
Thanks
<rant>
But the lack of proper bibtex import/export is a cold showstopper. I have years of citations in bibtex form, and LaTeX documents that cite those references using the existing citation keys. If I switch to Zotero I lose the ability to update those documents, because the cite keys don't survive import/export. That is simply intolerable, to the point that I'm astonished that such an obvious problem still exists in Zotero. It basically makes it impossible to switch to Zotero from bibtex-based reference management. Personally I don't care about what cite keys zotero assigns to new references, but I absolutely cannot switch until such time as Zotero preserves my existing cite keys through the import/export process.
</rant>
What value is a rant like this really? Next time take a breath before posting.
Your personal mapping should reside on your local system, and would be used either to adjust the keys in data re-exported from Zotero for ordinary BibTeX processing or, if direct access to Zotero is implemented by a BibTeX tool at some point, to remap keys on the fly in LaTeX code called by a one-line header added to your existing documents.
I have the latest version of Zotero installed and this works for me.
Create a new style
1) Browse to your styles directory2) Make a copy of BibTeX.js.
3) Rename the copy to BibTexCiteKeyOnly.js
4) open the file in a text editor
Make the style unique
5) replace the last character in the "translatorID" with a different character6) change the "label" to "BibTexCiteKeyOnly"
Replace "function doExport()"
5) Jump to the last function: function doExport()6) Delete the entire function
7) Replace with the following code:
function doExport() {
//Zotero.write("% BibTeX export generated by Zotero "+Zotero.Utilities.getVersion());
// to make sure the BOM gets ignored
var first = true;
var citekeys = new Object();
var item;
while(item = Zotero.nextItem()) {
// determine type
var type = zotero2bibtexTypeMap[item.itemType];
if (typeof(type) == "function") { type = type(item); }
if(!type) type = "misc";
// create a unique citation key
var citekey = buildCiteKey(item, citekeys);
// write citation key
Zotero.write("\\cite{"+citekey);
first = false;
Zotero.write("}");
}
}
8) Save the new file and restart Firefox
9) Within the export preferences set the style you just created
Exporting the Citation
Now you can drop your citations directly into latex. Hold down shift and click+drag the desired citation to your document.Hopefully this helps.
Cheers!
function doExport() {
//Zotero.write("% BibTeX export generated by Zotero "+Zotero.Utilities.getVersion());
// to make sure the BOM gets ignored
var first = true;
var citekeys = new Object();
var item;
Zotero.write("\\cite{");
while(item = Zotero.nextItem()) {
// determine type
var type = zotero2bibtexTypeMap[item.itemType];
if (typeof(type) == "function") { type = type(item); }
if(!type) type = "misc";
// create a unique citation key
var citekey = buildCiteKey(item, citekeys);
// write citation key
if(first == true) {Zotero.write(citekey);}
else { Zotero.write(","+citekey);}
first = false;
}
Zotero.write("}");
}
Cheers!
https://github.com/ZotPlus/zotero-better-bibtex/
You can use Better BibTeX addon (https://github.com/retorquere/zotero-better-bibtex), which adds automatic export and many other neat features for LaTeX users. I completely ditched Jabref from my workflow and use LaTeX editor (VSCode with LaTeX Workshop extension) directly with exported BIB file from Zotero without any problems.