Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \documentclass{article}
- \directlua{
- function tilderise(n)
- for nn in node.traverse(n) do
- if nn.id==0 or nn.id==1 then % hlist and vlist iterate over the lists
- tilderise(nn.head)
- elseif nn.id==29 then % if it is a glyph node change the glyph
- print ('\string\n glyph=' .. nn.char .. '/' .. nn.font) % debugging
- nn.char=126 % this is ~
- nn.font=15 % force a text font as the classic math fonts don't have a ~ in this slot
- end
- end
- return n
- end
- luatexbase.add_to_callback('hpack_filter',tilderise,'\string~ filter')
- }
- luatexbase.add_to_callback('pre_output_filter',tilderise,'\string~ filter')
- \def\startzzz{\directlua{luatexbase.add_to_callback('pre_output_filter',tilderise,'\string~ filter')}} \def\stopzzz{\directluaa{luatexbase.remove_from_callback('pre_output_filter','\string~ filter')}}
- \begin{document}
- \startzzz
- abc XYZ
- \[\phi+\int\frac{a}{1+x}dx\]
- \stopzzz
- abc XYZ
- \[\phi+\int\frac{a}{1+x}dx\]
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement