0

I am using bib file. Now I do not want use doi. But % is not working. I do not want to remove the line as I may use it later.

@article{Epelbaum:2008ga,
  author =       {Epelbaum, Evgeny and Hammer, Hans-Werner and Meissner,
                        Ulf-G.},
  title =        {Modern Theory of Nuclear Forces},
  journal =      {Rev. Mod. Phys.},
  volume =       81,
  year =         2009,
  pages =        {1773-1825},
  %doi =          {10.1103/RevModPhys.81.1773},
  eprint =       {0811.1338},
  archivePrefix ={arXiv},
  primaryClass = {nucl-th},
  reportNumber = {HISKP-TH-08-18, FZJ-IKP-TH-2008-20},
  SLACcitation = {%%CITATION = ARXIV:0811.1338;%%}
}
user12290
  • 3,341
  • 1
    Please post a full MWE … (https://tex.meta.stackexchange.com/questions/228/) There are probably ways to not have the DOI shown, but we need more details. – Ingmar Jun 12 '22 at 10:39
  • 2
    Try _doi or HIDEdoi –  Jun 12 '22 at 10:58
  • Or give xdoi a try. – Mico Jun 12 '22 at 11:10
  • 1
    This will depend on the bibliography backend you use. BibTeX does not have a way of adding comments inside entries. With Biber (which is the default backend for biblatex, the package whose tag you have used) % will act as a comment character. In both systems (BibTeX and Biber) unknown fields are ignored, so if you rename the doi field to something that isn't known like definitelynotadoi or HIDEdoi as suggested by user187803 the DOI will also be ignored. ... – moewe Jun 12 '22 at 15:24
  • ... Ideally it should be the choice of your bibliography style whether or not to show the DOI. Most biblatex have a convenient option to disable/enable the DOI, but with many BibTeX styles there will not be such a simple way. (You'd have to edit the .bst file.) – moewe Jun 12 '22 at 15:25

1 Answers1

1

The quickest and most elegant way to suppress the DOI will depend on the bibliography backend (BibTeX vs Biber), the bibliography package and style you are using.

Generally speaking all bibliography backends simply ignore fields that are unknown to the relevant style. So if we make the reasonable assumption that your style does not have a notadoi field, you can rename the doi field to notadoi and the DOI will not be shown. This method should work in all cases.

If you are using Biber, you can actually use % to comment out a line inside a bibliography entry. In BibTeX that is not possible because BibTeX does not recognise % as a comment character. BibTeX treats everything outside of an entry as comments though, so you could temporarily move the DOI field to after the closing brace of the entry (though that does not seem very practical to me).

See also Comments in BibTex, Are comments discouraged in a BibTeX file?, code comments in a biblatex file.

Ideally it should be the choice of your bibliography style whether or not to show the DOI. Most biblatex styles have a convenient option to disable/enable the DOI (Biblatex: Get rid of ISSN, URLs and DOIs in references), but with many BibTeX styles there will not be such a simple way (you'd have to edit the .bst file).

moewe
  • 175,683