![BibTeX-Felder für DOI, MR, Zbl und arxiv?](https://rvso.com/image/281556/BibTeX-Felder%20f%C3%BCr%20DOI%2C%20MR%2C%20Zbl%20und%20arxiv%3F.png)
Ich habe in einigen Texten mehrmals schön formatierte Bibliographien gesehen, die Hyperlinks zu MR, Zbl und arxiv enthielten, manchmal auch zu doi, zum Beispiel etwas, das ungefähr so aussah (kopiert vondieses Papier):
- Boris Albar und Daniel Gonçalves. Über Dreiecke in Kr-Moll-freien Graphen. 2013. arXiv:1304.5468.
- Ken-ichi Kawarabayashi und Zi-Xia Song. Unabhängigkeitszahl und Cliquenminoren. J. Graph Theory, 56(3):219–226, 2007. doi:10.1002/jgt.20268. HERR:2355127.
- Alexandr V. Kostochka. Die minimale Hadwiger-Zahl für Graphen mit einem gegebenen mittleren Grad an Knoten. Metody Diskret. Analiz., 38:37–58, 1982. MR:0713722, Zbl:0544.05037.
Welcher BibTeX-Stil kann verwendet werden, um so etwas zu erreichen? Welche Felder werden verwendet und wie werden sie formatiert?
Wie würde ich dies manuell machen (ohne BibTeX)?
Antwort1
biblatex
ist sehr gut in solchen Dingen.
biblatex
Da pro Eintrag nur die eprint
Angabe eines Ziels möglich ist, erstellen wir für jeden der unterschiedlichen E-Print-Typen ein neues Feld.
Wir müssen darum bitten, biblatex
dafür ein wörtliches Feld bereitzustellen und es für alle Eintragstypen zu aktivieren. * Dies geschieht über eine datamodel( .dbx
)-Datei. Diese Datei wird im folgenden Beispiel erstellt filecontents
. In der Praxis werden Sie das wahrscheinlich nicht tun und die Datei einfach an einen Ort kopieren, an dem .dbx
TeX sie finden kann.
Wir nennen die Dateiext-eprint.dbx
\ProvidesFile{ext-eprint.dbx}[2016/09/11 extended stand-alone eprint fields]
\DeclareDatamodelFields[type=field,datatype=verbatim]{arxiv,mr,zbl,jstor,hdl,pubmed,googlebooks,pmcid}
\DeclareDatamodelEntryfields{arxiv,mr,zbl,jstor,hdl,pubmed,googlebooks,pmcid}
\DeclareDatamodelFields[type=field,datatype=literal]{arxivclass}
\DeclareDatamodelEntryfields{arxivclass}
Anschließend müssen Sie die Datenmodelldatei laden. Vorausgesetzt, sie wird aufgerufen ext-eprint.dbx
, übergeben Sie die Option datamodel=ext-eprint
zur biblatex
Ladezeit an.
Man kann beliebige Aliase hinzufügen über
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldsource=pmid, fieldtarget=pubmed]
}
}
}
Dann brauchen diese E-Prints natürlich Formate, das allgemeine Muster ist ziemlich ähnlich
\makeatletter
\DeclareFieldFormat{arxiv}{%
arXiv\addcolon\space
\ifhyperref
{\href{http://arxiv.org/\abx@arxivpath/#1}{%
\nolinkurl{#1}%
\iffieldundef{arxivclass}
{}
{\addspace\texttt{\mkbibbrackets{\thefield{arxivclass}}}}}}
{\nolinkurl{#1}
\iffieldundef{arxivclass}
{}
{\addspace\texttt{\mkbibbrackets{\thefield{arxivclass}}}}}}
\makeatother
\DeclareFieldFormat{pmcid}{%
PMCID\addcolon\space
\ifhyperref
{\href{http://www.ncbi.nlm.nih.gov/pmc/articles/#1}{\nolinkurl{#1}}}
{\nolinkurl{#1}}}
\DeclareFieldFormat{mr}{%
MR\addcolon\space
\ifhyperref
{\href{http://www.ams.org/mathscinet-getitem?mr=MR#1}{\nolinkurl{#1}}}
{\nolinkurl{#1}}}
\DeclareFieldFormat{zbl}{%
Zbl\addcolon\space
\ifhyperref
{\href{http://zbmath.org/?q=an:#1}{\nolinkurl{#1}}}
{\nolinkurl{#1}}}
\DeclareFieldAlias{jstor}{eprint:jstor}
\DeclareFieldAlias{hdl}{eprint:hdl}
\DeclareFieldAlias{pubmed}{eprint:pubmed}
\DeclareFieldAlias{googlebooks}{eprint:googlebooks}
biblatex
verwendet das eprint
Bibmacro, um die Eprint-Informationen zu drucken, also fügen wir dort einfach unsere neuen Typen hinzu
\renewbibmacro*{eprint}{%
\printfield{arxiv}%
\newunit\newblock
\printfield{jstor}%
\newunit\newblock
\printfield{mr}%
\newunit\newblock
\printfield{zbl}%
\newunit\newblock
\printfield{hdl}%
\newunit\newblock
\printfield{pubmed}%
\newunit\newblock
\printfield{pmcid}%
\newunit\newblock
\printfield{googlebooks}%
\newunit\newblock
\iffieldundef{eprinttype}
{\printfield{eprint}}
{\printfield[eprint:\strfield{eprinttype}]{eprint}}}
MWE
\documentclass[a4paper,12pt]{article}%
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{filecontents}
\begin{filecontents*}{ext-eprint.dbx}
\ProvidesFile{ext-eprint.dbx}[2016/09/11 extended stand-alone eprint fields]
\DeclareDatamodelFields[type=field,datatype=verbatim]{arxiv,mr,zbl,jstor,hdl,pubmed,googlebooks,pmcid}
\DeclareDatamodelEntryfields{arxiv,mr,zbl,jstor,hdl,pubmed,googlebooks,pmcid}
\DeclareDatamodelFields[type=field,datatype=literal]{arxivclass}
\DeclareDatamodelEntryfields{arxivclass}
\end{filecontents*}
\begin{filecontents*}{\jobname.bib}
@article{ContEp,
author = {Mark G. Frei and Hitten P. Zaveri and Susan Arthurs and Gregory K. Bergey and Christophe Jouny and Klaus Lehnertz and Jean Gotman and Ivan Osorio and Theoden I. Netoff and Walter J. Freeman and John Jefferys and Gregory Worrell and Michel Le Van Quyen and Steven J. Schiff and Florian Mormannn},
title = {Controversies in epilepsy},
subtitle = {Debates held during the Fourth International Workshop on Seizure Prediction},
journaltitle = {Epilepsy \& Behavior},
volume = {19},
number = {1},
pages = {4-16},
date = {2010-09},
doi = {10.1016/j.yebeh.2010.06.009},
pmcid = {PMC2943379},
pmid = {20708976},
}
@article{frege,
author = {Gottlob Frege},
title = {The Thought},
subtitle = {A Logical Inquiry},
journaltitle = {Mind},
series = {newseries},
volume = {65},
number = {259},
jstor = {2251513},
date = {1956-07},
pages = {289-311},
}
@online{hawking,
author = {S. W. Hawking},
title = {Information Preservation and Weather Forecasting for Black Holes},
arxiv = {1401.5761},
arxivclass = {hep-th},
date = {2014-01-22},
}
@online{albar,
author = {B. Albar and D. Gon{\c c}alves},
title = {On triangles in $K_r$-minor free graphs},
arxiv = {1304.5468},
year = 2013,
}
@article{kawa,
author = {Ken-ichi Kawarabayashi and Zi-Xia Song},
title = {Independence number and clique minors},
journal = {J. Graph Theory},
volume = 56,
number = 3,
pages = {219-226},
year = 2007,
doi = {10.1002/jgt.20268},
mr = {2355127},
}
@article{kostochka,
author = {A. V. Kostochka},
title = {On the minimum of the Hadwiger number for graphs with given mean degree of vertices},
journal = {Metody Diskretn. Anal.},
volume = {38},
pages = {37--58},
year = {1982},
mr = {0713722},
zbl = {0544.05037},
}
\end{filecontents*}
\usepackage[backend=biber, style=authoryear-icomp, dashed=true, datamodel=ext-eprint]{biblatex}
\usepackage{hyperref}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldsource=pmid, fieldtarget=pubmed]
}
}
}
\makeatletter
\DeclareFieldFormat{arxiv}{%
arXiv\addcolon\space
\ifhyperref
{\href{http://arxiv.org/\abx@arxivpath/#1}{%
\nolinkurl{#1}%
\iffieldundef{arxivclass}
{}
{\addspace\texttt{\mkbibbrackets{\thefield{arxivclass}}}}}}
{\nolinkurl{#1}
\iffieldundef{arxivclass}
{}
{\addspace\texttt{\mkbibbrackets{\thefield{arxivclass}}}}}}
\makeatother
\DeclareFieldFormat{pmcid}{%
PMCID\addcolon\space
\ifhyperref
{\href{http://www.ncbi.nlm.nih.gov/pmc/articles/#1}{\nolinkurl{#1}}}
{\nolinkurl{#1}}}
\DeclareFieldFormat{mr}{%
MR\addcolon\space
\ifhyperref
{\href{http://www.ams.org/mathscinet-getitem?mr=MR#1}{\nolinkurl{#1}}}
{\nolinkurl{#1}}}
\DeclareFieldFormat{zbl}{%
Zbl\addcolon\space
\ifhyperref
{\href{http://zbmath.org/?q=an:#1}{\nolinkurl{#1}}}
{\nolinkurl{#1}}}
\DeclareFieldAlias{jstor}{eprint:jstor}
\DeclareFieldAlias{hdl}{eprint:hdl}
\DeclareFieldAlias{pubmed}{eprint:pubmed}
\DeclareFieldAlias{googlebooks}{eprint:googlebooks}
\renewbibmacro*{eprint}{%
\printfield{arxiv}%
\newunit\newblock
\printfield{jstor}%
\newunit\newblock
\printfield{mr}%
\newunit\newblock
\printfield{zbl}%
\newunit\newblock
\printfield{hdl}%
\newunit\newblock
\printfield{pubmed}%
\newunit\newblock
\printfield{pmcid}%
\newunit\newblock
\printfield{googlebooks}%
\newunit\newblock
\iffieldundef{eprinttype}
{\printfield{eprint}}
{\printfield[eprint:\strfield{eprinttype}]{eprint}}}
\begin{document}
\nocite{baez/online,wassenberg,hawking,albar,kawa,kostochka,frege,ContEp}
\printbibliography
\end{document}
* Die Ab Version 2.9 biblatex
Dokumentation empfiehlt, \DeclareDatamodelFields
und \DeclareDatamodelEntryfields
in eine externe Datenmodelldatei zu laden, aber es funktioniert auch im Dokument selbst. Siehe §4.5.3Datenmodellspezifikationdesbiblatex
Dokumentation.\DeclareDatamodel...
müssen Befehle in eine Datei ausgelagert werden .dbx
. SieheDatenmodellmakro kann nicht in der Präambel verwendet werden.
Antwort2
Diese Art von benutzerdefinierten Formatierungsänderungen sind mit dem kürzlich entwickelten Bibulous-Projekt (http://nzhagen.github.io/bibulous/). Für das Beispiel des OP haben wir eine Datenbankdatei
@arxiv{one,
author = {B. Albar and D. Gon{\c c}alves},
title = "{On triangles in K\_r-minor free graphs}",
eprint = {1304.5468},
year = 2013
}
@article{two,
author = {Ken-ichi Kawarabayashi and Zi-Xia Song},
title = {Independence number and clique minors},
journal = {J. Graph Theory},
volume = 56,
number = 3,
pages = {219-226},
year = 2007,
doi = {10.1002/jgt.20268},
mr = {2355127}
}
@article{three,
author = {A. V. Kostochka},
title = {On the minimum of the Hadwiger number for graphs with given mean degree of vertices},
journal = {Metody Diskretn. Anal.},
volume = {38},
pages = {37--58},
year = {1982},
mr = {0713722},
zbl = {0544.05037}
}
Für diese Datenbankeinträge können wir eine benutzerdefinierte Vorlage erstellen, die die Felder zbl
, mr
, doi
und eprint
wie folgt verwendet:
TEMPLATES:
arxiv = <au>. <title>. <year>. arXiv: \href{http://arxiv.org/abs/<eprint>}{<eprint>}.
article = <au>. <title>. <journal>, <volume>[(<number>)]:[<startpage>--<endpage>|<startpage>|<eid>|], <year>.[ doi: \href{http://dx.doi.org/<doi>}{<doi>}.][ MR: \href{http://www.ams.org/mathscinet-getitem?mr=MR<mr>}{<mr>}.][ Zbl: \href{http://zbmath.org/?q=an:<zbl>}{<zbl>}.]
Beachten Sie, dass der obige Ausschnitt eigentlich die vollständige Stilvorlagendatei ist. Mit der folgenden LaTeX-Hauptdatei
\documentclass{article}
\usepackage[colorlinks=True,urlcolor=blue,citecolor=blue,breaklinks=true]{hyperref}
\begin{document}
\nocite{one,two,three}
\bibliographystyle{mybst}
\bibliography{mybib}
\end{document}
wir erhalten die vom OP angeforderte formatierte Referenzliste: