書籍クラスでの組み込み問題

書籍クラスでの組み込み問題

tex私は本を​​書いていて、他のファイルにある章を組み込もうとしています。

以下の章があります:

ch1.tex

\chapter{1st chapter}

\begin{examp}
example1 example1
\end{examp}

text1 text1

ch2.tex

\chapter{2nd chapter}

\begin{examp}
example2 example2
\end{examp}

text2 text2

ch3.tex

\chapter{3rd chapter}

\begin{examp}
example3 example3
\end{examp}

text3 text3

これがメインファイルです:

main.tex

\documentclass{book}

\usepackage{amsthm}

\theoremstyle{definition}
\newtheorem{examp}{Example}[section]

\begin{document}

main text

\include{ch1.tex}

\include{ch2.tex}

\include{ch3.tex}

\end{document}

問題は、コンパイルまたはビルドしても何も表示されないことです。main.tex。また、コンパイルしてビルドしても(ただの実験なので、良いアイデアだったかどうかは分かりません)ch1.tex、そして、ch2.texしかしch3.texまだ何もありません...

何が間違っているのでしょうか?

よろしくお願いします!

答え1

\include{ch1.tex}

と書くべきである

\include{ch1}

常に、\include引数は拡張子のないファイル名であると想定します。

これはログファイルからも明らかである。

No file ch1.tex.tex.
No file ch2.tex.tex.
No file ch3.tex.tex.

\includeファイルが見つからない場合はエラーは発生しないことに注意してください。

答え2

これをメインに入れてみてください:

\input{ch1.tex}

の代わりに\include{}

関連情報