Bag of ML Words

ML = Machine Learning, Music Love, and Miscellaneous things in daily Livings

Latexで数式番号・図番号を途中から開始するには

論文書くときに、例えばAppendixは別ファイルにしろ、とかいわれることがありますね、というか言われましたIEEE TPAMIに。

そのとき、Appendix中で本文中の数式とか図を引いているうえに、さらに数式や図がある場合、数式番号をうまくしないと混乱してしまいます。

 

問題

たとえば、Appendix中で、本文中の式(1)の導出を詳説したいとします。

そのために、Appendix中で数式が必要になると・・・

 

本文

p(x|y) = N(x; m, S)    ...(1)

 

Appendix

Let us explain the derivation of Eq. (1).

First, the Eq. (1) is rewritten as follows:

 

p(x|y) \propto p(y|x) p(x)                                      ...(1)

          =   N(y; m_{1}, S_{1}) N(x; m_{0}, S_{0}  ...(2)

 

From Eq. (1), we know the equation (1) is decomposed into two pars.

 

みたいになって意味不明になりかねません。*1

解決策

解決策は簡単。Appendixのtexの適当なところ(\begin{document}のあとあたり)に

\setcounter{equation}{n}

と書きましょう。

n= 10にすると

本文

p(x|y) = N(x; m, S)    ...(1)

 

Appendix

Let us explain the derivation of Eq. (1).

First, the Eq. (1) is rewritten as follows:

 

p(x|y) \propto p(y|x) p(x)                                      ...(11)

          =   N(y; m_{1}, S_{1}) N(x; m_{0}, S_{0}  ...(12)

 

となって問題解決です。

\setcounterで数式番号をカウントしているんですね。

nに本文中の最後の数式番号を入れれば重複がなくなります。

同様にtable, figure番号も制御できます。

 

http://www.lightstone.co.jp/latex/kb0140.htm

*1:いやまあ、本文のEq.(1), AppendixのEq.(1)とかかけばいいのかもですが、それは面倒でしょう