I am using algorithmicx
to typeset my algorithms in XeTeX. Using fontspec
, I set the default font to be Linux Libertine with historical ligatures (e.g., ct
, st
). Unfortunately, this is also the font used by algorithmicx
to typeset my algorithms and historical ligatures look very much out of place there.
This is likely a newbie question, but is there any way to customize the font used within the algorithmic
environment without specifying the custom font at the beginning of each such environment?
A simple solution is to define a new environment
\newenvironment{halgorithmic}
{ \begin{algorithmic}\algofont }
{ \end{algorithmic} }
and use halgorithmic
instead of algorithmic
. Is there a cleaner method that comes to mind?
algorithmic
. This would allow you to use leave your code unchanged.