I wrote two simple files integrated using the standalone package:
main.tex:
\documentclass{article}
\usepackage[subpreambles]{standalone}
\begin{document}
\input{myfile}
\end{document}
myfile.tex:
\documentclass[class=article, crop=false]{standalone}
\usepackage{lipsum}
\usepackage{acronym}
\begin{document}
\acrodef{FB}{Foo Bar}
First call: \ac{FB} \par Later calls: \ac{FB}
\lipsum[1]
\end{document}
While the subfile compiles as intended, the main file compiles with error:
Seems like while the \lipsum
and the \ac
commands are both known to the main file, the \acrodef
command is not so as suggested by the errors I get. Even if I move the \acrodef
command to the preamble of the subfile, nothing changes.
The only way I could solve this so far was to add the acronym package also in the preamble of the main file while based on the documentation of the standalone package, this is what the subpreambles tag is expected to do and has already done with the lipsum package in this example.
So what am I missing or misunderstanding about the standalone package and how it handles the subpreambles?
Update
With using the command \newacro
instead of \acrodef
, the issue with the command \ac
gets solved. So the first call and the other calls to \ac
successfully resolves to correct outputs. But still there is an additional line showing up in the output when compiling main.tex
(the first line):