bst 檔案有問題

bst 檔案有問題

我在這裡使用 nar.bst (http://schneider.ncifcrf.gov/ftp/nar.bst)。但是,當我透過以下方式包含我的參考書目時:-

\bibliographystyle{nar}
\bibliography{main}

然而,產生的 bbl 檔案似乎有一些未閉合的大括號。例如,我得到以下 bibitem,其中 \bf 大括號未閉合。

\bibitem{chang2013temporal}
Chang, K.~N., Zhong, S., Weirauch, M.~T., Hon, G., Pelizzola, M., Li, H.,
Huang, S.-s.~C., Schmitz, R.~J., Urich, M.~A., Kuo, D., et al. (2013)
{\em Elife} {\bf 2.

這是從 bibtex 產生的

@article{chang2013temporal,
  title={Temporal transcriptional response to ethylene gas drives growth                hormone cross-regulation in Arabidopsis},
  author={Chang, Katherine Noelani and Zhong, Shan and Weirauch, Matthew T and Hon, Gary and Pelizzola, Mattia and Li, Hai and Huang, Shao-shan Carol and Schmitz, Robert J and Urich, Mark A and Kuo, Dwight and others},
  journal={Elife},
  volume={2},
  year={2013},
  publisher={eLife Sciences Publications Limited}
}

思考(但根本不確定)該函數

format.vol.num.pages

是罪魁禍首,但不知道如何解決它。

任何幫助,將不勝感激 :)

PS:- 修復似乎僅在存在 \bf 時才會發生的開大括號可以解決問題。

編輯(編輯 3 - 刪除了 NAR cls - 這對我來說沒有任何改變):下面的最小範例。使用 pdflatex 編譯然後執行 bibtex 會在 bbl 檔案中給出格式錯誤的 bibitem(如上所示)

\documentclass{article}

\begin{document}

\title{Sample}

\author{Sample}

\maketitle

Example~\cite{chang2013temporal}

\bibliographystyle{nar}
\bibliography{main}

\end{document}

我在檔案 main.bib 中有 @article 並將 MWE 命名為 main.tex。然後我運行 pdflatex main.tex 2 次,然後運行 bibtex main 以獲得格式錯誤的 main.bbl 。

答案1

解決方案

最新版本nar.bst現已在 CTAN 上更新(以前在舊版本上有)。如果您執行的是舊版的 TL,請使用 CTAN 上的版本。

原答案

nar.bstTL 隨附的版本(截至 2015 年)已過時。最新版本是這裡,這是原始問題中的連結。此版本修復了該問題,因此無需進行任何修改.bst.。這解釋了為什麼其他人無法重現該錯誤。我已向該文件的作者發送電子郵件.bst,要求他將更新版本放在 CTAN 上。

因此,要吸取的教訓是確保您使用的是最新副本並且您的系統確實能夠找到它們。

有多種方法可以查看 TeX 正在尋找的文件副本,但到目前為止最簡單的方法是從kpsewhich命令列使用。執行命令:

kpsewhich nar.bst

會準確地告訴您正在使用哪個文件。在標準 TL 系統上,它將返回:(以您的年份為模。)

/usr/local/texlive/2015/texmf-dist/bibtex/bst/beebe/nar.bst

TeX Live 對.bst文件的查找位置特別挑剔,因此當您下載最新副本並希望找到它時,應將其放置在:

<path-to-local-texmf>/texmf/bibtex/bst/

其中<path-to-local-texmf>取決於您的系統。如果您不知道它在哪裡,可以透過發出以下命令找到它的路徑:

kpsewhich -var-value=TEXMFHOME

相關內容