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 have problem with some of the longtable tables, as illustrated here:

Is there an easy way to make table wrap cell contents multi-line so that it does not exceed page margins?

share|improve this question
2  
Please provide a minimal working example (MWE) the duplicates this problem. That way community members can identify the problems much easier and hit the ground running. Specific to this example, you mention \multicolumn although it seems like you only have two columns in your longtable. Is there any addition (invisible) columns to your longtable? –  Werner Jun 4 '12 at 23:24
    
TeX file was auto-generated by Sphinx. Here is sample that produced above table: pastebin.com/88qjEfdG –  bmatt Jun 4 '12 at 23:36
    
Using the p{<width} column type should fix it. The l column type does not allow for line wrapping. –  Peter Grill Jun 4 '12 at 23:37
add comment

1 Answer

up vote 6 down vote accepted

longtable column specifiers are exactly the same as standard latex tabular ones (or the extended set from the array package. so change l to p{3cm} and it will wrap the lines in that column to the specified width.

share|improve this answer
    
It would be really nifty if one could use a X column type. –  Werner Jun 4 '12 at 23:48
    
@Werner The ltxtable package combines longtable and tabularx functionalities, and lets you do just that. :) –  LianTze Lim Jun 4 '12 at 23:54
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.