[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] fill-paragraph: wrong behaviour after latex-environments
From: |
Albert Z. Wang |
Subject: |
Re: [O] fill-paragraph: wrong behaviour after latex-environments |
Date: |
Thu, 03 May 2012 11:05:10 -0400 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.0.96 (gnu/linux) |
Benjamin Motz <address@hidden> 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 \[, \].