[NTG-context] Escaping reserved/problematic characters

Benct Philip Jonsson bpj at melroch.se
Thu Mar 11 18:37:53 CET 2021


In a program I'm writing I have a function for escaping characters which
are reserved or problematic in LaTeX. I would like to have a corresponding
function for ConTeXt, so I'm wondering which ones are
different/superfluous/missing from a ConTeXt perspective in the following
list (sorry about the formatting!):

    '{': "\\{"
    '}': "\\}"
    '_': "\\_"
    '%': "\\%"
    '#': "\\#"
    '$': "\\$"
    '&': "\\&"
    '`': "\\textasciigrave{}"
    '^': "\\textasciicircum{}"
    '~': "\\textasciitilde{}"
    '\\': "\\textbackslash{}"
    '|': "\\textbar{}"
    '<': "\\textless{}"
    '>': "\\textgreater{}"
    '[': '{[}'
    ']': '{]}'

Note that I'm not looking for accented letters, Unicode quotes and dashes
etc. I'm assuming that people in the year 2021 are using an UTF-8-aware
engine (and my corresponding HTML escape function similarly caters only to
& < > " ').

TIA,

/Benct
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20210311/97de75a6/attachment.htm>


More information about the ntg-context mailing list