Hi > I think this is a bug in LaTeX rather than LyX, especially (1)+(2a). I > googled > for a (LaTeX) workaround, but I can't see one.
Yes, you are right, it is a LaTeX error, I was blinded by the errormsg. Anyhow this is LyX, and LyX makes LaTeX code that do not compile if you make some unwise choices. I guess we could say that you should not make these choices, which is the easiest way :). However, if we could get LyX to end the environments before starting the marginpar the problem would go away. Contrast the LaTeX code outputed by LyX, which does not work: \paragraph{\emph{Elymus foliis mucronato-pungentibus, s. Elymus arenarius. }\textmd{\emph{}}% \protect\marginpar{ \paragraph{\textmd{\emph{\small Leymus arenarius}}}% }} With my hand written one that does work, (the only difference is that I moved the brace to end the paragraph before I start the marginpar): \paragraph{\emph{Elymus foliis mucronato-pungentibus, s. Elymus arenarius. }\textmd{\emph{}}}% <--extra brace here \protect\marginpar{ \paragraph{\textmd {\emph{\small Leymus arenarius}}}% } %<-- one less brace here I am not a programmer and do not understand the LaTeX "lexer", however, I understand that this might be difficult to accomplish and thus I leave it to the programmers to decide if this is something that happens so often that we should use time to fix it. yours, Ingar Pareliussen.