Using a solution to adjust spacing in my document with LuaLaTeX, I run into the problem, that the semicolons are also replaced in a TikZ environments:
MWE:
\documentclass{scrbook}
\usepackage{tikz}
\usepackage{luacode}
\usepackage{etoolbox}
\newrobustcmd\dblpnct[1]{%
\ifincsname\else
\ifmmode\else
\ifhmode
\unskip
\fi
\nolinebreak\hspace{#1}%
\fi
\fi
}
\begin{luacode}
function dosub(s)
s = string.gsub(s, ';', '\\dblpnct{1.08334em}:')
return(s)
end
\end{luacode}
\makeatletter
\AtBeginDocument{%
\luaexec{luatexbase.add_to_callback("process_input_buffer", dosub, "dosub")}%
\ifpatchable*\NR@sanitize@labelname
{\pretocmd\NR@sanitize@labelname{\let\dblpnct\@gobble}{}{\failed}}
{}
}
\makeatother
\begin{document}
\begin{tikzpicture}
\node{test};
\end{tikzpicture}
\end{document}
\let\dblpnct\@gobble
to the initializations oftikzpicture
. However I have no problem with this example, as you're changing the colon, not the semicolon.