Hi,
answers inline...

On Mon, 31 Mar 2025 at 19:12, Ihor Radchenko <yanta...@posteo.net> wrote:

> Pedro Andres Aranda Gutierrez <paag...@gmail.com> writes:
>
> > Hmmm...
> > I'd have to sleep over it. This is more a "user taste" issue IMvvHO.
> >
> > I have a snippet for that including:
> > #+LATEX_HEADER: \setmainfont{FreeSerif}
> > #+LATEX_HEADER: \setsansfont{FreeSans}
> > #+LATEX_HEADER: \setmonofont{FreeMono}
> > but just as a snippet which I modify on demand (and quite often).
> >
> > I would not dare to impose anything to anyone or force people
> > to add customisations for this, because I don't have a "standard"
> > setup. I would put this kind of things in the org-mode documentation.
>
> Yup. I agree that it is a valid point. I made the same point several times
> in the past.
> But the problem keeps popping up again and again into the face of
> unsuspecting users. So, it looks like having some kind of defaults could
> be a net win, after all.
>

Ok, that's a valid point,too.


> For example, we can make the above 3 fonts defcustoms with default
> values of 'auto. Then, if we detect non-ascii characters in latex
> export, we can auto-detect fonts (from some pre-populated constant list)
> and raise a warning message while proceeding with export. It is probably
> better than producing pdfs with unreadable characters.
>

That we need to discuss a bit more... It depends on many things, including
the LaTeX compiler.
 If we want to take this path, I would make code generation depend on the
compiler and not
on the characters present in a document,

And if and when we go this road, I'd take the step of  getting over it and
using lualatex as the default LaTeX compiler.
My experience in adopting lualatex was that I only had to change font
management, and that the new configuration
was by far simpler.

My take on it would be to have a predefined alist of fonts à la
(defcustom ox-latex-default-fonts-alist
 '((main . "FreeSerif")
   (sans . "FreeSans"
   (mono . "FreeMono"))
"An alist for the fonts to be used in a document")))

which eventually could be customised by the user and a variable controlling
whether it should
be used or not

(defcustom ox-latex-use-default-fonts-alist
  nil
  "Set this variable to non-nil to generate a font list declaration in the
exporter LaTeX header")

With this two variables, it shouldn't be too difficult to generate the font
control commands for latex, lualatex or xetex.
This should be cleaner than trying to detect non-ascii characters and do
all the stuff, which would, nevertheless, depend
on the LaTeX compiler.

WDYT?
/PA

-- 
> 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, write BE!
Year 1 of the New Koprocracy

Reply via email to