Text FormattingRegarding proper spacing in algorithmic

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
manishokade
Posts: 1
Joined: Tue Jan 03, 2012 11:06 am

Regarding proper spacing in algorithmic

Post by manishokade »

Hello

Iam writing a pseudocode using the algorithm and algorithmic packages. The IF statement which in my case is a bit lenghty is going to the newline and not giving proper indentation. Iam using the two column format for writing the paper. Iam giving the code snippet.

Code: Select all

\usepackage{algorithm}

\usepackage{algorithmic}


\begin{document}

\begin{algorithm}
\caption{Algo 1}
\label{alg}
\begin{algorithmic}[1]

\STATE Initialize $iFinalMM \leftarrow 0$,
\FOR{$i=1$ to $A/2$}
\FOR{$i=1$ to $B/2$}
        \IF {$iTestAC\neq0 \&\& iTestBC\neq0 \&\& iTestCA\neq0$}
                \STATE $iFinalMM \leftarrow 1$
        \ENDIF
\ENDFOR
\ENDFOR

\end{algorithmic}
\end{algorithm}

\end{document}


Thanks in advance

regards

manish
Last edited by Stefan Kottwitz on Tue Jan 03, 2012 11:27 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Post Reply