I have a theorem-style defined like this (based on this answer https://tex.stackexchange.com/a/65955/228413):
\newtheoremstyle{note}% name
{10pt}% space above
{10pt}% space below
{}% body font
{}% indent amount
{}% theorem head font
{}% punctuation after theorem head
{\newline}% space after theorem head
{\underline{\thmname{\@ifempty{#3}{#1}\@ifnotempty{#3}{#3}}}} % theorem head spec
....
\theoremstyle{note}
\newtheorem*{note}{Notiz}
And when using this environment in a subfile it produces the correct result when compiled by itself:
\begin{note}[Title]
\lipsum[4][1-3]
\end{note}
But when the same file is included (\subfile{file_name}), the result looks like this:
What is causing this, and how can I fix it?
Thanks in advance!


\newtheormstyle? – Kyuhunter Apr 26 '21 at 12:35styandclsfile, this character counts as a letter, but on user level it does not.\makeatlettermakes "at" a letter, and\makeatothermakes "at" again a character of category "other", as it should be on user level. See also https://tex.stackexchange.com/q/6240 – gernot Apr 26 '21 at 17:11