最近原稿の参考文献は pBibTeX ではなく Biber+BibLaTeX を使うようになりました。
BibLaTeX はスタイルファイルを書き換えなくとも表示がカスタマイズできるところが美点です。そこで最近やったカスタマイズについてメモを残します。
前提として,ACM のスタイルファイルで \bibliographystyle{abbrvnat} を使ったときに表示を近づけようとしています。そこで,パッケージの設定は次の通り。
以上より,次のような結果を得られます。
BibLaTeX はスタイルファイルを書き換えなくとも表示がカスタマイズできるところが美点です。そこで最近やったカスタマイズについてメモを残します。
前提として,ACM のスタイルファイルで \bibliographystyle{abbrvnat} を使ったときに表示を近づけようとしています。そこで,パッケージの設定は次の通り。
\usepackage[backend=biber,style=trad-abbrv,natbib=true]{biblatex}
doi や URL を表示しない
私は Mendeley を文献管理に使っており,なるべく得られた情報はすべてデータベース化しておきたいという考えの持ち主でもあるので,doi や PDF の URL も記録しているのですが,その全てを原稿中で表示したいわけではないため,次のようにしました。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\AtEveryBibitem{% | |
\ifentrytype{article}{% | |
}{} | |
\ifentrytype{inproceedings}{% | |
\clearfield{volume} | |
\clearfield{number} | |
}{} | |
\clearlist{publisher} | |
\clearfield{isbn} | |
\clearlist{location} | |
\clearfield{doi} | |
\clearfield{url} | |
} | |
会議名の先頭に In Proc. of を付けたい
会議名は会議名として記録・分類したいので,会議名の頭に In Proc. of とか In Proceedings of を付けて周るようなマネはしたくありません。とはいえ,それは Mendeley での管理の話で,原稿の中では会議の名前にだけ In Proc. of というのを付けたいです。しかし,このスタイルのデフォルトだと会議でも論文誌でも In Booktitle となるようなので,今回は\renewbibmacro{}
を使い in: という bibmacro を変更します。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\renewbibmacro{in:}{% | |
\ifentrytype{inproceedings}{% | |
\setunit{} | |
\addperiod\addspace In \textit{Proc.\ of the}}% | |
{\printtext{\bibstring{in}\intitlepunct}} | |
} |
会議名と会議の略称の体裁
最後に,これは私固有の問題ですが,Mendeley で会議名を Proc.Title,略称を Series に入れて管理していると,BibTeX ファイルにはそれぞれが booktitle と series に入れられます。これは,Book Title, Series,と表示されますが,これを
Book Title (Series),にしたいので,
$TEXMF/tex/biblatex/biblatex-trad/trad-standard.bbx
にある定義を参照しました。これによると,inproceedings の時の会議名の表示は series+number:emphcond という bibmacro で定義されていたので,エントリのタイプが inproceedings の時だけ表示を変え,そうでないときは元の定義をそのまま使うようにしました。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\renewbibmacro*{series+number:emphcond}{% | |
\ifentrytype{inproceedings}{% | |
\printtext{(}\printfield{series}\printtext{)}\setunit*{\addcomma\space}\newunit}% | |
{% | |
\printfield{number}% | |
\setunit*{\addspace\bibstring{inseries}\addspace}% | |
\ifboolexpr{% | |
not test {\iffieldundef{volume}} | |
}% | |
{\printfield{series}}% | |
{\ifboolexpr{% | |
test {\iffieldundef{volume}} | |
and | |
test {\iffieldundef{part}} | |
and | |
test {\iffieldundef{number}} | |
and | |
test {\ifentrytype{book}} | |
}% | |
{\newunit\newblock}% | |
{}% | |
\printfield[noformat]{series}}% | |
\newunit} | |
} |
以上より,次のような結果を得られます。
![]() |
元の表示 |
![]() |
あふたー |