Chapterbibはサブディレクトリとlatexmkで失敗します

Aug 23 2020

使用しようとしているかなり単純なレイアウトがありlatexmkます。私は何が間違っているのですか?

編集:最新の前進の結果で例を変更しました。サブディレクトリにall.bibシンボリックリンクする必要があり、で必要でした。chapters-flatexmk

これはほぼ望ましい出力を生成しますが、-f必要であり、参照の番号付けは(章ごとに特定されるのではなく)全体を通して一貫しているため、間違って行われていると思います。

\bibliographystyleこの章を省略して、\bibliography{../all}…に変更してみましたが無駄になりました。

複製:

$ latexmk -gg -pdf -quiet -f

Latexmk: Run number 1 of rule 'pdflatex'
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
Latexmk: Non-existent bbl file 'chapters/ch0.bbl'
 No file chapters/ch0.bbl.
Latexmk: Non-existent bbl file 'all.bbl'
 No file all.bbl.
Latexmk: Run number 1 of rule 'bibtex chapters/ch0'
For rule 'bibtex chapters/ch0', running '&run_bibtex(  )' ...
-- IEEEtranN.bst version 1.14 (2015/08/26) by Michael Shell.
-- http://www.michaelshell.org/tex/ieeetran/bibtex/
-- See the "IEEEtran_bst_HOWTO.pdf" manual for usage information.
** Natbib version - not for normal IEEE work.

Done.
Latexmk: Run number 1 of rule 'bibtex all'
For rule 'bibtex all', running '&run_bibtex(  )' ...
Illegal, another \bibstyle command---line 3 of file chapters/ch0.aux
 : \bibstyle
 :          {IEEEtranN}
I'm skipping whatever remains of this command
Illegal, another \bibdata command---line 7 of file all.aux
 : \bibdata
 :         {all}
I'm skipping whatever remains of this command
-- IEEEtranN.bst version 1.14 (2015/08/26) by Michael Shell.
-- http://www.michaelshell.org/tex/ieeetran/bibtex/
-- See the "IEEEtran_bst_HOWTO.pdf" manual for usage information.
** Natbib version - not for normal IEEE work.

Done.
(There were 2 error messages)
Latexmk: Run number 2 of rule 'pdflatex'
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
Latexmk: Run number 2 of rule 'bibtex chapters/ch0'
For rule 'bibtex chapters/ch0', running '&run_bibtex(  )' ...
-- IEEEtranN.bst version 1.14 (2015/08/26) by Michael Shell.
-- http://www.michaelshell.org/tex/ieeetran/bibtex/
-- See the "IEEEtran_bst_HOWTO.pdf" manual for usage information.
** Natbib version - not for normal IEEE work.

Done.
Latexmk: Run number 2 of rule 'bibtex all'
For rule 'bibtex all', running '&run_bibtex(  )' ...
Illegal, another \bibstyle command---line 3 of file chapters/ch0.aux
 : \bibstyle
 :          {IEEEtranN}
I'm skipping whatever remains of this command
Illegal, another \bibdata command---line 7 of file all.aux
 : \bibdata
 :         {all}
I'm skipping whatever remains of this command
-- IEEEtranN.bst version 1.14 (2015/08/26) by Michael Shell.
-- http://www.michaelshell.org/tex/ieeetran/bibtex/
-- See the "IEEEtran_bst_HOWTO.pdf" manual for usage information.
** Natbib version - not for normal IEEE work.

Done.
(There were 2 error messages)
Latexmk: Run number 3 of rule 'pdflatex'
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
Collected error summary (may duplicate other messages):
  bibtex all: Bibtex errors: See file 'all.blg'

all.tex

\documentclass{book}
\usepackage[sectionbib,square,sort,comma,numbers]{natbib}
\usepackage{chapterbib}

%\begin{filecontents*}{all.bib}\end{filecontents*}

\begin{document}

\bibliographystyle{IEEEtranN}

\include{chapters/ch0}

Hello random\cite{hawMaximizationExtractableRandomness2015} world

\bibliography{all}

\end{document}

チャプター/ch0.tex

\chapter{ch0}
so much div\cite{govindarajuGeneticsFraminghamHeart2008}

\bibliographystyle{IEEEtranN}
\bibliography{all}

all.bib

@article{hawMaximizationExtractableRandomness2015,
  title = {Maximization of {{Extractable Randomness}} in a {{Quantum Random}}-{{Number Generator}}},
  author = {Haw, J. Y. and Assad, S. M. and Lance, A. M. and Ng, N. H. Y. and Sharma, V. and Lam, P. K. and Symul, T.},
  year = {2015},
  month = may,
  volume = {3},
  pages = {054004},
  issn = {2331-7019},
  doi = {10.1103/PhysRevApplied.3.054004},
  journal = {Physical Review Applied},
  language = {en},
  number = {5}
}

@article{govindarajuGeneticsFraminghamHeart2008,
  title = {Genetics of the {{Framingham Heart Study Population}}},
  author = {Govindaraju, Diddahally R. and Cupples, L. Adrienne and Kannel, William B. and O'Donnell, Christopher J. and Atwood, Larry D. and D'Agostino, Ralph B. and Fox, Caroline S. and Larson, Marty and Levy, Daniel and Morabito, Joanne and Vasan, Ramachandran S. and Splansky, Greta Lee and Wolf, Philip A. and Benjamin, Emelia J.},
  year = {2008},
  volume = {62},
  pages = {33--65},
  issn = {0065-2660},
  doi = {10.1016/S0065-2660(08)00602-0},
  abstract = {This article provides an introduction to the Framingham Heart Study (FHS) and the genetic research related to cardiovascular diseases conducted in this unique population. It briefly describes the origins of the study, the risk factors that contribute to heart disease and the approaches taken to discover the genetic basis of some of these risk factors. The genetic architecture of several biological risk factors has been explained using family studies, segregation analysis, heritability, phenotypic and genetic correlations. Many quantitative trait loci underlying cardiovascular diseases have been discovered using different molecular markers. Additionally, results from genome-wide association studies using 100,000 markers, and the prospects of using 550,000 markers for association studies are presented. Finally, the use of this unique sample in genotype and environment interaction is described.},
  journal = {Advances in genetics},
  language = {eng},
  pmid = {19010253}
}

回答

1 DonaldArseneau Aug 24 2020 at 04:58

チャプタービブでは、\bibliographystyle含まれているチャプター/ビブリオグラフごとにコマンドが必要です。別のドキュメント全体のビブを生成する場合は、ドキュメントの先頭にも1つあるはずです。doc-bib全体を生成するとき、bibtexは複数の\bibdata[from \bibliography]および\bibstyle[aka \bibliographystyle]コマンドについて文句を言いますが、そのジョブは正しく完了します。

結局、latexmkはchapterbibについて知っており、含まれている各ファイルに対して個別に、またドキュメント全体に対してbibtexを実行します。問題は、bibtexからのエラーメッセージを見て、それらが致命的であると考え、中止することです。ラテックスムクはすでにチャプタービブを認識しているので、問題をかなり簡単に修正できるはずです。それまでの間、「-f」オプションを指定してlatexmkを実行してください。ラテックスmkのドキュメントによると

-f    強制latexmkエラーにもかかわらず、文書処理を継続します。

エラーが発生して停止しないため、これは少し手間がかかります。元の(または編集された)質問が「-f」が使用されたことを意味することを考えると、エラーメッセージにもかかわらず、最終結果は正しいはずです!実際(質問の編集によると)「-gg」オプションは、latexmkの実行に失敗した後に続行する場合に役立ちます。

縮小された形式では明らかではないドキュメントにはまだ問題があります。すべての参考文献は順番に番号が付けられた形式を使用しているため、最終的な全体的な参考文献は、示されている最も単純な場合を除いて、章の参考文献とは異なる番号が必要になります。チャプタービブのドキュメント(ここでも項目7「全体的な参考文献」)には次のように書かれています。

これにより、さまざまな名前の付いた参考文献スタイルにのみ意味のある、独立した全体的な参考文献が作成されます。番号付きのスタイル、または他のタイプの自動列挙を使用したスタイルでは、参考文献ごとに異なるタグが付けられ、混乱が生じます。

考えられる解決策は

  • 全体的な参考文献については、ルートドキュメントで名前付きの参考文献スタイルを使用してください。(natbibに「数字」をたまにしか使用しないように指示する方法があるかどうかはまだわかりません。)

  • [duplicate]最終的な参考文献が章の参考文献のコレクションになるように、列挙されたスタイルでchapterbibオプションを使用します(ただし、含まれている章以外の引用は許可されていません)。

SamuelMarks Sep 18 2020 at 09:53

@ john-collinsとやり取りします。そして今、この問題を解決する新しいバージョンがリリースされました。

バージョン4.70aを参照 http://www.personal.psu.edu/~jcc8/latexmk/versions.html