作者Hoare (boring)
看板LaTeX
标题[问题] 缩排问题
时间Thu Apr 26 05:19:28 2007
我想要在figure中写一段演算法
---------------------------------- %这是水平线
for(int i=0:n)
i++;
end
---------------------------------- %这是水平线
figure 1: A simple algorithm
我的tex如下
\documentclass{article}
\begin{document}
\begin{figure}
for(int i=0:n)\\
~~i++\\
end\\
\caption{A simple algorithm}
\end{figure}
\end{document}
但i++好像那里好像不能插入空白,但如果把~~放在for前面,它就真的会有两个空白
请问要怎麽修改呢?还有要怎麽弄出水平线呢?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 203.70.105.251