Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am currently making a presentation in LyX. After I have inserted some XML code in a code listing, I am getting this error:

Paragraph ended before \lst@next was complete.
Paragraph ended before \lst@next was complete.
LaTeX Error: \begin{lstlisting} on input line 228 ended by \end{beamer@framep
Missing } inserted.
Extra }, or forgotten \endgroup.

What's the problem? Have I to escape some characters or something? I am pretty new to LyX.

EDIT:

Here is a little code snippet. Because I am working with LyX, the code is generated and looks a little bit confusing, I think. I hope you can read it.

\begin_layout BeginFrame
\lang english
Güte der Ergebnisse
\end_layout
\begin_layout Standard
\lang english
\begin_inset listings
inline false
status open
\begin_layout Plain Layout
<server> 
\end_layout
\begin_layout Plain Layout
<name>MyServer</name> 
\end_layout
\begin_layout Plain Layout
<version>1</version> 
\end_layout
\begin_layout Plain Layout
<functionality>0</functionality> 
\end_layout
\begin_layout Plain Layout
<platform>Win</platform> 
\end_layout
\begin_layout Plain Layout
</server> 
\end_layout
\begin_layout Plain Layout
</ddsml> 
\end_layout
\end_inset
\end_layout
\begin_layout EndFrame
\start_of_appendix
\end_layout
share|improve this question
1  
A minimal example would be nice. It looks like you're using beamer as well as listings? How are you using listings? –  Seamus Dec 1 '11 at 9:19
1  
If any of the answers below solved your issue, would you consider accepting it by click the checkmark next to it? –  Torbjørn T. Dec 9 '11 at 21:09
    
oh, sorry. i missed that. –  Thomas Uhrig Dec 10 '11 at 8:40

4 Answers 4

up vote 4 down vote accepted

Perhaps this should rather be a comment on egregs answer, but it became a little long.

I searched a little, and there is a module for creating fragile frames, that can be found in the LyX wiki. I don't know how to install modules, but I guess that information can also be found in the LyX wiki.

An alternative is to use ERTs (source):

  1. Instead of starting a new frame the LyX way, add a TeX code box, or ERT, by hitting Ctrl + L, or choosing Insert --> TeX Code. In this box you write

    \begin{frame}[fragile]
    \frametitle{Title of the frame}
    
  2. Add the listing.

  3. Finally a second ERT with

    \end{frame}
    
share|improve this answer

I don't know how to do this in LyX, but a frame containing "verbatim" material such as a lstlisting environment should be declared as fragile:

\begin{frame}[fragile]
...
\begin{lstlisting}
...
\end{lstlisting}

\end{frame}
share|improve this answer

use it this way:

before the frame insert with Ctrl-L for inserting LaTeX Code

\defverbatim\lst{%
\begin{lstlisting}
your xml code}
\end{lstlisting}
}

inside the frame place also with Ctrl-L the command \lst where the listing should appear.

share|improve this answer

In LyX 2.1, you do not need to enter LaTeX code directly to achieve frames handling fragile elements correctly.

Just select the frame and press Alt+A 3. The new field "Options" should appear where you enter fragile. Alternatively, right click on the Frame 'header', and select Frame Options.

share|improve this answer
    
Welcome to TeX.SX! Just wondering, is this new for LyX 2.1? –  Torbjørn T. May 23 at 7:20
    
@TorbjørnT. yes (and I agree, that should be stated in the answer) –  scottkosty May 23 at 7:46
    
Also, I believe the shortcut is alt + a 3 (not 'g'). –  scottkosty May 23 at 7:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.