I am using algorithm2e to create pseudocode for my document. However, it has it so that the conditions in if clauses are italicised.
This solution suggests putting an \upshape in each if condition. Is there a permanent fix to set the if condition to never be italics?
For example
\documentclass{article}
\usepackage{algorithm2e}
\begin{document}
\begin{algorithm}
\Begin{
Flag $\leftarrow$ True\;
\If{Flag}{
DoSomething()\;
}
}
\end{algorithm}
\end{document}
I don't want Flag to be italicised without having to put an \upshape in the condition, or have to do multiple fixes for each condition in an algorithm.