1

I would like to have the "Exercise xx." (with a dot) in italic bold red in the same font size and the exercises text that would follow in the same line.

Exercise 1. Solve x+1=2.
Exercise 2. Solve x-1=3.

Now I have:

\documentclass[10pt,xcolor=dvipsnames]{beamer}
\setbeamertemplate{theorems}[numbered]
\newtheorem{exe}{Exercise}
\begin{document}
\begin{frame}{Frame title}
\begin{exe} Here is the exercise.
\end{exe}
\end{frame}
\end{document}

But this isn't what I want. Please help!

0

1 Answer 1

2

Based on https://tex.stackexchange.com/a/329929/36296

\documentclass{beamer}
\newtheorem{exe}{Exercise}
\usepackage{lmodern}

\makeatletter
\setbeamertemplate{theorem begin}{%
%  \begin{\inserttheoremblockenv}% removed
  {%
    \textcolor{red}{\bfseries\inserttheoremname\space\inserttheoremnumber.}
    \ifx\inserttheoremaddition\@empty\else\ (\inserttheoremaddition)\fi%
    \space% new
  }%
}

\setbeamertemplate{theorem end}{}
\makeatother

\begin{document}
    \begin{frame}{A theorem in a box}
            \begin{exe} Here is the exercise.
            \end{exe}
    \end{frame} 
\end{document}

enter image description here

You must log in to answer this question.

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