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 new to Latex and am working on a small presentation using Latex and Beamer. In one frame, I'm trying to show some Latex code and it's output. Initially I just took a screenshot of the Gummi tex code and preview panel, but I wanted to know how I can get just the code on one column and the output on another side of the frame. I've seen this in several presentations and can't seem to find anything via google or any of the tutorials I'm using.

Can anyone help me with spliting a beamer frame with Latex code on one side and the output on the other?

For what it's worth, I'm working in Ubuntu 10.10

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

One option would be to use the showexpl package. A little example:

\documentclass{beamer} 
\usepackage{showexpl} 

\lstloadlanguages{[LaTeX]Tex} 
\lstset{% 
     basicstyle=\ttfamily\small, 
     commentstyle=\itshape\ttfamily\small, 
     showspaces=false, 
     showstringspaces=false, 
     breaklines=true, 
     breakautoindent=true, 
     captionpos=t 
} 

\begin{document} 

\frame[containsverbatim]{ 
\begin{LTXexample} 
\begin{itemize} 
  \item First. 
  \item Second.
  \item Third.
\end{itemize} 
\end{LTXexample} 

\begin{LTXexample} 
\begin{equation} 
  x^2 + y^2 = z^2. 
\end{equation} 
\end{LTXexample} 
} 

\end{document}

Here's the result:

share|improve this answer
add comment

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.