5

How do I add a note after a URL in URL reference using BibTeX in IEEE format? My code looks like this

@misc{thz_net,
 title={Terahertz applications },
 url={http://thznetwork.net/index.php/thz-images},
 note={(Date last accessed 15-July-2014)},
 }

Note appears before the url like this

[2] “Terahertz applications,” (Date last accessed 15-July-2014). [Online]. Available: http://thznetwork.net/index.php/thz-images

I'd like the note to appear after the URL. How can I achieve it?

3 Answers 3

5

It turns out that modifying a copy of the file IEEEtran.bst to achieve your objective is not particular difficult. I suggest you perform the following steps:

  • Find the file IEEEtran.bst in your TeX distribution. (If you run TeXLive, it probably resides at /usr/local/texlive/2014/texmf-dist/bibtex/bst/IEEEtran/.)

  • Make a copy of this file -- don't edit a file from your TeX distribution directly -- and call the copy, say, myIEEEtran.bst.

  • Open the file myIEEEtran.bst in your favorite text editor. The editor you use for your .tex files will do fine.

  • Find the function called misc. (In my copy of this file, the function misc starts on line 2144.)

  • In this function, locate the two lines that say

      format.note output
      format.url output
    

    Exchange the ordering of these two lines so that format.url will be executed before format.note.

  • Save the file myIEEEtran.bst, either in the directory where you main tex file is located, or in a directory that's searched by BibTeX. If you choose the latter method, be sure to update your TeX distribution's filename database appropriately.

  • Start using the "new" bibliography style file by issuing the instruction

    \bibliographystyle{myIEEEtran.bst}
    

    The first time you use the new style file, be sure to run LaTeX, BibTeX, and LaTeX twice more to propagate all changes.

Happy BibTeXing!

enter image description here

\documentclass{article}
\usepackage{filecontents,url}
\begin{filecontents*}{\jobname.bib}
@misc{thz_net,
 title={Terahertz applications },
 url={http://thznetwork.net/index.php/thz-images},
 note={(Date last accessed 15-July-2014)},
 }
\end{filecontents*}
\bibliographystyle{myIEEEtran}
\begin{document}
\nocite{*}
\bibliography{\jobname}
\end{document}
8
  • Thanks. That works! However, I did not know where to place the myIEEEtran.bst. Also, texhash did not pick it up and kpsewhich command returned no path. So I just added the bst file to the same folder as my tex file, worked like a breeze.
    – user29898
    Jul 22, 2014 at 22:23
  • @user29898 - I'm glad it works for you. Incidentally, in the second-to-last bullet point I did suggest that the new file could be saved in the directory where the main tex file is stored.
    – Mico
    Jul 23, 2014 at 9:55
  • I don't know why but it works just fine :) thanks (+1). Maybe you want to elaborate the "why" and how you found out - I would be very interested.
    – Boern
    May 27, 2017 at 14:19
  • I tried this, but in my case after doing this pdf did not generate references. I am using texstudio, I run .tex file many times.
    – Infinity
    Dec 20, 2018 at 13:12
  • @Infinity - You mention that you run TeX -- I'm assuming you meant LaTeX. But do you run BibTeX too?
    – Mico
    Dec 20, 2018 at 13:40
5

Consider using biblatex-ieee and the urldate field rather than note. The default string for urldate isvisited on (in English). If you prefer the string produced in your question, uncomment the 3 commented lines.

    \documentclass{article}
    \usepackage[style = ieee, urldate =comp]{biblatex}
    \usepackage{xpatch}
    \usepackage{url}

    \usepackage{filecontents}
    \begin{filecontents}{\jobname.bib}
    @misc{thz_net,
    title={Terahertz applications },
    url={http://thznetwork.net/index.php/thz-images},
    urldate={2014-07-15},
    }
    \end{filecontents}
    \addbibresource{\jobname.bib}

% \DefineBibliographyStrings{english}{%
% urlseen = {Date last accessed on}%
% }

    \begin{document}

    \nocite{*}
    \printbibliography

    \end{document} 

enter image description here

enter image description here

0

with this patch [1] for IEEEtranN.bst the urldate entry will be shown with ieeeTran 1.8a

don't forget to update your tex installation with

 texconfig-sys rehash

hopefully it's in the next release

[1] http://pastebin.com/fqSS9fRX

1
  • 2
    Welcome to TeX.SE. Please consider moving the bulk of the patch file to the body of your posting. I would also be helpful if you indicated how a user might make use of the patch if their TeX distribution doesn't run on a Unix-based system.
    – Mico
    Oct 31, 2014 at 21:59

You must log in to answer this question.

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