Here's an emacs defun I written to use numfig:

(defun rst-bk-numfigs (Fig)
  (interactive "sEnterh the name of the figure (e.g. markov-chain.png): ")
  (let (FigStripped FigWithUnderscore FigWithUnderscoreLowerCase)
    (setq FigStripped (replace-regexp-in-string "[^a-zA-Z]" "" Fig))
    (setq FigWithUnderscore (replace-regexp-in-string "[^a-zA-Z]" "_" Fig))

    (with-temp-buffer
      (insert FigWithUnderscore)
      (downcase-region (point-min) (point-max))
      (setq FigWithUnderscoreLowerCase (buffer-substring-no-properties 
(point-min) (point-max))))

    (insert (format "\
:num:`Fig. #%s`).

.. _%s:

.. figure:: _static/%s
   :width: 50%s
   :alt: %s
   :align: center
" FigWithUnderscoreLowerCase FigWithUnderscoreLowerCase Fig "%" Fig)))
  (search-backward-regexp "`).") 
  (forward-char 3)
  (insert " "))



On Thursday, August 30, 2012 11:29:20 PM UTC+4, kt-fsi wrote:
>
> Is it somehow possible to have a figure caption different form the text of 
> the link to that figure?
>
> This may also help. It is a sphinx extension. We use this to have 'Figure 
> #' display in our HTML output: (numfig extension with the role, :num: )
>
> https://bitbucket.org/arjones6/sphinx-numfig/wiki/Home
>
> Kathy
> [email protected] <javascript:>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sphinx-dev/-/yixioT9C7fQJ.
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/sphinx-dev?hl=en.

Reply via email to