Hi all,
I have a LilyPond inset inside a float:Figure. Im getting the error
Undefined control sequence.
Argument of \@caption has an extra }.
Paragraph ended before \@caption was complete.
If I just have the lilypond inset by itself it works fine.
Can anyone help please?
Thanks,
Tommy
LyX ⇒ Inset inside float error
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10348
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Inset inside float error
Hi Tommy,
it seems there's a fragile macro which breaks while moving to the list of figures. Protect the macro, that is, write a \protect right before the problematic macro. Or add an optional caption.
Perhaps export your LyX document into LaTeX and post the relevant part here, the code of the figure. Then we could tell you in detail.
Stefan
it seems there's a fragile macro which breaks while moving to the list of figures. Protect the macro, that is, write a \protect right before the problematic macro. Or add an optional caption.
Perhaps export your LyX document into LaTeX and post the relevant part here, the code of the figure. Then we could tell you in detail.
Stefan
LaTeX.org admin
Inset inside float error
Hi, Thanks for your reply,
The code can be found here:
Im not sure what you mean by macro? There is a \protect before \caption. Is this what you mean?
Many thanks,
Tommy Burn
The code can be found here:
Code: Select all
by the original. This has given the final work a much deeper feel,
and it integrates with the story much better.
\begin{figure}
\protect\caption{
\begin{lilypond}[staffsize=18]
\version "2.18.2"
\header { title = "Symphony" composer = "Tommy Burn" opus = "Op. 9" }
\relative c'{ \set Score.alternativeNumberingStyle = #'numbers \repeat volta 3 { c4 d e f | } \alternative { { c4 d e f | c2 d \break } { f4 g a b | f4 g a b | f2 a | \break } { c4 d e f | c2 d } } c1 \break \set Score.alternativeNumberingStyle = #'numbers-with-letters \repeat volta 3 { c,4 d e f | } \alternative { { c4 d e f | c2 d \break } { f4 g a b | f4 g a b | f2 a | \break } { c4 d e f | c2 d } } c1 }
\end{lilypond}
}
\end{figure}
\end{abstract}
As the composer I approached the task with a number of objectives
I wanted to achieve.
Many thanks,
Tommy Burn
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Inset inside float error
You have a figure environment (placing the figure to where it fits best) generating the need to reference it by a number and describe it (the figure), i.e. the caption.
Your figure-environment does not include an image (or something else), but a caption containing lilypond code. As the content of the caption is printed to the list of figures as well, nearly all commands inside the caption argument break. You can prevent the breaking by putting a
You didn't post a minimal example and i don't have any experience with lilypond, so i can't be really helpful.
Your figure-environment does not include an image (or something else), but a caption containing lilypond code. As the content of the caption is printed to the list of figures as well, nearly all commands inside the caption argument break. You can prevent the breaking by putting a
\protect
in front of the breaking command (also called macro). In your case, you have an environment inside the caption. Are you sure this should go to the caption?You didn't post a minimal example and i don't have any experience with lilypond, so i can't be really helpful.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Re: Inset inside float error
Yes, Thanks so much, That fixed it.
I didn't realise i was putting it as a caption. I thought I was puttting it as a figure. I moved it outside of the caption and wrote appropriatley in the caption box and it works.
Thanks loads.
Tommy
I didn't realise i was putting it as a caption. I thought I was puttting it as a figure. I moved it outside of the caption and wrote appropriatley in the caption box and it works.
Thanks loads.
Tommy