使用 biblatex,我想隐藏 TEL(thèse en ligne)和 HAL(Hyper articles en ligne)上一些博士参考文献的完整 URL,只显示实际参考编号,单击后将链接到正确的 URL。ArXiv 参考文献在此处的显示方式正是如此。
这是 MWE,请注意两个不同条目的显示方式。我希望 PhD 条目的显示方式与 ArXiv 条目相同,但不显示整个 URL,而是显示类似“TEL: ”的 ID,并且可点击并直接链接到实际 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}
有了biblio.bib这样的,直接从arxiv和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}
}
顺便说一句,如果有办法使用法语引号“»而不是英语引号“”来将 biblatex 法语化。以及用斜体打印“et al.”,我也想知道怎么做。谢谢。
答案1
有两种方法可以实现类似 HAL 的电子印刷档案。(1)使用专用字段(hal
在 MWE 中)或(2)使用eprint
和eprinttype
。
(1) 需要一个新的“数据模型”( .dbx
) 文件,以便 Biber 和 了解新字段biblatex
。 (2) 不需要这样的东西,因为该eprint
字段已经存在。但是只有一个eprint
字段,因此如果您想提供多个电子印刷标识符,您将不得不在某个时候求助于新字段。
DOI、MR、Zbl 和 arxiv 的 BibTeX 字段?显示了您可以采取的一般方法。下面的 MWE 显示了使用eprint
专用hal
字段的方法。
\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}