DOI、MR、Zbl 和 arxiv 的 BibTeX 欄位?

DOI、MR、Zbl 和 arxiv 的 BibTeX 欄位?

我曾多次在一些文本中看到格式良好的參考書目,其中包括指向 MR、Zbl 和 arxiv 的超鏈接,有時是 doi,例如,看起來大約像這樣的東西(複製自這張紙):

  • 鮑里斯·阿爾巴爾和丹尼爾·貢薩爾維斯。關於 Kr 小調自由圖中的三角形。 2013.arXiv:1304.5468
  • 川原林健一和宋子霞。獨立數和小集團。 J.圖論,56(3):219–226,2007。10.1002/jgt.20268。先生:2355127
  • 科斯托奇卡 (Alexandr V. Kostochka)具有給定平均頂點度的圖的最小哈維格數。方法磁碟。分析,38:37-58,1982。0713722,Zbl: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請求的格式化參考清單:

在此輸入影像描述

相關內容