在LaTeX中添加新行和新段落的最佳方法是什么?

时间:2018-04-25 00:22:20

标签: 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)"错误。开始新段落的正确方法是什么?

4 个答案:

答案 0 :(得分:1)

在你想要的代码行之后使用\ 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)

答案 1 :(得分:0)

我只是在两者之间插了一个空白。

I like sharks, sharks are cool.

Also bears are really cool.

虽然我不会担心未完成的\ hbox警告。你可能有更好的事情要做,而不是试图让所有的LaTeX警告消失。

答案 2 :(得分:0)

我还会看一下\paragraph{} command,它也可能提供段落标题。

答案 3 :(得分:0)

不确定它是否是最佳做法,但我会使用:

I like sharks, sharks are cool. \newline

Also bears are really cool.

\ newline后跟一个空行将为您提供两行之间的空格。