[luatex] Library for regular expressions in lualatex

Henri Menke henrimenke at gmail.com
Tue Jun 11 04:05:04 CEST 2019

On 11/06/2019, 04:17:15, Саша Козловский wrote:
> Hello Henri. Maybe you right,and regexp is not good way. May be exists ways
> to redefine $$ and $ in lualatex,because i want,that for formulas with $$
> and $ inserted actualtext,so i decided use lua callbacks,to replace it in []
> or (),because in this redefined commands i do insertion of actualtext in
> formula. May be you know another ways,how insert actualtext in formulas with
> $$ or $ (actualtext must contains tex notation of this formula)? Thanks very
> mutch everybody for the any help and any ideas.

If the only delimiters to your math environments are $ and $$, then you
can just use the \everymath and \everydisplay hooks to grab the contents
of the environment.  Keep in mind that this will fix catcodes, so
verbatim material will not work.

        \pdfextension literal direct {/Span <</ActualText(foobar)>> BDC}%
        \pdfextension literal direct {EMC}%
    $ a^2 + b^2 = c^2 $
    $$ a^2 + b^2 = c^2 $$

I also noticed that you have asked this question before (at least I
think that was you):


Cheers, Henri

More information about the luatex mailing list