And now the file,

sorry, /PA

On Mon, 26 Jan 2026 at 10:11, Pedro Andres Aranda Gutierrez <
[email protected]> wrote:

> A small fix and test that we can override from #+OPTIONS in all cases
>
> Best, /PA
>
> On Mon, 26 Jan 2026 at 08:22, Pedro Andres Aranda Gutierrez <
> [email protected]> wrote:
>
>> Hi
>>
>> final version of the patch.
>> Best, /PA
>>
>> PS: Trying to move to new git is being a roller-coaster...
>>
>>
>>
>> On Sun, 25 Jan 2026 at 19:18, Ihor Radchenko <[email protected]> wrote:
>>
>>> Pedro Andres Aranda Gutierrez <[email protected]> writes:
>>>
>>> > Version 2 with the requested addition (documented)
>>>
>>> > +    (:latex-use-sans nil "latex-use-sans" org-latex-use-sans)
>>> > ...
>>> > -                            (plist-get info :latex-header-extra)))
>>> > +                            (plist-get info :latex-header-extra))
>>> > +                          (and (not snippet?)
>>> > +                               org-latex-use-sans
>>> > +
>>>  "\\renewcommand*\\familydefault{\\sfdefault}"))
>>>
>>> You should check :latex-use-sans rather than directly consulting the
>>> custom option here. Just as it is done for :latex-header-extra.
>>>
>>>
>>> --
>>> Ihor Radchenko // yantar92,
>>> Org mode maintainer,
>>> Learn more about Org mode at <https://orgmode.org/>.
>>> Support Org development at <https://liberapay.com/org-mode>,
>>> or support my work at <https://liberapay.com/yantar92>
>>>
>>
>>
>> --
>> Fragen sind nicht da, um beantwortet zu werden,
>> Fragen sind da um gestellt zu werden
>> Georg Kreisler
>>
>> "Sagen's Paradeiser" (ORF: Als Radiohören gefährlich war) => write BE!
>> Year 1 of the New Koprocracy
>>
>>
>
> --
> Fragen sind nicht da, um beantwortet zu werden,
> Fragen sind da um gestellt zu werden
> Georg Kreisler
>
> "Sagen's Paradeiser" (ORF: Als Radiohören gefährlich war) => write BE!
> Year 1 of the New Koprocracy
>
>

-- 
Fragen sind nicht da, um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

"Sagen's Paradeiser" (ORF: Als Radiohören gefährlich war) => write BE!
Year 1 of the New Koprocracy
From ae9782abfd57d7d441f086bc73173e2e62fbc3ae Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" <[email protected]>
Date: Mon, 26 Jan 2026 10:06:39 +0100
Subject: [PATCH 2/2] Fix overriding (org-latex-use-sans) from OPTIONS

* lisp/ox-latex.el: (org-latex-make-preamble): use (plist-get) only to
get (org-latex-use-sans)
* testing/lisp/test-ox-latex-el: Add test
overriding (org-latex-use-sans) from OPTIONS
---
 lisp/ox-latex.el              |  2 +-
 testing/lisp/test-ox-latex.el | 16 ++++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 82a16234a..8223e7c40 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -2044,7 +2044,7 @@ specified in `org-latex-default-packages-alist' or
 			  (and (not snippet?)
 			       (plist-get info :latex-header-extra))
                           (and (not snippet?)
-                               (or (plist-get info :latex-use-sans) org-latex-use-sans)
+                               (plist-get info :latex-use-sans)
                                "\\renewcommand*\\familydefault{\\sfdefault}"))
 
 		    ""))))
diff --git a/testing/lisp/test-ox-latex.el b/testing/lisp/test-ox-latex.el
index 003ee5aa3..a2ffaf6c8 100644
--- a/testing/lisp/test-ox-latex.el
+++ b/testing/lisp/test-ox-latex.el
@@ -312,6 +312,22 @@ Fake test document
       (goto-char (point-min))
       (should (search-forward "\\begin{document}" nil t))))
 
+(ert-deftest test-ox-latex/use-sans-override ()
+  "Test `org-latex-use-sans' overriding variable."
+  (let ((org-latex-use-sans t))
+    (org-test-with-exported-text 'latex
+                                 "#+TITLE: Test no sans fonts
+#+OPTIONS: latex-use-sans:nil
+
+* Test
+
+Fake test document
+"
+      (goto-char (point-min))
+      (should-not (search-forward "\\renewcommand*\\familydefault{\\sfdefault}" nil t))
+      (goto-char (point-min))
+      (should (search-forward "\\begin{document}" nil t)))))
+
 (ert-deftest test-ox-latex/math-in-alt-title ()
   "Test math wrapping in ALT_TITLE properties."
   (org-test-with-exported-text
-- 
2.43.0

Reply via email to