5

I currently have a BibTeX entry for a book, of which I want to cite a section, like this:

@inbook{..., chapter = {1}, ...}

During the output of the bibliography, this will be printed as

..., chapter 1, ...

Can I somehow change the prefix of the chapter, so that it reads "section 1" or any text I want? More generally, is there a command to adapt any of the keyword labels to your likings?

2
  • 5
    Don't do this. Reference lists are for identifying sources that are cited in the text. When you want to narrow down where in the source the material you are interested in appears, standard source documentation is to do so at the point of citation. Nov 23, 2010 at 18:34
  • 1
    I figure this is indeed the best way to go. The point was that we are to work on a given section from a book, and that section alone, so instead of adding it to every single citation, I thought it to be more easy to just add it to the bibliography's entry.
    – jonny
    Nov 24, 2010 at 15:12

3 Answers 3

7

Charles Stewart is right - don't do this.

That said, here's a solution using biblatex. Note that biblatex treats the @inbook type in a different way than traditional BibTeX, and for "Chapter X" entries you should use the type @book. If you want to change the term "Chapter" for certain entries, add the execute field and the tailor-made code of my example.

\documentclass{article}

\usepackage[abbreviate=false]{biblatex}

\newbool{specialchap}
\newcommand*{\specialchapname}{(Special chapter name)}
\DeclareFieldFormat{chapter}{%
  \ifbool{specialchap}{%
    \specialchapname~#1%
  }{%
    \bibstring{chapter}~#1%
  }%
}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@book{A01,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
  chapter = {11},
}
@book{B02,
  author = {Buthor, B.},
  year = {2002},
  title = {Bravo},
  chapter = {12},
  execute = {\booltrue{specialchap}\renewcommand*{\specialchapname}{Section}},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\nocite{*}

\begin{document}

\printbibliography

\end{document}

enter image description here

3

I would look at the bibtex bst style provided by revtex (google it) to figure out the details of bibliographic formatting for the specific task you are after. You'll probably need to learn the Bibtex programming syntax.

Bibtex documentation: http://en.wikipedia.org/wiki/BibTeX#External_links

1

You ask

Can I somehow change the prefix of the chapter, so that it reads "section 1" or any text I want?

for entries of type @inbook.

If you want to change the string "chapter" to "section" for all entries of type @inbook and @inproceedings, you can achieve this objective by editing the bibliography style file you use. You don't mention which bibliography style you use, so for the sake of this answer I'll assume it is the plain style.

  • Locate the file plain.bst in your TeX distribution, make a copy and name the copy say, myplain.bst, and open the new file in your favorite text editor. (Don't edit an existing file from your TeX distribution directly.)

  • The function that will need to be changed is called format.chapter.pages. In myplain.bst, it looks like this:

    FUNCTION {format.chapter.pages}
    { chapter empty$
        'format.pages
        { type empty$
            { "chapter" }
            { type "l" change.case$ }
          if$
          chapter tie.or.space.connect
          pages empty$
            'skip$
            { ", " * format.pages * }
          if$
        }
      if$
    }
    
  • Change the line

            { "chapter" }
    

    to

            { "section" }
    
  • Save the file, update TeX's filename database as needed/appropriate so that TeX can find the file. From now on use \bibliography{myplain} rather than \bibliographystyle{plain}.

Happy BibTeXing!

2
  • +1 -- the OP didn't state, though, that he/she wanted to change the label for every @inbook entry, and your solution isn't tailored to single entries.
    – lockstep
    Nov 18, 2012 at 14:57
  • @lockstep - good point. I've edited my answer to point out that the proposed change to the bst file will affect all entries of type @inbook (and @inproceedings as well).
    – Mico
    Nov 19, 2012 at 3:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .