長いdoiフィールドをエレガントに分割する方法

長いdoiフィールドをエレガントに分割する方法

これは私の論文からのコードスニペットです。

\RequirePackage{filecontents}

\begin{filecontents}{bib.bib}
@article{baumert62,
  author = {Baumert, Leonard and Golomb, Solomon W. and Hall, Jr, Marshall},
  doi = {10.1090/S0002-9904-1962-10761-7},
  journal = {Bulletin of the American Mathematical Society},
  number = 3,
  pages = {237--238},
  title = {Discovery of an Hadamard Matrix of Order 92},
  volume = 68,
  year = 1962
}

\end{filecontents}

\documentclass{article}

% for back reference in bibliography
\usepackage[ocgcolorlinks,pdfusetitle]{hyperref}

% for biblatex with biber
\usepackage[
  backend=biber,
  style=alphabetic,
  citestyle=alphabetic,
  backref=true]{biblatex}

% for DOI field
\usepackage{doi}

\addbibresource{bib.bib}

\begin{document}
The first missing order of 92 was resolved in 1962 by Baumert, Golomb,
and Hall Jr. \cite{baumert62} who ran computer experiment on Williamson's method.

%%% bibliography
\printbibliography
\end{document}

これは、掲載日フィールドが長すぎます。

ここに画像の説明を入力してください

当然、誰もがそれを修正したいと思うでしょう。私は、以下の説明に従って、これ糸。

\setcounter{biburlnumpenalty}{100}  % allow breaks at numbers
\setcounter{biburlucpenalty}{100}   % allow breaks at uppercase letters
\setcounter{biburllcpenalty}{100}   % allow breaks at lowercase letters

数字、小文字、大文字で改行を許可する代わりに、、、などの特殊文字で改行を許可したいと思います/。DOI.フィールド-を扱っているので、通常の英数字よりもこれらの場所で改行を許可する方が適切だと思います。どうすればいいでしょうか?

答え1

このオプションocgcolorlinksでは、リンク内での改行は許可されません。

からhyperrefのREADME

実験的なオプション 'ocgcolorlinks'

アイデアは、表示されるときは色付きのリンクですが、印刷されると色なしになります。

...

  • 主な欠点: リンクを行間で分割することはできません。

つまり、オプション とほぼ同じですcolorlinksが、2 つの違いがあります。

  • colorlinksリンク内の改行を許可しますが、ocgcolorlinks許可しません。
  • colorlinksドキュメントを印刷するときに色を保持しますが、ocgcolorlinksは黒で印刷します。

では、これを回避するために何ができるでしょうか?

colorlinksの代わりに オプションを使用しocgcolorlinks、ドキュメントを印刷するときに「白黒」で印刷することを選択します。

MWE:

\RequirePackage{filecontents}

\begin{filecontents}{bib.bib}
@article{baumert62,
  author = {Baumert, Leonard and Golomb, Solomon W. and Hall, Jr, Marshall},
  doi = {10.1090/S0002-9904-1962-10761-7},
  journal = {Bulletin of the American Mathematical Society},
  number = 3,
  pages = {237--238},
  title = {Discovery of an Hadamard Matrix of Order 92},
  volume = 68,
  year = 1962
}

\end{filecontents}

\documentclass{article}

% for back reference in bibliography
\usepackage[colorlinks,pdfusetitle]{hyperref}

% for biblatex with biber
\usepackage[
  backend=biber,
  style=alphabetic,
  citestyle=alphabetic,
  backref=true]{biblatex}

% for DOI field
\usepackage{doi}

\addbibresource{bib.bib}

\begin{document}
The first missing order of 92 was resolved in 1962 by Baumert, Golomb,
and Hall Jr. \cite{baumert62} who ran computer experiment on Williamson's method.

%%% bibliography
\printbibliography
\end{document} 

出力:

ここに画像の説明を入力してください

答え2

完全を期すためにocgcolorlinks(色付きのリンクは黒で印刷されます)改行(および必要に応じてページ区切り)を囲むリンクが、ocgx2パッケージ:

\usepackage{hyperref}
\usepackage[ocgcolorlinks]{ocgx2}

MWE:

\RequirePackage{filecontents}

\begin{filecontents}{bib.bib}
@article{baumert62,
  author = {Baumert, Leonard and Golomb, Solomon W. and Hall, Jr, Marshall},
  doi = {10.1090/S0002-9904-1962-10761-7},
  journal = {Bulletin of the American Mathematical Society},
  number = 3,
  pages = {237--238},
  title = {Discovery of an Hadamard Matrix of Order 92},
  volume = 68,
  year = 1962
}

\end{filecontents}

\documentclass{article}

% for back reference in bibliography
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[pdfusetitle]{hyperref}
\usepackage[ocgcolorlinks]{ocgx2}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% for biblatex with biber
\usepackage[
  backend=biber,
  style=alphabetic,
  citestyle=alphabetic,
  backref=true]{biblatex}

% for DOI field
\usepackage{doi}

\addbibresource{bib.bib}

\begin{document}
The first missing order of 92 was resolved in 1962 by Baumert, Golomb,
and Hall Jr. \cite{baumert62} who ran computer experiment on Williamson's method.

%%% bibliography
\printbibliography
\end{document}

答え3

使用できますhttp://shortdoi.org@matth が述べたように、DOI の短い永続的なエイリアスを作成します。これらの短縮された DOI には、正規の DOI に比べていくつかの利点があります。

  1. 十分に短いので、改行する必要はありません。
  2. 紙からコピーするのは簡単です。論文の紙のコピーしかない場合、長い DOI はほとんど役に立ちません (タイトルや著者を検索する方が簡単です)。
  3. 見た目も美しく、出版社や共著者からの抵抗も少なくなります。

既存の BibTeX ファイルを処理し、すべての DOI 名を短縮された DOI に置き換えるスクリプトを作成しました。 https://github.com/mosco/bibtex-shorten-doi

注意: 残念ながら、短い DOI は適切な DOI とはみなされず、CrossRef、Sci-Hub など、doi.org 以外のサイトでの手動検索には使用できません。そのため、現時点では、参考文献内のすべての DOI を自動的に変換することはお勧めしません。

関連情報