[tex-live] \pdfdecimaldigits=3

The Thanh Han hanthethanh at gmail.com
Thu Jan 21 11:20:48 CET 2016


On 20 January 2016 at 05:08, Reinhard Kotucha <reinhard.kotucha at web.de>

> On 2016-01-19 at 23:50:13 +0000, Karl Berry wrote:
>  > Hi David,
>  >
>  >     Currently pdftexconfig.tex sets \pdfdecimaldigits=3
>  >     In other words was there a particular reason to choose 3....
>  >
>  > Not that I know of, but then I probably wouldn't know.  (Ross, Thanh?)
>  >
>  > However, in any case ... changing it at this late date would mean, I
>  > think, that most PDF output from pdftex would be gratuitiously different
>  > from what was produced before.  That doesn't sound like a good outcome.
>  > On the badness scale, I'd say that's rather worse than not being able to
>  > share settings ... -k
> AFAIR Hartmut Henkel investigated a decade ago and came to the
> conclusion that more than 3 decimal digits don't make sense.
> As far as the backend is concerned, it sounds reasonable.  PDF's unit
> is a "big point", and with
> ​​
> \pdfdecimaldigits=3 the resolution in the
> PDF file is about 0.3µm.  This should be sufficient in most cases.
> If it's not sufficient in a particular case, the configuragtion can be
> changed.

\pdfdecimaldigits=3 ​was a decision that makes sense for most cases. A
larger value
results in bigger pdf output without visible change to human eyes.

> Hans said that many transformations are involved.  Sure, if too many
> "cm" ("concat" in PostScript) operations are written to the PDF file,
> rounding errors add up.

​yes, this is a valid case where it makes sense
 to have ​

​larger \​

> Hans distinguishes between LuaTeX internals and the (PDF) backend.
> So what does \pdfdecimaldigits actually control?  Since LuaTeX is
> written in C I would expect that numbers are either floats, doubles,
> or integers internally and numbers are represented with a reasonable
> resolution.
> Does \
> ​​
> pdfdecimaldigits really control how numbers are processed in the
> innards of LuaTeX?  That would be strange.
> If
> ​​
> \pdfdecimaldigits only controls how numbers are represented in a
> PDF file,

When outputting a dimen to PDF, ​pdftex rounds the value represented in
point by tex to a real number in PDF, and
 \pdfdecimaldigits says how
many digits can be after the the decimal point. The differences between the
outputted value in PDF  and the desired value (in scaled point) are
tracked, in order
to minimize the accumulation of rounding errors.

Example (roughly):

- pdftex needs to move the pen to the right by 123456 sp

- convert to bp: 123456 sp = (123456/65536)*(7200/7227) =

- \​pdfdecimaldigits​​=3 => outputted value: 1.877

- pdftex takes into account that the pen was moved to the right by
  1.877bp = 1.877*(7227/7200)*65536 = 123472.36352 = 123472 sp

- the difference (123456 - 123472) will be considered when  the next pen
movement comes

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/tex-live/attachments/20160121/8e3e129b/attachment-0001.html>

More information about the tex-live mailing list