[pdftex] pdftex Digest, Vol 184, Issue 1

Doug McKenna doug at mathemaesthetics.com
Mon Mar 27 03:29:11 CEST 2023


Isn't "px" the CSS unit for one pixel, with unknown size?  Or, if printing, 1/96th of a PostScript ("bp") point?

See <https://www.w3.org/Style/Examples/007/units.en.html>

If that's the case, I don't quite get why

*\message{\number\dimexpr10px}

prints

657820

which seems too large if a single "px" is 1/96 of an inch.

If a "px" is 1/96 of an inch, the numbers should be

10px=493363 10bp=657817 1bp=65781 1px=49336

TeX engines initialize their conversion factors ("pt", "in", "cm", "sp", etc.) using ratios of integers.  What ratio is being used for "px" conversion?

If "px" means 1/96 of an inch, the ratio would be 7227 / (100 * 96), which is what results in the above "1px=49336" answer.

Or is this particular conversion dependent on some other interpreter state?

Which TeX engine is "px" as a units of dimension suffix first implemented in?


Doug McKenna


----- Original Message -----
From: pdftex-request at tug.org
To: "pdftex" <pdftex at tug.org>
Sent: Sunday, March 26, 2023 4:00:02 AM
Subject: pdftex Digest, Vol 184, Issue 1

Send pdftex mailing list submissions to
	pdftex at tug.org

To subscribe or unsubscribe via the World Wide Web, visit
	https://tug.org/mailman/listinfo/pdftex
or, via email, send a message with subject or body 'help' to
	pdftex-request at tug.org

You can reach the person managing the list at
	pdftex-owner at tug.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of pdftex digest..."


Today's Topics:

   1. 1px is not 1bp which seems to contradict the pdftex manual (jfbu)


----------------------------------------------------------------------

Message: 1
Date: Sat, 25 Mar 2023 20:26:28 +0100
From: jfbu <jfbu at free.fr>
To: pdftex at tug.org
Subject: [pdftex] 1px is not 1bp which seems to contradict the pdftex
	manual
Message-ID: <545D51CE-ED9E-482F-9DF0-E39DC1401566 at free.fr>
Content-Type: text/plain;	charset=utf-8

Hi,

(please CC if replying)

The pdftex manual says 

The default value of \pdfpxdimen is 1 bp, corresponding to a pixel density of 72 dpi.

I thus expected 1px by default to be as 1bp but it is not:

$ rlwrap pdftex
This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded format=pdftex)
 restricted \write18 enabled.
**\relax
entering extended mode

*\message{\number\dimexpr10px}
657820
*\message{\number\dimexpr10bp}
657817
*\message{\number\dimexpr1bp}
65781
*\message{\number\dimexpr1px}
65782
*\message{\number\pdfpxdimen}
65782
*\bye

with luatex both 1px and 1bp map to 65781sp.

I don?t know if other engines support px.

I tried also with TL2019 and got same result.

Best,

Jean-Fran?ois




End of pdftex Digest, Vol 184, Issue 1
**************************************


More information about the pdftex mailing list.