I have modified the eprint entry in the hsiam.bst bibliography style file from arXiv (available here). More specifically, I have substituted the format.eprint function for the following one:

FUNCTION {format.eprint}
{ eprint empty$
    { "" }
    { "available in \href{http://arxiv.org/abs/" eprint * "}{arXiv:" eprint * "}" *}
  if$
}

When I cite the following entry

@Article{testone,
  Title                    = {Sample Title},
  Author                   = {Me Myself},

  Month                    = {August},

  Eprint                   = {2222.2222},
  Url                      = {http://arxiv.org/abs/2222.2222}
}

in an MWE like the following:

\documentclass[paper=a4,fontsize=11pt]{article}
\usepackage[sort&compress,numbers]{natbib}
\usepackage{hyperref}
\usepackage{bibentry}
\bibliographystyle{hsiam}

\begin{document}
\nobibliography{biblio}
\begin{enumerate}
\item \bibentry{testone}
\end{enumerate}
\end{document}

I get the following error when compiling with Bibtex:

This is BibTeX, Version 0.99d (MiKTeX 2.9 64-bit) The top-level auxiliary file: main.aux The style file: hsiam.bst Database file #1: publications.bib Warning--empty journal in testone Warning--empty year in testone ptr=1, stack= {\em Sample Title} ---the literal stack isn't empty for entry testone while executing---line 1053 of file hsiam.bst (There was 1 error message)

My guess is that I am calling eprint twice, but I don't know any other way to get the desired result, which should be like this:

M. Myself, Sample Title, available in arXiv:2222.2222, 2015.

Thank you for your time.

  • Is it a good idea to assign the entry type @article to pieces not published in a formal journal? For sure, the fields journal and year are required for entries of type @article. – Mico Aug 1 '15 at 19:16
  • When I add a journal field, the title appears but the year disappears, it looks like it's kind of trying to fit the pieces of information in not enough boxes. – Alex Aug 1 '15 at 22:26
  • It would be helpful if you would provide us with the means to reproduce the issue. To do this, I suggest adding the change you have made to the .bst file in the form of a standard patch. We also need a small, complete document which, when copy-paste-compiled reproduces the error you are having trouble with. On a unix-type system, you can produce a standard patch file using diff -Naur <path to original/siam.bst> <path to new/siam2.bst>, for example. – cfr Aug 2 '15 at 0:39
  • Thank you very much. Unfortunately I do not have access now to a unix-type system, but all the modifications done are explained in the post. I have also created an MWE in which I already find the issue. – Alex Aug 2 '15 at 22:40
up vote 1 down vote accepted

So, the solution I have found is to add a * before the second eprint call, having the following code:

FUNCTION {format.eprint}
{ eprint empty$
    { "" }
    { "available in \href{http://arxiv.org/abs/" eprint * "}{arXiv: " * eprint * "}" *}
  if$
}

When compiling the previous MWE, now the output of BibTeX is

This is BibTeX, Version 0.99d (MiKTeX 2.9 64-bit) The top-level auxiliary file: main.aux The style file: hsiam.bst Database file #1: biblio.bib

No errors at all, as looked for.

Thank you all for your help!

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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