From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id WPcnJOu+bWBJBwEAgWs5BA (envelope-from ) for ; Wed, 07 Apr 2021 16:17:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id wHIEHuu+bWCEMQAAbx9fmQ (envelope-from ) for ; Wed, 07 Apr 2021 14:17:15 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AF03D1F22B for ; Wed, 7 Apr 2021 16:17:14 +0200 (CEST) Received: from localhost ([::1]:49486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lU8zZ-00013t-U1 for larch@yhetil.org; Wed, 07 Apr 2021 10:17:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU8z5-00013h-SI for emacs-orgmode@gnu.org; Wed, 07 Apr 2021 10:16:43 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:55111) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lU8z3-000305-9W for emacs-orgmode@gnu.org; Wed, 07 Apr 2021 10:16:43 -0400 Received: by mail-wm1-x329.google.com with SMTP id k128so9113341wmk.4 for ; Wed, 07 Apr 2021 07:16:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zzamboni-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Qeib24rbeBo3L4fmCQvnDPNMeoWj2Jz99vE0x8x/zjk=; b=sNkYYlDG+zcqJpAHOOWq6WmZAJxZK+alivHOxaooVBPOQqdYDeXl2gLdchIoNKhshy futL5Wh0y7/pQgmtyvxSkKwMX759nISP6ITDOkdwrj58suPJ/L5IR/5lKEXBICrXjkPk fpKilB92zhWiLAeU2GEJu2uGXfNPuzlN6HWA/hyLtYYOzMOteiAsPlk5iUrSl+QSWcE5 6n9wUHEpgXjRURA3bS5sm04BZDE7b6OvEW0URtecosB2yLxuP46zKlA4KIQ60ZodbwVR e1xt7Vx00R+tJ9r5Cocu7mhie9kHoTDjax1qCoeCjZ9K8pt9lrIBLszOV0gjRnKvHQZ9 WSGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Qeib24rbeBo3L4fmCQvnDPNMeoWj2Jz99vE0x8x/zjk=; b=ugkUEQXq9Cc8U12UItz2KjrMnM5a/6djrZOUErNrvzW6lQwPm8DaSKcq4ABQE9MSlf Fbwlp9yuPfmJaeLI4XaEcOtpfgAJC2eq3EXNrZVdRVBQ8O9Pgpgxix6qL2wWy3I5BTl/ s+0DkNNldZ+I9uK8hc2Vh9/w1iUUMsB6+uxvyJbUYbpjGBJ/vwg3tnjQzYr2qWZq6UiA XH3+/P0Y4/rMbqVZFPvE+lPUuXQHa0sc32Sn3vPe0rJc7X4/1kKyE8AkiH12T/SSDatz rm8JNw2oAdVZ3A51PhL7XIgoRFhJcKvqME1MgV/mGjym1ydBHwjoIVHOy+/WQ48nmNCj 7Cgw== X-Gm-Message-State: AOAM533p1YZxn1AZVMx88eZMwfJP5uwFWcfXLCGfBtX5I7/dtb93SUX0 uOOYZXMff5HZJ00PL7l9ArcxA9mkCq4tuOugPknzlA== X-Google-Smtp-Source: ABdhPJwoT3TD4P0It7lImINZFBTseQbyGifckellyoW/hepcB0EpP5c8MuHLnbTjLg5snnypHyTUI81ywugujh+3XMg= X-Received: by 2002:a1c:ed0a:: with SMTP id l10mr3262475wmh.151.1617804998393; Wed, 07 Apr 2021 07:16:38 -0700 (PDT) MIME-Version: 1.0 References: <87tuokh2z3.fsf@posteo.net> In-Reply-To: <87tuokh2z3.fsf@posteo.net> From: Diego Zamboni Date: Wed, 7 Apr 2021 16:16:27 +0200 Message-ID: Subject: Re: Choosing a LaTeX Compiler (my predilection for LuaTeX) To: =?UTF-8?Q?Juan_Manuel_Mac=C3=ADas?= Content-Type: multipart/alternative; boundary="0000000000003ed0c205bf629470" Received-SPF: none client-ip=2a00:1450:4864:20::329; envelope-from=diego@zzamboni.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: orgmode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1617805035; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Qeib24rbeBo3L4fmCQvnDPNMeoWj2Jz99vE0x8x/zjk=; b=nQGql+/F7ShVDVYP3l4/Ea0V9qPs2PJhXP/MhRZZmJslS88sAd7ABh7ArW34tKxtsYrJeB oSk9FNe4aXudZ2rq6KkMshkdqGwcxmnFw2jcABA9L+pg+MLLWTtcWvOBCpJ4jaO8WJvYcH 6LQqP4OIgQS/Ooa7qGTltoyTt+Jb2XEejLbIaJpgow12kshlB6DOJn2ZOryQIU4tmnmbQT KM+3+uNDCiPC80io3agbSWB4zRsoIiwKFNZHpxntB+jjzhNULUtWTCPzImUR8UGqtjv8MB TRqI85EBNUEuzW5ogPrJqw4QU+uPTzdYJpZ0TP69S7d24X5jSMADjTM3v28oCg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617805035; a=rsa-sha256; cv=none; b=nGorxH0D42R+kVxxgcmnWppbNW5GGTIQ/Uope2fDdROLIgMl6LAji++7P3bMlPggy8c5TU x1GiIuYVNk69qIVDGdfWVSV2CAXdWxW53STLrH4zQIOkhjQhfJpTmOdkLJbob+PwJGZVKB FeV3cTJLRdMX0gVo440YQv9m8YPa1FKVNVTeQBFgw/GVJe5V7s8ctR0Erxw+iy8miR+zEO pglvjzc1D6JI+mXVLprQIMCv6KwI6Skm6X8Hqd00m3R9gPx84fqqgmY0B4MuIV4ZJs3JW/ Foh7f+PaobEebG5JbkUDgwQROpsH96Pp8MdxtMMFYZah27Dov7hPngKtKwEZXg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=zzamboni-org.20150623.gappssmtp.com header.s=20150623 header.b=sNkYYlDG; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.23 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=zzamboni-org.20150623.gappssmtp.com header.s=20150623 header.b=sNkYYlDG; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: AF03D1F22B X-Spam-Score: -3.23 X-Migadu-Scanner: scn0.migadu.com X-TUID: lEhwRwFguTmY --0000000000003ed0c205bf629470 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Juan Manuel, Thank you for writing this, which is the clearest explanation I have seen of the advantages of LuaLaTeX/XeLaTeX. I have been using LaTeX for nearly 30 years, but stopped using it intensively every day when pdfLaTeX was still the bleeding edge. When I started again in the last couple of years, it has been a bit confusing to understand why and what all these different versions are. These days I use LuaLaTeX as well, but most of the documents I process are exported from Org-mode. Best, --Diego On Mon, Apr 5, 2021 at 10:49 PM Juan Manuel Mac=C3=ADas wrote: > Hi all, > > There have been some threads recently about exporting to LaTeX, but I > think something that I consider interesting for novice Org/LaTeX users > has not been commented: the choice of the TeX engine. I think this is > important because although people often say they "use LaTeX", what they > actually use is TeX via the La-TeX format. What TeX engine to choose? I > would dare to say the following: unless you want to maintain some > backward compatibility with old documents, I highly recommend using > LuaTeX or XeTeX, especially LuaTeX. Although pdfTeX is very popular > among average or veterans LaTeX users, I think using it nowadays doesn't > make much sense (IMHO). LuaTeX is the natural evolution of pdfTeX and > adds the great advantage of accesing the TeX internals through Lua > scripting. > > (What follows is specially intended for those Org users who haven't used > XeTeX or LuaTeX yet). > > LuaTeX and XeTeX are *100% Unicode-based* and you can use your system > fonts (open type, true type, etc.) in your documents in a simple way > through the fontspec (https://www.ctan.org/pkg/fontspec) package, which > provides a very neat interface and manages all OpenType features (LuaTeX > and XeTeX use HarfBuzz as otf rendering engine). In LuaTeX also you can > use any font that is not installed in your system: just indicate the > path to the fonts files. This is very useful to test new fonts without > installing them... In all modern word processing systems the user has > always been able to pick a font easily, and that has been historically > quite complex, hard and complicated in the (La)TeX ecosystem. > > For example, if we want to use globally the Palatino Linotype family in > our LuaLaTeX document: > > \setmainfont{Palatino Linotype} > > We can add some OpenType features, like old style numbering: > > \setmainfont{Linux Libertine O}[Numbers=3DLowerCase] > > And if we want to use another font for italics, with certain properties > (color[1] and scaling): > > \setmainfont{Crimson} > [Numbers=3DLowercase, > ItalicFont=3DMinionPro-It.otf, > ItalicFeatures=3D{Color=3Dred, > Scale=3DMatchLowercase}] > > ([1] Requires the xcolor package) > > We can also define our own family with its properties (for example, with > upper case numbers and letters tracking): > > \newfontfamily\myfamily{crimson} > [Numbers=3DLining,LetterSpace=3D3.0] > > Furthermore (for more advanced users), in LuaTeX we can define new > opentype features on the fly, both positional and of substitution (as > long as the typeface includes the glyphs needed to replace). For > example, if I use the Crimson typeface, a contextual substitution for > character Q + u can be defined, by including some Lua code through the > LuaTeX primitive `directlua': > > \directlua{ > fonts.handlers.otf.addfeature{ > name =3D "mycontextual", > type =3D "chainsubstitution", > lookups =3D { > { > type =3D "substitution", > data =3D { > ["Q"] =3D "Q.alt01", > }, > }, > }, > data =3D { > rules =3D { > { > after =3D { { "u" } }, > current =3D { { "Q" } }, > lookups =3D { 1 }, > }, > }, > }, > } > } > > ... And add anywhere in the text: > > \addfontfeature{RawFeature=3D+mycontextual} > > If I had to choose, finally, between XeTeX and LuaTeX, I would choose > LuaTeX, for things like these and many other reasons. In addition, there > are emerging cool new packages that only work with LuaTeX. > > Anyway, XeTeX is another very good option too, especially for users who > prefer something that works more "out of the box" and is less esotheric > than LuaTeX. > > To export to PDF always with LuaTeX we can put in our ~ /.emacs: > > (setq org-latex-pdf-process > '("lualatex -shell-escape -interaction nonstopmode -output-director= y > %o %f" > "lualatex -shell-escape -interaction nonstopmode -output-director= y > %o %f" > "lualatex -shell-escape -interaction nonstopmode -output-director= y > %o %f")) > > Or with latexmk, which will take care of compiling as many times as > necessary for indexes, bibliographies, etc .: > > (setq org-latex-pdf-process > '("latexmk -lualatex -e '$lualatex=3Dq/lualatex %%O -shell-escape > %%S/' %f")) > > Best regards, > > Juan Manuel > > --0000000000003ed0c205bf629470 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Juan Manuel,

Thank you for writing t= his, which is the clearest explanation I have seen of the advantages of Lua= LaTeX/XeLaTeX. I have been using LaTeX for nearly 30 years, but stopped usi= ng it intensively every day when pdfLaTeX was still the bleeding edge. When= I started again in the last couple of years, it has been a bit confusing t= o understand why and what all these different versions are. These days I us= e LuaLaTeX as well, but most of the documents I process are exported from O= rg-mode.

Best,
--Diego


On Mon, Apr 5, 2021 at 10:49 PM Juan Manuel Mac=C3=ADas <maciaschain@posteo.net> wrote:
Hi all,

There have been some threads recently about exporting to LaTeX, but I
think something that I consider interesting for novice Org/LaTeX users
has not been commented: the choice of the TeX engine. I think this is
important because although people often say they "use LaTeX", wha= t they
actually use is TeX via the La-TeX format. What TeX engine to choose? I
would dare to say the following: unless you want to maintain some
backward compatibility with old documents, I highly recommend using
LuaTeX or XeTeX, especially LuaTeX. Although pdfTeX is very popular
among average or veterans LaTeX users, I think using it nowadays doesn'= t
make much sense (IMHO). LuaTeX is the natural evolution of pdfTeX and
adds the great advantage of accesing the TeX internals through Lua
scripting.

(What follows is specially intended for those Org users who haven't use= d
XeTeX or LuaTeX yet).

LuaTeX and XeTeX are *100% Unicode-based* and you can use your system
fonts (open type, true type, etc.) in your documents in a simple way
through the fontspec (https://www.ctan.org/pkg/fontspec) packag= e, which
provides a very neat interface and manages all OpenType features (LuaTeX and XeTeX use HarfBuzz as otf rendering engine). In LuaTeX also you can
use any font that is not installed in your system: just indicate the
path to the fonts files. This is very useful to test new fonts without
installing them... In all modern word processing systems the user has
always been able to pick a font easily, and that has been historically
quite complex, hard and complicated in the (La)TeX ecosystem.

For example, if we want to use globally the Palatino Linotype family in
our LuaLaTeX document:

\setmainfont{Palatino Linotype}

We can add some OpenType features, like old style numbering:

\setmainfont{Linux Libertine O}[Numbers=3DLowerCase]

And if we want to use another font for italics, with certain properties
(color[1] and scaling):

\setmainfont{Crimson}
[Numbers=3DLowercase,
ItalicFont=3DMinionPro-It.otf,
ItalicFeatures=3D{Color=3Dred,
Scale=3DMatchLowercase}]

([1] Requires the xcolor package)

We can also define our own family with its properties (for example, with upper case numbers and letters tracking):

\newfontfamily\myfamily{crimson}
[Numbers=3DLining,LetterSpace=3D3.0]

Furthermore (for more advanced users), in LuaTeX we can define new
opentype features on the fly, both positional and of substitution (as
long as the typeface includes the glyphs needed to replace). For
example, if I use the Crimson typeface, a contextual substitution for
character Q + u can be defined, by including some Lua code through the
LuaTeX primitive `directlua':

\directlua{
=C2=A0 =C2=A0fonts.handlers.otf.addfeature{
=C2=A0 =C2=A0 name =3D "mycontextual",
=C2=A0 =C2=A0 type =3D "chainsubstitution",
=C2=A0 =C2=A0 lookups =3D {
=C2=A0 =C2=A0 =C2=A0 {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 type =3D "substitution",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 data =3D {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ["Q"] =3D "Q.alt01",=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 },
=C2=A0 =C2=A0 =C2=A0 },
=C2=A0 =C2=A0 },
=C2=A0 =C2=A0 data =3D {
=C2=A0 =C2=A0 =C2=A0 rules =3D {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 after=C2=A0 =3D { { "u" } }, =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 current =3D { { "Q" } },
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 lookups =3D { 1 },
=C2=A0 =C2=A0 =C2=A0 =C2=A0 },
=C2=A0 =C2=A0 =C2=A0 },
=C2=A0 =C2=A0 },
=C2=A0 }
}

... And add anywhere in the text:

\addfontfeature{RawFeature=3D+mycontextual}

If I had to choose, finally, between XeTeX and LuaTeX, I would choose
LuaTeX, for things like these and many other reasons. In addition, there are emerging cool new packages that only work with LuaTeX.

Anyway, XeTeX is another very good option too, especially for users who
prefer something that works more "out of the box" and is less eso= theric
than LuaTeX.

To export to PDF always with LuaTeX we can put in our ~ /.emacs:

(setq org-latex-pdf-process
=C2=A0 =C2=A0 =C2=A0 '("lualatex -shell-escape -interaction nonsto= pmode -output-directory %o %f"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 "lualatex -shell-escape -interaction nonst= opmode -output-directory %o %f"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 "lualatex -shell-escape -interaction nonst= opmode -output-directory %o %f"))

Or with latexmk, which will take care of compiling as many times as
necessary for indexes, bibliographies, etc .:

(setq org-latex-pdf-process
=C2=A0 =C2=A0 =C2=A0 '("latexmk -lualatex -e '$lualatex=3Dq/lu= alatex %%O -shell-escape %%S/' %f"))

Best regards,

Juan Manuel

--0000000000003ed0c205bf629470--