Jim <[email protected]> writes:

> Here are my files:
>
> latex-standalone-main.tex:
> ---------- cut here -------------
> \documentclass{article}
> \usepackage{standalone}
> \usepackage{amsmath} % Load necessary packages in the main file
> \begin{document}
> \section{My Document}
> Here is my first picture:
> \includestandalone{latex-standalone-subfile}
> \end{document}
> ---------- cut here -------------
>
> latex-standalone-subfile.tex
> ---------- cut here -------------
>      \documentclass{standalone} % This is in the subfile
>      \usepackage{amsmath} % This is in the subfile
>       \begin{document}
> % Content of the picture/figure
> An equation $a+b=c$.
>       \end{document} % This is in the subfile
> ---------- cut here -------------
>
> I have indented and commented the LaTeX control sequences in the subfile so
> we can see (I hope!) where each line comes from.
>
> Now I edit the subfile, and set TeX-master to the main file.

Sorry if my comment is off, but I always thought that with standalone,
*all* files have this file local variable:

  %%% Local Variables:
  %%% mode: LaTeX
  %%% TeX-master: t
  %%% End:

So in your latex-standalone-subfile.tex, you don't set `TeX-master' to
latex-standalone-main.tex.

Best, Arash

Reply via email to