To fix the problem of arxiv papers, first, you have to replace, in the utphys.bst
file, the code
FUNCTION {format.primaryClass}
{
primaryClass empty$
{ "" }
{ " [" primaryClass * "]" *}
if$
}
FUNCTION {format.eprint}
{ eprint empty$
{ ""}
{ archive empty$
{"\href{http://arxiv.org/abs/" eprint * "}" *
"{{\ttfamily " * format.archive * eprint *
format.primaryClass * "}}" *}
{"\href{" archive * "/" * eprint * "}" *
"{{\ttfamily " * format.archive * eprint *
format.primaryClass * "}}" *}
if$
}
if$
}
by the following code:
FUNCTION {format.primaryClass}
{
primaryClass empty$
{ "Arxiv:" } %
{ "" primaryClass * "/" *} %Vall { " [" primaryClass * "]" *}
if$
}
FUNCTION {format.eprint} % eprint:9605032, http://arxiv.org/abs/hep-th/9605023
{ eprint empty$
{ "" }
{ archive empty$
{"\href{http://arxiv.org/abs/" format.primaryClass * eprint * "}" *
"{{" * " [" * format.primaryClass * % vall "{{\ttfamily " * format.archive * eprint *
eprint * "]" * "}}" * }
{"\href{http://arxiv.org/abs/" "}" *
"{{" * " [" * format.primaryClass *
eprint * "]" * "}}" *}
if$
}
if$
}
Explication:
I) in format.primaryClass
{ "" primaryClass * "/" *}
instead of { " [" primaryClass * "]" *}
will replace [hep-th]
by hep-th/
. So it will print primaryClass/
(printClass is
the catagory of the paper e.g. hep-th
) when it is defined, else (some of arxiv papers do not have a primaryClass
) it would print Arxiv:
(If$ will check that).
II) in format.eprint
:
A): \href{http://arxiv.org/abs/" format.primaryClass * eprint * "}"
: this useful only when you use the hyperref
package,
it produces the hyperlink http://arxiv.org/abs/primerClass/eprint
e.g. if primaryClass = {hep-th}
and eprint = {9605032}
it will produce
http://arxiv.org/abs/hep-th/9605032
. The code "{{" * " [" * format.primaryClass * eprint * "]" * "}}" * }
is the hyperlinked printed text which is
[format.primaryClass eprint]
i.e. in my previous example [hep-th/9605032]
. Remark: If you do not use the hyperref
package this will just print
[hep-th/9605032]
.
B) : Now, you can guess what the code "\href{http://arxiv.org/abs/" "}"
does ?. When the arxiv paper does not have a primaryClass
the case
A) is omitted and the program will excute this code, so this is nothing but \href{http://arxiv.org/abs/format.primaryClass eprint }
and since there is no primaryClass
the format.primaryClass
is just Arxiv:
. e.g. if eprint = {1512.00704}
this will give the hyperlink http://arxiv.org/abs/Arxiv:1512.00704
and you will automatically redirected
to the link http://arxiv.org/abs/1512.00704
. Finally, the code "{{" * " [" * format.primaryClass * eprint * "]" * "}}" *
will print the hyperlinked
text [format.primaryClass eprint]
which is in our last example [Arxiv:1512.00704]
.
To remove the comma before Arxiv
you must replace the following code (as in this answer):
FUNCTION {article}
{ output.bibitem
format.collaboration output
format.authors "author" output.check
format.title "title" output.check
blank.sep
crossref missing$
{ journal missing$
{}
{ format.journal add.doi "journal" output.check}
if$
report missing$
{format.eprint output}
{blank.sep format.report output format.eprint output}
if$
}
{ format.article.crossref output.nonnull
format.pages output
format.eprint output
}
if$
new.sentence
format.url output
new.sentence
note output
new.sentence
format.SLACcitation output
fin.entry
}
by the code:
FUNCTION {article}
{ output.bibitem
format.collaboration output
format.authors "author" output.check
format.title "title" output.check
blank.sep
crossref missing$
{ journal missing$
{}
{ format.journal add.doi "journal" output.check}
if$
report missing$
{before.all 'output.state := %% added
format.eprint output}
{blank.sep format.report output format.eprint output}
if$
}
{ format.article.crossref output.nonnull
format.pages output
format.eprint output
}
if$
new.sentence
format.url output
new.sentence
note output
new.sentence
format.SLACcitation output
fin.entry
}
A MWE:
\documentclass{article}
\begin{filecontents*}{test.bib}
@article{A,
archivePrefix = {arXiv},
arxivId = {hep-th/9605032},
author = {AuthorI, A. and AuthorII, B. and AuthorIII, C.},
eprint = {9605032},
journal = {Journal of Bla bla},
pages = {12},
primaryClass = {hep-th},
title = {{Title of the paper A}},
volume = {123},
year = {2016}
}
@article{B,
archivePrefix = {arXiv},
author = {AuthorA, A. and AuthorB, B. and AuthorC, C.},
arxivId = {1512.00704},
eprint = {1512.00704},
journal = {Journal of bla bla},
pages = {1233},
title = {{Title of the paper B}},
volume = {567},
year = {2016}
}
\end{filecontents*}
\begin{document}
~\nocite{*}
%Bibleography
\bibliographystyle{Vall}
\bibliography{test}
\end{document}
The result: