Say I have the following figure:

#+ATTR_HTML: :title This Figure
#+ATTR_HTML: :width 50%
#+CAPTION: blah blah blah.

The resulting caption in the .html (generated from org-html-export-to-html) file looks like this:

<p><span class="figure-number">Figure 1: </span>blah blah blah.</p>

How can I make the caption smaller? I tried to enclose the caption text in <p size="3">blah blah blah</p> but that prints what I typed literally.

Font tags are no longer supported in HTML5 so not sure what else to try here.

  • Use CSS. You should be able to use the figure-number class and set the font size for that. – NickD Jan 14 '19 at 14:29
  • Since only Figure1 is included in the span of figure-number, it doesn't affect the main text? – hatmatrix Jan 14 '19 at 20:37
  • Right: you might be able to define the caption with a <span class=...> around it and see if it is exported properly, but it would be HTML-specific (although you could use macros to abstract that). – NickD Jan 14 '19 at 20:44
  • Hm, seemed like a good idea but <span font-size="50%"> blah </span> did not work – hatmatrix Jan 15 '19 at 3:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.