X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/284f1fa2ace3e276052ff1bd7d66442500e693da..ff4e398b224974d6283f71aa78daef4210371e32:/doc/sod.sty?ds=sidebyside

diff --git a/doc/sod.sty b/doc/sod.sty
index 9fffa17..28b6ccc 100644
--- a/doc/sod.sty
+++ b/doc/sod.sty
@@ -223,5 +223,14 @@
 \def\desc@#1#2#3{\desc@begin{\dhead@{#1}{#2}{#3}}}
 \let\enddescribe\desc@end
 
+\def\descref#1{\@ifnextchar[{\descref@i{#1}}{\descref@ii{#1}{}}}
+\def\descref@i#1[#2]{\descref@ii{#1}{ #2}}
+\def\descref@ii#1#2#3{%
+  \code{#1}#2 (page~%
+  {\let\protect\@empty%
+   \def\@uscore{-\@gobble}\edef\@tempa{\noexpand\pageref{#3:#1}}\@tempa}%
+  )%
+}
+
 %%%----- That's all, folks --------------------------------------------------
 \endinput
