Search code examples
latexbeamer

How to change formatting of text in a beamer theorem-environment?


I am making a beamer-presentation and I want to change the formatting of the text in a theorem-environment.

The text in a theorem is by default formatted in \textit{} or \textsl{}, but I want it to be formatted 'normally', i.e. I want to change the formatting to 'plain text'. How can I do that?


Solution

  • Based on the answer to your previous question, you can add \normalfont to the definition of the theorem block:

    \documentclass{beamer}
    
    \usetheme{Aalborg}
    
    \uselanguage{danish}
    \languagepath{danish}
    \deftranslation[to=danish]{Theorem}{Saetning}
    
    \makeatletter
    \setbeamertemplate{theorem begin}{%
      \setbeamercolor{block title}{bg=cyan!100!white}%
      \setbeamercolor{itemize item}{fg=cyan!100!white}%
      \setbeamercolor{itemize subitem}{fg=cyan!100!white}%
      \setbeamercolor{itemize subsubitem}{fg=cyan!100!white}%
      \setbeamercolor{enumerate item}{fg=cyan!100!black}%
      \setbeamercolor{enumerate subitem}{fg=cyan!100!black}%
      \setbeamercolor{enumerate subsubitem}{fg=cyan!100!black}%
      \begin{\inserttheoremblockenv}
        {%
          \inserttheoremname
          \inserttheoremnumber
          \ifx\inserttheoremaddition\@empty\else\ \inserttheoremaddition\fi%
        }%
        \normalfont%
    }
    
    \setbeamertemplate{theorem end}{%
        \end{\inserttheoremblockenv}%
    }
    
    \makeatother
    
    \begin{document}
    
    \begin{frame}
        \begin{theorem}[Pythagoras]
                text
            $a^2+b^2=c^2$ 
            \begin{itemize}
            \item test
            \end{itemize}
            \label{pytagoras}
        \end{theorem}
    
        Theorem \ref{pytagoras}
    
        \begin{block}{Title Pythagoras}
            content...
            \begin{itemize}
            \item test
            \end{itemize}
        \end{block}
    \end{frame} 
    
    \end{document}