From ca2023b8567b5e012b373eff8544be7920ce5c17 Mon Sep 17 00:00:00 2001
From: Mark Wooding <mdw@distorted.org.uk>
Date: Sat, 3 Aug 2019 16:20:30 +0100
Subject: [PATCH] doc/: Invent an override for `\xref' categories, and use it.

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   | 4 ++--
 doc/sod.sty        | 2 ++
 doc/structures.tex | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/doc/concepts.tex b/doc/concepts.tex
index 495356f..eae67aa 100644
--- a/doc/concepts.tex
+++ b/doc/concepts.tex
@@ -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
diff --git a/doc/sod.sty b/doc/sod.sty
index 48f07e7..457dcad 100644
--- a/doc/sod.sty
+++ b/doc/sod.sty
@@ -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\#}
diff --git a/doc/structures.tex b/doc/structures.tex
index f000af0..9ae64af 100644
--- a/doc/structures.tex
+++ b/doc/structures.tex
@@ -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.
-- 
2.11.0

