5

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?

  • 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
6

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.

| 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. :) – imnothere Jun 4 '12 at 23:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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