Edit Links |
BibTeX /
TipsCategories: Bibliography, Tips << | Page list | >>Table of contents (hide) 1. EncodingBibTeX does not support files encoded in UTF-8 (i.e., Unicode), which is nowadays the default file encoding on most OSes. The reason is that current BibTeX (v. 0.99c) was released in 1988 and thus predates the advent of unicode. Unless the long-announced BibTeX v. 1.0 or one of the many planned potential successing applications are ready, latin1 (ISO-8859-1) or another 8-bit encoding has to be used for the bib file (this does not affect the LaTeX encoding, which still can be utf8). If you rely on UTF-8, you might try biblatex-biber, a BibTeX replacement program written in Perl. Biber can handle unicode, however, as the name indicates, it only works in conjunction with biblatex. Please look here for some instructions. Decent bib file editors take care about the correct encoding, which usually can be set in the Preferences or Options dialog of the bib file editor. However, you might have to take care yourself about special characters. Particularly, characters not included in the bib file encoding need to be inserted via LaTeX macros. (Some editors automatically do this conversion for you, e.g. Pybliographic and BibDesk. In the latter application, you need to check "Convert accented characters to TeX when exporting or pasting BibTeX" in the "Opening and Saving" preferences.) Existing utf8-encoded bib files can be converted by means of the command line tool recode. The following command (with an adapted bib file name) should do the trick (however, please backup your bib file before trying): recode -d u8..ltex myfile.bib
This re-encodes the file to 7-bit ASCII. recode -d u8..l9 myfile.bib
Please check the recode man page for more options. Some background information:
2. Change bibliography headingYou can change the heading of your bibliography by inserting a ERT element (Insert→TeX) right before the bibliography with the following command: \renewcommand\refname{New References Header} or \renewcommand\bibname{New Bibliography Header}, depending on whether you use an article or a report/book class. Cf. the FAQ for a more general explanation. 3. Cross references vs. explicit referencesBibTeX adds cross-referenced entries to the bibliography even if they are not explicitly referenced when those entries are cross-referenced by two or more citations. The -min-crossrefs option can be used to disable or customize this behavior. As of LyX 1.4, you can customize the way bibtex is called (in Preferences→Output→LaTeX). Add the bibtex -min-crossrefs=200 .
With LyX < 1.4, the bibtex call was hardcoded. To customize /path/to/bibtex -min-crossrefs=200 "$@"
Name the script 'bibtex' and make sure it appears on the search path before the real bibtex executable. 4. Abbreviation of author name in textIf you want to abbreviate an author (or most likely institutional) name in the citation while having it in full form in the bibliography, the procedure depends on the citation approach. Biblatex and jurabib have the Example: @techreport{FEMA350, author = {{Federal Emergency Management Agency (FEMA)}}, shortauthor = {FEMA}, title = {Recommended seismic design criteria for new steel moment-frame buildings}, year = 2000, number = {FEMA-350}, address = {Washington, D.C.} } With natbib, things are more complicated. You need to define a cite alias.
5. Multiple and subdivided bibliographies5.1 Subdivided bibliographiesAs of LyX 1.4, subdivided bibliographies are natively supported via the bibtopic package:
Note, though, that bibtopic does not support unsorted bibliographies. With LyX < 1.4, you have to use TeX code as described in the bibtopic manual. N.B.: You have to call the package in the preamble with the command \usepackage[dot]{bibtopic}
Without the dot-option, LyX won't find the auxiliary files, hence the bibliography will be empty. Biblatex provides its own means to produce subdivided bibliographies (via keywords, filter tags, and categories). These are described on the biblatex manual, section Subdivided bibliographies 5.2 Multiple bibliographiesMultiple bibliographies will be supported as of LyX 2.3 (using, depending on the setting, either the bibtopic or chapterbib package, or biblatex):
See section 3.1.2 of Help→Additional Features for details. Up to LyX 2.2, you can produce multiple bibliographies with bibtopic, chapterbib or biblatex as follows:
If the aforementioned approaches do not fit your needs, you can produce multiple bibliographies with some extra code, using the package bibunits:
Also cf. this bibunits example
6. Creating your own style file with custom-bibSometimes it is necessary to change the format of the reference list. Most journals require a certain style; often there are recommendations how to style the reference list when doing a thesis. The easiest way to accomplish this task is to use Once installed, the command line "latex makebst" launches an interactive dialogue. Just keep patiently answering the questions, and you end up with a style file that should come close to your needs. Save that style file in a directory where LaTeX can find it (in your TEXMF directory in the folder When this is done, use natbib (Format→Document→Bibliography→Use natbib). Insert the reference list where you want it to appear (usually at the end of the document). Then select your .bst file as Style. 7. Creating hyperlinks within a documentSometimes you might want to employ, say, the To create hyperlinks within your document, go to Document→Settings...→PDF options and check Enable Hyperref Support. Make sure that you use Simply checking this option will make all hyperlinks in your document work, including citations. However, a reader may not notice that the links in your PDF file are clickable. If you wish to color the hyperlinks to increase legibility, add something like
You can put in any of LaTeX's default colors, i.e. white, black, blue, red, green, yellow, cyan and magenta. If you still want to do more, combine the commands with other color schemes or packages. For example, add \usepackage{xcolor}
to the preamble. With
Categories: Bibliography, Tips |