lvjr / codehigh

Highlight codes and demos with l3regex and lpeg
https://ctan.org/pkg/codehigh
11 stars 6 forks source link

Add \fakeverb command for tabularray #11

Closed lvjr closed 1 year ago

lvjr commented 1 year ago

To ease the pain of writing verbatim commands (see https://github.com/lvjr/tabularray/issues/358), I will add \fakeverb command to codehigh package.

This command will remove the backslashes in the following control symbols before typesetting its content:

Input Result Catcode
\\ \ 0
\{ { 1
\} } 2
\# # 6
\^ ^ 7
\ 10
\% % 14

The argument of \fakeverb command need to be enclosed with curly braces. Therefore it could be safely used inside tabularray tables and other LaTeX commands.

To make it a replacement for \verb command, we should not highlight the code inside this command by default.

muzimuzhi commented 1 year ago

Looks similar to \EscVerb from fvextra package.

lvjr commented 1 year ago

Looks similar to \EscVerb from fvextra package.

Yes, both are based on a similar idea. But not totally the same.