[latexrefman-discuss] \centering, \raggedright, \raggedleft

Hefferon, James S. jhefferon at domain.hid
Sun Aug 23 15:39:22 CEST 2015


I ran across this issue for the case of \centering and I tried to tackle it with the text below (part of @node \centering).  Improvements would be great, of course.

Let me note that I tested each statement with a small LaTeX file, so I believe they are accurate (some of them were new to me so testing was in order).

Jim

.......................

It also does not start a new paragraph; it simply changes how @LaTeX{}
formats paragraph units.  If @code{ww @{\centering xx \\ yy@} zz} is
surrounded by blank lines then @LaTeX{} will create a paragraph whose
first line @samp{ww xx} is centered and whose second line, not centered,
contains @samp{yy zz}.  Usually what is desired is for the scope of the
declaration to contain a blank line or the @code{\end} command of an
environment such as @code{figure} or @code{table} that ends the
paragraph unit.  Thus, if @code{@{\centering xx \\ yy\par@} zz} is
surrounded by blank lines then it makes a new paragraph with two
centered lines @samp{xx} and @samp{yy}, followed by a new paragraph with
@samp{zz} that is formatted as usual.  See also the following example.

This example's @code{\centering} causes the graphic to be horizontally
centered.  

@example
\begin at domain.hid@}
  \centering
  \includegraphics[width=0.6\textwidth]@{ctan_lion.png@}
  \caption at domain.hid Lion@}  \label at domain.hid@}
\end at domain.hid@}
@end example

The scope of the @code{\centering} ends with the @code{\end at domain.hid@}}.

--------------------------------------
`Does not the Captain seek your advice, sir?'
`Not always,' said Stephen.





More information about the latexrefman mailing list