From 438f075b9a1dacc9aa69d86d99efcc438c426c57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Novotn=C3=BD?= Date: Mon, 19 Jul 2021 23:01:27 +0200 Subject: [PATCH] Do not allocate new toks when a setup snipped is redefined --- markdown.dtx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/markdown.dtx b/markdown.dtx index d7a72cbda..49f8e6e8d 100644 --- a/markdown.dtx +++ b/markdown.dtx @@ -10997,10 +10997,16 @@ pdflatex --shell-escape document.tex % \end{markdown} % \begin{macrocode} \newcommand\markdownSetupSnippet[2]{% - \newtoks\next - \next={#2}% - \expandafter\let\csname markdownLaTeXSetupSnippet% - \markdownLaTeXThemeName#1\endcsname=\next}% + \@ifundefined + {markdownLaTeXSetupSnippet\markdownLaTeXThemeName#1}{% + \newtoks\next + \next={#2}% + \expandafter\let\csname markdownLaTeXSetupSnippet% + \markdownLaTeXThemeName#1\endcsname=\next + }{% + \csname markdownLaTeXSetupSnippet% + \markdownLaTeXThemeName#1\endcsname={#2}% + }}% % \end{macrocode} % \begin{markdown} %