[Tex/LaTex] Omitting unwanted bibtex information from bibliography

bibtex

My .bib files are generated by Mendley desktop and usually contain URLs, ISSN and DOIs. I'm using the \usepackage[round]{natbib} package and \bibliographystyle{plainnat}.

I realize I'm not the first user to ask about this (question 1; question2)–although to be fair this user is asking about a different style than the one I'm using. And like this user, I don't want DOI, URL, ISSN to be displayed in my bibliography. How can I get rid of them?

Joseph Wright suggests using doi=false etc. But I'm unclear how this would be coded. I tried adding doi=false as follows: \bibliographystyle{natbib, doi=false} but this didn't work.

EDIT: Changes for clarity.

Best Answer

Recommended solution

There's no really simple way to do this elegantly using natbib, since the .bst files that format the bibliography entries either produce the fields or not. There's no way to selectively turn them on or off. For this reason, I would recommend that instead of using natbib you use biblatex to manage your bibliography, since this will allow you to have direct control over whether to produce them or not.

See

and then the solution in the question that Joseph linked to:

will work.

One minor problem with this solution however, is that there are no biblatex styles that mimic plainnat exactly, mainly because most Author-Year systems put the year right after the author, and not right at the end like plainnat does. If you have any flexibility in choosing a style, you can choose one of the standard biblatex authoryear styles, the apa style, or the biblatex-chicago package with the authordate style. Here's a minimal example using the APA style:

% !BIB TS-program = biber
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@ARTICLE{AD.Smith2001,
  author    = {Arthur D. Smith},
  title     = {A simple model of LaTeX References.},
  journal   = {Journal of LaTeX},
  year      = {2001},
  volume    = {100},
  pages     = {1--10},
  number    = {3},
  keywords  = {LaTeX models; biology},
  doi       = {10.1115/1.1372322},
  publisher = {Cambridge},
  url       = {http://link.aip.org/link/?PBY/321},
}
\end{filecontents*}

\documentclass[a4paper,12pt]{article}

\usepackage[american]{babel} 
\usepackage{csquotes} 
\usepackage[style=apa,
            backend=biber,
            natbib=true, % use this to use natbib cite commands
            url=false,
            doi=false]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\addbibresource{\jobname.bib}  

\begin{document}
\citet{AD.Smith2001}.

\printbibliography
\end{document} 

output of code

Non-recommended (but will work) solution

It's not that difficult to modify a .bst file to not print any of these fields. The .bst file plainnat has functions that look like this (one for URL, one for ISSN, one for DOI etc.)

FUNCTION {format.isbn}
{ isbn empty$
    { "" }
    { new.block "ISBN " isbn * }
  if$
}

We can replace each one of these with a function like this:

FUNCTION {format.isbn}
{ "" }

And this will simply cause any of these fields not to be printed. Make a copy of plainnat.bst, give it a new name, (I've called it plainnat-noURL, and save it in the same folder as your .tex document. Then edit the file and for each of functions, replace that function with one like the one above.

With this minimal example we get the output we want.

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@ARTICLE{AD.Smith2001,
  author    = {Arthur D. Smith},
  title     = {A simple model of LaTeX References.},
  journal   = {Journal of LaTeX},
  year      = {2001},
  volume    = {100},
  pages     = {1--10},
  number    = {3},
  keywords  = {LaTeX models; biology},
  doi       = {10.1115/1.1372322},
  publisher = {Cambridge},
  url       = {http://link.aip.org/link/?PBY/321},
}
\end{filecontents*}


\documentclass[a4paper,12pt]{article}


\usepackage[round]{natbib}


\begin{document}
\cite{AD.Smith2001}.

\bibliographystyle{plainnat-noURL}
\bibliography{\jobname}   % using the bib file created with filecontents
\end{document} 

output of code