2

I want to modify the line of text which comes before an url when you add a url to your bibliography item.

The default format for the url is

FUNCTION {format.url}
{ url empty$
    { "" }
    { this.to.prev.status
      this.status.std
      cap.yes 'status.cap :=
      name.url.prefix " " *
      "\url{" * url * "}" *
      punct.no 'this.status.punct :=
      punct.period 'prev.status.punct :=
      space.normal 'this.status.space :=
      space.normal 'prev.status.space :=
      quote.no 'this.status.quote :=
    }
  if$
}

Now I removed name.url.prefix " " * and replaced it with

accessdate empty$
  { "[Online]. Available: " * }
  { "[Online; accessed: " * accessdate * "]. Available:" * }
if$

And added accessdate to the set if ENTRY items. When I however now compile it I get the error:

You can't pop an empty literal stack for entry BIBLIOGRAPHY ITEM

What is the problem here? I noticed that as soon as I add the line name.url.prefix " " * back everything works again, also in combination with my added code. I tried removing everything which was associated with name.url.prefix but that did not work helas.

Minimal example IEEEtran.cls needed:

document.tex

\documentclass[journal]{IEEEtran}
\usepackage{cite}
\usepackage{url}
\begin{document}
Test \cite{stackexchange}.  
\bibliographystyle{IEEEtran}
\bibliography{IEEEabrv,bibliography}
\end{document}

Bibliography.bib

@misc{stackexchange,
  title="Title",
  author="Author",
  year="2014",
  publisher="Someone",
  url="http://tex.stackexchange.com/",
  accessdate="2014-11-04"
}

Modified IEEEtran.bst

http://pastebin.com/VQa7V4bx

The url function is on line 1938 and name.url.prefix is used in multiple lines.

Your Answer

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

Browse other questions tagged or ask your own question.