4

The \bibliographystyle{IEEEtran} in my IEEE Overleaf template produces:

[1] D. C. Knill and A. Pouget, “The Bayesian brain: the role of uncertainty in neural coding and computation ”Trends in Neurosciences,vol. 27, no. 12, pp. 712–719, Dec. 2004.
[Online]. Available: http://linkinghub.elsevier.com/retrieve/pii/S0166223604003352

but I want:

[1] D. C. Knill and A. Pouget, “The Bayesian brain: the role of uncertainty in neural coding and computation,” Trends in Neurosciences, vol. 27, no. 12, pp. 712–719, Dec. 2004.

How can I get rid of the '[Online]' and 'Available:' strings, as well as of the contents of the url field itself?

I have synced my Zotero library with Overleaf to produce a .bib file. Entries look as follows:

@article{knill_bayesian_2004,
        title = {The {Bayesian} brain: the role of uncertainty in 
        neural coding and computation},
        volume = {27},
        issn = {01662236},
        shorttitle = {The {Bayesian} brain},
        url =          
       {http://linkinghub.elsevier.com/retrieve/pii/S0166223604003352},
        doi = {10.1016/j.tins.2004.10.007},
        language = {en},
        number = {12},
        urldate = {2018-11-14TZ},
        journal = {Trends in Neurosciences},
        author = {Knill, David C. and Pouget, Alexandre},
        month = dec,
        year = {2004},
        pages = {712--719}
}

I use bibtex to generate the bibliography.

\bibliography{bibtex/bib/references_from_zotero.bib}
\bibliographystyle{IEEEtran}

Does anyone know a better way than to manually remove the url, doi, and urldate from either Zotero or the resulting .bbl file?

I have tried to untick the 'Include URLS of paper articles in references' box Zotero for Mac --> Preferences --> Cite and then resync with Overleaf. This didn't have an effect.

1
  • If you are using natbib, it is relatively hard to make even slight changes in the bibliography style. Apr 25 '19 at 10:44
3

the IEEEtran.bst has an in-built control system.

Add this to your bib:

@IEEEtranBSTCTL{IEEEexample:BSTcontrol,
CTLuse_url = "no",
}

and then compile your document like this (the definition is not needed if you are using a IEEE class):

\documentclass[10pt]{book}
\makeatletter
\def\bstctlcite{\@ifnextchar[{\@bstctlcite}{\@bstctlcite[@auxout]}}
\def\@bstctlcite[#1]#2{%
 \@bsphack
 \@for\@citeb:=#2\do{%
 \edef\@citeb{\expandafter\@firstofone\@citeb}%
 \if@filesw\immediate\write\csname #1\endcsname{\string\citation{\@citeb}}\fi}%
 \@esphack}
\makeatother

\begin{document}
\bstctlcite{IEEEexample:BSTcontrol}
\cite{knill_bayesian_2004}
\bibliographystyle{IEEEtran}
\bibliography{test}

\end{document}

enter image description here

For more info check \IEEEtran_bst_HOWTO.pdf.

1
  • Support for \bstctlcite can also be added via the ieeetrantools package.
    – moewe
    Apr 25 '19 at 17:32
0

enter image description here

Look for IEEEtran.bst in your TeX distribution files. For Windows and MiKTeX 2.9, this would be C:\Users\username\AppData\Roaming\MiKTeX\2.9\bibtex\bst\ieeetran. Make a backup copy of it and save it under different name (e.g., IEEEtranbak.bst). Open IEEEtran.bst (your LaTeX editor would work for that) and and look for FUNCTION {default.is.use.url} { #1 } and change it to FUNCTION {default.is.use.url} { #0 }

\begin{filecontents*}{sample.bib}
@article{knill,
    title = {The {Bayesian} brain: the role of uncertainty in 
        neural coding and computation},
    volume = {27},
    issn = {01662236},
    shorttitle = {The {Bayesian} brain},
    url =          
    {http://linkinghub.elsevier.com/retrieve/pii/S0166223604003352},
    doi = {10.1016/j.tins.2004.10.007},
    language = {en},
    number = {12},
    urldate = {2018-11-14TZ},
    journal = {Trends in Neurosciences},
    author = {Knill, David C. and Pouget, Alexandre},
    month = dec,
    year = {2004},
    pages = {712--719}
}
\end{filecontents*}

\documentclass[]{IEEEtran}

\usepackage[square, nonamebreak, sort&compress, comma, numbers]{natbib}

\begin{document}

\cite{knill}

\newpage
\bibliographystyle{IEEEtran}
\bibliography{sample}

\end{document}
7
  • 2
    Note that this might have side effects for other entries where you do want to use urls, such as misc.
    – Marijn
    Apr 25 '19 at 12:01
  • 6
    Sorry, but suggesting to modify, say, IEEEtran.bst -- or any original file of the TeX distribution, for that matter -- is very poor advice. Making changes to an original file almost certainly violates the terms of the LaTeX license. But even if you don't care about legal niceties, you still should never apply changes to an original file: Original files get overwritten without warning whenever you update (a) the package the file belongs to or (b) your entire TeX distribution, say, from TeXLive2018 to TeXLive2019. That's why one should make a copy, rename the copy, and modify only the copy.
    – Mico
    Apr 25 '19 at 12:16
  • 1
    While this kind of hack might work for locally compiled documents, it's kinda useless if you're submitting a paper for publication (like, for example, to an IEEE Transactions journal...) - They will want to use their original, unmodified copy. Apr 25 '19 at 12:43
  • 3
    @Al-MotasemAldaoudeyeh - in the answer given in the link you provided, I deliberately wrote "Don't edit an original file of your TeX distribution directly." This advice continues to hold. I did NOT tell the OP to modify the original file; instead, I suggested that the OP make a copy, rename the copy, and edit the copy. The terms of use of the LaTeX license prohibit modifying an original file; they do not prohibit modifying a renamed copy of a file.
    – Mico
    Apr 25 '19 at 13:15
  • 1
    @Al-MotasemAldaoudeyeh Related explanation about renaming: tex.stackexchange.com/a/47360/187536 Apr 25 '19 at 16:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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