doc/: Invent an override for `\xref' categories, and use it.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 3 Aug 2019 15:20:30 +0000 (16:20 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 3 Aug 2019 15:46:25 +0000 (16:46 +0100)
The most important thing here is to able to list two things as `sections
X and Y'.  I can't use plain `\ref' for this any more because I'm
relying on `\xref' to highlight the category name.

doc/concepts.tex
doc/sod.sty
doc/structures.tex

index 495356f..eae67aa 100644 (file)
@@ -314,8 +314,8 @@ qualified by the defining class's nickname.
 As well as defining slot names and types, a class can also associate an
 \emph{initial value} with each slot defined by itself or one of its
 superclasses.  A class $C$ provides an \emph{initialization message} (see
-\xref{sec:concepts.lifecycle.birth}, and
-\xref{sec:structures.root.sodobject}) whose methods set the slots of a
+\xref[\instead{sections}]{sec:concepts.lifecycle.birth}, and
+\ref{sec:structures.root.sodobject}) whose methods set the slots of a
 \emph{direct} instance of the class to the correct initial values.  If
 several of $C$'s superclasses define initializers for the same slot then the
 initializer from the most specific such class is used.  If none of $C$'s
index 48f07e7..457dcad 100644 (file)
@@ -28,6 +28,8 @@
 %% More reference types.
 \defxref{p}{part}
 
+\def\instead#1#2{#1}
+
 %% Other languages with special typesetting.
 \def\Cplusplus{C\kern-\p@++}
 \def\Csharp{C\#}
index f000af0..9ae64af 100644 (file)
@@ -30,7 +30,8 @@ classes and associated metadata.  Note that Sod's object system is very
 flexible and it's possible for an extension to define a new root class which
 works very differently from the standard @|SodObject| described here.
 
-The concrete types described in \xref{sec:structures.common} and
+The concrete types described in
+\xref[\instead{sections}]{sec:structures.common} and
 \ref{sec:structures.root} are declared by the header file @|<sod/sod.h>|.
 The definitions described in \xref{sec:structures.layout} are defined in the
 header file generated by the containing module.