
私は、各演習がスタンドアロンの TeX ファイルである演習のメイン ファイルを 1 つコンパイルしようとしています。 は、standalone
そのための完璧なパッケージですが、追加するサブファイルの特定の部分を選択するカスタマイズ性がありません。
この場合、私は を使用しています。documentclass{exam}
これは、個々の質問を取り込んで\question
列挙します。 の問題は、standalone
各演習がスタンドアロンの TeX ファイルである場合、それらを組み合わせると、メイン ファイル内の各演習に番号 1 が割り当てられ、列挙されないことです。
私の目標のメインファイル:
\documentclass{exam}
\usepackage{standalone} %or any suitable package
\begin{document}
\begin{questions}
\input{exercise1}
\input{exercise2}
\input{exercise3}
\end{questions}
\end{document}
サンプル練習ファイル:
% exercise1.tex
\documentclass{exam}
\begin{document}
\begin{questions}
\question A sample question
\begin{solution}
Solution Here
\end{solution}
\end{questions}
\end{document}
このアプローチは\begin{questions}
メインファイルにフィールドが含まれているため機能しません。2つのネストされたファイルが作成されます。\begin{questions}
question
特定のタグまたは環境 (私の場合は env.)内にあるものを含めるパッケージ、またはこれに対する別の回避策はありますか。 ありがとうございます!
答え1
これはうまくいくかもしれません:
\documentclass{exam}
\usepackage{standalone} %or any suitable package
\begin{document}
\begin{questions}
\begingroup
\renewenvironment{questions}{}{}
\input{exercise1}
\input{exercise1}
\input{exercise1}
\endgroup
\end{questions}
\end{document}