emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Stefan Nobis <stefan-ml@snobis.de>
To: 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 09:50:51 +0200	[thread overview]
Message-ID: <m1pmic6qas.fsf@nobis-it.eu> (raw)
In-Reply-To: <87pmicqtko.fsf@localhost> (Ihor Radchenko's message of "Mon, 11 Jul 2022 10:19:51 +0800")

Ihor Radchenko <yantar92@gmail.com> writes:

> But can someone check if Free* fonts are available on Windows and
> Mac by default?

I just checked TeXLive (on MacOS, but should be the same on all
systems): The Free* fonts are part of TeXLive as truetype and as
opentype versions (and partly in other formats).

For Windows I remember vaguely that some prefer the MikTeX
distribution (TeXLive is also available for Windows and has the same
fonts as everywhere). A short search shows that the gnu-freefont set
is also availabe for MikTeX, but I currently don't know whether it
will be installed with a default MikTeX installation.

> This unified preamble approach is consistent with what we do now.
> However, our currently used large preambles will slow down compilation.

Not that much. The time consuming packages like tikz/pgf (used by
beamer) are not part of out default preamble. There is not that much
speed to gain (all times are for a single lualatex run):

1) Only hyperref loaded, no other packages:
   0.46s user 0.10s system 99% cpu 0.568 total

2) Complete default preamble for lualatex:
   0.48s user 0.14s system 99% cpu 0.623 total

3) The same as above, but with babel and mathtools:
   0.51s user 0.15s system 99% cpu 0.673 total

4) And another variant (same as before, but package caption instead of
   capt-of):
   0.53s user 0.14s system 98% cpu 0.674 total

5) Back to our default preamble, but adding fontspec:
   0.60s user 0.14s system 99% cpu 0.748 total

6) With fontspec, unicode-math, babel, mathtools, caption:
   1.02s user 0.19s system 99% cpu 1.220 total

Therefore most of out default packages (and even the addition of
babel) does not change much for the speed of compilation. I don't
think its worth to try to further optimize this default preamble.

Adding fontspec and especially unicode-math adds quite some time, so
maybe its worth to take care to only add these if necessary (only for
lualatex/xelatex and only if e.g. if a font has been selected or math
seems to be used in the document).

And, by the way, our preamble is neither large nor complex. For my
LaTeX documents, the preamble is usually *much* larger. :)


Here is the test file for the default preamble (but with mathtools
instead of amsmath and with babel; test run 3):

--8<---------------cut here---------------start------------->8---

% Intended LaTeX compiler: lualatex
\documentclass{article}
\usepackage[english, safe=none, math=normal]{babel}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\date{\today}
\title{Test Document}
\hypersetup{
 pdfcreator={Emacs 28.1 (Org mode 9.5.4)},
 pdflang={English}}
\begin{document}
This is a short test document.
\end{document}

--8<---------------cut here---------------end--------------->8---


Here is the test file for the last run with all extra packages:

--8<---------------cut here---------------start------------->8---

% Intended LaTeX compiler: lualatex
\documentclass{article}
\usepackage{fontspec}
\usepackage[english, safe=none, math=normal]{babel}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage[warnings-off={mathtools-colon,mathtools-overbracket}]{unicode-math}
\usepackage{caption}
\usepackage{hyperref}
\date{\today}
\title{Test Document}
\hypersetup{
 pdfcreator={Emacs 28.1 (Org mode 9.5.4)},
 pdflang={English}}
\begin{document}
This is a short test document.
\end{document}

--8<---------------cut here---------------end--------------->8---



-- 
Until the next mail...,
Stefan.


  reply	other threads:[~2022-07-11  7:51 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 [this message]
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=m1pmic6qas.fsf@nobis-it.eu \
    --to=stefan-ml@snobis.de \
    --cc=emacs-orgmode@gnu.org \
    /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).