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

"<no registered function for 'post_linebreak_filter' callback>" in DVI mode #44

Closed muzimuzhi closed 9 months ago

muzimuzhi commented 9 months ago

When nodetree is loaded as a LaTeX package and the tex file is complied in DVI mode (by using dvilualatex <file>.tex), I got

<no registered function for 'post_linebreak_filter' callback>

after each node tree.

Are these behaviors expected?

\documentclass{article}
\usepackage{nodetree}

\NodetreeUnregisterCallback{postline}

% got in dvi mode only
\NodetreeRegisterCallback{postline}
% never got
% \NodetreeRegisterCallback{preline}
% got in both dvi and pdf modes
% \NodetreeRegisterCallback{preout} % line, buildfilter, preout

\begin{document}
foo\par
bar
\end{document}

In standard output

before callback post_linebreak_filter
------------------------------------------
├─GLUE (baselineskip) wd 4.95pt
└─HLIST (line) wd 345pt, dp 0.11pt, ht 7.05pt
  ╚═head
    ├─LOCAL_PAR
    ├─HLIST (indent) wd 15pt
    ├─GLYPH (glyph) 'f', font 15, wd 3.06pt, ht 7.05pt
    ├─GLYPH (glyph) 'o', font 15, wd 5pt, ht 4.48pt, dp 0.11pt
    ├─KERN (fontkern) 0.28pt
    ├─GLYPH (glyph) 'o', font 15, wd 5pt, ht 4.48pt, dp 0.11pt
    │   props {['injections'] = {['leftkern'] = 18350.08}}
    ├─PENALTY (linepenalty) 10000
    ├─GLUE (parfillskip) plus +1fil
    └─GLUE (rightskip)
-----------------------

<no registered function for 'post_linebreak_filter' callback>

before callback post_linebreak_filter
------------------------------------------
├─GLUE (baselineskip) wd 4.95pt
└─HLIST (line) wd 345pt, dp 0.11pt, ht 6.94pt
  ╚═head
    ├─LOCAL_PAR
    ├─HLIST (indent) wd 15pt
    ├─GLYPH (glyph) 'b', font 15, wd 5.56pt, ht 6.94pt, dp 0.11pt
    ├─GLYPH (glyph) 'a', font 15, wd 5pt, ht 4.48pt, dp 0.11pt
    ├─GLYPH (glyph) 'r', font 15, wd 3.92pt, ht 4.42pt
    ├─PENALTY (linepenalty) 10000
    ├─GLUE (parfillskip) plus +1fil
    └─GLUE (rightskip)
-----------------------

<no registered function for 'post_linebreak_filter' callback> [1]
Josef-Friedrich commented 9 months ago

Thank you for reporting this issue. I will look into it. Maybe @lemzwerg can help? He has implemented this message in https://github.com/Josef-Friedrich/nodetree/commit/e62007703769ef58afdad951c21b57b0b793746e

lemzwerg commented 9 months ago

Uh, oh, DVI mode :slightly_smiling_face:

Actually, there is no bug, AFAICS: The message is part of the node dump – it tells you that by default (i.e., by luatex itself) there is no callback installed. So yes, the behaviour is expected.

muzimuzhi commented 9 months ago

@lemzwerg So the fact that I only get the message for post_linebreak_filter callback in DVI mode, reflects that LuaTeX itself (and/or some Lua modules loaded by LaTeX format) acts a little bit differently between PDF and DVI modes?

lemzwerg commented 9 months ago

Yes, I think so. However, I don't have time right now (and, honestly, lack of knowledge regarding luatex internals) to check this in more detail. Maybe the luatex people can answer this in a satisfactory way.