Is there a way to insert arbitrary (La)TeX-code at the line break of a typeset line?
I am aware that this isn't really possible with (La)TeX as such. But looking at all the interesting chickenize-features applied on a line-basis, I started wondering whether LuaTeX could facilitate a simple mechanism to do this.
To illustrate: I'd like the box with the time to be typeset right after "nulla":
\documentclass{article}
\usepackage{datetime}
\newcommand{\doatlinebreak}[1]{#1}
\begin{document}
Vivamus pharetra posuere sapien. Nam consectetuer.
Sed aliquam, nunc eget euismod ullamcorper, lectus nunc
ullamcorper orci, fermentum bibendum enim nibh eget ipsum.
Donec porttitor ligula eu
dolor. \doatlinebreak{\makebox[0pt][l]{\currenttime}}Maecenas
vitae nulla consequat libero cursus venenatis.
\end{document}


linebreak_filterandpost_linebreak_filter. You should be aware that you are working on the level of nodes and that you might want to insert a whatsit and not some "zero-width" box. See also some examples at http://wiki.luatex.org/index.php/Post_linebreak_filter and http://wiki.luatex.org/index.php/Show_the_hyphenation_points. – TeXnician Sep 23 '18 at 08:58