branch: externals/org
commit ada33a652e739189934974b14d2b70914c0ffda2
Author: Ihor Radchenko <yanta...@posteo.net>
Commit: Ihor Radchenko <yanta...@posteo.net>

    Fix fontification of the last line in latex environments
    
    * lisp/org.el (org-latex-regexps): Include trailing whitespace and
    newline after \end{...}.  This way, latex fontification will include
    the whole environment.
    
    Reported-by: Rudolf Adamkovič <rud...@adamkovic.org>
    Link: https://orgmode.org/list/m2ldt0picx....@adamkovic.org
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index ec6aa75806..14df7ed66d 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -674,7 +674,7 @@ An entry can be toggled between COMMENT and normal with
 ;;;; LaTeX Environments and Fragments
 
 (defconst org-latex-regexps
-  '(("begin" "^[ 
\t]*\\(\\\\begin{\\([a-zA-Z0-9\\*]+\\)\\(?:.\\|\n\\)+?\\\\end{\\2}\\)" 1 t)
+  '(("begin" "^[ 
\t]*\\(\\\\begin{\\([a-zA-Z0-9\\*]+\\)\\(?:.\\|\n\\)+?\\\\end{\\2}[ \t]*\n?\\)" 
1 t)
     ;; ("$" "\\([ \t(]\\|^\\)\\(\\(\\([$]\\)\\([^ 
\t\n,.$].*?\\(\n.*?\\)\\{0,5\\}[^ \t\n,.$]\\)\\4\\)\\)\\([ \t.,?;:'\")]\\|$\\)" 
2 nil)
     ("$1" "\\([^$]\\|^\\)\\(\\$[^ 
\t\r\n,;.$]\\$\\)\\(\\s.\\|\\s-\\|\\s(\\|\\s)\\|\\s\"\\|'\\|$\\)" 2 nil)
     ("$"  "\\([^$]\\|^\\)\\(\\(\\$\\([^ 
\t\n,;.$][^$\n\r]*?\\(\n[^$\n\r]*?\\)\\{0,2\\}[^ 
\t\n,.$]\\)\\$\\)\\)\\(\\s.\\|\\s-\\|\\s(\\|\\s)\\|\\s\"\\|'\\|$\\)" 2 nil)

Reply via email to