在我的文档中,我目前正在使用paragraph
我的定理创建“子标题”。
在序言中:
\usepackage{amsthm}
\newtheorem{deff}{Definition}
在文档中:
\begin{deff}
A recipe is
\paragraph{given}
\begin{enumerate}
\item a desired outcome
\item a language of instruction
\end{enumerate}
\paragraph{a set of}
\begin{enumerate}
\item required inputs
\item cooking instructions
\item sanity checks
\end{enumerate}
\paragraph{, such that}
\begin{itemize}
\item the desired outcome is achieved using inputs and instructions
\item the sanity checks verify that the cook is still sane
\end{itemize}
\end{deff}
这使
现在,我想在我的投影仪幻灯片中实现类似的功能。但是,似乎paragraph
无法实现 - 以下文档会产生错误(未定义的控制序列):
% !TEX encoding = UTF-8 Unicode
% !TEX TS-program = pdflatexmk
\documentclass{beamer}
% add page numbers for malmoe
\newcommand*\oldmacro{}%
\let\oldmacro\insertshorttitle%
\renewcommand*\insertshorttitle{%
\oldmacro\hfill%
\insertframenumber\,/\,\inserttotalframenumber}
\usetheme{Malmoe}
\setbeamertemplate{headline}{}
\setbeamertemplate{footline}{}
\addtobeamertemplate{navigation symbols}{}{%
\usebeamerfont{footline}%
\usebeamercolor[fg]{footline}%
\hspace{1em}%
\insertframenumber/\inserttotalframenumber
}
\usepackage{amsthm}
\newtheorem{deff}{Definition}
\begin{document}
\begin{frame}
\begin{deff}
A recipe is
\paragraph{given}
\begin{enumerate}
\item a desired outcome
\item a language of instruction
\end{enumerate}
\paragraph{a set of}
\begin{enumerate}
\item required inputs
\item cooking instructions
\item sanity checks
\end{enumerate}
\paragraph{, such that}
\begin{itemize}
\item the desired outcome is achieved using inputs and instructions
\item the sanity checks verify that the cook is still sane
\end{itemize}
\end{deff}
\end{frame}
\end{document}
我需要alert{}
强调列表中的某些项目,所以我不想将其用作\alert
标题。我还能如何在 Beamer 中重现上述布局?理想情况下,标题上方的间距也会更小,甚至更好——这是一种让我控制它的方法。
答案1
如果您想要使用已定义的命令,则可以例如使用\structure{}
:
\documentclass{beamer}
\usetheme{Malmoe}
\setbeamertemplate{headline}{}
\setbeamertemplate{footline}{}
\addtobeamertemplate{navigation symbols}{}{%
\usebeamerfont{footline}%
\usebeamercolor[fg]{footline}%
\hspace{1em}%
\insertframenumber/\inserttotalframenumber
}
\newtheorem{deff}{Definition}
\begin{document}
\begin{frame}
\begin{deff}
A recipe is
\structure{given}
\begin{enumerate}
\item a desired outcome
\item a language of instruction
\end{enumerate}
\structure{a set of}
\begin{enumerate}[a.]
\item required inputs
\item cooking instructions
\item sanity checks
\end{enumerate}
\structure{, such that}
\begin{itemize}
\item the desired outcome is achieved using inputs and instructions
\item the sanity checks verify that the cook is still sane
\end{itemize}
\end{deff}
\end{frame}
\end{document}
或者您可以创建一个新命令并对其进行样式设置以满足您的需要:
\documentclass{beamer}
\usetheme{Malmoe}
\setbeamertemplate{headline}{}
\setbeamertemplate{footline}{}
\addtobeamertemplate{navigation symbols}{}{%
\usebeamerfont{footline}%
\usebeamercolor[fg]{footline}%
\hspace{1em}%
\insertframenumber/\inserttotalframenumber
}
\newtheorem{deff}{Definition}
\newcommand{\mypar}[1]{\textbf{#1}}
\begin{document}
\begin{frame}
\begin{deff}
A recipe is
\mypar{given}
\begin{enumerate}
\item a desired outcome
\item a language of instruction
\end{enumerate}
\mypar{a set of}
\begin{enumerate}[a.]
\item required inputs
\item cooking instructions
\item sanity checks
\end{enumerate}
\mypar{, such that}
\begin{itemize}
\item the desired outcome is achieved using inputs and instructions
\item the sanity checks verify that the cook is still sane
\end{itemize}
\end{deff}
\end{frame}
\end{document}