21

When building my bibliography using the

 \bibliographystyle{plainnat} 

The output looks like

[88] G. R. Ruetsch and M. R. Maxey. Small-scale features of vorticity and pas- sive scalar fields in homogeneous isotropic turbulence. Physics of Fluids A: Fluid Dynamics, 3(6):1587, 1991. ISSN 08998213. doi: 10.1063/1.857938. URL http://link.aip.org/link/PFADEB/v3/i6/p1587/s1&Agg=doi.

I'd like to omit of some of the fields, such as URL and ISSN. Is this possible? If so, what do I need to do?

(Note: My BibTex was made using Mendley)

3
  • 1
    If you want to omit the url and issn fields altogether in your references, just do a search and replace in your bib file: change url into NOOPurl and issn into NOOPissn in the field names and BibTeX will ignore those fields.
    – egreg
    Commented Oct 11, 2013 at 9:31
  • 4
    @egreg, If I edit the .bib file, Mendley will just overwrite it when i run it again. I could make a copy of the .bib file, but then i loose the advantage of having the .bib automatically update when i update in Mendley.
    – mrsoltys
    Commented Oct 11, 2013 at 20:35
  • 1
    Do you mean Mendeley? It is evil anyway :)
    – pluton
    Commented Oct 12, 2013 at 2:21

3 Answers 3

19

One way to proceed is to create a modified version of the file plainnat.bst, in which the functions that format and print fields such as doi and isbn are reduced to stubs that do nothing:

  • Find the file plainnat.bst in your TeX distribution. Make a copy of this file and call it, say, myplainnat.bst. (Don't edit an original file of the TeX distribution directly.)

  • Open myplainnat.bst in your favorite text editor, and search for the function called format.doi. (In my copy of the file, it starts on line 292.)

  • In this function, replace the line

    { new.block "\doi{" doi * "}" * }
    

    with

    { "" }
    

    In short, tell BibTeX to do nothing even if the field doi is non-empty. (You could go further and replace the function's entire body with { " " }. However, if you ever choose to undo some of these edits, it may be easier to do so if you leave behind for more than that absolute minimum code snippet.)

  • Repeat this procedure, as needed, for the functions format.url, format.issn, and format.isbn.

  • Save the file myplainnat.bst, either in the directory where your main .tex file is located or in a directory that's searched by BibTeX. If you choose the latter option, you'll probably need to update the filename database of your TeX distribution too.

  • Start using the new bibliography style via

    \bibliographystyle{myplainnat}
    
8
  • How do I find the file plainnat.bst in my TeX distribution? (I use Ubunbu) Commented Oct 17, 2013 at 6:30
  • 1
    @ErelSegalHalevi - What does kpsewhich plainnat.bst (to be typed from a command line) return?
    – Mico
    Commented Oct 17, 2013 at 6:34
  • Thanks! I didn't know about this useful command. Commented Oct 17, 2013 at 6:43
  • And your solution works perfectly, thanks again. Commented Oct 17, 2013 at 6:50
  • 1
    @Ernesto - If one has to work with the plainnat bibliography style (and BibTeX), the answer to your question is "No". If you're free to use the biblatex package, you could indeed affect a lot more of the formatting via LaTeX code.
    – Mico
    Commented Aug 18, 2017 at 20:26
6

You should use biblatex with this in your preamble (remove \bibliographystyle{plainnat})

\usepackage[style=authoryear-comp,firstinits=true,citestyle=authoryear,natbib=true,backend=bibtex]{biblatex}
\renewcommand\nameyeardelim{, }
\DeclareNameAlias{sortname}{last-first}
\renewcommand*{\multinamedelim}{\addcomma\space}
\renewcommand*{\finalnamedelim}{\addcomma\space}
\setlength{\bibitemsep}{\baselineskip}
\renewbibmacro{in:}{}

Where this gives you the expected removal.

\AtEveryBibitem{%
  \clearfield{issn} % Remove issn
  \clearfield{doi} % Remove doi

  \ifentrytype{online}{}{% Remove url except for @online
    \clearfield{url}
  }
}

This is based on http://codydunne.blogspot.se/2012/01/suppressing-bibtex-fields-for-specific.html

0
0

I have a setup where I have OverLeaf as my LaTeX distribution and it is synced with Zotero. For some reason, Zotero is exporting also a field "note" in my .bib file:

@article{osokin_real-time_2018,
title = {Real-time 2D Multi-Person Pose Estimation on {CPU}: Lightweight {OpenPose}},
rights = {Creative Commons Attribution 4.0 International},
url = {https://arxiv.org/abs/1811.12004},
doi = {10.48550/ARXIV.1811.12004},
shorttitle = {Real-time 2D Multi-Person Pose Estimation on {CPU}},
abstract = {In this work we adapt multi-person pose estimation architecture to use it on edge devices. We follow the bottom-up approach from {OpenPose}, the winner of {COCO} 2016 Keypoints Challenge, because of its decent quality and robustness to number of people inside the frame. With proposed network design and optimized post-processing code the full solution runs at 28 frames per second (fps) on Intel\${\textbackslash}unicode\{{xAE}\}\$ {NUC} 6i7KYB mini {PC} and 26 fps on Core\${\textasciicircum}\{{TM}\}\$ i7-6850K {CPU}. The network model has 4.1M parameters and 9 billions floating-point operations ({GFLOPs}) complexity, which is just {\textasciitilde}15\% of the baseline 2-stage {OpenPose} with almost the same quality. The code and model are available as a part of Intel\${\textbackslash}unicode\{{xAE}\}\$ {OpenVINO}\${\textasciicircum}\{{TM}\}\$ Toolkit.},
author = {Osokin, Daniil},
urldate = {2023-02-16},
date = {2018},
note = {Publisher: {arXiv} Version Number: 1 Read\_Status: To Read Read\_Status\_Date: 2023-02-16T14:04:41.638Z},
keywords = {Computer Vision and Pattern Recognition (cs.{CV}), {FOS}: Computer and information sciences}}

This made the citations flooded with unnecessary information about the Read Status of the papers (Generated by a Zotero add-on https://github.com/Dominic-DallOsto/zotero-reading-list).

I managed to remove the note by adding the following to the preamble.tex

\AtEveryBibitem{%
    \clearfield{note}
}

Thank you @fredrik-erlandsson your approach works.

You must log in to answer this question.

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