X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/1f7d590d9c7b87442c8d8b6424ed4f769d377692..43cb10f990292bc1b82037dd7833e1f24f200288:/doc/sod.sty

diff --git a/doc/sod.sty b/doc/sod.sty
index 105a6c7..2894feb 100644
--- a/doc/sod.sty
+++ b/doc/sod.sty
@@ -103,6 +103,7 @@
 \atdef !{\m@maybe|\@scripts}
 \def\returns{\m@maybe\longrightarrow\m@maybe@end\hspace{0.5em}\ignorespaces}
 \atdef >{\leavevmode\unskip\hspace{0.5em}\returns}
+\atdef -#1{\if>#1{\ensuremath\rightarrow}\fi}
 
 %% Comment setting.
 \atdef ;#1\\{\normalfont\itshape;#1\\}
@@ -152,7 +153,10 @@
   \vspace{\bigskipamount}%
   \setbox\z@\hbox{\bfseries[\describecategoryname{#2}]}%
   \dimen@\linewidth\advance\dimen@-\wd\z@%
-  \def\@temp##1 ##2\q@{\message{#2:##1}\label{#2:##1}}%
+  \def\@temp##1 ##2\q@{%
+    \message{#2:##1}%
+    {\def\@uscore####1{-}\edef\@tempb{\noexpand\label{#2:##1}}\@tempb}%
+  }%
   \def\@tempa{#1}\ifx\@tempa\q@\@temp#3 \q@\else\@temp{#1} \q@\fi%
   \edef\@temp{{\the\linewidth}{@{}p{\the\dimen@}%
       @{\extracolsep{\fill}}l@{\extracolsep{0pt}}}}%
