Is it possible to have "if .. then .. else" in a single line?
I am looking for ways to condense simple conditional statements that is taking much space in my write-up. So, any help is appreciated.
\documentclass[conference]{IEEEtran}
\usepackage{amsmath}
\usepackage{algorithm}
\usepackage{algorithmicx}
\usepackage[noend]{algpseudocode}
\begin{document}
\title{HOWTO Single Line If Then Else}
\author{Author}
\maketitle
\begin{abstract}
This is an abstract.
\end{abstract}
\hspace{10pt}
\begin{IEEEkeywords}
a, b, c, d.
\end{IEEEkeywords}
\IEEEpeerreviewmaketitle
\section{Introduction}
\begin{algorithm}
\caption{Single line IF THEN ELSE}\label{alg:IfThenElse}
{\fontsize{8}{8}\selectfont
\begin{algorithmic}[1]
\If {$\text{foo} \leq \text{bar}$} $doh$ = 0
\Else {} $\text{duh}$ = 1
\EndIf
\end{algorithmic}
}
\end{algorithm}
\end{document}