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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a problem with re-sizing the table in LyX. When I export it to .pdf its too wide so it goes far out of the border.

Any ideas on how to shrink it, or make it readable in .pdf?

p.s. In LyX, everything seems ok.

share|improve this question
up vote 7 down vote accepted

You could use any of the methods described in Wider tables in LaTeX, which is the best solution? Here's a LyX take on it:

Insert an ERT before your table and include the necessary LaTeX code, followed by an ERT after to complete the grouping, if necessary. For example:

enter image description here

In the LyX "LaTeX Source" window, this will result in:

a & b & c & d & e & f & g & h & i & j & k & l & m & n & o\tabularnewline
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15\tabularnewline
15 & 14 & 13 & 12 & 11 & 10 & 9 & 8 & 7 & 6 & 5 & 4 & 3 & 2 & 1\tabularnewline
4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 & 1 & 2 & 3\tabularnewline

which appropriately uses % to avoid a spurious space (as reference, see What is the use of percent signs (%) at the end of lines?). Make sure you add the package graphicx to your LaTeX preamble (Document > Settings... > LaTeX preamble).

Depending on the location of this table, you may have to prepend the ERT with \noindent. For example, inside a table environment, there is usually no indent, while inside the regular document body, indents are common. \noindent would remove this indent.

share|improve this answer
Thanks. I got it now :) – ttwis Jan 20 '13 at 14:57

Many times the problem is not the exposed by Werner of a big table with several columns that must be of reduced (also in font size in this way), but only that there are some long text in some cell that must have some line breaks, but this is not allowed by default in tabular environment.

For example, a table with big font like this:


Produce this awful result in the PDF:


To correct this, al least one column must have a defined width. Select a column in the Lyx screen and go to right-click menu -> More ... -> Configuration -> Column -> Width (or something similar, this is a translation of a LyX in Spanish).

In the above example, setting the width of the three columns to 20% of text width produce this effect in in Lyx screen and PDF view:



Another option for a minor width fix is only reduce the space between cells contents. See Table padding in LyX.

BTW, I know that the table format is ugly. I have not changed the default in LyX to focus on the width problem.

share|improve this answer

Your Answer


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.