[XeTeX] page size of pdf file

Ross Moore ross at ics.mq.edu.au
Mon Oct 19 00:32:21 CEST 2009


Hi again,

On 19/10/2009, at 7:29 AM, Ross Moore wrote:

> I get the discrepancy too now.
> The scale factor is:  ~ 0.99626
> which is the conversion between scaled-points and big-points.
>
> I'm trying to see how to force this extra scaling to occur,
> using the macros provided in LaTeX's  graphics.sty .


Here's how to remove the discrepancy:

      \piccommand
     }\dimen0=\wd0 \dimen2=\ht0
    \edef\next{\egroup
%     \def\noexpand\Gin at urx{\strip at pt\dimen0}%   replace these 2 lines
%     \def\noexpand\Gin at ury{\strip at pt\dimen2}%   with the 2 that follow
      \def\noexpand\Gin at urx{\the\dimen0}%
      \def\noexpand\Gin at ury{\the\dimen2}%
      }%
   \next
   \Gin at defaultbp\Gin at llx{0}%
   \Gin at defaultbp\Gin at lly{0}%
   \expandafter\Gin at defaultbp\expandafter\Gin at urx\expandafter{\Gin at urx}%
   \expandafter\Gin at defaultbp\expandafter\Gin at ury\expandafter{\Gin at ury}%


The difference occurs due to the last 2 lines, which provides a way
to scale into big-points, using the factor: 72/72.27 ~ .996264

It seems that this conversion is always needed, for reasons that
I don't fully yet understand. However, I think it is related to coding
that implements viewports and clipping, which may be assuming that
lengths are expressed in big-points.
Hence the image's size must also be recorded this way.

Anyway, with this change to  xetex.def  I now get the following,
for including a PDF file that was created using XeTeX :

XeTeX —  plain: 597.5022pt, 844.9768pt
XeTeX —  latex: 597.50073pt, 844.97475pt
pdfTeX — latex: 597.50082pt, 844.97478pt

BTW,  graphicx.sty  hard-codes a scale-factor of .99626 .
On my machine, changing this to  .996264  had no effect,
whereas changing to  .99627  did have an effect.
So it seems that there is a boundary to the precision that
can be obtained, and that the 6th decimal place is on the
wrong side of this boundary.




>>> The LaTeX "graphics driver" is just an interface to the
>>> XeTeX primitive, so both *should* give the same result

It seems that LaTeX is imposing a measured width and height
on an \hbox which encloses the actual image, and also
some \special commands to control graphics effects such
as scaling/rotation/clipping, etc. even when these are trivial.

In calculating this height and width, there is some small
inaccuracy, which hopefully is not perceptible in the final PDF.


>>> --- unless somehow an extra space character is getting
>>> inserted somewhere. If this is so, then it's not happening
>>> in my version of  xetex.def . Send me what you have, so that
>>> I can do a  diff  to check whether somehow it has become
>>> different after packaging and unpacking again.
>>
>> I just downloaded xetex.def from CTAN again, but I still
>> get different sizes.
>>
>> CTAN:macros/latex/contrib/xetex-def/xetex.def
>>
>>
>> Can anyone reproduce the size discrepancies that I get?
>>
>>
>> Ciao
>> Andreas


BTW, does anyone (JK ??) know whether viewports and clipping can
be supported by XeTeX yet ?

There has been no reply about this to a message from May 2009:


>>>> 	From: 	  mpg at elzevir.fr
>>>> 	Subject: 	[XeTeX] Why 'Package xetex.def Warning: No clipping  
>>>> support in XeTeX yet'?
>>>> 	Date: 	25 May 2009 4:38:41 AM
>>>> 	To: 	  xetex at tug.org
>>>> 	Reply-To: 	  xetex at tug.org
>>>>
>>>> Hi,
>>>>
>>>> While using graphicx with xelatex and trying to use the clip  
>>>> option, I got the
>>>> message:
>>>>
>>>> Package xetex.def Warning: No clipping support in XeTeX yet
>
>

If this can be done now, it seems a good time to fix  xetex.def
to add the required code-hooks.


Cheers,

	Ross


------------------------------------------------------------------------
Ross Moore                                       ross at maths.mq.edu.au
Mathematics Department                           office: E7A-419
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------





More information about the XeTeX mailing list