![如何减小算法标题和索引号的字体大小?](https://linux22.com/image/423843/%E5%A6%82%E4%BD%95%E5%87%8F%E5%B0%8F%E7%AE%97%E6%B3%95%E6%A0%87%E9%A2%98%E5%92%8C%E7%B4%A2%E5%BC%95%E5%8F%B7%E7%9A%84%E5%AD%97%E4%BD%93%E5%A4%A7%E5%B0%8F%EF%BC%9F.png)
我在算法环境中编写了一些伪代码,如何减小算法标题和索引号的字体大小?
\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}