7

MWE

#+CAPTION: Lisp is a language of timeless elegance. https://imgs.xkcd.com/comics/lisp_cycles.png 

Export as HTML will look something like this (depending on CSS):

output

I just want

Lisp is a language of timeless elegance

to appear under the image. How can I get rid of the numbering?

3 Answers 3

11

You may not be able to easily influence the Org export itself, but you can still remove the figure number with some CSS:

.figure-number { display: none; } 

result

3
  • Clever. Note that this does get rid of both "Figure: " and the number... Commented Oct 24, 2015 at 13:37
  • @wasamasa Yep, which is what I wanted in the original question =) Commented Oct 24, 2015 at 13:43
  • Ah, I did read it too quickly to notice. Commented Oct 24, 2015 at 18:00
9

I'm afraid you can't influence this in the HTML export (as opposed to the LaTeX export which allows adding arbitrary captioning code) because the behaviour is hardcoded in Org's org-html-paragraph:

(if (not (org-string-nw-p raw)) raw (concat "<span class=\"figure-number\">" (format (org-html--translate "Figure %d:" info) (org-export-get-ordinal (org-element-map paragraph 'link 'identity info t) info nil 'org-html-standalone-image-p)) "</span> " raw)) 

Therefore, the only alternative I can imagine is using raw HTML:

#+BEGIN_HTML <div class="figure"> <p><img src="https://imgs.xkcd.com/comics/lisp_cycles.png" /></p> <p>Lisp is a language of timeless elegance</p> </div> #+END_HTML 

Did you consider handing in a bug report with M-x org-submit-bug-report?

1
  • 1
    I'll consider it – this is definitely something that should be configurable from an Org-ish workflow – but I'll draw attention to the workaround in my answer =) Commented Oct 24, 2015 at 13:17
4

Building on Sean Allred's answer, this worked great for me (no need to link to / tweak external style sheet, e.g. for a one-off use):

@@html: <style> .figure-number { display: none; } </style> @@ #+CAPTION: Lisp is a language of timeless elegance. https://imgs.xkcd.com/comics/lisp_cycles.png 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.