From 5893e63785289dacde4099004aed510cabf7eee8 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Mon, 25 Jul 2022 22:45:29 +0100 Subject: [PATCH] mdwref.dtx: Make the `\xref' command robust. Otherwise it doesn't work very well in figure captions and suchlike. --- mdwref.dtx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mdwref.dtx b/mdwref.dtx index acfcd44..1a40fb3 100644 --- a/mdwref.dtx +++ b/mdwref.dtx @@ -217,7 +217,7 @@ % We're meant to typeset a reference. The first job is to see whether % there's an optional argument. If so, grab it; otherwise |\relax| will do. % \begin{macrocode} -\def\xref{\@ifnextchar[\xref@{\xref@[\relax]}} +\DeclareRobustCommand\xref{\@ifnextchar[\xref@{\xref@[\relax]}} \def\xref@[#1]#2{\xref@@{#1}#2:\q@delim:\q@delim:\q@delim\q@delim} % \end{macrocode} % Right; now we abuse \TeX's argument parser to pick apart the reference -- 2.11.0