
使用以下程式碼,函數名稱 foo 被列印為\textsc{foo}
。
\usepackage{algorithmic}
\begin{document}
\begin{frame}
\begin{algorithmic}[1]
\Function{foo}{$a$}
\EndFunction
\end{algorithmic}
\end{frame}
如何將其更改為\texttt{foo}
適用於所有\Function
命令\Call
?
答案1
所需的包是algpseudocode
, 不是algorithmic
。
\documentclass{article}
\usepackage{algpseudocode}
\algrenewcommand\textproc{\texttt}
\begin{document}
\begin{algorithmic}[1]
\Function{foo}{$a$}
\EndFunction
\end{algorithmic}
\end{document}