1

我尝试使用 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}
4

1 回答 1

4

那么第一个问题是你的文本用美元符号$ ... $表示,这意味着在数学模式下打字。所以间隔会很远。试试这个

\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$ }
于 2010-06-16T13:44:01.193 回答