开发者

TeX/LaTeX algorithmic package issue

开发者 https://www.devze.com 2023-01-03 12:01 出处:网络
I try to layout an algorithm in pseudocode with TeX and the package \"algorithmic\". It gets a mess: no spaces between words, and no lin开发者_Go百科ebreaks. Can anyone help me out.

I try to layout an algorithm in pseudocode with TeX and the package "algorithmic". It gets a mess: no spaces between words, and no lin开发者_Go百科ebreaks. 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}


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$ }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号