乳胶多行突破

我使用LaTeX来编写类的编程作业。 我需要这样做:

my line of text blah blah blah new line of text with blank line between 

我知道我可以使用双斜杠来打破线条,但是LaTeX只会采取第一个换行符(抱怨更多)并开始一个新行,它会产生这样的结果:

 my line of text blah blah blah new line of text with blank line between 

我怎么能在那里得到额外的线路突破,所以我可以在我的文本行之间有空格?

你想要更多的段落之间的空间? 然后你可以改变参数\parskip

例如,尝试

 \setlength{\parskip}{10pt plus 1pt minus 1pt} 

这意味着段落之间的空间通常是10pt,但可以增长或缩小达1pt。 这意味着您可以将LaTeX更改为1pt,以实现更好的页面布局。 您可以删除正和负部分,使其始终您指定的长度。

如果您尝试显示源代码,请尝试listings包或verbatim使用。 如果您尝试排版伪代码,请尝试使用algorithm包。

换行在括号中接受一个可选的参数,垂直长度为:

 line 1 \\[4in] line 2 

为了使字体大小更具可扩展性,您可以使用其他长度,例如\\[3\baselineskip]\\[3ex]

插入一些垂直空间

 blah blah blah \\ \vspace{1cm} 

要缩放到字体,请使用ex (小写“x”的高度)作为单位,并且存在与可用行距有关的各种预定义长度 ,您可能对baselineskip特别感兴趣。

对于程序来说,你最好在verbatimalltt环境,但如果你想要一个空白的行,乳胶不会婊子,尝试

 my line of text blah blah blah\\ \mbox{ }\\ %% space followed by newline new line of text with blank line between 

你可以使用提供间隔环境的setspace包,例如:

 \documentclass{article} \usepackage{setspace} \begin{document} \doublespace my line of text blah blah blah new line of text with blank line between \end{document} 

或者使用verbatim环境来精确控制代码的布局。

我发现当我在\\后在源代码中包含空白行时,我的输出中也会出现一个空行。 例:

 It's time to recognize the income tax as another horrible policy mistake like banning beer, and to return to the tax policies that were correct in the Constitution in the first place. Our future depends on it. \\ Wherefore the 16th Amendment must forthwith be repealed. 

然而,你是正确的,乳胶只允许你这样做一次。 对于更为一般的解决scheme,可以根据需要制作尽可能多的空行,使用\ null可以创build空白段落。 例:

 It's time to recognize the income tax as another horrible policy mistake like banning beer, and to return to the tax policies that were correct in the Constitution in the first place. Our future depends on it. \null \null \null Wherefore the 16th Amendment must forthwith be repealed. 

虽然verbatim可能是最好的select,但您也可以尝试命令\smallskip\medskip \smallskip或猜测\bigskip

引用此页面 :

这些命令只能在段落中断之后使用(由一个完全空白的行或\ par命令)。 这些命令分别输出灵活的或橡皮的空间,大约分别为3pt,6pt和12pt,但这些命令会自动压缩或扩展一点,这取决于页面其余部分的需求

\\\\

这适用于pdfLatex。 它会为您创build2个新行。