我在算法环境中编写了一些伪代码,如何减小算法标题和索引号的字体大小?
\begin{frame}{Proposal Algorithm}
\begin{minipage}{.49\textwidth}
\centering{\textcolor{red}{Proposal}}
\begin{algorithm}[H]
\begin{algorithmic}[10]
\tiny{
\STATE a
\WHILE {\textcolor{red}{$x>0$}}
\STATE Simulate $g\sim uniformm[0,1]$;\\
\STATE Simulate $y\sim \mathcal{N}(0,\sigma^2)$\\
\ENDWHILE
}
\end{algorithmic}
\caption{\small{$\Delta$- proposla new algorithm}}
\label{al122}
\end{algorithm}
\end{minipage}
\end{frame}
答案1
您可以使用该caption
包来更改字体大小:
\documentclass{beamer}
\setbeamertemplate{caption}[numbered]
\usepackage{caption}
\captionsetup[algorithm]{font=tiny}
\usepackage{algorithm,algorithmic}
\begin{document}
\begin{frame}{Proposal Algorithm}
\begin{minipage}{.49\textwidth}
\centering{\textcolor{red}{Proposal}}
\begin{algorithm}[H]
\begin{algorithmic}[10]
\tiny
\STATE a
\WHILE {\textcolor{red}{$x>0$}}
\STATE Simulate $g\sim uniformm[0,1]$;\\
\STATE Simulate $y\sim \mathcal{N}(0,\sigma^2)$\\
\ENDWHILE
\end{algorithmic}
\caption{$\Delta$- proposla new algorithm}
\label{al122}
\end{algorithm}
\end{minipage}
\end{frame}
\end{document}