LaTeX:设置自定义行距(某些文档部分除外)

发布于 2024-07-27 05:34:26 字数 211 浏览 7 评论 0原文

我的文档中需要有 1.5 行距,但没有某些部分,如目录、标题页等。

当我使用此命令将行距设置为 1.5 时:

\renewcommand{\baselinestretch}{1.50}\normalsize

文档行距设置为 1.5。

如何从该设置中排除文档的某些部分?

感谢您的帮助!

I need to have a 1.5 line spacing within my document but without some parts like the TOC, title page etc.

When I use this command to set the line spacing to 1.5:

\renewcommand{\baselinestretch}{1.50}\normalsize

the documents line spacing is set to 1.5.

How can I exclude some parts of the document from that setting?

Thanks for your help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

弥枳 2024-08-03 05:34:26

您不必将该行放在序言中。 您可以将其放在文档正文中,就在需要不同间距的文本之前,并且 \renewcommand 行之前的所有文本将不受影响:

\begin{document}

% This text has the original line spacing.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sed ante nisi.
Nam accumsan, justo at hendrerit feugiat, urna diam elementum dolor, eu
consectetur nunc magna eu ipsum. Praesent consequat magna et lectus convallis
tempus. Nullam sed nunc augue. Vivamus a nisl vel risus condimentum posuere
aliquet ac sapien. Vestibulum ultrices sollicitudin blandit. Morbi nec augue
mauris. Praesent aliquam erat urna, condimentum semper nisi. Aenean a odio
elit. Fusce eu justo nec odio consectetur bibendum.

% This text will have 1.5 line spacing.
\renewcommand{\baselinestretch}{1.50}\normalsize

Ut vitae mauris neque, sed pellentesque urna. Mauris faucibus, augue eu
feugiat mollis, dui metus fermentum nibh, eget ultrices ipsum tortor
vehicula neque. Proin nec molestie nulla. Cras et odio in ante venenatis
tincidunt sit amet eget felis. Maecenas pretium magna vitae nibh hendrerit
nec lobortis sapien placerat. Proin diam lacus, vulputate ac commodo a,
convallis ut nunc. Sed sit amet ante purus. Integer porttitor molestie orci
ut adipiscing. Maecenas consequat turpis quis nunc fermentum cursus. Etiam
commodo justo eu nunc eleifend fringilla. Nam in neque augue, at feugiat metus.
Integer luctus risus et ipsum vulputate vulputate. Phasellus eget lectus dolor,
a pellentesque nunc. In hac habitasse platea dictumst. Duis est lorem, placerat
ut pharetra sed, sagittis at dui. Nam congue dui rhoncus urna mattis eget
vestibulum tortor feugiat. Nullam mauris sapien, sodales non rutrum imperdiet,
fermentum non nisl.

\end{document}

You don't have to put that line in the preamble. You can put it in the document body, just before the text that you need spaced differently, and all the text prior to the \renewcommand line will remain unaffected:

\begin{document}

% This text has the original line spacing.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sed ante nisi.
Nam accumsan, justo at hendrerit feugiat, urna diam elementum dolor, eu
consectetur nunc magna eu ipsum. Praesent consequat magna et lectus convallis
tempus. Nullam sed nunc augue. Vivamus a nisl vel risus condimentum posuere
aliquet ac sapien. Vestibulum ultrices sollicitudin blandit. Morbi nec augue
mauris. Praesent aliquam erat urna, condimentum semper nisi. Aenean a odio
elit. Fusce eu justo nec odio consectetur bibendum.

% This text will have 1.5 line spacing.
\renewcommand{\baselinestretch}{1.50}\normalsize

Ut vitae mauris neque, sed pellentesque urna. Mauris faucibus, augue eu
feugiat mollis, dui metus fermentum nibh, eget ultrices ipsum tortor
vehicula neque. Proin nec molestie nulla. Cras et odio in ante venenatis
tincidunt sit amet eget felis. Maecenas pretium magna vitae nibh hendrerit
nec lobortis sapien placerat. Proin diam lacus, vulputate ac commodo a,
convallis ut nunc. Sed sit amet ante purus. Integer porttitor molestie orci
ut adipiscing. Maecenas consequat turpis quis nunc fermentum cursus. Etiam
commodo justo eu nunc eleifend fringilla. Nam in neque augue, at feugiat metus.
Integer luctus risus et ipsum vulputate vulputate. Phasellus eget lectus dolor,
a pellentesque nunc. In hac habitasse platea dictumst. Duis est lorem, placerat
ut pharetra sed, sagittis at dui. Nam congue dui rhoncus urna mattis eget
vestibulum tortor feugiat. Nullam mauris sapien, sodales non rutrum imperdiet,
fermentum non nisl.

\end{document}
明月夜 2024-08-03 05:34:26

使用setspace 包。 使用命令 \singlespacing\onehalfspacing\doublespacing 更改文档中的行距。

Use the setspace package. Use the commands \singlespacing, \onehalfspacing and \doublespacing to change the line spacing in the document.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文