A BibT EX Guide via Examples Ki-Joo Kim∗ Version 0.1 April 4, 2003 Abstract Thi

A BibT EX Guide via Examples Ki-Joo Kim∗ Version 0.1 April 4, 2003 Abstract This document describes how to (i) modify citation styles in your body text, (ii) make your own bibliography style (.bst) file, and (iii) modify the bibliography style file. Contents 1 Introduction 1 2 Example 2 3 Citation Styles 3 4 Making a .bst File 4 5 Modifying Bibliography Style Files 5 6 Useful Tips 6 7 Closing Remark 8 1 Introduction This short document describes how to change/modify citation and bibliography styles for your L AT EX documents. As you already know, there are basically two methods for adding bibliography at the end of your L AT EX documents. The first method is to use thebibliography environment. Reference entries are added using \bibitem{key} and are called via \cite{key} in the body text. You can change the style of references by formatting the bibitem entry. This is a convenient way to handle bibliography. However, there are big problems: you have to format each reference item and have ∗kim dot ki-joo at epa dot gov 2. Example 2 to reformat it when you are required to change bibliography style. Thus this method is good for small L AT EX documents. The second method is to use BibT EX. In this case you need two files: bibliography style (format) file (.bst file) and bibliography database file (.bib file). In your text, you can add the following two lines for bibliography: \bibliographystyle{unsrt} % Bibliography style file, unsrt.bst \bibliography{moea} % Bibliography database file, moea.bib The .bib file is formatted by the predefined rules in the .bst file, resulting in .bbl file which is referenced by your L AT EX source file. Once you have a correct .bst file, this method is good for long L AT EX documents such as journal papers, reports, books, and your dissertation. You can find lots of bibliography style files in the \bibtex\bst directory in your \texmf tree. If you are lucky, book publishing companies and your universities may provide the bibliography style files. You can also see examples of many .bst files on the web (http://www.cs.stir.ac.uk/˜kjt/software/latex/showbst.html). Now the problem is how to crteate/modify a .bst file if you cannot find a right one and are strictly required to follow the citation and reference styles by the book publishing companies. For example: • How can we change [1] in the body citation to (1), (Kim, 2000), Kim (2000), 1, or whatever you or the journal publisher want? ⇒Citation style. • How can we change [1,2,3,4,12,14,13,7] in the body citation to [1-4,7,12-14] ? ⇒Citation style. • How can we change [1] in the bibliography list to none, 1., 1), or whatever you or the journal publisher want? ⇒Bibliography style. • How can we change “Kim, A.B., Lee, C.D., and Park, E.F.” to “AB Kim, CD Lee, EF Park”, “AB Kim, CD Lee, and EF Park” (w/ and), “KIM, A.B., LEE, C.D., and PARK, E.F.”, “Kim, Ava Bell, Lee, Cleo Dave, and Park, Elvis Frank”, or whatever you are required? ⇒Bibliography style. • How can we change journal title styles (italic or normal?), volume (bold, presence of vol., style of vol., ...), number, page, and other styles (such as location of the publisher name and its address)? ⇒Bibliography style. The main focus of this article is how to change citation and bibliography styles in BibT EX. Section 2 shows one example of citation and bibliography styles required. Section 3 describes how to change citation styles in the body text while Section 4 and 5 present how to create and modify bibliography style files to meet the given bibliography styles. Finally Section 6 provides some useful tips about citation and bibliography styles. Enjoy ! 2 Example Suppose that you are submitting your journal paper and the company requires the following citation and reference styles: 3. Citation Styles 3 • Citation style: Cite references in text by number in parentheses, in order of appearance (e.g., The algorithms in literature (1-3,5,22)). • Bibliography style: Do not use boldface, italics, or underscoring. List all known coauthors. For more specific styles, see the following examples. 1. AW Warner, DL White, WA Bonner. Real-time Fourier transformation via acousto-optics. J Appl Phys 43:4489-4493, 1972. (for journal papers) 2. D Dzombak. Elements of Power Systems Analysis. 3rd ed. New York: McGraw-Hill, 1975, pp. 125-134. (for books) 3. KJ Kim, UM Diwekar, Solvent selection under uncertainty. In: GV Recklitis, ed. Clean Solvents Design. New York: Marcel Dekker, 2002, pp.169-174. (for book chapters) 4. S Sorensen, S Skogestad, Multivessel columns. Proceedings of Advances in Batch Distil- lation, Pittsburgh, 2002, pp. 270-282. (for meetings) Some difficult parts of this style are: • Pure first name initial (no periods) + Last name (e.g., KJ Kim), • Periods after the author field and journal, book, book chapter, and meeting titles. Commas elsewhere, • Year after page numbers in journals while year before page numbers in books, book chapters, and meetings (if any), and • ‘In: ’ in book chapters but no ‘In: ’ in meetings. In this case citation styles are quite easy and are described in the next section. 3 Citation Styles The natbib package has been strongly recommended for reference citation. This package, devel- oped by Patrick W. Daly1, provides high degree of freedom for citation style change. The following examples are taken from his natbib.dvi file. In the author-year citation mode with an author-year .bst file, \citet{jon90} =⇒ Jones et al. (1990) \citet[Chap. 2]{jon90} =⇒ Jones et al. (1990, Chap. 2) \citep{jon90} =⇒ (Jones et al., 1990) \citep{jon90,jam91} =⇒ (Jones et al., 1990; James et al., 1991) \citet*{jon90} =⇒ Jones, Baker, and Williams (1990) \citep*{jon90} =⇒ (Jones, Baker, and Williams, 1990) In the number citation mode with an author-year .bst file, \citet{jon90} =⇒ Jones et al. [21] \citep{jon90} =⇒ [21] \citep{jon90,jam91} =⇒ [21,32] 1One of the authors of A Guide to L A T EX: Document Preparation for Beginners and Advanced Users. 4. Making a .bst File 4 In the number citation mode with a number .bst file, only \cite{} is valid and generates citation number in [ ]. Thus from these three modes, it is better to make an author-year .bst file all the time! The above styles are the default settings of the package. Now we want to use citation numbers in ( ), instead of [ ]. There are many options; but here the author only shows his flavor. \usepackage[sort&compress]{natbib} % Natbib citation style package \bibpunct{(}{)}{,}{n}{}{} % More options for Natbib Theoption [sort&compress] generatessortedand compressednumbercitations (e.g., [1,2,9,3,14,16,15] ⇒[1-3,9,14-16]). The options in \bibpunct creates curly parentheses ( ) (instead of [ ]), ‘,’ divider between citation numbers (instead of ‘;’), and number citation from the option {n} (the default is {a} for author-year citation). For more information, please read the manual, natbib.dvi. One more tip from this file is superscript citation as seen in Nature. Put the following two lines in the preamble and use \cite{key} in the body text. \usepackage[sort&compress]{natbib} \citestyle{nature} % Superscript citation style (Nature style) 4 Making a .bst File To make your own .bst file, the custom-bib package, also developed by Patrick W. Daly, is the best solution. Get makebst.ins, makebst.dtx, and merlin.mbs from CTAN (http://www.ctan.org) or other mirror sites. The merlin.mbs file is a master bibliography style file. So your .bst file is extracted from this .mbs file under given options that you will choose now. 1. Type latex makebst.ins in the command mode. This will generate makebst.tex and makebst.drv. 2. Type latex makebst to make your own .bst file. You will be asked a lot of questions regarding the bibliography style options. If you are not sure about the questions, just select the default value (*). Some important style questions (not all the questions!) are given below in order of appearance. Remember that we want to stick on the bibliography styles described in Section 2. Also remember that there is no way to go back and correct an error during this job.2 (a) The first question that you will meet is Do you want a description of the usage? ⇒ yes. (b) Enter the name of the MASTER file ⇒default. (c) Name of the final OUTPUT .bst file? ⇒type your .bst file name (here, imsi). (d) Do you want verbose comments? ⇒yes. (e) <<STYLE OF CITATIONS: ⇒(a) Author-year with some non-standard interface. (f) <<AUTHOR-YEAR SUPPORT SYSTEM ⇒Natbib for use with ˜. 2Do not worry. You can correct it later. 5. Modifying Bibliography Style Files 5 (g) <<ORDERING OF REFERENCES ⇒(c) Citation order (unsorted ...). (h) <<AUTHOR NAMES ⇒(x) Surname + pure initials (Smith JF). Remember that the style JF Smith is not provided. We will modify this later! (i) <<DATE POSITION ⇒(*) Date at end. Remember that we need year after page num- bers in journals but year before page numbers in books, book chapters, and meetings. (j) <<JOURNAL NAMES ⇒(x) Dottles journal names as ’Phys Rev’. This is required by the book publisher in Section 2. (k) <<VOLUME PUNCTUATION ⇒(*) Volume with colon as vol(num):ppp. (l) <<JOURNAL NAME PUNCTUATION uploads/s3/ bibtex-guide.pdf

  • 24
  • 0
  • 0
Afficher les détails des licences
Licence et utilisation
Gratuit pour un usage personnel Attribution requise
Partager