LoginSignup
0
0

More than 1 year has passed since last update.

LaTeXソースコードの\inputを展開し、1つのファイルにする方法

Posted at

具体的に解決したい問題

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.texmain_after.texに同じファイルを指定することで、差分がないためそのまま展開されたTeXファイルが出力できる。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0