LoginSignup
0
1

More than 3 years have passed since last update.

Mendeley が出力する bib ファイルにおける month フィールドの不適合とその対策

Last updated at Posted at 2020-08-26

はじめに

MendeleyElsevier が提供する文献管理ツールである.

自分の手元にある論文や記事の PDF を投げ込み,著作情報などを入力しておけば,一元的に管理できて便利である.

登録された文献を引用したいときには様々な引用形式で情報を提示してくれる.

もちろん,BiBTeX 形式のファイル出力にも対応している.

問題点

Mendeley の BiBTeX 出力では,month フィールドが以下のように出力される.

month = {jan},

一見問題ないように見受けられるが,bibtex コマンドを用いる場合には右辺の中括弧を外さなければ認識してくれない.すなわち,

month = jan,

とする必要がある1

ちなみに,biber + biblatex であれば,前者の形式でも問題なく読み込んでくれるそうだ.
month = {1} などもまた問題なし.jan,feb,... を用いるときのみ問題が生じる.

対策

出力された bib ファイルに対して,以下の sed コマンドを実行すれば month フィールドの括弧を取り除いてくれる.

sed -i '' -e '/^month = /s/[{}]//g' <filename>

なお,上記の sed の記法は BSD 形式(Mac 対応)となっており,GNU 形式(Linux)ではない点に注意する.

0
1
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
1