Consider the following piece of text
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
$$e^ix = cos(x) + i \dot sin(x)$$
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
The text is overly long so want to org-fill-paragraph
it. Unfortunately M-q
yields
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore $$e^ix = cos(x) + i \dot
sin(x)$$ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed
do eiusmod tempor incididunt ut labore et dolore
which puts the formula within the text making it hard to read.
What can I do to make Emacs fill the text but keep the formula between $$
on its own line?
I looked at this answer but couldn't make it work. I'm also hoping for a simpler solution for what I suspect is a common use case.
org-fill-paragraph
on each paragraph and then delete the extra newlines. Otherwise, the while thing is one paragraph and is formatted as such. – NickD Sep 3 '20 at 20:23