X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/f64eb323a5798e155cc494043f5f750abf50a482..ba07ddc2280d5b8c8bd10e70cab195127a0984f3:/doc/sod.sty diff --git a/doc/sod.sty b/doc/sod.sty index 9c9aaf8..f1ba880 100644 --- a/doc/sod.sty +++ b/doc/sod.sty @@ -62,7 +62,7 @@ \let\syntright\empty %% Literal code is in sans face. -\let\codeface\sffamily +\def\codeface{\upshape\sffamily} \DeclareRobustCommand\code[1]{% \ifmmode\hbox\else\leavevmode\fi% {\normalfont\codeface\/#1\/}% @@ -79,7 +79,7 @@ \atdef <#1>{\synt{#1}\@scripts} \atdef "#1"{\lit*{#1}\@scripts} \atdef `#1'{\lit{#1}\@scripts} -\atdef |#1|{\textsf{#1}\@scripts} +\atdef |#1|{\lit*{#1}\@scripts} %% A handy abbreviation; `\\' itself is too good to steal. \atdef \\{\textbackslash} @@ -119,7 +119,11 @@ \atdef -#1{\if>#1\hbox{--\raisebox{.4pt}{>}}\penalty200\relax\fi} %% Comment setting. -\atdef ;#1\\{\normalfont\itshape;#1\\} +\def\comment#1{\mbox{\normalfont\itshape\/#1\/}} +\atdef /*#1*/{/*\comment{#1}*/} +\def\@semis{\@ifnextchar;{;\@semis}\@semicomment} +\def\@semicomment#1\\{\comment{#1}\\} +\atdef ;#1\\{;\@semis} %% Environment for setting programs. Newlines are explicit, because %% otherwise I need comments in weird places to make the vertical spacing @@ -148,6 +152,7 @@ \def\@progcr@ii#1{\csname @progcr@#1\endcsname\ignorespaces} \@namedef{@progcr@+}{\prog@@cr[\medskipamount]} \@namedef{@progcr@-}{\prog@@cr*[\jot]} +\def\macsl{\`\textbackslash\hskip\leftmargin} %% Put a chunk of text in a box. \newenvironment{boxy}[1][\q@]{%