9

Is there any sort of markup in org-mode to get multiple lines of text to be bold, italics, etc?

*This is what I want to be bold and I only want lines to 
be a certain length so that this doesn't work.*

I know about using visual-line-mode as an alternative to fill-paragraph which would solve this problem, but I like M-q too much and I want to try and keep my files at a certain width.

Snippets welcome. I don't know Elisp so I can't do it myself. But I guess this would ruin export too.

I'm thinking something like:

#+BEGIN_BOLD
  All my text in here would be super bold
  and would be very nice.
#+END_BOLD
  • 6
    Duplicate of Inline verbatim and code with quotes in Org-mode, see the fifth point in the answer. – nicael Nov 15 '15 at 13:34
  • So I have to use customize to specify exactly how many lines I want to mark up? That doesn't really seem the same to me. – salotz Nov 15 '15 at 20:26
  • Okay, you can put allowed 1000 lines. It's up to 1000 lines, not only exactly 1000 lines. – nicael Nov 15 '15 at 20:30
  • Seems a bit of a hack, but I guess that works. Thank you. – salotz Nov 15 '15 at 21:13
2

As per the answer from nicael's comment on the question:

By default, org-mode allows a single newline. So if you want to be able to add markup to text that spans more than two consecutive lines, you'll need to modify this entry.

(setcar (nthcdr 4 org-emphasis-regexp-components) N)

... where N is the number of newlines you want to allow.

Higher up in the same answer, it says that you need to add the line:

(org-set-emph-re 'org-emphasis-regexp-components org-emphasis-regexp-components) 

after the line above.

  • This simply doesn't work for me. I've run exactly what you've posted and restarted org-mode and yet using emphasis over N lines doesn't work. Is there anything I may have missed? – itdoesntwork Apr 25 '18 at 21:16
  • @itdoesntwork Sorry, I'm not an expert in emacs, just reposted a good answer here as community wiki since it solved this problem also. Try commenting on the original answer (linked above) and you might be able to get help. Include more information about your setup, such as the emacs version. The one thing I can think of is to create a config file with just this line and then run emacs with this config. – joelostblom Apr 25 '18 at 21:50

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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