Josef-Friedrich / nodetree

LuaTeX package to visualize node lists in a tree view.
https://www.ctan.org/pkg/nodetree
LaTeX Project Public License v1.3c
14 stars 2 forks source link

Support question: Lua code available as a separate package? #1

Closed pgundlach closed 7 years ago

pgundlach commented 7 years ago

nodetree looks useful to me. Is the Lua code available as a separate package that gets a box as the input?

Josef-Friedrich commented 7 years ago

The Lua code is unfortunately very well “hidden” in the dtx markup. In my texlive installation the Lua code of the package can be found at

/usr/local/texlive/texmf-dist/tex/luatex/nodetree/nodetree.lua

If you write a little bit of boilerplate code nodetree analyzes boxes out of the box:

\setbox0\hbox{\vbox{\hbox{abc}}\vbox{x}}
\directlua{
  nodetree = require("nodetree")
  nodetree.set_default_options()
  nodetree.analyze(tex.getbox(0))
}
\bye

box.tex

pgundlach commented 7 years ago

Thank you, I'll have a look (the output is very nice!)