具体的に解決したい問題
LaTeXにおいて、例えば以下のような\input{hoge}
を含むmain.tex
を1つのファイルに展開したい。
...
\maketitle
\input{introduction}
\input{proposed_method}
\input{evaluation}
\input{conclusion}
...
解決策
latexdiff
コマンドの--flatten
オプションを活用する。
latexdiff --flatten main.tex main.tex > flatten.tex
latexdiff --flatten main_before.tex main_after.tex > diff.tex
で\include{hoge}
を含めたファイル間の差分を強調したTeXファイルを出力できるが、main_before.tex
とmain_after.tex
に同じファイルを指定することで、差分がないためそのまま展開されたTeXファイルが出力できる。