How do I center the text on the page? The text is flush against the right margin. (I have more text. On the second page, the text is also flush against the right margin.)


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


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

\noindent {\bf Definition} \vskip1.25mm
\noindent \hspace*{1em}
{\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$.)}

\noindent {\bf Theorem} \vskip1.25mm
\noindent \hspace*{1em}
{\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}
\frac{\vert Ax_{\circ} + By_{\circ} + C \vert}{\sqrt{A^{2} + B^{2}}} .

\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,
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}} .
&= \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}} ,
\big\vert\overline{PQ}\big\vert &= \frac{\vert Ax_{\circ} + By_{\circ} + C \vert}{\sqrt{A^{2} + B^{2}}} . \ \rule{1.5ex}{1.5ex}

\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.

\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.

  • 2
    Add \calclayout before \begin{document}.
    – egreg
    Jun 22, 2015 at 22:01
  • 1
    \centerline, \bf and \vskip shouldn't be used in latex (and \noindent only rarely) Jun 22, 2015 at 22:10
  • 2
    @Adelyn \calclayout is for centering the text block on the page. It has nothing to do with the typesetting of paragraphs in the text. Why are you talking about a play and show a mathematical text? Please, change your question so it reflects what you're about.
    – egreg
    Jun 22, 2015 at 22:45
  • 1
    The text block is the total area available for regular content on the page. In your document this is 6.1in wide and 9in high. This allows margins around the page - left margin, right margin, top and bottom. Regular content goes in the text block. Page numbers and headers etc. may go outside the text block. Think about a novel. The text block is where all the stuff you read is. The page numbers and headers are outside this. If you centre the text block, the margins are made equal i.e. left margin = right margin etc. Centring particular bits of text within the text block is different.
    – cfr
    Jun 23, 2015 at 0:40
  • 2
    @cfr -- texdoc amsclass is the correct reference. even there, \calclayout isn't very well documented. the general layouts of ams document classes weren't really meant to be tinkered with by anyone who wasn't familiar with the "internal" coding; it was both a policy decision and a practical one based on the (at the time) limited memory space. (it has also been a thorn in our side.) i'll write an answer. Jun 23, 2015 at 13:34

1 Answer 1


short answer: add \calclayout to your preamble after resetting the page dimensions.

details: unlike the basic article, book and proc classes, ams document classes (among them amsart) horizontally center the contents of the page on the output medium. since a goal of the ams classes is to enforce ams publication style, this positioning is "locked in" so that attempts by authors to modify page dimensions will be immediately obvious to the ams production staff.

the "lock-in" mechanism is a routine called by the command \calclayout.

the horizontal positioning is accomplished by subtracting the \textwidth from the \paperwidth, and dividing by two to establish equal side margins. (it's actually a bit more complicated, as adjustments are made to ensure that the "canonical" 1in indentation to the left is taken into account, and that the final left-hand margin always has a positive minimum value.)

vertical positioning is more complicated. the prescribed \textheight is assumed to include the \headheight and \headsep, so those are subtracted from \textheight. further calculations are made using the \topmargin as the "scratch dimension". first this is set to the \paperheight, and then decreased in turn by \textheight, \headheight, and \headsep. what remains is divided by two and adjusted to take into account the "canonical" 1in top margin, again enforcing a minimum final top margin.

if a user wishes to reset the page size so that the contents are centered horizontally, it's necessary to call \calclayout. but owing to the way the vertical positioning is calculated, unless all the components are reset, it's not guaranteed that the top and bottom margins will be equal, although the difference between them will not be great, since the default \headheight and \headsep are small.

so, as a first cut, simply add \calclayout after resetting \textheight and \textwidth, examine the output (of a full page, not usually the first page), and if the positioning is not to your liking, also reset \headheight and \headsep (and the paper dimensions if not lettersize or a4).

the geometry package is not compatible with the ams document classes. usually, no real errors will be reported, but the results are not likely to be what is wanted.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .