[XeTeX] Xetex equiv to luatex's \directlua{}

maxwell maxwell at umiacs.umd.edu
Fri Mar 23 22:49:43 CET 2018

On 2018-03-23 16:44, David Carlisle wrote:
> there are several ways to get the box output in classic tex (or xetex)
> although perhaps the easiest (and safest in terms of not accidentally
> affecting the typeset positions)  is to use \showoutput so all boxes
> are (somewhat verbosely) logged in the log file, and then parse that
> with perl or python or whatever to get whatever lengths you need,
> David

David, do you have a life?  Everywhere I see some conversation about 
TeX, your name is there...

Anyway, I just now tried your idea (thanks!), but I'm not clear how to 
parse the results.  When I run a small example with xelatex, I see lines 
.\vbox(608.40024+0.0)x360.0, shifted 54.0
..\vbox(12.0+0.0)x360.0, glue set 12.0fil
(some lines omitted)
..\vbox(541.40024+0.0)x360.0, glue set 503.14648fil
(some lines omitted)
...\hbox(7.71974+2.25569)x360.0, glue set - 0.17555
....\TU/lmr/m/n/10.95 Now
(where the word "Now" is the first word in one of the lines of PDF 
output).  I think the first hbox is a line of text in the output, but I 
don't know what to make of those numbers.  They seem to be approximately 
the same for every line's hbox in the trivial example I wrote (except 
for the number after "glue set", which is different for each one), so 
maybe they translate into the horizontal position and/or size of the 
line's hbox.  And maybe the vbox line is the entire paragraph's box, 
where the numbers translate into the vertical position and/or size of 
the vbox.  But I'm not sure how to go from those numbers to the position 
(in points) of each hbox in the output PDF.

Is there a guide somewhere to interpreting this trace?  I didn't see 
anything on-line.


More information about the XeTeX mailing list