org-latex-preview: Work around XeTeX misbehaviour

* lisp/org-latex-preview.el (org-latex-preview--latex-preview-filter):
Since XeLaTeX seems to misbehave with tightpage, we special-case the
tightpage processing to account for it.
This commit is contained in:
TEC 2023-03-02 19:11:13 +08:00
parent 178fd49021
commit ce260ed2c9
Signed by: tec
SSH Key Fingerprint: SHA256:eobz41Mnm0/iYWBvWThftS0ElEs1ftBr6jamutnXc/A
1 changed files with 5 additions and 2 deletions

View File

@ -1772,8 +1772,11 @@ fragments in EXTENDED-INFO."
(setq preview-marks (nreverse preview-marks))
(while preview-marks
(goto-char (caar preview-marks))
;; Check for tightpage-info
(unless tightpage-info
;; Check for tightpage-info, as long as XeLaTeX is not being used,
;; as it seems to behave differently to pdfLaTeX and luaLaTeX and
;; produces an image without the margins that tightpage reports.
(unless (or tightpage-info (equal (plist-get extended-info :latex-processor)
"xelatex"))
(save-excursion
(when (re-search-forward
"^Preview: Tightpage \\(-?[0-9]+\\) *\\(-?[0-9]+\\) *\\(-?[0-9]+\\) *\\(-?[0-9]+\\)"