Re: Link to a heading by number in ReST

Guenter Milde <[email protected]>
Newsgroups gmane.text.docutils.user
Message-ID <[email protected]>
On 2016-09-29, Steven D'Aprano wrote:
> I have a ReST (ReStructured Text) document that auto-numbers headings 
> like:

>     My Heading
>     ----------

> which will be given a number like 10.1 (say), except of course I don't 
> know what the number will be until I've compiled the .rst file.

> I'm using this as a legal document, where the canonical way to refer to 
> a clause is by number, not title. So rather than say:

>     see clause My Heading ...

> I want to say 

>     see clause 10.1 ...


> How can I do this using ReST and/or Sphinx?

This is not (yet) implemented in standard reStructuredText.
It is on the todo list for Docutils. 
Maybe there is a Sphinx extension.

If you only need LaTeX output, you can use raw LaTeX to define a reference as
\ref{normalized-name-of-the-heading}

Günter


------------------------------------------------------------------------------
_______________________________________________
Docutils-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/docutils-users

Please use "Reply All" to reply to the list.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.