11

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?

El Diego Efe
  • 1,601
  • 1
  • 19
  • 24

3 Answers3

17

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]]
mihai
  • 321
  • 2
  • 12
  • 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 '17 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 01 '21 at 21:39
9

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

Stefan
  • 26,154
  • 3
  • 46
  • 84
John Kitchin
  • 11,555
  • 1
  • 19
  • 41
0

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

emagar
  • 119
  • 6
  • This is similar to using `visual-line-mode`, but the solution of mihai using multiple caption lines is usually preferable. – Andrew Swann Sep 09 '17 at 14:36