LaTeX 段落:段落缩进、段落间距、行距 |
您所在的位置:网站首页 › 正文各段落行距 › LaTeX 段落:段落缩进、段落间距、行距 |
原 文:Paragraph formatting 译 者:Xovee 翻译时间:2021年8月12日 LaTeX 段落LaTeX 默认的段落是比较容易阅读的。当然,有时候你也需要一种不同的段落样式。本文介绍如何更改默认的段落样式,例如行距等。 文章目录 LaTeX 段落介绍开始一个新的段落段落缩进段落间距行距参考指南 介绍改变某些特定元素的长度也许会改变整个文档的结构。 \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \setlength{\parindent}{4em} \setlength{\parskip}{1em} \renewcommand{\baselinestretch}{2.0} \begin{document} This is the first paragraph, contains some text to test the paragraph interlining, paragraph indentation and some other features. Also, is easy to see how new paragraphs are defined by simply entering a double blank space. Hello, here is some text without a meaning. This text should show what a printed text will look like at this... \end{document}在上面的例子中,我们使用一个空行来分割不同的段落,每个段落的第一行会有缩进,我们还设置了行距和段落之间的间距。 开始一个新的段落在 LaTeX 文档中开始一个新的段落的方式非常简单:插入一个空行。 你也可以使用另外一种方法: This is the text in first paragraph. This is the text in first paragraph. This is the text in first paragraph. \par This is the text in second paragraph. This is the text in second paragraph. This is the text in second paragraph.
默认情况下,LaTeX 不对章或者节内的第一个段落进行缩进。之后的段落的缩进大小取决于\parindent。 \setlength{\parindent}{4em} \begin{document} This is the text in first paragraph. This is the text in first paragraph. This is the text in first paragraph. \par This is the text in second paragraph. This is the text in second paragraph. This is the text in second paragraph. This is another paragraph, contains some text to test the paragraph interlining, paragraph indentation and some other features. Also, is easy to see how new paragraphs are defined by simply entering a double blank space. ... \end{document}
如果你想创建一个没有缩进的段落,在段落的开头使用\noindent命令。如果你希望文档的所有段落都没有缩进,那么将缩进的大小设置为零:\setlength{\parindent}{0pt}。 另一方面,如果你想要对一个段落进行缩进,在段落之前使用\indent命令。这个命令只有在\parindent不等于零的时候才有效。 段落间距决定段落间距的参数为\parskip,它是一个段落和之前的文字的间距大小。 \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \setlength{\parindent}{4em} \setlength{\parskip}{1em} \begin{document} This is the text in first paragraph. This is the text in first paragraph. This is the text in first paragraph. \par This is the text in second paragraph... \end{document}
LaTeX 有三个命令来控制行距,下面这个例子重定义了\baselinestretch的长度: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \setlength{\parindent}{4em} \setlength{\parskip}{1em} \renewcommand{\baselinestretch}{1.5} \begin{document} This is the text in first paragraph. This is the text in first paragraph. This is the text in first paragraph. \par This is the text in second paragraph... \end{document}
此外,还要两个参数可以影响行距: \baselineskip 控制一个段落中最后两行的最小距离。你可以在 preamble 中改变它的值:\setlength{\baselineskip}{value}。 \linespread{value} 设置行距的大小。在这里,value的大小是很有点迷惑的: Value行距1.0单倍行距1.3一点五倍行距1.6双倍行距 参考指南段落中长度的原理图: \parindent:段落缩进\parskip:段落间距 |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |