Is there a way to make latexdiff work with the 'subfiles' package ?
I use subfiles to include parts of the document from different .tex files. Latexdiff does not seem to mark changes in the subfiles.
The --flatten option does not help. Latexdiff version is 1.0.2.
Example :
main.tex
\documentclass[10pt]{article}
\usepackage{subfiles}
\begin{document}
\subfile{includeme.tex}
\end{document}
includeme.tex
\documentclass[main.tex]{subfiles}
\begin{document}
Text!
\end{document}
Running
latexdiff d1/main.tex d2/main.tex --flatten > mydiff.tex
the resulting document simply does not include the contents of the subfile.
mydiff.tex
\documentclass[10pt]{article}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF (...)
%DIF END PREAMBLE EXTENSION ADDED BY LATEXDIFF
\begin{document}
\subfile{includeme.tex}
\end{document}
So yes, the problem lies with the flatten pipeline/workflow, which does not seem to be made to work with \subfile{includeme.tex} includes.
flatten
alternatives discussed here: tex.stackexchange.com/questions/21838/…subfiles
includes subsidiary files.\subfile
argument. You can adapt some of the scripts mentioned in the link before to use\subfile
in a similar way as\input
, but as your example ofincludeme.tex
includes adocumentclass
I think it's not going to be compilable.latexdiff version 1.1.1
, using the--flatten
option worked for me with subfiles. It took a little tweaking of the file-structure to get it to work, then I had to manually modify the resultingmydiff.tex
slightly to get it to build into a PDF... but it worked.