DOI、MR、Zbl 和 arxiv 的 BibTeX 字段?

DOI、MR、Zbl 和 arxiv 的 BibTeX 字段?

我曾多次在一些文本中看到格式良好的参考书目,其中包括指向 MR、Zbl 和 arxiv 的超链接,有时还有 doi,例如,看起来大致像这样(从这张纸):

  • Boris Albar 和 Daniel Gonçalves。论 Kr 小自由图中的三角形。2013 年。arXiv:1304.5468
  • Ken-ichi Kawarabayashi 和 Zi-Xia Song。独立数和团小式。J. Graph Theory, 56(3):219–226, 2007. doi:10.1002/jgt.20268。 先生:2355127
  • Alexandr V. Kostochka。给定平均顶点度的图的最小 Hadwiger 数。Metody Diskret. Analiz.,38:37–58,1982 年。MR:0713722, 兹布尔:0544.05037

哪种 BibTeX 样式可用于获得此类内容?使用哪些字段以及如何格式化它们?

我该如何手动完成此操作(不使用 BibTeX)?

答案1

biblatex在这类事情上非常擅长。

biblatex只允许eprint为每个条目指定一个目的地,因此我们将为每种不同的电子打印类型创建一个新字段。

我们必须要求biblatex提供逐字字段,并为所有条目类型启用它。*这是通过数据模型 ( .dbx) 文件完成的。该文件是filecontents在下面的示例中创建的,实际上您可能不会这样做,只需将文件复制.dbx到 TeX 可以找到它的地方。

我们将该文件称为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}

然后您需要加载数据模型文件。假设它被调用,则在加载时ext-eprint.dbx将选项传递给datamodel=ext-eprintbiblatex

可以通过以下方式添加任意别名

\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}

biblatex使用eprintbibmacro 打印 eprint 信息,因此我们只需在那里添加新类型

\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}}}

平均能量损失

\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}

在此处输入图片描述

* 文档biblatex建议在外部数据模型文件中加载\DeclareDatamodelFields\DeclareDatamodelEntryfields但它也可以在文档本身中使用。请参阅 §4.5.3数据模型规范biblatex文档从 2.9 版开始,命令\DeclareDatamodel...必须外部化到.dbx文件中。请参阅数据模型宏不能在序言中使用

答案2

这些自定义格式的改变可以通过最近开发的 Bibulous 项目轻松实现(http://nzhagen.github.io/bibulous/)。对于 OP 的示例,我们有一个数据库文件

@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}
}

对于这些数据库条目,我们可以创建一个自定义模板,利用zblmrdoieprint字段,如下所示:

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>}.]

请注意,上面的代码片段实际上是完整的样式模板文件。使用以下 LaTeX 主文件

\documentclass{article}
\usepackage[colorlinks=True,urlcolor=blue,citecolor=blue,breaklinks=true]{hyperref}

\begin{document}
\nocite{one,two,three}
\bibliographystyle{mybst}
\bibliography{mybib}
\end{document}

我们得到了 OP 要求的格式化的参考列表:

在此处输入图片描述

相关内容