In Org Mode fill-paragraph brakes the following paragraph (containing LaTeX displayed equation)

* Some headline
   Text text text
   text text text.


* Some headline
  Text text text \[ e=mc^2 \] text text text.

so the Org Mode form (with LaTeX preview) no longer reflects the LaTeX layout.

How can I prevent fill-paragraph from breaking LaTeX displayed equations?

UPDATE (edited on 11.04.2017)

By hacking org-element.el file I've modified org-element-paragraph-separate variable (in place of its definition). Now it includes also the "\\\\\\[" regexp, so \[ is recognized as a place when new paragraph begins. The attempt to modify the org-element-paragraph-separate in my init file has failed.

Unfortunately this is only a halfway solution: running fill-paragraph with cursor point before \[ does not break the equation, as expected, but when I run fill-paragraph having the cursor after \[ the paragraph changes to

* Some headline
  Text text text
  \[ e=mc^2 \] text text text.
  • The examples in (org) LaTeX fragments lists a equation in exactly that inline format and also a longer \begin{equation} ... \end{equation} syntax. The latter isn't modified when I'm calling fill-paragraph in the "Text text text" line. I have no LaTeX environment ready to test the inline \[ e=mc^2 \] formatting
    – p_wiersig
    Dec 6 '16 at 23:36
  • @p_wiersig \[ ... \] can be compared to equation* environment or better to displaymath so (in LaTeX) there is a new line after \[ and \] and the equation is centered.
    – premopie
    Dec 7 '16 at 11:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.