# Beamer and indentation with alltt

The following beamer code

\begin{frame}[fragile]
\frametitle{PROC TEMPLATE for a fancy graph (part 2)}
\begin{alltt}
rowaxes;
rowaxis /label = 'Infant Mortality (\%)'
griddisplay = on;
rowaxis /label = '' griddisplay = on;
endrowaxes;
layout overlay;
scatterplot x = unemployment
y = infantmortality;
loessplot x = unemployment
y = infantmortality/nomarkers;
loessplot x = unemployment
y = infantmortality/smooth = 1;
ellipse  x = unemployment y = infantmortality
/type = predicted;
endlayout;
\end{alltt}
\end{frame}


Indents as shown until the line starting "ellipse" which is set flush left. Adding a paragraph marker after "unemployment" does not help.

Any ideas?

-

## migrated from stackoverflow.comSep 20 '11 at 1:09

This question came from our site for professional and enthusiast programmers.

Your code snippet works OK for me, after suitable completion. Could you please post a (complete) minimal working example illustrating the problem? –  Gonzalo Medina Sep 20 '11 at 1:22
A cause for this can be using <tab> instead of spaces. –  egreg Sep 20 '11 at 12:15

I cannot see any problem, when I create a complete document from your code fragment! However, beamer knows the environment semiverbatim which can also be used:

\documentclass{beamer}
\begin{document}

\begin{frame}[fragile]
\frametitle{PROC TEMPLATE for a fancy graph (part 2)}
\begin{semiverbatim}
rowaxes;
rowaxis /label = 'Infant Mortality (\%)'
griddisplay = on;
rowaxis /label = '' griddisplay = on;
endrowaxes;
layout overlay;
scatterplot x = unemployment
y = infantmortality;
loessplot x = unemployment
y = infantmortality/nomarkers;
loessplot x = unemployment
y = infantmortality/smooth = 1;
ellipse  x = unemployment y = infantmortality
/type = predicted;
endlayout;
\end{semiverbatim}
\end{frame}

\end{document}


-
Thanks! semiverbatim solved this problem. I hadn't even heard of this environment. –  Peter Flom Sep 20 '11 at 10:59