我有一个段落。它以 \begin{gather*} 开头,然后每行都有一个 \text{...},然后是 \end{gather*}。我想知道是否有更简单的方法来制作一个考虑到空格、缩进等的段落。
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}
\centering
\begin{gather*}
\text{Ecliptic and Equatorial Planes Explained}
\\
\text{The distance from the Sun and Earth is iconic. It is the basic for calculations of other bodies in the solar System and beyond and is the average of the largest and the smallest part of Earth orbit.}
\\
\end{gather*}
\end{document}
对于 {gather*} 我有那些选项可以选,这样我就不用为每一行都写 \text 从而得到空格了?
答案1
只有当环境包含的大部分内容都是数学内容时,才应该使用此类环境gather*
。但这里的情况似乎并非如此。
我认为您想要将文本材料居中设置。 (如果不是这种情况,请告知...)我能想到两种实现排版目标的方法:
使用
center
环境。优点:非常简单
缺点:解释段落中的材料看起来非常“参差不齐”,因为没有努力(大致)均衡行长
使用一个
tabularx
环境,将单列设置为以其材料为中心,以使行长度大致平衡。优点:内容大致平衡
缺点:设置工作比
center
环境所需的稍微多一些。
\documentclass{article}
\usepackage{tabularx,ragged2e}
\newcolumntype{C}{>{\Centering\arraybackslash}X}
\begin{document}
\hrule % just to illustrate width of textblock
\begin{center}
Ecliptic and Equatorial Planes Explained
The distance between the Sun and Earth is iconic. It is the basis for
calculations of other bodies in the solar system and beyond and is
the average of the largest and the smallest part of Earth orbit.
\end{center}
\medskip\noindent
\begin{tabularx}{\textwidth}{C}
Ecliptic and Equatorial Planes Explained\\
The distance between the Sun and Earth is iconic. It is the basis for
calculations of other bodies in the solar system and beyond and is
the average of the largest and the smallest part of Earth orbit.
\end{tabularx}
\end{document}
哪种方法更适合您的特定文档取决于您想通过居中布局实现什么目的。