Description
In LuaTeX, if you use TikZ when \lsstyle is in effect, then \lsstyle will for some reason also affect things outside of the current group. It doesn’t happen with pdfTeX.
This was first reported here.
Minimal example demonstrating the issue
\documentclass{article}
\usepackage{microtype,tikz}
\AddToHook{shipout/foreground}{
\put(-.1cm, -5cm){%
\Huge P%
}
}
\begin{document}
{\lsstyle Hello World
\tikz\draw (0,0) -- (1,0);%
}
Test
\end{document}
Compiling with LuaTeX, we get:

Now let’s comment out the TikZ part. This shouldn’t change the output of anything outside the group:
{\lsstyle Hello World
%\tikz\draw (0,0) -- (1,0);%
}

As you see, there is a small, but visible difference regarding the position of the P in the margin. If you compare them closely, you will also see that the “Test” has shifted ever so slightly to the right.
Compiling with pdfTeX, there is no difference in output. It also doesn’t happen without \lsstyle.
Description
In LuaTeX, if you use TikZ when
\lsstyleis in effect, then\lsstylewill for some reason also affect things outside of the current group. It doesn’t happen with pdfTeX.This was first reported here.
Minimal example demonstrating the issue
Compiling with LuaTeX, we get:
Now let’s comment out the TikZ part. This shouldn’t change the output of anything outside the group:
As you see, there is a small, but visible difference regarding the position of the
Pin the margin. If you compare them closely, you will also see that the “Test” has shifted ever so slightly to the right.Compiling with pdfTeX, there is no difference in output. It also doesn’t happen without
\lsstyle.