Hi

After giving it a thought, I would say that adding a new custom
variable to control the default options might do the trick.
Something like (in .dir-locals.el format):

#+BEGIN_SRC elisp
(org-latex-fontspec-default-features
      . (("Path" . "../fonts/")
         ("Extension" . ".otf")
         ("Numbers" . "OldStyle")))
#+END_SRC

would cover the use case, right. For your example it could reduce to
#+BEGIN_SRC elisp
(org-latex-fontspec-default-features . (("Numbers" . "OldStyle")))
#+END_SRC
And that wouldn't be to cumbersome and flexible enough at the same
time. I wonder if we want to cover all cases like in
#+BEGIN_SRC latex

\defaultfontfeatures[\rmfamily,\sffamily]{Ligatures=TeX}

#+END_SRC

That would surely make things too tricky, I fear.

WDYT? Do we really need it?

On Fri, 13 Jun 2025 at 18:39, Jacob S. Gordon <jacob.as.gor...@gmail.com> wrote:
>
> Hey Pedro,
>
> On 2025-06-13 01:27, Pedro Andres Aranda Gutierrez wrote:
> > The idea behind the current structure is that there might be other
> > things beyond the mode that go in the feature list, therefore I
> > didn't want it to be that specific
>
> Makes sense! I just mentioned it since the trailing ':' seems to be
> necessary in the fallback font names, and it might trip someone up.
>
> > Could you please elaborate a bit more on defaultfontfeatures?
>
> Instead of specifying a feature for each font, e.g. old‐style numbers
> everywhere:
>
> #+begin_src latex
> \setmainfont{TeX Gyre Pagella}[Numbers=OldStyle]
> \setsansfont{TeX Gyre Heros}[Numbers=OldStyle]
> \setmonofont{TeX Gyre Cursor}[Numbers=OldStyle]
> #+end_src
>
> you can set it once in `defaultfontfeatures':
>
> #+begin_src latex
> \defaultfontfeatures{Numbers=OldStyle}
> \setmainfont{TeX Gyre Pagella}
> \setsansfont{TeX Gyre Heros}
> \setmonofont{TeX Gyre Cursor}
> #+end_src
>
> Other features like the font path and extension can be factored out
> this way too.
>
> One more thing I forgot to mention, consider the document:
>
> #+begin_src org
> ,#+OPTIONS: toc:nil
> ,#+LATEX_COMPILER: lualatex
> \[\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ}\]
> #+end_src
>
> On main, `amsmath' is loaded and we get one style of calligraphic
> symbols. On this branch, `unicode-math' is loaded by default which
> means we get another style from Latin Modern Math. Personally, I think
> the trade‐off is worth it, but since it could change the look of
> existing documents it might be worth an option or a line of
> documentation.
>
> Thanks,
>
> --
> Jacob S. Gordon
> jacob.as.gor...@gmail.com
>
> ======================
>
> Please avoid sending me HTML emails and MS Office documents.
> https://useplaintext.email/#etiquette
> https://www.gnu.org/philosophy/no-word-attachments.html



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

Sagen's Paradeiser, write BE!
Year 1 of the New Koprocracy

Reply via email to