Benjamin Motz <b.m...@uni-muenster.de> writes:

> Hi,
>
> invoking fill-paragraph on the following org-code will delete the
> newline after \end{equation}:
>
> The relation
> \begin{equation}
> E=mc^2
> \end{equation}
> won't be further discussed here.
>
> This behaviour is undesirable because it makes the org-text less
> readable. Also, when adding '%' after \end{equation}, newline is still
> being deleted by fill-paragraph (and the text after '%' won't be
> exported e.g. by latex-export).
>
> Is there a workaround or can someone point me to the location where I
> can fix/change this behaviour?
>
> Thanks, Benjamin

I had the same issue; fixed it by adding the following org-mode-hook:

(add-hook 'org-mode-hook 
          (lambda ()
            ;; don't rewrap display equations into paragraphs
            (setq paragraph-separate 
                  (concat "[\\f 
\\t]*\\(\\\\begin{\\|\\\\end{\\|\\\\\\[\\|\\\\\\]\\)\\|"
                          paragraph-separate))
            ))))

This sets several new paragraph boundary markers to prevent wrapping
them into paragraphs: \begin{, \end{, and the unnumbered display
equation shortcut \[, \].



Reply via email to