首页 > 解决方案 > 在 LaTeX 中添加新行和新段落的最佳方法是什么?

问题描述

我目前正在写一份报告,其中我写了这样的新段落:

I like sharks, sharks are cool.

Also bears are really cool.

这之间基本上有一条完全空的线。为了创建一个新段落,我使用“\”代码:

I like sharks, sharks are cool. \\
Also bears are really cool.

然而,这会产生“Underfull \hbox (badness 10000)”错误。开始新段落的正确方法是什么?

标签: latex

解决方案


在你希望有一个新段落的代码行之后使用 \par

I like sharks, sharks are cool. \par
Also bears are really cool.

https://www.sharelatex.com/learn/Paragraphs_and_new_lines

如果您正在寻找换行符,请访问这里 https://www.sharelatex.com/learn/Line_breaks_and_blank_spaces

你有几个选择

\\ (two backslashes)
\newline
\hfill \break
\vspace{5mm}
Inserts a vertical spaces whose length is 5mm. Other LATEX units can be used with this command.
\vfill
Inserts a blank space that will stretch accordingly to fill the vertical space available. That's why the line "Text at the bottom of the page." is moved to the bottom, and the rest of the space is filled in.    
\smallskip
Adds a 3pt space plus or minus 1pt depending on other factors (document type, available space, etc)
\medskip
Adds a 6pt space plus or minus 2pt depending on other factors (document type, available space, etc)
\bigskip
Adds a 12pt space plus or minus 4pt depending on other factors (document type, available space, etc)

推荐阅读