3

using biblatex, I want to hide the full URL of some phd references on TEL (thèse en ligne) and HAL (Hyper articles en ligne) and just display the actual reference number that will link to the proper URL when clicked. Exactly how ArXiv references are displayed here.

Here is a MWE, notice how the two different entries are displayed. I want the PhD entry to be displayed same as the ArXiv one, without displaying the entire URL but rather the ID saying something like "TEL: " with the being clickable and linking directly to the actual URL.

\documentclass[french, 11pt, a4paper, titlepage]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage[
    backend=biber,
    style=numeric,
    sorting=ynt
]{biblatex}
\addbibresource{biblio.bib}

\begin{document}
The arXiv eprint: \cite{2018arXiv180609824G}\\
Some PhD on HAL/TEL: \cite{olry:tel-00005985}
\printbibliography[heading=bibintoc, title={Bibliographie}]
\end{document}

With biblio.bib as such, directly downloaded from arxiv and tel.

@phdthesis{olry:tel-00005985,
  TITLE = {{Etude d'une cavite acc{\'e}l{\'e}ratrice supraconductrice Spoke pour les acc{\'e}l{\'e}rateurs de protons de forte intensit{\'e}}},
  AUTHOR = {Olry, Guillaume},
  URL = {https://tel.archives-ouvertes.fr/tel-00005985},
  HAL_LOCAL_REFERENCE = {IPNO-T-04-02},
  SCHOOL = {{Universit{\'e} Paris-Diderot - Paris VII}},
  YEAR = {2004},
  MONTH = Apr,
  KEYWORDS = {cavit{\'e}s spoke ; supraconductivit{\'e} ; acc{\'e}l{\'e}rateur lin{\'e}aire {\`a} protons ; contr{\^o}le dimensionnel},
  TYPE = {Theses},
  PDF = {https://tel.archives-ouvertes.fr/tel-00005985/file/tel-00005985.pdf},
  HAL_ID = {tel-00005985},
  HAL_VERSION = {v1},
}

@ARTICLE{2018arXiv180609824G,
   author = {{Grassellino}, A. and {Romanenko}, A. and {Bice}, D. and {Melnychuk}, O. and 
    {Crawford}, A.~C. and {Chandrasekaran}, S. and {Sung}, Z. and 
    {Sergatskov}, D.~A. and {Checchin}, M. and {Posen}, S. and {Martinello}, M. and 
    {Wu}, G.},
    title = "{Accelerating fields up to 49 MV/m in TESLA-shape superconducting RF niobium cavities via 75C vacuum bake}",
  journal = {ArXiv e-prints},
archivePrefix = "arXiv",
   eprint = {1806.09824},
 primaryClass = "physics.acc-ph",
 keywords = {Physics - Accelerator Physics},
     year = 2018,
    month = jun,
   adsurl = {http://adsabs.harvard.edu/abs/2018arXiv180609824G},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

By the way, if there is a way to frenchasize biblatex using the French quotation marks «» and not the English ones "". As well as printing the "et al." in italic I would be down to know how as well. Thank you.

  • 1
    Does tex.stackexchange.com/q/151628/35864 help? To fully frenchify things you can load babel with the french option and load csquotes. If you still want to write in English and just use French quotation marks (not sure if that is wise), you need a few tricks like \usepackage[style=french]{csquotes}. – moewe Sep 26 '18 at 9:28
  • How can I tell a HAL from a TEL given your .bib entries? – moewe Sep 26 '18 at 9:35
  • I guess tel have a link format as tel-xxxxxx and hal don't. I am trying to do something with the DeclareFieldFormat from biblatex. – Odyseus_v4 Sep 26 '18 at 9:49
  • Please verify this. If there is no other indication for HAL vs TEL in the .bib data that makes things a bit harder. \DeclareFieldFormat won't be enough if you want to use hal_id and friends, you will need to declare them in the data model to be able to use them (see my link). – moewe Sep 26 '18 at 9:53
  • it seems it actually is, for example with id being jpa-00218793v1 is then an article. What if i manually change the bib file so that eprint = {tel-00005985} and eprinttype = {tel}. Is the \DeclareFieldFormat enough to declare a new URL for TEL. PS: it don't seem to but i'm working on it. – Odyseus_v4 Sep 26 '18 at 10:06
2

There are two ways you can implement e-print archives like HAL. (1) With a dedicated field (hal in the MWE) or (2) with eprint and eprinttype.

(1) needs a new 'datamodel' (.dbx) file to make the new field known to Biber and biblatex. (2) Needs no such thing since the eprint field exists already. But there is only one eprint field, so if you want to give multiple e-print identifiers you will have to resort to a new field at some point.

BibTeX fields for DOI, MR, Zbl and arxiv? shows the general approach you could take. The MWE below shows both the approach with eprint and with a dedicated hal field.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{csquotes}

\usepackage{filecontents}

\begin{filecontents*}{eprint-hal.dbx}
\ProvidesFile{eprint-hal.dbx}[2018/09/26 HAL/TEL eprints]
\DeclareDatamodelFields[type=field,datatype=verbatim]{arxiv,hal}
\DeclareDatamodelEntryfields{hal}
\DeclareDatamodelFields[type=field,datatype=literal]{arxivclass}
\DeclareDatamodelEntryfields{arxivclass}
\end{filecontents*}

\usepackage[
    backend=biber,
    style=numeric,
    sorting=ynt,
    datamodel=eprint-hal,
]{biblatex}

\usepackage{hyperref}

\DeclareFieldFormat{hal}{%
  \mkbibacro{HAL}\addcolon\space
  \ifhyperref
    {\href{https://hal.archives-ouvertes.fr/#1}{\nolinkurl{#1}}}
    {\nolinkurl{#1}}}

\DeclareFieldAlias{eprint:hal}{hal}
\DeclareFieldAlias{eprint:HAL}{eprint:hal}

\renewbibmacro*{eprint}{%
  \printfield{hal}%
  \newunit\newblock
  \iffieldundef{eprinttype}
    {\printfield{eprint}}
    {\printfield[eprint:\strfield{eprinttype}]{eprint}}}

\begin{filecontents}{\jobname.bib}
@phdthesis{olry:tel-00005985,
  title       = {Etude d'une cavite accélératrice supraconductrice Spoke pour les accélérateurs de protons de forte intensité},
  author      = {Olry, Guillaume},
  school      = {Universit{\'e} Paris-Diderot -- Paris VII},
  date        = {2004-04},
  hal         = {tel-00005985},
}
@article{sasso:hal-01882235,
  title      = {Performances of Four Real-Time PCR Assays for Diagnosis of Pneumocystis jirovecii Pneumonia},
  author     = {Sasso, Milène and Chastang-Dumas, Elsa and Bastide, Sophie and Alonso, Sandrine and Lechiche, Catherine and Bourgeois, Nathalie and Lachaud, Laurence},
  journal    = {Journal of Clinical Microbiology},
  volume     = {54},
  number     = {3},
  pages      = {625 - 630},
  date       = {2016-02},
  eprint     = {hal-01882235},
  eprinttype = {hal},
}
@phdthesis{waldvogel:tel-01881957,
  title      = {Development of an efficient catalyst for the process chain Power-to-Methane and kinetic study},
  author     = {Waldvogel, Audrey},
  school     = {Université de Strasbourg},
  date       = {2017-12},
  eprint     = {tel-01881957},
  eprinttype = {HAL},
}
\end{filecontents}

\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\begin{document}
The arXiv eprint: \cite{wassenberg}

Some PhD on HAL/TEL: \cite{olry:tel-00005985,sasso:hal-01882235,waldvogel:tel-01881957}

\printbibliography[heading=bibintoc, title={Bibliographie}]
\end{document}

Guillaume Olry. « Etude d’une cavite accélératrice supraconductrice Spoke pour les accélérateurs de protons de forte intensité ». Thèse de doct. Université Paris-Diderot – Paris VII, avr. 2004. hal : tel-00005985.//Jan Wassenberg et Peter Sanders. Faster Radix Sort via Virtual Memory and Write-Combining. Version 1. 17 août 2010. arXiv : 1008.2849v1 [cs.DS].//Milène Sasso et al. « Performances of Four Real-Time PCR Assays for Diagnosis of Pneumocystis jirovecii Pneumonia ». In : Journal of Clinical Microbiology 54.3 (fév. 2016), p. 625-630. hal : hal-01882235.//Audrey Waldvogel. « Development of an efficient catalyst for the process chain Power-to-Methane and kinetic study ». Thèse de doct. Université de Strasbourg, déc. 2017. hal : tel-01881957.

| improve this answer | |
  • Awesome thank you. I've played a bit with this definition in order to use the field hal_id – Odyseus_v4 Sep 27 '18 at 8:17

Your Answer

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

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