如何更改 beamer 定理环境中的文本格式?
How to change formatting of text in a beamer theorem-environment?
我正在制作投影仪演示文稿,我想更改定理环境中文本的格式。
定理中的文本默认格式为 \textit{}
或 \textsl{}
,但我希望它的格式为 'normally',即我想将格式更改为 'plain text'。我该怎么做?
根据你上一个问题的答案,你可以在定理块的定义中添加\normalfont
:
\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}
我正在制作投影仪演示文稿,我想更改定理环境中文本的格式。
定理中的文本默认格式为 \textit{}
或 \textsl{}
,但我希望它的格式为 'normally',即我想将格式更改为 'plain text'。我该怎么做?
根据你上一个问题的答案,你可以在定理块的定义中添加\normalfont
:
\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}