[texhax] in-section references

martin f krafft madduck at madduck.net
Sat Jan 27 20:54:18 CET 2007

Dear list,

I have a very complex document (a book of more than 600 pages),
which uses crossrefs a great deal. It being a book and having gone
through countless hours of scrutiny and revisions, sections have
been moved around, and I have not kept track of all the crossrefs
— after all, LaTeX should do that for me, no?

The problem I am facing now is that I end up with some crossrefs
referencing the very section in which they occur, in part because
\subsubsections are not numbered:

  \section{My section}                    % section 2

  \subsection{My subsection}              % section 2.1
  some text [...]

  \subsubsection{My subsubsection 1} \label{subsub1}
  [...] we will return to this in section \ref{subsub2} [...]

  \subsubsection{My subsubsection 2} \label{subsub2}
  [...] as discussed in section \ref{subsub1} [...]

In the final output, this will yield:

  [...] we will return to this in section 2.1 [...]
  [...] as discussed in section 2.1 [...]

Obviously, this is a bit undesirable, since both of these sentences
appear in section 2.1 themselves.

Short of making subsubsections numbered (I'd rather not deviate from
the LaTeX standards here), what are my options here? Ideally,
I would like LaTeX to realise if it's inserting a crossref to the
current section, and if that's the case, them insert a pageref
instead ("... we will return to this on page 345 ..."), or something
even more fancy ("... we will return to this later in this section
(p. 345) ...").

Is this somehow possible without having to go through the document
and verifying every single ref, because that:

$ grep -c '\ref{' *.tex

is not something i'd like to do.

I have checked out the varioref package, but that's not really what
I am looking for.

Thanks a lot!

martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net at madduck
spamtraps: madduck.bogus at madduck.net
i must confess, I was born at a very early age.
                                                       -- groucho marx
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature (GPG/PGP)
Url : http://tug.org/pipermail/texhax/attachments/20070127/60193d47/attachment.bin 

More information about the texhax mailing list