I'm trying to define a macro that uses two active characters inside an \AtBeginDocument
command.
I can write a macro such as the following using only one active character:
\catcode`\_=13
\begingroup
\lccode`\~=`\_
\lowercase{\endgroup
\def~#1~}{\emph{#1}}
\def\_{\char"5F\relax}
However, I'd like to define two characters as active and use them at the same time to enclose a shorthand syntax.
If I use code similar to the following:
\catcode`\<=13
\catcode`\>=13
\begingroup
\lccode`\~=`\<
\lowercase{\endgroup
\def~#1>}{\url{#1}}
\def\<{\char"3C\relax}
\def\>{\char"3E\relax}
the console returns Paragraph ended before < was complete
.
It seems that both characters need to be used in an indirect method similar to defining them as a lowercase version of the tilde.
Is there another character I can use in such a situation to make such a macro work? Or would there be a better way of doing this?
<...>
shorthand for URLs?