Sam Quigley wrote:
Hi,
I'd like to be able to refer to anchors within my document by
(sub)section number. That is, I have a document of the form
…
[[lolwut]]
=== Foo
…
=== Bar
As we saw in xref:lolwut[Section 2], the thing with the thing is…
…
I would like the text of the cross reference — "Section 2" in this
example — to automatically refer to the correct section number, so
that if I rearrange the text I don't have to manually update all the
cross-reference labels. Is there an easy way to do this? It seems
like it should be a straightforward problem, but I haven't been able
to track the answer down…
If you are going the DocBook route it's easy, just omit the caption from the
xref macro. dblatex and DocBook XSL will use the section name if the id refers
to a section, for example:
[[X1]]
Introduction
------------
Blah blah...
Next section
------------
See also <<X1>>.
In fact, DocBook XSL will set the default caption to the section name regardless
of where the BlockId element appears in the section, very handy.
Cheers, Stuart
Thanks,
-sq
--
You received this message because you are subscribed to the Google Groups
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/asciidoc?hl=en.