Beamer:定理中的“字幕”

Beamer:定理中的“字幕”

在我的文件中,我目前正在使用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標題。我還能如何在投影機中重現上述佈局?最理想的是,標題上方的間距也更小,甚至更好——這是我控制它的一種方式。

答案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}

相關內容