#66 patch to make figure and table captions hyperlink targets

open
nobody
None
5
2009-11-25
2009-11-25
Terry Brown
No

This patch makes figure and table captions hyperlink targets. It was difficult to set the \label{} inserted into the latex longtable in the required place (after the \caption, but not at the end where it added trailing garbage) so the patch assumes the id in get_caption().

Only HTML and (old)latex supported.

Discussion

  • Terry Brown
    Terry Brown
    2009-11-25

    patch to make figure and table captions hyperlink targets

     
    Attachments
  • Günter Milde
    Günter Milde
    2011-06-07

    Thanks for the patch. However,
    I'd prefer manual labeling over the auto-labels for all figures and tables.

    Also,
    +++ docutils/docutils/writers/latex2e/__init__.py 2009-11-25 12:05:28.000000000 -0600
    @@ -743,8 +743,9 @@
    if not self.caption:
    return ''
    caption = ''.join(self.caption)
    + label = "\\label{%s}" % '-'.join(caption.lower().split())

    will fail if the caption contains any special ("forbidden") characters like _^$~ {[]}