Skip to content

Conversation

@muzimuzhi
Copy link

As the \footnote is already redefined to re-tokenize its argument, there's no need to prefix commands in short verbs |...| by \string.

Current (in pythontex.pdf for v0.18 from 2021/06/06)

  • image
  • image
  • image

Related codes

% Create a short verbatim pipe that handles quotation marks properly
\begingroup
\catcode`\|=\active
\gdef\pipe@active@verbatim{%
\begingroup
\let\do\@makeother\dospecials
\catcode`\|=\active
\catcode`\`=\active
\catcode`\'=\active
\catcode`\<=\active
\catcode`\>=\active
\catcode`\-=\active
\catcode`\,=\active
\catcode`\ =\active
\pipe@active@verbatim@i}
\gdef\pipe@active@verbatim@i#1|{%
\endgroup
\begingroup
\def\FV@SV@pipe@active@verbatim{%
\FV@Gobble
\expandafter\FV@ProcessLine\expandafter{#1}}%
%\let\FV@BeginVBox\relax
%\let\FV@EndVBox\relax
%\def\FV@BProcessLine##1{\FancyVerbFormatLine{##1}}%
\BUseVerbatim{pipe@active@verbatim}%
\endgroup}
\AtBeginDocument{\let|\pipe@active@verbatim}
\endgroup

\let\orig@footnote\footnote
\renewcommand{\footnote}{%
\begingroup
\let\do\@makeother
\dospecials
\catcode`\{=1
\catcode`\}=2
\new@footnote}
\newcommand{\new@footnote}[1]{%
\endgroup
\orig@footnote{\scantokens{#1}}}

in short verbs in footnotes
@muzimuzhi muzimuzhi force-pushed the docs/verb-in-footnote branch from ce2916e to 6cc0b03 Compare October 16, 2023 19:19
@muzimuzhi muzimuzhi changed the title docs: remove superfluous\string prefix docs: remove superfluous \string prefix Oct 16, 2023
@gpoore
Copy link
Owner

gpoore commented Nov 11, 2025

Fixed in 5734eb0.

@gpoore gpoore closed this Nov 11, 2025
@gpoore gpoore added the doc documentation label Nov 11, 2025
@muzimuzhi muzimuzhi deleted the docs/verb-in-footnote branch November 11, 2025 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants