Latex 多重换行符

Latex 多重换行符,latex,line-breaks,Latex,Line Breaks,我用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 我如何才能在那里获得额外的换行符,以便

我用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 

我如何才能在那里获得额外的换行符,以便在文本行之间留出空间?

插入一些垂直空间

blah blah blah \\
\vspace{1cm}

要缩放到字体,请使用
ex
(小写“x”的高度)作为单位,并且与可用的行距相关,您可能特别感兴趣。

是否希望段落之间有更多的空间?然后您可以更改参数
\parskip

例如,试试看

\setlength{\parskip}{10pt plus 1pt minus 1pt}
这意味着段落之间的间距通常为10pt,但最多可以增加或减少1pt。这意味着您可以将LaTeX更改为1pt,以实现更好的页面布局。可以删除加号和减号部分,使其始终保持指定的长度

如果您试图显示源代码,请尝试使用
清单
软件包或使用
逐字显示
。如果您试图排版伪代码,请尝试
算法
软件包。

您可以使用提供间距环境的软件包,例如:

\documentclass{article}
\usepackage{setspace}
\begin{document}
\doublespace
my line of text blah blah blah

new line of text with blank line between
\end{document}

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

换行符接受括号中的可选参数,垂直长度:

line 1
\\[4in]
line 2

为了使其在字体大小方面更具可伸缩性,您可以使用其他长度,例如
\\[3\baselineskip]
,或
\[3ex]
对于程序,您最好使用
逐字
alltt
环境,但如果您想要一个LaTeX不会抱怨的空行,请尝试

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

虽然逐字
可能是最佳选择,但您也可以尝试使用命令
\smallskip
\medskip
,或者猜猜看,
\bigskip

引述此文:

这些命令只能在以后使用 段落中断(由 一个完全空白的行或由 命令\par)。这些命令输出 弹性或橡胶空间, 大约3pt、6pt和12pt高 分别执行,但这些命令将 自动压缩或扩展文件 位,具体取决于 页面的其余部分


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

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.
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.
然而,你是正确的,乳胶只允许你这样做一次。要获得一个更通用的解决方案,允许您创建任意多的空行,请使用\null创建空段落。例如:

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.
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.
\\\\


这对pdfLatex有效。它会为您创建两行新行。

是否可以尝试仅用空格插入行

\ \\
\ \\

这对我来说很有用:

我试图在Apple Pages的新乳胶输入区留下一个空间。我输入了以下内容,它留下了一行空白


\mbox{\phantom{0}\\\

右。如果这是编程作业,即源代码,然后逐字使用。现在重复的,重复的QN可能得到更强的答案:属于,但没有办法移动它。这是我所需要的,请考虑添加评论或因为您的低信誉,这是可以理解的,你把这作为一个答案,但请尽量使其简短,如果你正在添加一个答案。谢谢