> From: Ingar Pareliussen <ingar.parelius...@dmmh.no>
>
> > 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
>
>
First let me talk about your particular document; sorry if you already know
everything I say. Then I'll talk about your suggested workaround.
As I said in my last email, I really don't think you mean to use the
"paragraph"
layout here, especially _inside_ the marginpar. "Paragraph" (in this context)
means a type of heading. You should only use it if you have divided your
document into sections, subsections, subsubsections, and now want to divide it
into even smaller pieces. And by making the *inside* of marginal notes
paragraph
layout, you are saying that these are headings too.
To put it another way, if you make the table of contents more detailed (you can
do this in document settings under "numbering and TOC"), then *all text in
paragraph layouts* will appear in the table of contents. Including these
marginal notes, on their own lines.
If you were just after the formatting that the "paragraph" layout produces,
then
you can email this list with exactly what you're trying to do and we can help
you achieve it the easiest way.
Back to your suggestion. Unfortunately your workaround doesn't just fix the
compile error, but produces completely different output. E.g. (this is
simplified but the same idea):
Original: \paragraph{ xxx \protect\marginpar{ yyy } zzz }
This is a single paragraph-level heading "xxx zzz" with a margin note "yyy"
next
to it.
Changed: \paragraph{ xxx } \protect\marginpar{ yyy } \paragraph { zzz }
This is a paragraph-level heading "xxx", followed by an empty paragraph (not a
heading) with margin note "yyy", followed by a paragraph-level heading "zzz".
I think that perhaps \paragraph{\marginpar{\paragraph{ blah }}} could be
disallowed in LyX, because it doesn't make any sense, but something like
\paragraph{\marginpar{\itemize{ blah }}} makes sense and might one day work, if
this LaTeX bug is fixed. So overall I don't think LyX should do anything about
it.
Jim