
かなりシンプルなレイアウトを操作しようとしていますlatexmk
。何が間違っているのでしょうか?
編集: 最新の進捗状況の結果に合わせて例を変更しました。サブディレクトリ
all.bib
にシンボリックリンクする必要がありchapters
、-f
で必要でしたlatexmk
。これはほぼ希望どおりの出力を生成しますが、が必須であり、参照の番号付けが全体を通して一貫している(章ごとに特定されているのではなく)ため、間違っていると言え
-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'
すべて.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}
すべて.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
\bibliographystyle
chapterbib では、含まれる各章/参考文献ごとにコマンドが必要です。別の文書全体の bib を生成する場合は、文書の先頭にもコマンドが必要です。文書全体の bib を生成する場合、bibtex は複数の\bibdata
[from \bibliography
] コマンドと\bibstyle
[aka \bibliographystyle
] コマンドについてエラーを発しますが、ジョブは適切に完了します。
結局、latexmk は chapterbib を認識しており、各インクルードファイルに対して別々に bibtex を実行し、またドキュメント全体に対しても bibtex を実行することがわかりました。問題は、bibtex からのエラーメッセージを見て、それが致命的であると判断して中止することです。latexmk はすでに chapterbib を認識しているので、この問題は簡単に解決できるはずです。それまでの間、latexmk を "-f" オプション付きで実行してください。latexmk のドキュメントには次のように書かれています。
-f 力ラテックスエラーがあっても文書処理を続行します。
それはちょっと強引だ。なぜなら止まらないからだどれでもエラー。元の(または編集された)質問では「-f」が使用されていることが示されているため、エラー メッセージにもかかわらず、最終結果は正しいはずです。実際(質問の編集によると)、latexmk の実行が失敗した後に続行する場合は、「-gg」オプションが便利です。
この文書には、縮小版では明らかでない問題がまだ残っています。すべての参考文献は番号順の形式を使用しているため、図に示す最も単純なケースを除いて、最終的な全体の参考文献には章の参考文献とは異なる番号が必要になります。章の参考文献のドキュメント(再び項目7「全体の参考文献」)には次のように書かれています。
これにより、さまざまな名前付き参考文献スタイルにのみ意味のある独立した全体的な参考文献が作成されます。番号付きスタイル、またはその他の種類の自動列挙を持つスタイルでは、各参考文献に異なるタグが付けられ、混乱が生じます。
潜在的な解決策としては
全体の参考文献には、ルート ドキュメントで名前付き参考文献スタイルを使用します。(natbib に「数字」を時々のみ使用するように指示する方法があるかどうかはまだわかりません。)
[duplicate]
最終的な参考文献が章の参考文献のコレクションになるように、列挙スタイルでchapterbib オプションを使用します(ただし、含まれる章以外の引用は許可されません)。
答え2
@john-collins とメールのやり取りをしたところ、この問題を解決する新しいバージョンがリリースされました。
バージョン4.70aを参照http://www.personal.psu.edu/~jcc8/latexmk/versions.html