Search code examples
fontslatexorg-mode

In Org-mode, can I change the font size in a table to make it fit in the page?


I need a wide table in my PDF output, and with the default font size, the same as the normal text, it does not fit in the page width.

Is there a way in Org-mode to use a smaller font for tables? Any specific attribute?

Is there a way to center the table with respect to the page? Now it is aligned with the text margin on the left side, and goes beyond the page edge on the right side.

This is my table:

|     | columnTag1 | columnTag2 | columnTag3 | columnTag4 | columnTag5 | columnTag6 | columnTag7 | columnTag8 | columnTag9 | columnTag10 | columnTag |  
|-----+------------+------------+------------+------------+------------+------------+------------+------------+------------+-------------+-----------|  
| 0.0 | 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1.0 |  
| 0.0 | 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1.0 |  
| 0.0 | 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1.0 |  
| 0.0 | 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1.0 |  

Solution

  • It works adding the following details:

    #+LATEX: {\vspace{5mm} \small \makebox[\textwidth \vspace{5mm}][c]{
    #+ATTR_LATEX: :center nil
    |     | columnTag1 | columnTag2 | columnTag3 | columnTag4 | columnTag5 | columnTag6 | columnTag7 | columnTag8 | columnTag9 | columnTag10 | columnTag |  
    |-----+------------+------------+------------+------------+------------+------------+------------+------------+------------+-------------+-----------|  
    | 0.0 | 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1.0 |  
    | 0.0 | 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1.0 |  
    | 0.0 | 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1.0 |  
    | 0.0 | 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1.0 |  
    #+LATEX: }}
    

    This both centers the table, and uses a smaller font.