From 96cf9853329dacd69745a225a889855dd13e5c2c Mon Sep 17 00:00:00 2001 From: TEC Date: Sat, 7 May 2022 13:59:13 +0800 Subject: [PATCH 5/7] ox-latex: Don't use `length' to get string width * lisp/ox-latex.el (org-latex-src-block--listings, org-latex-src-block--engraved, org-latex-src-block--minted): Use `string-width' instead of `length' to gauge the displayed width of the string in LaTeX. This may not be a perfect match, but it should be an improvement. --- lisp/ox-latex.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 10cd6d76d..afd7ee48e 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -3286,7 +3286,7 @@ (defun org-latex-src-block--minted (let* ((code-info (org-export-unravel-code src-block)) (max-width (apply 'max - (mapcar 'length + (mapcar 'string-width (org-split-string (car code-info) "\n"))))) (org-export-format-code @@ -3438,7 +3438,7 @@ (defun org-latex-src-block--listings (let* ((code-info (org-export-unravel-code src-block)) (max-width (apply 'max - (mapcar 'length + (mapcar 'string-width (org-split-string (car code-info) "\n"))))) (org-export-format-code (car code-info) -- 2.35.3