Wednesday, March 25, 2020

LaTeX from Zero



II. Bibliography in LaTeX: bibtex vs. biber and biblatex vs. natbib

What are they?

The term of "bibtex" is very confuse. We will use the following terms:
  • bibtex and biber are external programs that process bibliography information and act (roughly) as the interface between your .bib file and your LaTeX document.

  • natbib and biblatex are LaTeX packages that format citations and bibliographies; natbib works only with bibtex, while biblatex (at the moment) works with both bibtex and biber.)

To use your database (i.e. your .bib file) within your LaTeX document, you need an external program to process it — that is, to transform your .bib file into a .tex understandable one.

To do that, you can use either biber or BibTeX. They both use your .bib file as input, even if some of its features/fields might be available for biber only (e.g. utf8 encoding, the fields crossrefurldate, ...).

To display your bibliography and use citing commands, you need to use a LaTeX package. You can use either biblatex, or natbibWith the latter, your .bib file need to be processed with BibTeX. But if you use biblatex, you can process your .bib file either with biber, or with BibTeX.

1. natbib

The natbib package has been around for quite a long time, and although still maintained, it is fair to say that it isn't being further developed. It is still widely used, and very reliable.

  • requires .bst files, which use a postfix language that is difficult to program in for most people.
  • It is not able to do traditional humanities style citation styles or footnote style citations 
  • Multiple bibliographies in a single document or categorized bibliographies require extra packages.
  • By depending on bibtex as a backend, it inherits all of its disadvantages (see below).

You might want to use natbib if:

  • there is a .bst file already created for the specific journal you submitting a paper to;
  • a journal accepts latex submissions and requires or expects natbib. Such journal may not accept biblatex for the bibliography.

2. bibLatex

The biblatex package is being actively developed in conjunction with the biber backend.
  • Journals and publishers may not accept documents that use biblatex if they have a house style with its own natbib compatible .bst file.
  • It is not trivial to include the bibliographies created by biblatex into a document (as many publishers require.) 


3. Using Bibtex/Bilatex


Create a *.bib file (use for both Bitex/Biber)
A *.bib file will contain the bibliographic information.


3a. Using BibTeX
\bibliography : tells LaTeX the location of our .bib file
\bibliographystyle: selects one of various bibliographic styles.
\documentclass{article}

\begin{document}

Random citation \cite{DUMMY:1} embeddeed in text.

\newpage

\bibliography{lesson7a1} 
\bibliographystyle{ieeetr}

\end{document}

3b. Using BibLaTeX

Autogenerate footnotes in LATEX: The abilities of BibTeX are limited to basic styles as depicted in the examples shown above. Sometimes it is necessary to cite all literature in footnotes and maintaining all of them by hand can be a frustrating task. At this point BibLaTeX kicks in and does the work for us.
We now have to include the biblatex package and use the \printbibliography command.
It is crucial to move the \bibliography{lesson7a1} statement to the preamble of our document:
\documentclass{article}

\usepackage[backend=bibtex,style=verbose-trad2]{biblatex}
\bibliography{lesson7a1} 

\begin{document}

Random citation \autocite[1]{DUMMY:1} embeddeed in text.

\newpage

\printbibliography

\end{document}
For BibLaTeX we have to choose the citation style on package options with:
\usepackage[backend=bibtex,style=verbose-trad2]{biblatex}
The backend=bibtex part makes sure to use BibTeX instead of Biber as our backend.

To create footnote, use the \autocite command. The 'verbose' family of styles produces full citations in footnotes, with and a variety of options for ibidem abbreviations.
\usepackage[style=verbose-ibid,backend=bibtex]{biblatex}

3c. Summary
  • First define a .bib file using: \bibliography{BIB_FILE_NAME} (do not add .bib)
  • For BibTeX put the \bibliography statement in your document, for BibLaTeX in the preamble
  • BibTeX uses the \bibliographystyle command to set the citation style
  • BibLaTeX chooses the style as an option like: \usepackage[backend=bibtex, style=verbose-trad2]{biblatex}
  • BibTeX uses the \cite command, while BibLaTeX uses the \autocite command
  • The \autocite command takes the page number as an option: \autocite[NUM]{}


4. BibTeX with elsarticle

 elsarticles use Bibtex+natbib. But it maybe able use biblatex with some minor changes
\usepackage[
  natbib = true,
    backend=bibtex,
    isbn=false,
    url=false,
    doi=false,
    eprint=false,
    style=numeric,
    sorting=nyt,
    sortcites = true
]{biblatex}
\bibliography{mybibfile}

and

1
\printbibliography

1. if other than ‘review’ options are chosen (i.e. 1p,3p or 5p) then there is a conflict with two definitions in elsarticle.cls:
\global\let\bibfont=\footnotesize
\global\bibsep=0pt
it seems that these lines can be simply commented.

2. another thing is quite odd one – with renamed \author field to \auth or anything else there is no author list in the title of manuscript (i.e. empty line). I couldn’t find the reason for this behavior.

so in the end, I found another approach to include biblatex package in elsarticle class. here is the important part of preamble:

\documentclass[5p]{elsarticle}

\makeatletter
\let\c@author\relax
\makeatother
\let\bibhang\relax
\let\citename\relax
\let\bibfont\relax
\let\Citeauthor\relax
\expandafter\let\csname ver@natbib.sty\endcsname\relax

\usepackage[… options …]{biblatex}



No comments:

Post a Comment