[翻译] [Overleaf] LaTeX 中的段落和换行

您所在的位置:网站首页 latex的换行 [翻译] [Overleaf] LaTeX 中的段落和换行

[翻译] [Overleaf] LaTeX 中的段落和换行

2024-07-01 15:28:07| 来源: 网络整理| 查看: 265

原??文:Paragraphs and new lines 译??者:Xovee 翻译时间:2020年5月24日

LaTeX 中的段落和换行

LaTeX 默认的排版已经是很好的了,不过我们有时候也需要一些定制化。本篇文章将会告诉你如何排版段落、改变文字对齐、以及添加空白的行。

文章目录 LaTeX 中的段落和换行 介绍 新段落 段落对齐(文字对齐) 段落缩进 延伸阅读

介绍

让我们用一个例子开始:

1234567891011\begin{center} Example 1: The following paragraph (given in quotes) is an example of Center Alignment using the center environment. ``LaTeX is a document preparation system and document markup language. LaTeX uses the TeX typesetting program for formatting its output, and is itself written in the TeX macro language. LaTeX is not the name of a particular editing program, but refers to the encoding or tagging conventions that are used in LaTeX documents". \end{center}

例子中的两个段落包含在一个 center 环境之中,这使环境中的文字变成居中对齐。需要注意的是,如果你想开始一个新的段落,你需要添加空白行。这是一种非常自然的做法,当然,还有其他方法。

在 Overleaf 中打开这个例子。

新段落

为了在 LaTeX 中开始一个新的段落,你需要添加空白行。还有另外一种方法:

1234This 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.

显然,\par命令可以创建新的段落。

默认情况下,段落会进行缩进,距离是当前文字大小的 1.5 倍。段落之间也不会有空白的行。下面的章节介绍如何改变段落的样式。

在 Overleaf 中打开这个例子。

段落对齐(文字对齐)

LaTeX 之中的段落是完全对齐的,例如,文字左边和右边的边距都是对齐的。如果你想改变段落的对齐方式,LaTeX 有如下几个环境:center, flushleft, flushright(center 环境如上面的例子所示)。

1234567\begin{flushleft} ``LaTeX is a document preparation system and document markup language. LaTeX uses the TeX typesetting program for formatting its output, and is itself written in the TeX macro language. LaTeX is not the name of a particular editing program, but refers to the encoding or tagging conventions that are used in LaTeX documents". \end{flushleft}

flushleft环境会将段落进行左对齐。flushright环境会将段落进行右对齐。

上面提到的环境都基于开关命令:\raggedright和\raggedleft和\centering(等同于flushleft和flushright和center)。开关命令会将命令之后的样式更改为命令所定义的样式,而让之前的样式保持不变。

更多关于文字对齐的信息请参考这篇文章。

在 Overleaf 中打开这个例子。

段落缩进

默认情况下,LaTeX 不会缩进一个章的第一个段落。而该章之后段落的缩进则取决于参数\parindent。

123456\setlength{\parindent}{10ex} This is the text in first paragraph. This is the text in first paragraph. This is the text in first paragraph. \par \noindent %The next paragraph is not indented This is the text in second paragraph. This is the text in second paragraph. This is the text in second paragraph.

该参数的默认值是由文档的类所决定的。你可以使用\setlength命令来改变段落的缩进距离。在这个例子中,命令\setlength{\parindent}{10ex}之后的段落将会有这大小为 10ex 的缩进(ex 等于当前字体下 x 的长度)。

如果你想创建一个没有缩进的段落,你可以在段落的开头使用\noindent命令。

如果你想对一个没有缩进的段落进行缩进,你可以使用\indent命令。需要注意的是,这个命令只有在\parindent不等于 0 的时候才有效。

更多的例子和信息请参考段落样式。

在Overleaf中查看这个例子

延伸阅读

更多信息请参考:

LaTeX中的长度 段落样式 换行和空白行 文字对齐 列表 粗体、斜体、下划线 一篇并不间断的LaTeX2e介绍


【本文地址】

公司简介

联系我们

今日新闻


点击排行

实验室常用的仪器、试剂和
说到实验室常用到的东西,主要就分为仪器、试剂和耗
不用再找了,全球10大实验
01、赛默飞世尔科技(热电)Thermo Fisher Scientif
三代水柜的量产巅峰T-72坦
作者:寞寒最近,西边闹腾挺大,本来小寞以为忙完这
通风柜跟实验室通风系统有
说到通风柜跟实验室通风,不少人都纠结二者到底是不
集消毒杀菌、烘干收纳为一
厨房是家里细菌较多的地方,潮湿的环境、没有完全密
实验室设备之全钢实验台如
全钢实验台是实验室家具中较为重要的家具之一,很多

推荐新闻


图片新闻

实验室药品柜的特性有哪些
实验室药品柜是实验室家具的重要组成部分之一,主要
小学科学实验中有哪些教学
计算机 计算器 一般 打孔器 打气筒 仪器车 显微镜
实验室各种仪器原理动图讲
1.紫外分光光谱UV分析原理:吸收紫外光能量,引起分
高中化学常见仪器及实验装
1、可加热仪器:2、计量仪器:(1)仪器A的名称:量
微生物操作主要设备和器具
今天盘点一下微生物操作主要设备和器具,别嫌我啰嗦
浅谈通风柜使用基本常识
 众所周知,通风柜功能中最主要的就是排气功能。在

专题文章

    CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭