Instantly share code, notes, and snippets.

# pgundlach/viznodelist.lua Last active Oct 16, 2019

LuaTeX nodelist visualization

### hennigs commented Oct 8, 2012

 An issue with hlist and vlist nodes. Edges departing from the field labelled list always head south, while in most cases they should head east, like, e.g., the edges departing from next fields do.

### hennigs commented Oct 8, 2012

 An issue with hlist and vlist nodes. Field list should be renamed to head. To quote from the LuaTeX manual: Note: the new field name head was introduced in 0.65 to replace the old name list. Use of the name list is now deprecated, but it will stay available until at least version 0.80.
Owner Author

### pgundlach commented Nov 10, 2012

 I missed your comment, sorry. I will rename head/list and have a look at the edges departing from list/head field. Thank you very much for your comment!

### hennigs commented Nov 10, 2012

 An RFE this time: In user-defined whatsit nodes, would it be possible to show fields user_id, type and value?
Owner Author

### pgundlach commented Feb 27, 2013

 Thanks @hennigs, I've finally implemented your suggestions.

### neapel commented May 24, 2013

 To limit output for quickly checking a node's neighbours max_prev, max_next and max_head options would be useful, i.e. called on node n with max_head=1 would draw n and n.head but not n.head.head, but instead a dangling arrow.

### Josef-Friedrich commented Jul 7, 2016 • edited

 I have also witten a package which visualizes the node lists. My package nodetree tries to solve the challenge to visualize the node structure in a different approach. https://www.ctan.org/pkg/nodetree
Owner Author

### pgundlach commented Nov 16, 2017

 Here is an example of the output of the file:

### u-fischer commented Mar 14, 2018

 I tried the code on the AtBeginShipoutBox with luatex 1.07 from texlive 2018 pretest: \documentclass{article} \usepackage{atbegshi,lipsum} \AtBeginShipout {% \directlua{require("viznodelist") viznodelist.nodelist_visualize(tex.box["AtBeginShipoutBox"],"mybox.gv")}} \pagestyle{empty} \begin{document} abc \end{document}  When I try to convert this to a pdf with dot.exe I get a warning Warning: node n80, port title unrecognized Warning: node n80, port title unrecognized  and there is a mysterious n80 node in the middle:

### rolfn commented Apr 12, 2018

 I can confirm this (Linux, TeXLive 2017, luatex 1.0.4). I get Warning: node n78, port title unrecognized  ...Rolf

### rolfn commented Jan 7, 2019

 Another issue with current TeXLive (2018, luatex 1.09.0). If I compile ulrikes (u-fischer) example above I see the following error: ./viznodelist.lua:124: attempt to index a nil value (field 'spe c') stack traceback: ./viznodelist.lua:124: in upvalue 'dot_analyze_nodelist' ./viznodelist.lua:120: in upvalue 'dot_analyze_nodelist' ./viznodelist.lua:152: in function 'viznodelist.nodelist_visualize' [\directlua]:1: in main chunk. ...list_visualize("AtBeginShipoutBox","mybox.gv")} l.10 \end{document}  It would be nice to see a graphic of the ShipoutBox. Thanks in advance.
Owner Author

### pgundlach commented Jan 21, 2019

 @u-fischer I cannot reproduce this problem with my installation of tl2018. @rolfn I don't have LuaTeX 1.09 at the moment (& I don't know how to upgrade) Both: sorry for the late reply, I somehow don't get a notice when there are new comments here.

### u-fischer commented Feb 8, 2019

 @pgundlach: I still get the node message: \dot.exe -Tpdf mybox.gv -o dot.pdf Warning: node n80, port title unrecognized Warning: node n80, port title unrecognized  Regarding the luatex1.09 error: As it uses lua5.3 you should probably replace glue_set %d by glue_set %.0f (twice).