emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tim Cross <theophilusx@gmail.com>
To: "Juan Manuel Macías" <maciaschain@posteo.net>
Cc: 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 06:58:26 +1000	[thread overview]
Message-ID: <8735f81x7s.fsf@gmail.com> (raw)
In-Reply-To: <87r12ssonv.fsf_-_@posteo.net>


Juan Manuel Macías <maciaschain@posteo.net> writes:

> Considering some discussions in the parent thread, I think maybe it
> wouldn't hurt to ensure a minimal preamble when the output is compiled
> with LuaLaTeX or XelaTeX, so that some very basic fontspec configuration
> is loaded to be able to read PDFs in non-Latin scripts.
>
> But before proposing the patch directly, I'd like to discuss its
> structure. I think (IMHO) that a certain balance should be ensured
> between a) users who don't want to mess with fontspec and want something
> more out-of-the-box and b) users who prefer to be in control when
> compiling with LuaTeX and XeTeX.
>
> I think maybe it would be nice to let LaTeX do the work, via a
> conditional from the iftex package (idea taken from pandoc).
>
> The structure of the patch could be this:
>
> 1. There could be a defcustom, something like 'org-latex-use-fontspec'
> (I would vote for nil by default).
>
> 2. There would be three variables for the default fonts: roman, sans and
> mono. By default, the FreeSerif, FreeSans and FreeMono fonts could be
> set as default value, since they are very ubiquitous and have a very
> good coverage for non-Latin scripts.
>
> 3. A variable (something like 'org-latex-fontspec-default-configuration') would return something like this:
>
> (format
>  \\usepackage{iftex}
>  \\ifpdftex
>  \\relax
>  \\else
>  \\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)
>
> (and this string would be added at some point to org-latex-make-preamble)
>
> 4. Conclusion: I think the good thing about letting LaTeX do the
> conditional work with iftex is that it saves us less invasive code on
> our end. I also think that other more complex approaches, such as
> searching for the fonts present in the system and adding them according
> to the document scripts, would lead us to a completely slippery slope.
> Of course, a list of recommended free-licensed fonts could be included
> in the documentation.
>
> WDYT?
>

I'll prefix this by being very clear that I'm so out of my depth, I know
nothing! I'm an Australian who lives on the worlds largest
island. Despite being a country where 1/4 people have at least one
parent born in a non-english speaking country, Australia is at this time
monolingual. As a consequence, I've never had to deal with fonts other
than trying to select one which 'looks nice'. This tends to be something
I leave to Latex as my aesthetic skills are only slightly better than my
language skills!

Like many, I have had to struggle with fonts at one time or another -
typically, it was with respect to type formatting of mathematics/logic
and it was what got me using Latex originally (30+ years ago). I rarely
need to do this now.

So, my perspective on this is fairly basic.

   - I think the move to luatex is important for org, especially given
     the rise of packages which use/need it

   - It seems like luatex could make org easier to use for those who do
     need support for other non-latin languages and especially for those
     who need to work in multiple languages.

   - For many simpler people like me, I just want it to work. When I
     export to a PDF document, I want to continue to have people say
     "Wow, that is a good looking document, what is your secret" and I
     can reply, "Don't use MS Office!". I don't want to mess with
     selecting fonts, defining font specs etc. I want good defaults.

  - For many people, it seems fonts are a very personal and important
    component and they want the power to manage them at a lower
    level. Therefore, support for this user is as important as my use
    case. They need to be able to adapt their document to their
    preferred fonts without having to code elisp or low level latex/tex.

Juan, if I understand your proposal correctly, I think your on the right
track. It sounds like what you are proposing would have almost no impact
on basic users like me, but would allow those with more demanding
requirements to adjust without too much effort. I originally raised the
question regarding what would need to change with the switch to uatex to
ensure that we do actually get things positioned to enable people to
exploit the benefits and not just switch out one tool for another which
only appears to be a little slower. I think what you are suggesting
addresses that concern. 

but as I said, I know nothing....





  parent reply	other threads:[~2022-07-10 21:21 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 [this message]
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
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=8735f81x7s.fsf@gmail.com \
    --to=theophilusx@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=maciaschain@posteo.net \
    /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).