I am using subfiles with multiple comment environments inside (which I use as translation versions and annotations of a text).
Example: guitarteacher.txt
\documentclass[../resume]{subfiles}
\begin{document}
\begin{English}
Guitar teacher.
\leavevmode
\hrulefill
\small
\begin{annotate}
\begin{itemize}
\item Example annotation.
\end{itemize}
\normalsize
\leavevmode
\hrulefill
\end{annotate}
\end{English}
\begin{Swedish}
Gitarrlärare.
\leavevmode
\hrulefill
\small
\begin{annotate}
\begin{itemize}
\item Example annotation.
\end{itemize}
\normalsize
\leavevmode
\hrulefill
\end{annotate}
\end{Swedish}
\end{document}
When I import a single sentence or word into a document with subfiles - such as:
\subfile{resume/guitarteacher.txt}
it puts in a newline afterwards, which I want to get rid of, like this:
Gitarrlärare
, Privat, 2009, etc.
Someone showed me that taking out all the whitespace inside the subfiles can take care of this problem if it's a simple file, like this:
\documentclass[./resume.txt]{subfiles}\begin{document}Some text.\end{document}
(See: Can I edit the subfiles package to not include new lines after each subfile?)
But in this case, I can't completely condense the file because then the comment environments don't work. I get error messages like "Sorry, your Latex code couldn't compile for some reason"; "Runaway argument?", "Extra }, or forgotten \endgroup", "You can't use / in vertical mode", and "Emergency stop".
There might be some way to arrange the line breaks so I don't get these errors and I don't get a newline in the output file, but that wouldn't be a good longterm solution. Instead, can subfiles be fixed so it doesn't add a newline unless there is clearly one between \begin{document} and \end{document}, or between whatever comment commands that are currently turned on, such as \begin{Swedish} and \end{Swedish}?
What would it take to fix the package? Should I edit the package myself? Is that a standard thing to do? Is it significantly difficult?

subfilesintroduces an empty line/a paragraph? Older versions may introduce an extra empty space, but I cannot reproduce a case with a new praragraph. The upcoming version ofsubfileswill behave like the\inputregarding spaces, i.e., extra spaces will be introduced (and can be removed) in the document, not in the package. – gernot Oct 12 '19 at 10:36