June 25, 2009

Collapse multiple citations into one for BibTeX - mcite & mciteplus

在Latex可以使用BibTeX語法引用文獻,然而在物理期刊常常將引用合一,也就是本來三個引用
[1] Sheldon Glashow. Partial symmetries of weak interactions. Nucl. Phys.,
22:579, 1961.
[2] Abdus Salam. Weak and electromagnetic interactions. In W. Svartholm,
editor, Elementary Particle Theory, page 367, Stockholm, 1968. Almquist
and Wiksell.
[3] Steven Weinberg. A model of leptons. Phys. Rev. Lett., 19:1264, 1967.
合併為
[1] Sheldon Glashow, Nucl. Phys. 22 (1961) 579; Abdus Salam, in: W. Svartholm
(ed.), Elementary Particle Theory, p. 367, Stockholm, 1968; Steven Wein-
berg, Phys. Rev. Lett. 19 (1967) 1264.
這是一種節省空間的寫法,可見物理學者多麼惜字如金啊!研究了快一個月都搞不定要怎麼作,只能用手動改.blg的方法來處理,但是每編譯一次就要重弄一次,這實在是太不科學了!不過還好有mcite這個package,而且還是MikTeX內建的。

mcite會overload \cite的定義,所以從此\cite就等於\mcite了,只要把想被合併的引用bibtexkey加上星號即可
\cite{Glashow,*Salam,*Weinberg}
不過這裡很不幸的,我最常用的revtex4環境以及apsrev.bst並不支援mcite。好在有另外一位寫出mciteplus,搭配他的apsrevM.bst即可翹著二郎腿管理bibliography了。

Remake 2024

新年新希望啊,有什麼想重啟的,就是現在吧。