12

I would like to include figures with long comments in an org-mode file. The problem is that the #+CAPTION directive only recognizes the text on its same line. If you write many sentences in a very long line it becomes cumbersome to work with. Take a look at this example:

#+CAPTION: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
#+NAME: fig01
[[file:./figs/fig01.png]]

Is there any work around to have multi-lines captions?

2
  • 1
    Use visual wrapping. Visual line mode I think. Or wrap the whole thing in a latex environment and use \caption{}. Mar 13, 2016 at 10:02
  • Thank you, John, visual line mode worked. If you post your answer (instead of this comment), I'll accept it. Mar 14, 2016 at 15:50

3 Answers 3

9

You can use visual-line-mode to show wrapping without breaking the actual line.

18

You can use as many captions as you like, one after the other:

#+CAPTION: Lorem ipsum dolor sit amet, consectetur adipiscing elit, 
#+CAPTION: sed do eiusmod tempor incididunt ut labore et dolore magna
#+CAPTION: aliqua. Ut enim ad minim veniam, quis nostrud exercitation 
#+NAME: fig01
[[file:./figs/fig01.png]]
2
  • 1
    This should be he accepted answer, since it provides a technical solution instead of a workaround. I is too bad that M-q fails, though.
    – Kaligule
    Mar 21, 2017 at 18:42
  • This is a terribly impractical solution though. If captions are longer than a few lines they are an absolute pain to write. I know Org is a well established syntax but it must be possible to add some kind of option e.g. a :caption: drawer or something, to make this easier.
    – Thriveth
    Apr 1, 2021 at 21:39
0

M-x toggle-truncate-lines will let you see long lines more conveniently in your buffer.

1
  • This is similar to using visual-line-mode, but the solution of mihai using multiple caption lines is usually preferable. Sep 9, 2017 at 14:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.