I am using algorithm2e to write algorithms, and I use the answer to this question to prevent the text in the algorithm to be in italic (by adding \SetArgSty{textrm} at the start of the algorithm).
\documentclass{article}
\usepackage{algorithm2e}
\begin{document}
\begin{algorithm}
\SetArgSty{textrm} % <-'Flag' will not be written in italic
\Begin{
Flag $\leftarrow$ True\;
\If{Flag}{
DoSomething()\;
}
}
\end{algorithm}
\end{document}
There are several algorithms in my document, and it is typically the kind of thing I like to have factored at the start of the document rather than to write it in each and every algorithm.
I am wondering, is there a way to have this working for all the algorithms in my document ?
