0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

bibtexでarXivが生成するbibエントリを使う

0
Posted at

arXivが生成するbibtexエントリ

arXivにはbibtexエントリを出力するボタンがついていてとても便利。しかし、miscで独自の形式で出してくるので、学会指定のbstファイルではうまく出力されなかったりする。例えばGANの論文のエントリはこんな感じ。

@misc{goodfellow2014generativeadversarialnetworks,
      title={Generative Adversarial Networks}, 
      author={Ian J. Goodfellow and Jean Pouget-Abadie and Mehdi Mirza and Bing Xu and David Warde-Farley and Sherjil Ozair and Aaron Courville and Yoshua Bengio},
      year={2014},
      eprint={1406.2661},
      archivePrefix={arXiv},
      primaryClass={stat.ML},
      url={https://arxiv.org/abs/1406.2661}, 
}

書誌情報に当たる部分は arXiv:1406.2662 なのだろうが、普通のbstファイルは archivePrefixeprint も知らないので、何も出力されない。

査読に回ってくる論文で参考文献に書誌情報がまったくないケースがあるが、おそらくこのせいなんだと思う。

bstファイルを修正する

bibtex の出力はbstファイル(bib style file)で制御するようになっているので、これを修正して、archivePrefixeprintを出力するように修正してやればいい。

bstファイルは、forthのようなスタックマシンのスクリプトになっている。スタック上にパラメータを置いて操作する。ここ にマニュアルの翻訳がある。

変更すべき点は2点。

  • ENTRY
  • miscを出力する関数

前者は、そのbstファイルが対象とするbibtex entryの属性値のリストである。ファイルの冒頭に以下のように定義されている。これにarchivePrefixeprintを追加する。

ENTRY
  { address
    author
    booktitle
    chapter
    edition
    ...
  }

後者のmiscを出力する関数は以下のように定義されている。コメントに囲まれている部分を追加した。

FUNCTION {misc}
{ output.bibitem
  format.authors output
  title howpublished new.block.checkb
  format.title output
  howpublished new.block.checka
  howpublished output
%%%%%%%%%
  archivePrefix empty$ eprint empty$ or     
    'skip$
    { archivePrefix ":" eprint * * output }
  if$
%%%%%%%%%
  format.date output
  new.block
  note output
  fin.entry
  empty.misc.check
}

archivePrefixとeprintが両方とも定義されていたら、この2つを: を挟んで接続した文字列を出力する、という意味になっている。ここで * 演算子が文字列の結合を意味している。

所感

慣れればなんということはないし、よく出来てるとも思うのだけど、latexエコシステムを我々はいつまで使うのだろうか。登場から40年。そろそろ代替システムに移行したいものだ。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?