设置边距以使文本在页面上居中

设置边距以使文本在页面上居中

如何将文本置于页面中央?文本与右边距齐平。(我有更多的文本。在第二页上,文本也与右边距齐平。)

\documentclass{amsart}

\setlength{\textwidth}{6.1in}
\setlength{\topmargin}{0.0in} \setlength{\textheight}{9in}


\begin{document}


\centerline{\Large{\textbf{Distance between a Point and a Line}}} \vskip0.5in


\noindent {\bf Definition} \vskip1.25mm
\noindent \hspace*{1em}
\begin{minipage}{5.75in}
{\em $\ell$ is a line, and $P = (x_{\circ}, \, y_{\circ})$ is a point that is not on $\ell$. The {\bf distance} between $P$ and $\ell$ is the distance between $P$ and the intersection of $\ell$ and the line through $P$ that is perpendicular to $\ell$. (According to the Pythagorean Theorem, it is less than the distance between $P$ and any other point on $\ell$.)}
\end{minipage}
\vskip0.25in


\noindent {\bf Theorem} \vskip1.25mm
\noindent \hspace*{1em}
\begin{minipage}{5.75in}
{\em $\ell$ is a line, and $P = (x_{\circ}, \, y_{\circ})$ is a point that is not on $\ell$. If $Ax + By + C = 0$ is an equation for $\ell$, the distance between $P$ and $\ell$ is}
\begin{equation*}
\frac{\vert Ax_{\circ} + By_{\circ} + C \vert}{\sqrt{A^{2} + B^{2}}} .
\end{equation*}
\end{minipage}
\vskip0.2in

\noindent {\bf Demonstration} \vskip1.25mm
\noindent An equation for the line through $P$ that is perpendicular to $\ell$ is $-Bx + Ay + (Bx_{\circ} - Ay_{\circ}) = 0$, and the lines intersect at $Q = (x_{1}, \, y_{1})$ if, and only if,
\begin{equation*}
x_{1} = \frac{B^{2}x_{\circ} - ABy_{\circ} - AC}{A^{2} + B^{2}}
\qquad \text{and} \qquad
y_{1} = \frac{-ABx_{\circ} + A^{2}y_{\circ} - BC}{A^{2} + B^{2}} .
\end{equation*}
So,
\begin{align*}
\big\vert\overline{PQ}\big\vert^{2}
&= \left(\frac{B^{2}x_{\circ} - ABy_{\circ} - AC}{A^{2} + B^{2}} - x_{\circ}\right)^{2}
+ \left(\frac{-ABx_{\circ} + A^{2}y_{\circ} - BC}{A^{2} + B^{2}} - y_{\circ}\right)^{2} \\
&= \left(\frac{-A^{2}x_{\circ} - ABy_{\circ} - AC}{A^{2} + B^{2}}\right)^{2}
+ \left(\frac{-ABx_{\circ} - B^{2}y_{\circ} - BC}{A^{2} + B^{2}}\right)^{2} \\
&= \frac{(A^{2}x_{\circ} + ABy_{\circ} + AC){\vphantom{A^{2}}}^{2} + (ABx_{\circ} + B^{2}y_{\circ} + BC){\vphantom{B^{2}}}^{2}}{(A^{2} + B^{2}){\vphantom{A^{2}}}^{2}} \\
&= \frac{A^{2}(Ax_{\circ} + By_{\circ} + C)^{2} + B^{2}(Ax_{\circ} + By_{\circ} + B)^{2}}{(A^{2} + B^{2}){\vphantom{A^{2}}}^{2}} \\
&= \frac{(A^{2} + B^{2})(Ax_{\circ} + By_{\circ} + C)^{2}}{(A^{2} + B^{2}){\vphantom{A^{2}}}^{2}} \\
&= \frac{(Ax_{\circ} + By_{\circ} + C)^{2}}{A^{2} + B^{2}} ,
\intertext{and}
\big\vert\overline{PQ}\big\vert &= \frac{\vert Ax_{\circ} + By_{\circ} + C \vert}{\sqrt{A^{2} + B^{2}}} . \ \rule{1.5ex}{1.5ex}
\end{align*}
\vskip0.25in


\noindent \textbf{Quotes from Alan Shepard} \vskip1.25mm
\noindent It's a very sobering feeling to be up in space and realize that one's safety factor was determined by the lowest bidder on a government contract. \\
\noindent It's been a long way, but we're here.
\vskip0.25in

\noindent \textbf{Quotes from Yogi Berra} \vskip1.25mm
\noindent Baseball is ninety percent mental and the other half is physical.
\noindent You can observe a lot by just watching.

\end{document}

答案1

简短回答:\calclayout重置页面尺寸后添加到您的序言中。

细节: 与基本的articlebookproc类不同,ams 文档类(其中包括amsart)将页面内容在输出介质上水平居中。由于 ams 类的目标是强制执行 ams 出版样式,因此这种定位是“锁定的”,以便作者修改页面尺寸的尝试会立即被 ams 制作人员发现。

“锁定”机制是由命令调用的例程\calclayout

水平定位是通过从中减去\textwidth\paperwidth然后除以二来建立相等的侧边距来实现的。(它实际上有点复杂,因为需要进行调整以确保1in考虑到左侧的“规范”缩进,并且最后的左边距始终具有正的最小值。)

垂直定位更为复杂。规定\textheight 被认为包括\headheight\headsep,因此从中减去它们\textheight。使用 \topmargin作为“临时尺寸”进行进一步计算。首先将其设置为\paperheight,然后依次减少\textheight\headheight\headsep。将剩余部分除以二并进行调整以考虑“规范”1in顶部边距,再次强制执行最小最终顶部边距。

如果用户希望重置页面大小,使内容水平居中,则需要调用\calclayout。但由于垂直定位的计算方式,除非重置所有组件,否则不能保证顶部和底部边距相等,尽管它们之间的差异不会很大,因为默认的\headheight\headsep很小。

因此,作为第一步,只需\calclayout在重置\textheight和后添加\textwidth,检查输出(整页,通常不是第一页),如果定位不符合您的喜好,也请重置 \headheight\headsep(如果不是信纸尺寸或,则重置和纸张尺寸 a4)。

geometry包与 ams 文档类不兼容。通常不会报告任何实际错误,但结果可能不是所希望的。

相关内容