Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a draft version of a large latex document with a long bibliography (>30 pages long). It has been created with biblatex and has about 330 entries.

I'm editing a printout of the draft version and I'd like to create a short version of the bibliography to have a more compact copy which contains

  • the bibtexkey for each entry
  • the number (like [3])
  • and the most important data of the entry (title, year, authors, where published, pages) - no URLs

Is there an easy way to do that in a separate document?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

To add entry keys to the bibliography, you can redefine \begentry. Omitting data from the bibliography can be done using the \clearfield, \clearlist and \clearname commands, which can be executed using the \AtEveryBibitem hook.

None of these commands affect the bibliographic data, so a document with a "short" version of the bibliography can be generated without having to re-run biber/bibtex. The code below provides an example.

\documentclass{article}
\usepackage[style=numeric]{biblatex}
\usepackage{filecontents}

\newtoggle{draftbib}

% Comment this line for full bibliography
\toggletrue{draftbib}

\iftoggle{draftbib}
  {\renewbibmacro*{begentry}{%
     \printtext{\mkbibbold{\thefield{entrykey}}}\addcolon\addspace}
   \AtEveryBibitem{%
     \clearname{editor}%
     \clearfield{subtitle}%
     \clearfield{booktitle}%
     \clearfield{booksubtitle}%
     \clearfield{maintitle}%
     \clearfield{mainsubtitle}%
     \clearfield{url}%
     \clearfield{doi}}}
  {}

\begin{filecontents}{\jobname.bib}
@Article{bertram,
  author = {Bertram, Aaron and Wentworth, Richard},
  title = {Gromov invariants for holomorphic maps on Riemann surfaces},
  journaltitle = {J.~Amer. Math. Soc.},
  volume = {9},
  number = {2},
  date = {1996},
  pages = {529--571}}
@Book{companion,
  author = {Goossens, Michel and Mittelbach, Frank and Samarin, Alexander},
  title = {The LaTeX Companion},
  edition = {1},
  publisher = {Addison-Wesley},
  location = {Reading, Mass.},
  date = {1994}}
@InBook{nietzsche,
  author = {Nietzsche, Friedrich},
  bookauthor = {Nietzsche, Friedrich},
  editor = {Colli, Giorgio and Montinari, Mazzino},
  title = {Unzeitgem{\"a}sse Betrachtungen. Zweites St{\"u}ck},
  subtitle = {Vom Nutzen und Nachtheil der Historie f{\"u}r das Leben},
  booktitle = {Die Geburt der Trag{\"o}die. Unzeitgem{\"a}{\ss}e Betrachtungen I--IV. Nachgelassene Schriften 1870--1973},
  maintitle = {S{\"a}mtliche Werke},
  mainsubtitle = {Kritische Studienausgabe},
  volume = {1},
  publisher = {Deutscher Taschenbuch-Verlag and Walter de Gruyter},
  location = {M{\"u}nchen and Berlin and New York},
  date = {1988},
  pages = {243--334}}
@Online{ctan,
  title = {CTAN},
  subtitle = {The Comprehensive TeX Archive Network},
  date = {2006},
  url = {http://www.ctan.org}}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}
\nocite{*}
\printbibliography
\end{document}
share|improve this answer
    
thank you very much - I was not successful at first, maybe because of forbidden characters in the bib files. I'm sorry, could you please add to your answer what I have to do to adapt the example to my case? Do I have to \addbibresource the 3 bib files which I use in my main.tex document? Do I have to add information about my main.tex document? Do I have to run bibtex on the file or only pdflatex? –  Martin Aug 10 '11 at 14:32
1  
@Martin From the code above, copy and paste lines 5-22 into the preamble (before \begin{document}) of main.tex. Then run pdflatex main. Your new pdf document will have a short version of the bibliography. To revert back to the long bibliography, comment out \toggletrue{draftbib} and run pdflatex main again. Additional fields can be suppressed in the short bibliography by adding more \clearfield, \clearname and \clearlist commands within \AtEveryBibitem. –  Audrey Aug 10 '11 at 15:17
    
I see. Thank you very much. Would it be possible to create the new, short bibliography in a separate pdf document with nothing else in it (and without changing the original tex file or pdf)? –  Martin Aug 10 '11 at 15:44
1  
@Martin I think so. Make a copy of the file main.bbl and call it, say, shortbib.bbl. Create a new file shortbib.tex containing code similar to the example above, but delete lines 24-61. Replace these with \addbibresource commands referring to your actual bib files. Then run pdflatex shortbib. –  Audrey Aug 10 '11 at 16:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.