I need create a table in a document with a width of exactly 24cm. Print will be A4 – landscape (in EU if it matters). Is there some way set it?
If I set:
\usepackage[a4paper,landscape,top=0cm, bottom=0cm, left=0cm, right=0cm]{geometry}
then my \textwidth
is 29.69577cm.
EDIT (I forgot):
when I set:
\usepackage[a4paper,landscape,textwidth=24cm]{geometry}
then my \textwidth
is 23.99658cm
I want to use this later on:
\begin{tabular*}{\textwidth}
I am doing somethig wrong?
Best Answer
First case:
The margins are zero, thus the text width equals the paper width:
Conversion to cm:
Result (gcalculator): 29.6999996347 cm
Result (perl1): 29.6999996347032 cm
This is pretty close to the
29.7 cm
of the longer side of A4 paper.TeX's accuracy is limited by it smallest unit: 1 sp
Specifying 297 mm instead of 29.7 cm improves the accuracy:
Result:
Conversion to cm (perl): 29.6999996347032 cm
(By adding 1 sp this can be made larger and a tiny little bit closer to 29.7 cm.)
Second case:
Result:
Conversion to cm (perl): 23.9999995876574 cm
Again very close to 24 cm, the greatest value ≤ 24 cm in TeX. (It could made be closer to, but larger as 24 cm by adding 1 sp.)
Calculations in TeX
A scaling operation (multiplication followed by division) in e-TeX's
\...expr
commands provide the best accuracy, from the e-TeX manual:Also e-TeX's
\...expr
commands round the result rather than truncate it to fit the result in TeX's internal sp scala.Second case as example:
The real numbers 2.54 and 72.27 are multiplied by 100 to get an integer for the divisor.
\strip@pt
removes thept
at the end. Result:1
perl -e 'print 845.04684/72.27*2.54'