Skip to content

Commit 0c99297

Browse files
akirakylennicandro
authored andcommitted
Fix jupyter-org--parse-latex-element
Upstream org commit f01390c changed the behavior of org-inside-LaTeX-fragment-p which now checks for both latex fragments and environments
1 parent 5b28049 commit 0c99297

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

jupyter-org-client.el

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,20 +1052,13 @@ parsed, wrap DATA in a minipage environment and return it."
10521052
(with-temp-buffer
10531053
(insert data)
10541054
(goto-char (point-min))
1055-
;; Try to determine if we are in an environment or fragment
1056-
(if (save-excursion
1057-
(forward-char 2)
1058-
(org-inside-LaTeX-fragment-p))
1059-
(org-element-latex-fragment-parser)
1060-
;; If we are not in a fragment, try to parse an environment
1061-
(let ((env (ignore-errors
1062-
(org-element-latex-environment-parser
1063-
(point-max) nil))))
1064-
(if (eq (org-element-type env) 'latex-environment) env
1065-
;; If all else fails, wrap DATA in a minipage
1066-
;; environment
1067-
(jupyter-org-latex-environment
1068-
(concat "\
1055+
(let ((context (org-element-context)))
1056+
(cond ((memq (org-element-type context) '(latex-fragment latex-environment))
1057+
context)
1058+
(t
1059+
;; If all else fails, wrap DATA in a minipage environment
1060+
(jupyter-org-latex-environment
1061+
(concat "\
10691062
\\begin{minipage}{\\textwidth}
10701063
\\begin{flushright}\n" data "\n\\end{flushright}
10711064
\\end{minipage}")))))))

0 commit comments

Comments
 (0)