In detail I want to change the font style of all keywords like If Return For
to bold/sans serif, but only the keywords.
MWE:
\documentclass{article}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\usepackage{caption}
\begin{document}
\begin{algorithm}
\caption{algo}
\begin{algorithmic}[1]
\Function{x}{z}
\State a
\State b
\If{c}
\State d
\EndIf
\State \Return
\EndFunction
\end{algorithmic}
\end{algorithm}
\end{document}
Best Answer
algpseudocode.sty
uses explicit\textbf
for the keywords, so you have to redefine them to add\textsf
(or to change them to the desired formatting):Of course, a better option is to use something like
so a simple change to
\keywordfont
will propagate to all keywords. Something like this could be a feature request for the package author.