[OS X TeX] Re : Stupid question about the tabular environment

Herbert Schulz herbs at wideopenwest.com
Sat Jan 17 15:08:34 EST 2009


On Jan 17, 2009, at 1:50 PM, Alain Schremmer wrote:

> Got curious. Seems to work … out of the box. Well, maybe 2mm off.
>
> I am sending you a screen dump offlist.
>
> TeXShop Version 2.18-svn (2.18)
> under 10.4.11
>
> Regards
> --schremmer
>
>
> On Jan 17, 2009, at 8:40 AM, ewan.Delanoy at math.unicaen.fr wrote:
>
>>> If your tabular is wider than the line so it sticks out into >the  
>>> right
>>> margin use
>>> \makebaox[\textwidth]{put your tabular here}
>>> or
>>> \makebox[\textwidth][c]{put your tabular here}
>>
>>
>>    Actually, your suggestion does not work very
>> well on my example ; I append below a "minimal"
>> file which uses \makebox and still produces
>> an unbalanced tabular (on my Mac, at least).
>>
>>                             Ewan
>>
>> *************************************************
>>
>> \documentclass[a4paper,12pt]{article}
>>
>> \begin{document}
>>
>>
>> \makebox[\textwidth][c]{\begin{tabular}{|l|p{0.5cm}|p{0.5cm}| 
>> p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}| 
>> p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|}\hline
>> & 1&2&3&4&5&6&7&8&9&10&11&12&13&14\\
>> \hline Z17(B, du 2 f\'evrier au 6 f\'evrier)& & & & & & &
>> &P2&P1&P7&P3&P5&P6&P4\\
>> \hline
>> Z18(A, du 9 f\'evrier au 13 f\'evrier)&P2&P1&P7&P3&P5&P6&P4& & & &  
>> & & & \\
>> \hline
>> Z19(B, du 16 f\'evrier au 20 f\'evrier)& & & & & & &  
>> &P4&P2&P1&P7&P3&P5&P6\\
>> \hline
>> Z20(A, du 9 mars au 13 mars)&P4&P2&P1&P7&P3&P5&P6& & & & & & & \\
>> \hline
>> Z21(B, du 16 mars au 20 mars)& & & & & & & &P6&P4&P2&P1&P7&P3&P5\\
>> \hline
>> Z22(A, du 23 mars au 27 mars)&P6&P4&P2&P1&P7&P3&P5& & & & & & & \\
>> \hline
>> Z23(B, du 30 mars au 3 avril)& & & & & & & &P5&P6&P4&P2&P1&P3&P7\\
>> \hline
>> Z24(A, du 6 avril au 10 avril)&P5&P6&P4&P2&P1&P7&P3& & & & & & & \\
>> \hline
>> Z25${}^*$(B, du 13 avril au 17 avril)& & & & & & &  
>> &P7&P5&P6&P4&P2&P1&P3\\
>> \hline
>> Z27(B, du 11 mai au 15 mai)&P3&P5&P6&P4&P2&P1&P7& & & & & & & \\
>> \hline
>> Z28${}^*$(A, du 18 mai au 22 mai)& & & & & & &  
>> &P3&P7*&P5*&P6&P4&P2&P1\\
>> \hline
>> Z29(B, du 25 mai au 29 mai)&P7&P3&P5&P6&P4&P2&P1& & & & & & & \\
>> \hline
>> Z30${}^*$(A, du 1$^{\rm er}$ juin au 5 juin)& & & & & & &
>> &P1&P3&P7&P5&P6&P4&P2\\
>> \hline
>> Z31(B, du 8 juin au 12 juin)&P1&P7&P3&P5&P6&P4&P2& & & & & & & \\
>> \hline
>> \end{tabular}
>> }
>> \end{document}
>>
>>

Howdy,

The 1-2mm offset is due to the extra space in the \makebox because of  
the extra return between the \end{tabular} and the closing } from the  
\makebox. Make the end look like

\end{tabular}}

or

\end{tabular}%
}

instead of

\end{tabular}
}

and the small offset disappears.

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)






More information about the MacOSX-TeX mailing list