1

I am writing a paper using the elsarticle documentclass and as far as I know it loads natbib. The problem I am facing has to do with the references : when I invoke a url there is the work "URL" and "[link]" in the entry, so what I want to achieve is to get rid of those.

A simple MWE to illustrate the issue and a sample .bib file follows up next.

MWE

\documentclass[preprint, 5p]{elsarticle}

\RequirePackage[colorlinks,citecolor=blue,urlcolor=blue,linkcolor=blue]{hyperref}
\RequirePackage{url}

%% `Elsevier LaTeX' style for references
\bibliographystyle{elsarticle-num}
\biboptions{numbers,sort&compress}

\usepackage{blindtext}

\begin{document}

\section{Section}
\blindtext \cite{MGAS3, Tsinganis, nTOF}

\section*{References}
\bibliography{bibliography}

\end{document}

bibliography.bib file

@online{nTOF,
title = {The {n\_ToF} Collaboration},
url   = {www.cern.ch/ntof},
}

@techreport{MGAS3,
  AUTHOR      = {Y. Giomataris},
  XTITLE      = {MICROMEGAS: results and prospects},
  INSTITUTION = {CEA/Saclay, DAPNIA},
  URL         = {www.slac.stanford.edu/pubs/icfa/fall99/paper1/paper1a.html},
}

@inbook{Tsinganis,
xtitle     = "Measurement of the 240Pu(n,f) cross-section at the CERN n-TOF facility: First results from EAR-2",
author     = "A. Tsinganis and et al.",
year       = "2015",
isbn       = "9789290834182",
pages      = "23--28",
booktitle  = "Proceedings of the 14th International Conference on Nuclear Reaction Mechanisms, NRM 2015",
publisher  = "CERN-2114737",
URL        = "https://cds.cern.ch/record/2114737",
}

The output looks like that

enter image description here

Why is this happening? Does it have to do with the class itslef? Is there a way to avoid and get rid of what's contained in the red rectangles?

1 Answer 1

3

A real solution would require to change the bst-file. As a hack you can try this -- it assumes that \href has to eat four arguments -- the standard two argument, a period and a \newline. If there are cases where the \newline is missing it could fail. Then one would have to improve the hack.

\documentclass[preprint, 5p]{elsarticle}

\RequirePackage[colorlinks,citecolor=blue,urlcolor=blue,linkcolor=blue]{hyperref}
\RequirePackage{url}
\usepackage{etoolbox}
%% `Elsevier LaTeX' style for references
\bibliographystyle{elsarticle-num}
\biboptions{numbers,sort&compress}

\usepackage{blindtext}

\begin{document}

\section{Section}
\blindtext \cite{MGAS3, Tsinganis, nTOF}

\section*{References}

\def\urlprefix{}\def\href#1#2#3#4{\ifstrequal{#2}{[link]}{}{#2\newline}}
\bibliography{test}

\end{document}

enter image description here

6
  • Thank you very much for your answer! In this way, however the "Description" in the 3rd reference is missing, i.e. The n_ToF collaboration.
    – Thanos
    Nov 21, 2017 at 10:01
  • Why are these word there? Does it have to do with the class?
    – Thanos
    Nov 21, 2017 at 10:02
  • I added a test for the text [link]. And as I already wrote: it is the bibliographystyle that adds this words. Nov 21, 2017 at 10:06
  • Thank ou very much for your help! Unfortunately I am not sure whether I am able to change the bibliography style, since this is required by the journal... :(
    – Thanos
    Nov 21, 2017 at 10:10
  • If you plan to sent the article to this journal: Don't hack around. If they want the "URL" prefix it is their choice. Nov 21, 2017 at 10:12

You must log in to answer this question.

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