2

I would like to have the content of the Verbatim environment to be on the left of this beamer slide. However, whatever I try it always gets centered. How can I control the position of the start of the text?

\documentclass{beamer}
\usepackage{fancyvrb}

\begin{document}
    
    \begin{frame}[fragile]
        \frametitle{My Slide Title}
        \begin{Verbatim}[fontsize=\scriptsize, commandchars=\\\{\}]
            Call:
            lm(formula = mod.eq.ancova, data = dat)
            
            Residuals:
            Min      1Q  Median      3Q     Max 
            -41.933  -4.221  -0.322   4.053  43.217 
        \end{Verbatim}
    \end{frame}
    
\end{document}

enter image description here

1 Answer 1

2

Don't indent your verbatim code:

\documentclass{beamer}
\usepackage{fancyvrb}

\begin{document}
    
    \begin{frame}[fragile]
        \frametitle{My Slide Title}
\begin{Verbatim}[fontsize=\scriptsize, commandchars=\\\{\}]
Call:
lm(formula = mod.eq.ancova, data = dat)

Residuals:
Min      1Q  Median      3Q     Max 
-41.933  -4.221  -0.322   4.053  43.217 
\end{Verbatim}
    \end{frame}
    
\end{document}

Or if you really must indent your code, at least only use two spaces per level, this way you could use the gobble option to remove them (only works up to 9 spaces):

\documentclass{beamer}
\usepackage{fancyvrb}

\begin{document}
  
  \begin{frame}[fragile]
    \frametitle{My Slide Title}
    \begin{Verbatim}[fontsize=\scriptsize, commandchars=\\\{\},gobble=6]
      Call:
      lm(formula = mod.eq.ancova, data = dat)
      
      Residuals:
      Min      1Q  Median      3Q     Max 
      -41.933  -4.221  -0.322   4.053  43.217 
    \end{Verbatim}
  \end{frame}
  
\end{document}

enter image description here

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .