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.

I'm using the longtable environment with the field p{0.5\textwidth}. The text on that field is set with very odd spacing, because latex attempts to justify it both for the left and right column margins. I tried setting \raggedright for the entire document, but this has no effect on the text in the field. Can anyone suggest a quick fix?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

If you want to apply this to all p-columns you could consider this:

\usepackage[raggedrightboxes]{ragged2e}

From the documentation:

All \parboxes, minipages, \marginpars and p-columns of tabulars and arrays are automatically set using \RaggedRight.

If you want to apply \RaggedRight only to a particular column, you can insert it into its format definition: >{\RaggedRight}p{0.5\textwidth}.

share|improve this answer
1  
@Mayer See also this answer for a more localised solution (also using ragged2e). –  Alan Munn Apr 17 '11 at 5:36
    
The only problem with using ragged2e is that it seems to be incompatible with the bidi package. In my specific project, however, I didn't need to use the bidi (I load it automatically for xelatex), so I dropped it and all is working well. Thanks! –  Mayer Goldberg Apr 17 '11 at 8:38

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.