LaTeX中的段落设置 | 您所在的位置:网站首页 › 情况说明内容字体行距 › LaTeX中的段落设置 |
各种长度参数
参数名称含义默认值\parindent首行缩进15.0pt\leftskip左缩进15.0pt\rightskip右缩进15.0pt\baselineskip基本行距12.0pt (字号10pt的1.2倍)\parskip段间距0.0pt plus 1.0pt\lineskip见下图\lineskiplimit见下图
参考《Ishort 6.02》表5.6 在latex中可以通过命令 \the 输出各种参数,如下面的代码 The \texttt{\textbackslash parindent} is \the\parindent. \par The \texttt{\textbackslash leftskip} is \the\leftskip.\par The \texttt{\textbackslash rightskip} is \the\rightskip.\par \vspace{2ex} The approximate font size is \the\fontdimen6\font.\par \vspace{2ex} The baseline skip is \the\baselineskip.\par The line skip is \the\lineskip.\par The line skip limit is \the\lineskiplimit.\par \vspace{2ex} The \verb|\parskip| is \the\parskip.输出的效果为 LaTeX \LaTeX LATEX 默认在 \chapter、\section 等章节标题命令之后的第一段不缩进(如果是直接开始文本写作而没有标题,那第一段则有缩进)。如果不习惯这种设定,可以调用 indentfirst 宏包,令第一段的首行缩进照常。 即直接在导言区添加如下宏包即可 \usepackage{indentfirst}缩进的长度由parindent参数规定。如果想要修改,方法为 \setlength{\parindent}{⟨length⟩} 关于 \indent 和 \noindent在设置段落首行缩进时,\indent 和 \noindent 两个参数也常被提及。如果需要在某一段 不缩进,可在段落开头使用\noindent 命令。相反地,\indent 命令强制开启一段首行缩进的 段落。在段落开头使用多个\indent 命令可以累加缩进量。 但是,如果是想用这种方式在章节标题命令之后的第一段设置缩进,需要写连续两个\indent。 而从第二段开始,默认就是长度为 \parindent 的缩进,此时如果写一个 \indent 也是没有效果的。 以下面设置为例 \documentclass{article} \begin{document} The parindent is \the\parindent. \section{Indent} \indent \indent This is a paragraph without indentation. This is a paragraph without indentation. This is a paragraph without indentation. This is a paragraph with manual indentation. This is a paragraph with manual indentation. This is a paragraph with manual indentation. \indent This is a paragraph with manual indentation. This is a paragraph with manual indentation. This is a paragraph with manual indentation. \indent \indent This is a paragraph with manual indentation. This is a paragraph with manual indentation. This is a paragraph with manual indentation. \noindent This is another paragraph without indentation. This is another paragraph without indentation. This is another paragraph without indentation. \end{document}显示效果为 这部分内容参考《Ishort 6.02》5.3.2节和刘海洋书2.1.4节。 行距最初引起困惑的地方是在于 \setstretch{2} 和 \doublespacing 两个命令实现的效果不一样,从而引发了对行距含义的困惑。 简单说来,缺省的基础行距是1.2 倍字号大小,因此使用 \setstretch{2} 意味着最终行距为 2.4 倍的字号大小,而要想设置成和 \doublespacing 相同的效果,则需要设置为 \setstretch{1.667} ,因为 2/1.2=1.667。 下面详细解释。 行距基本含义行距的基本含义可以通过下面这张图解释: 这几个命令则是指行距相比字号尺寸的倍数。所以说 \doublespacing 相当于是设置行距为 20pt。 如果想要显示效果相同,也就需要设置 \setstretch 的因子为 20pt/12pt=1.667。 一般来说,目前大多数英文latex模板字号为 10pt(对应Word中的五号字体),行距设置为 20pt 是比较好看的,即使用 \doublespacing 即可。但如果字号为 12pt(对应Word中的小四字体),行距可能要设置为 \setstretch{2} 更为合适。具体根据实际情况调整。 需要补充说明的是,Word中的字号如果采用数字的话单位是磅bp,而不是这里的pt。因此在Word中,五号字体对应数字是10.5,而小四字体对应的数字是12。 另外按照刘海洋书中的说法,Word中的n倍行距的概念也是加之于基本行距的因子。但自己没有细究Word中的基本行距概念,毕竟Word在这类问题上过于“灵活”(概念含混不清),一个“是否对齐网格”就把行距的概念全整乱了。 全局行距的设置上面的 \setstretch 命令需要 setspace 宏包。需要注意的是,默认情况下该宏包可能导致公式前后间距较大,因此建议调用该宏包时设置为 \usepackage[nodisplayskipstretch]{setspace}可以一定程度上缓解公式前后间距过大的问题。 其实还可以使用 \linespread{⟨factor⟩} 命令,这个命令可以直接使用,不需要额外宏包。这个命令的详细用法可参考《Ishort》。 局部行距的设置感觉这种需求应该不是很多。具体参考《Ishort》。注意 \par 命令的位置要在中括号内而不能在中括号外。 实现的效果为 段落间的垂直间距为\parskip,如设置段落间距在0.8ex 到1.5ex 变动: \setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}如果我们想要人为地增加段落之间的垂直间距,可以在两个段落之间的位置使用\vspace 命令: A paragraph. \vspace{2ex} Another paragraph. |
CopyRight 2018-2019 实验室设备网 版权所有 |