views:

36

answers:

1

Hi all, I try to layout an algorithm in pseudocode with TeX and the package "algorithmic". It gets a mess: no spaces between words, and no linebreaks. Can anyone help me out.

How do I get spacing and linebreaks into algorithmic comments?

Thanks!

Here's my TeX code:

\documentclass{llncs}
\usepackage{algorithmic}

\begin{document}
\begin{algorithmic}

\REQUIRE{ $ Some long text here. Unfortunately this text is a mess. Spaces and line breaks are missing and the text gets weird block layout when setting line breaks manually. $}
\FORALL{$i = 1 \ldots \mid L_{items}\mid $  } 
\STATE { $  i miss spaces here, too $}
\ENDFOR

\end{algorithmic}
\end{document}
+3  A: 

Well the first problem is that you have your text in dollar signs $ ... $ that means to typest it in math mode. So the spaceing would be way off. Try this

\REQUIRE{ Some long text here. Unfortunately this text is a mess. Spaces and line breaks are missing and the text gets weird block layout when setting line breaks manually. }
\FORALL{$i = 1 \ldots \mid L_{items}\mid $  } 
\STATE {   i miss spaces here, too But I can get math $x = x +1$ }
Ukko
Thanks! That's it.
Bernie
Happy to help!!
Ukko