Updated: 06-13-2021 |
||
Table of Contents
Why BibTeX ?Using BibTeX instead of inline citations has several advantages:
Setting up your environmentI assume you are using a Unix variant like, e.g., Linux, Tru64 oder AIX. I recommend that you create a special directory to store all BibTeX related data: mkdir ~/texte/Bibdb To use this directory it is convenient to define the following two environment variables and include them in your startup files, e.g., in .zprofile: export BIBINPUTS=$HOME/texte/Bibdb export BSTINPUTS=$HOME/texte/Bibdb Now you can easily use BibTeX from any directory without worrying about the location of specific files. Creating and maintaining the databaseThe following steps guide you through the database creation. If you already have a database and want to update/add further entries, simply skip the first two steps
Choosing the styleThere are several styles available. If you want to publish it might be worthwhile to check if the magazine provides a style. Otherwise I would recommend using unsrt_new for German texts and unsrt_newen for English texts, which will create fairly standard citations with numbers. If you want a different layout check your favorite Latex-book. Remember to put your style into the directory you created, i.e. ~/texte/Bibdb. If you want to make small modifications of a given style (e.g., to change a string) I suggest copying the style to a new name and editing the new style, so cp almost_good.bst very_good.bstand edit very_good.bst to suit your needs. If you want to create your personal style (say, you want to have a special formatting or you want all strings in Esperanto or Catalan) then I suggest to use custom-bib. You can find it by searching for it on CTAN. Using BibTeXUsing BibTeX is quite easy. Simply add \bibliographystyle{unsrt_newen} \bibliography{mydb1,mydb2} where you want the bibliography to appear in your document. Substitute mydb1 with your databases. You can list several databases or only one. Now you cite as usual, e.g., as \cite{Eins:1995} showed, we need more documentation for efficient use ... To create your document (the TeX file is called mydoc.tex) you would issue the following commands: latex mydoc bibtex mydoc latex mydoc latex mydoc You need to run LaTeX twice after BibTeX to get all numbers right. Of course during editing you would only occasionally go through this cycle. Especially as long as your database and your citations haven't changed, you don't need to call BibTeX. That's all. If you need several indicesSometimes it might be necessary to include several bibliographies in one work. This can be accomplished using multibib. Say you want to have one bibliography with your own work and one with other peoples work. I assume that your own citations should be prefixed with E while the others should have no prefix. Further I assume that your publications are stored in myname.bib while all other citations are stored in others.bib. Unfortunately multibib does not directly support this, so we have to include a small workaround. In your heading enter \usepackage[resetlabels]{multibib} \makeatletter \newcommand\biblabelprefix{} \renewcommand\@biblabel[1]{[\biblabelprefix#1]} \def\@bibitem#1{\item\if@filesw \immediate\write\@auxout{\string\bibcite{#1} {\biblabelprefix\the\value{\@listctr}}}\fi\ignorespaces} \makeatother \newcites{my}{My Bibliography} \newcites{rest}{Other Bibliography} and in your document where you want your bibliography to appear you would enter \renewcommand\biblabelprefix{E} \bibliographystylemy{unsrt_new} \bibliographymy{myname} and at the place where you want the other bibliography to appear you would enter \renewcommand\biblabelprefix{} \bibliographystylerest{unsrt_new} \bibliographyrest{others} Citation works as usual except that you have two cite-commands, depending in which group of references the article is in: In my work \citemy{Myname:1998} I showed that this is possible contrary to other works \citerest{Author1:1990,Author2:1995} which claimed ... Note that the usual commands are simply appended by the strings my and rest you chose in the heading of your document. Not that you now have to call BibTeX with the two style files, i.e., bibtex my bibtex rest Of course, you can use more than two separate bibliographies this way. Note: If you want to use hyperref as well, you have to first load hyperref before redefining the labels, i.e., \usepackage[resetlabels]{multibib} \usepackage[...]{hyperref} \makeatletter ... Publish your database !There is one more advantage of using BibTeX: You can put you bib-File on the web and every colleague can simply get it to cite you right. If you keep this file up to date then you can simply tell your colleagues Just get my bib-File from my homepage, you will find the work in it. If you want your papers verbosely cited on the web (see this example), that's possible too. There are several tools available for this, but I currently recommend bibtex2html. This enables you to also include hyperlinks, e.g., if you have a preprint in your bib-file, you would add a line similar to the following line url = {http://xxx.uni-augsburg.de/abs/quant-ph/0011107}, where you substitute the real URL for the preprint. The online version will then have a link to your preprint. My example was created that way. © Dr. Helge Kreutzmann |