我尝试使用TeX和包“算法”在伪代码中布局算法。它变得一团糟:单词之间没有空格,也没有换行符。谁能帮我吗。
如何将间距和换行符添加到算法注释中?
谢谢!
这是我的TeX代码:
\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}
答案 0 :(得分:3)
第一个问题是你的文字是美元符号$ ... $
,这意味着要在数学模式下输入它。因此,太空将是远离的。试试这个
\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$ }