Hi, thanks for the review. Please find attached an updated patch. > I guess so. OTOH, I assume latex environments are always math > environments. One can use LaTex export blocks for "regular" LaTeX. I left the math check in the attached patch for now. Please let me know if you would like me to remove it. > Nitpick: since this is a predicate, it should be named > `org-html--math-environment-p'. Done. > Meanwhile, I think the implementation is a bit convoluted. What about > the following? > > (replace-regexp-in-string > "\\`[ \t]*\\\\begin{\\([^*]+?\\)}" > "\\1*" > (replace-regexp-in-string "^[ \t]*\\\\end{\\([^*]+?\\)}[ \r\t\n]*\\'" > "\\1*" > latex-frag nil nil 1) > nil nil 1) Done. > IMO, this doesn't deserve to be a function, you can just use something > like this: > > (if (org-string-nw-p label) > (replace-regexp-in-string "\\`.*" > (format "\\&\n\\\\label{%s}" label) > latex-frag) > latex-frag) Done. Thanks, thibault