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.

linenumbers of minted are not shown in beamer if i use infolines as an outertheme

example:

\documentclass{beamer}
\usepackage{minted}

\usetheme{Warsaw}
\useoutertheme{infolines}
\addtobeamertemplate{headline}{}{\vskip2pt}

\begin{document}
\begin{frame}[fragile]{Hello}
\begin{minted}[linenos]{c}
#include <stdio.h>

int main() {
    printf("hello\n");
}
\end{minted}
\end{frame}
\end{document}

any suggestions?

share|improve this question
    
Welcome to TeX.SE! Great question, and thanks for providing a complete MWE, it really helps folks trying to debug :) –  cmhughes Dec 1 '12 at 17:38

1 Answer 1

up vote 6 down vote accepted

This is caused because the numbers are set in the margin, but with the infolines theme, the margin is too small. It does

\setbeamersize{text margin left=1em,text margin right=1em}

Reverting the margins back to the defaults of 1cm is one way to fix the problem, and may or may not be satisfactory to you:

\documentclass{beamer}
\usepackage{minted}

\usetheme{Warsaw}
\useoutertheme{infolines}
\setbeamersize{text margin left=1cm,text margin right=1cm}
\addtobeamertemplate{headline}{}{\vskip2pt}

\begin{document}
\begin{frame}[fragile]{Hello}
\begin{minted}[linenos]{c}
#include <stdio.h>

int main() {
    printf("hello\n");
}
\end{minted}
\end{frame}
\end{document}
share|improve this answer
    
thanks! exactly what i was looking for. –  obl Dec 1 '12 at 17: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.