Bibtex export
Is there a way of changing the key used in the bibtex export?
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.
Unique keys are still used outside of BibTeX too. As you probably know, the bibliography manager in the current OO.o does have an 'identifier' column which must be unique (similar to BibTeX keys).
RIS has "ID:", ISI/ENDNOTE has "%F:", etc.
I don't know whether the key field should be part of the interface/DB. If kkutner's criticism of the default naming, perhaps a way to change the algorithmic naming (hidden away in the extension preferences) would be reasonable.
So yeah, my instinct is to prefer being able to configure the key generation.
From http://www.gerg.ca/software/btOOL/doc/bt_language.html
NAME [a-z0-9\!\$\&\*\+\-\.\/\:\;\<\>\?\[\]\^\_\`\|]+
Best,
Randall
<http://groups.google.com/group/zotero-dev/browse_frm/thread/9642749ff2ddb593/#>
month = {nov},
to
month = NOV,
Best,
Randall
IMHO a well formatted BibTeX output is strategic to Zotero. I think it could be useful getting this link at hand to support the discussion. You'll find a "Format" tag in it.
http://www.bibtex.org/
Regards,
ftp://tug.ctan.org/pub/tex-archive/biblio/bibtex/contrib/doc/btxdoc.pdf
Which specifies an output such as
month = jul # "~4,"
Note the lack of braces.
It would be helpful if the first attached note to each entry was entered as the annote field as well...
So at least to be able to see the generated key in the info pane, and maybe the naming scheme somewhere in the preferences. You may even add a check to keep it hidden for those who seem to be really allergic...
i would join my opinion to those FOR the possibility of customizing BibTeXkeys.
My reasons: Till recently i used to use a global bib file with some logic i already elaborated for biblio keys. These notations are not smarter than those present actually in zotero, but not worse either, and my TeX documents are based on them. Any compilation or other document recycling with my bibliography up to date requires the citations redone (or keys on new entries of the zotero-generated bib file made conform to my old rules). This is quite tedious and might constitute a source of errors while typesetting documents.
ANOTHER ISSUE (in this conservative context) might be at least keeping the original keys while importing a bib file data.
Now when I use LaTeX/BibTeX, I create a unique bib file for that project, exported from a Zotero collection, which I keep with the tex source. That way I know I can always build a self-consistent document.
Again FWIW (ie. it doesn't answer your question, and is really just a comment on my change of process) I have stopped worrying about bibtex key naming at all. I just use AucTex and allow it to find my entries. Admittedly my loyalty to LaTeX is slight (I have a sense that it is a temporary solution, and only really use it because the alternatives are so dire), which probably puts me in a different category from most users. I'd drop it in a shot if a workable alternative tool for academic writing became available.
One option (which I just mentioned on the ticket) is to allow the use of a format string similar to the one currently used for attachment file naming (default: "{%c - }{%y - }{%t{50}}", meaning "First Creator - Year - First 50 Characters of Title"). A formatted BibTeX string would also have to be stripped using the regex from Randall above.
Doing it this way wouldn't allow for the retaining of keys on import, but it seems that as long as the format string could replicate the logic people were using in their imported keys, it would address the large majority of requests in these forums.
eg. Dennis Garlick's (2002) "Understanding the nature of the general factor of intelligence: The role of individual differences in neural plasticity as an explanatory mechanism" would be garlick2002ung
something else about bibtex export: the 'volume' and 'pages' field are exported ok, but it seems the 'number' field is not exported, is that normal? Overall, i guess the more field are exported the better, as latex takes care of which one are actually used... Is there any way a user can tweak the export format? I don't have much time as I'm (being late at) writing my PhD, but...
I began to look into the bibtex export code, and I finally found it in the zotero.sqlite file (which I dumped into a text file because I known nothing of SQL, line 15755 if it means anything). The key generation code is here indeed, and the number field is indeed not exported (there is a comment before the "fieldMap" relevant line (15391?), is that intentional?).
Anyway, if I was to change it, how could I do it? I guess that code is elsewhere before being written in the .sqlite... I am really sorry if those are simple questions, but I really have very little time right now (and I have to decide whether to use zotero or not for my thesis in a matter of days).
thanks...
http://forums.zotero.org/discussion/537/lyx-support
If you (or anyone else) has worked on this, or if you would like to, please post to that discussion, since these projects would work well together.
Key:
I would like to at least define a format for the keys as well (I use primary author name followed by "_" followed by two digit year followed by "_" followed by a number to prevent duplicates). In my .bib file I keep all items in alphabetical order so that I can easily determine the last number of the key. I suppose this would not be so important if the key were to be automatically generated, but I would need easy access to the key for citations.
Formatting:
I am no BibTeX expert so perhaps the current format of the export will work, but in the documentation I've read, the information is supposed to be located between double quotes, like...
article@{author_07_01,
author = "First LastName",
...
pages = "1--9",
}
instead of between brackets like in the current export...
@article{ComplicatedKey,
author = {First LastName},
...
pages = {1-9},
}
I also agree with some of the comments above regarding the formatting of the dates.
Fields:
There are some fields that are useful depending upon the type of reference you are recording, and I find that sometimes they are not available with Zotero.
In my humble opinion, in order to be a truly useful tool to the greatest number of researchers, a more customizable database and export feature is necessary. I realize that it is a challenge to implement customization when trying to automatically gather data from web sources, but I believe most people would much rather adapt a tool to their work flow than adapt their work flow to a tool.
The method I use of defining keys, which I also use to file papers as well as using to refer to work in my notes, is
SurnameYY
If that is already taken, I add the next letter of the alphabet (b, c, d etc.). Where the Surname is hyphenated, I only use the first part of the surname.
Unlike others here, I do remember the the key citation keys that I am working with at the time, so I want them to be simple and straightforward.
For my purposes, I really just want to be able to set an ID field to arbitrary text. I am looking at using the "Extra" field for that (since I don't know its original intent anyway :-). So long as it gets spit out into the (RDF) XML, I can use XSLT to whack it into any format I need, barring unforeseen complications.
It would be nice if Zotero had some kind of slick integration with XSLT, since that's a pretty well-known standard language for transforming marked-up text, for which a fair number of experienced programmers exist.. One could imagine "Export using stylesheet..." and "Generate report using stylesheet..." options, for example.
I run it as a quick post-process after the zotero->bibtex export. It can autogenerate keys very flexibly, sort, clean up output in various ways, etc.