Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

What is the difference between flushright and raggedleft?

share|improve this question
add comment

2 Answers

up vote 25 down vote accepted

\begin{flushright}...\end{flushright} is the environment form of \raggedleft. They are the equivalent of \begin{center}...\end{center} and \centering, respectively. Here's an example using the two:

\documentclass[twocolumn]{article}
\usepackage{lipsum}
\listfiles\begin{document}
\lipsum[1]
\begin{flushright}\lipsum[2]\end{flushright}
\lipsum[3]

\newpage
\lipsum[4]
{\raggedleft\lipsum[5]\par}
\lipsum[6]
\end{document}

In particular, note the extra space around flushright.

share|improve this answer
    
Thanks. Yes, I noted the extre scpace and that's why I was asking. –  pluton Oct 1 '10 at 13:06
add comment

The environments internally are based on a list (exactly a »trivlist«) with fixed list parameters. That's why they cause the extra vertical space before and behind that Will mentioned. The amount of this space is determined by the length \topsep. Regarding the center environment this can be very annoying when used to center float objects.

share|improve this answer
8  
Which is why you should use \centering to centre floats rather than {center}. (Or, better, use something like floatrow to automatically centre them.) –  Will Robertson Oct 1 '10 at 8:17
    
Yes, and I should have added that. –  Thorsten Donig Oct 1 '10 at 8:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.