emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Juan Manuel Macías" <maciaschain@posteo.net>
To: Max Nikulin <manikulin@gmail.com>
Cc: orgmode <emacs-orgmode@gnu.org>
Subject: Re: [possible patch] Basic fontspec code for LuaLaTeX and XelaTeX (was "LaTeX export: when is it more useful...")
Date: Mon, 11 Jul 2022 14:23:49 +0000	[thread overview]
Message-ID: <87wncjg22y.fsf@posteo.net> (raw)
In-Reply-To: <tah578$v34$1@ciao.gmane.io> (Max Nikulin's message of "Mon, 11 Jul 2022 19:31:24 +0700")

Max Nikulin writes:

>>   \\relax
>>   \\else
>
> Is it the case of latex as the old engine with tex->dvi->ps workflow
> besides new XeTeX and LuaTeX? However such engine is not used by Org.

According to the iftex documentation (p. 2):

\ifpdftex, \ifPDFTeX
True if PDFTEX is in use (whether writing PDF or DVI), so this is true
for documents processed with both the latex and pdflatex commands.

So the code says: if pdfTeX is used, do nothing; else, add this (luatex
and xetex related) code.

>>   \\usepackage{fontspec}
>>   \\usepackage{unicode-math}
>>   \\defaultfontfeatures{Scale=MatchLowercase}
>>   \\defaultfontfeatures[\\rmfamily]{Ligatures=TeX}
>>   \\setmainfont{%s}
>>   \\setsansfont{%s}
>>   \\setmonofont{%s}
>>   \\fi
>>   org-latex-fontspec-mainfont
>>   org-latex-fontspec-sansfont
>>   org-latex-fontspec-monofont)
>
> Too many variables to my taste. It can be single property list. If I
> remember correctly, changing of mainfont requires setting of a
> consistent font for mathematics, so more options may be required.

Yes, that is true, sorry. I don't work with math. But:

\setmathrm{⟨font name⟩}
\setmathsf{⟨font name⟩}
\setmathtt{⟨font name⟩}
\setboldmathrm{⟨font name⟩}

Now, weren't we talking about ensuring a minimum readability out of the
box in case non-Latin characters are used? I assume that by default the
mathematical notation is assured, although the default mathematical font
may be typographically or aesthetically incompatible with the chosen
text fonts. For example, Computer Modern and FreeSerif are antipodes in
design. The first is a Didotian font and the second is a times style
typeface. But I think that what is sought here is that certain (non
latin) glyphs are represented in the PDF, beyond other typographical or
aesthetic considerations. My idea here is that a) the user who doesn't
want to mess with all these issues has a minimum of readability out of
the box; b) the user who wants to have full control over the fontspec
options has the possibility to do so; c) the user who does not want Org
to write the preamble under any circumstances (that is, people like me),
has the possibility of continuing doing so.

> Finally, default value may be language-dependent or alternative font
> set may be activated when non-latin characters are detected in the
> document.

If I had to choose between both options, I would prefer the second one.
But don't you think it would be much simpler to ensure the readability
of non-Latin characters (at least in a high percentage) by means of
three default fonts (roman, sans, mono), and let the user who needs
another font be able to choose it freely, simply by changing the value
of those variables? Generally, users working with a certain non-Latin
script are already used to using a certain font (I mean, they haven't
suddenly teleported into the digital world), and they know perfectly
well which fonts to use for their use case and their language. And for
those users who are a bit more lost, a list of recommended fonts can be
added to the documentation (many of which are already installed on their
system or are included with TeX live).

The other more extreme possibility is to default to GNU unifont
(https://unifoundry.com/unifont/index.html). With this font I think the
readability of almost everything is ensured (although it is a horrible
font, but it is not the case here). Or Google's Noto Fonts (but I don't
remember now what license terms those fonts are under).

Best regards,

Juan Manuel 


  reply	other threads:[~2022-07-11 15:17 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-08 12:17 LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX? Juan Manuel Macías
2022-07-08 15:49 ` Uwe Brauer
2022-07-08 16:46   ` Juan Manuel Macías
2022-07-08 15:54 ` Greg Minshall
2022-07-08 16:13 ` Thomas S. Dye
2022-07-08 17:27 ` Bruce D'Arcus
2022-07-08 19:03   ` Juan Manuel Macías
2022-07-08 18:49 ` Thomas S. Dye
2022-07-09  2:23   ` Max Nikulin
2022-07-09  3:23     ` Thomas S. Dye
2022-07-09 11:10       ` Juan Manuel Macías
2022-07-09  3:24     ` Tim Cross
2022-07-09  3:50       ` Ihor Radchenko
2022-07-09  4:10         ` Tim Cross
2022-07-09  5:35           ` Dominik Schrempf
2022-07-09  6:31         ` Max Nikulin
2022-07-09  9:59       ` Juan Manuel Macías
2022-07-09 23:49         ` Tim Cross
2022-07-10 11:19           ` M-x org-create-worg-article command? (was: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?) Ihor Radchenko
2022-07-10 19:06             ` Tim Cross
2022-07-11  2:09               ` Ihor Radchenko
2022-07-11  2:49                 ` Tim Cross
2022-07-11  3:18                   ` Ihor Radchenko
2022-07-11  4:00                     ` Tim Cross
2022-07-11  4:20                       ` Ihor Radchenko
2022-07-10 19:31           ` LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX? Juan Manuel Macías
2022-07-09 10:42     ` Juan Manuel Macías
2022-07-09 12:15       ` Max Nikulin
2022-07-09 14:58         ` Juan Manuel Macías
     [not found]           ` <b58ee3cc-c58c-b627-9cc5-51993020db2c@gmail.com>
2022-07-09 20:22             ` Juan Manuel Macías
2022-07-10 20:23               ` [possible patch] Basic fontspec code for LuaLaTeX and XelaTeX (was "LaTeX export: when is it more useful...") Juan Manuel Macías
2022-07-10 20:31                 ` Juan Manuel Macías
2022-07-10 20:58                 ` Tim Cross
2022-07-11 13:34                   ` Juan Manuel Macías
2022-07-11  2:19                 ` Ihor Radchenko
2022-07-11  7:50                   ` Stefan Nobis
2022-07-11 14:19                   ` Timothy
2022-07-11 15:00                     ` Juan Manuel Macías
2022-07-11 17:45                       ` fontsets (was: [possible patch] Basic fontspec code for LuaLaTeX and XelaTeX (was "LaTeX export: when is it more useful...")) Timothy
2022-07-11 22:09                         ` fontsets Juan Manuel Macías
2022-07-12  7:12                           ` fontsets Stefan Nobis
2022-07-12 11:37                             ` fontsets Juan Manuel Macías
2022-07-12 15:26                               ` Fallback fonts in LuaTeX via 'luaotfload.add_fallback' (was "Fontsets") Juan Manuel Macías
2022-07-15 14:35                                 ` Max Nikulin
2022-07-11  3:59                 ` [possible patch] Basic fontspec code for LuaLaTeX and XelaTeX (was "LaTeX export: when is it more useful...") Greg Minshall
2022-07-11  8:05                 ` Stefan Nobis
2022-07-11 11:39                   ` Juan Manuel Macías
2022-07-11 12:04                     ` Juan Manuel Macías
2022-07-11 12:31                 ` Max Nikulin
2022-07-11 14:23                   ` Juan Manuel Macías [this message]
2022-07-11 17:20                     ` Max Nikulin
2022-07-16  3:01                     ` Max Nikulin
2022-07-11 17:08               ` LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX? Max Nikulin
2022-07-10  2:12           ` Max Nikulin
2022-07-09  0:34 ` Matt Huszagh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wncjg22y.fsf@posteo.net \
    --to=maciaschain@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=manikulin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).