On 1 May 2020, at 09:38, Hans Hagen <j.hagen@xs4all.nl> wrote:

On 5/1/2020 1:44 AM, Gerben Wierda wrote:
   { ‘\n', ‘\\strut\\\\' },
often a \zwj or \zwno also works ok (has zero dimensions, contraty to strut; you could also try \crlf

I tried \crlf{} and that worked too (the “{}” because I do not know what comes after even if I think any whitespace is eaten and to influence any catcode trickery, just feels it is more robust than a space).

Hans, an additional question about lmtx’s XML interface. As I want the TeX special characters to be able to be part of a label, I replace all of them. That works. But what if I would like a way to introduce TeX commands again by using some other UTF8 character, would there be a character that curvies the pass through lmtx, can be used in a lua table so that I can  (in a preferred order) get unescaped characters passed that flow?

E.g. code a \ as some weird UTF8 character in the XML file, and in that table I use

  local rep = lpeg.replacer {
   { '\n', '\\crlf{}' },
   { '{', '{\\textbraceleft}' },
   { '}', '{\\textbraceright}' },
   { '#', '{\\texthash}' },
   { '$', '{\\textdollar}' },
   { '&', '{\\textampersand}' },
   { '%', '{\\textpercent}' },
   { '\\','{\\textbackslash}' },
   { '|', '{\\textbar}' },
   { '_', '{\\textunderscore}' },
   { '~', '{\\textasciitilde}' },
   { '^', '{\\textasciicircum}' },
   { '"', "\"&ditto&\"" },
  }

code it back to a \ ? E.g. something like

   { ‘\U{XXX}', '\' },



Hans

-----------------------------------------------------------------
                                         Hans Hagen | PRAGMA ADE
             Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------