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 have several slides in a beamer presentation where i'm presenting some programming code. However, the font ends up being too large and isn't fully featured on the slide. How can I change the font on the verbatim on a beamer slide. Furthermore, is there a way to keep it left alligned, but move it closer to the center of the slide.

\begin{frame}[fragile]
\begin{center}
\begin{verbatim}
> library(apsrtable)
> y = rnorm(100)
> x1 = rnorm(100)*3
> mod1 = lm(y ~ x1)

> y2 = rnorm(150)
> x1 = rnorm(150)*3
> mod2 = lm(y2 ~ x1)

> y3 = rnorm(130)
> x1 = rnorm(130)*3
> mod3 = lm(y3 ~ x1)

> apsrtable(mod1, mod2, mod3)
\end{verbatim}
\end{center}
\end{frame}

Help!

share|improve this question
add comment

1 Answer 1

up vote 7 down vote accepted

if you want to change it for all frames, write into the preamble:

\makeatletter
\def\verbatim@font{\ttfamily\tiny}
\makeatother

However, package listings or fancyvrb allow more flexible verbatim modes

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.