From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id yAK/IGPNyGJ1UgAAbAwnHQ (envelope-from ) for ; Sat, 09 Jul 2022 02:35:47 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id qKLHH2PNyGIIdAEAG6o9tA (envelope-from ) for ; Sat, 09 Jul 2022 02:35:47 +0200 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 05A4113168 for ; Sat, 9 Jul 2022 02:35:47 +0200 (CEST) Received: from localhost ([::1]:47816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o9yRl-0004KK-P3 for larch@yhetil.org; Fri, 08 Jul 2022 20:35:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9yQY-0004K0-Jq for emacs-orgmode@gnu.org; Fri, 08 Jul 2022 20:34:30 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:37841) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o9yQV-0006QI-GY for emacs-orgmode@gnu.org; Fri, 08 Jul 2022 20:34:29 -0400 Received: by mail-pf1-x430.google.com with SMTP id w185so385535pfb.4 for ; Fri, 08 Jul 2022 17:34:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=ZE+ypyMo7g4WbBujksqtGnmo3hS+DQcgZA2flyGTvWY=; b=NzJo5+Z5aCNBDjk6ZMoD655qirkMD+/i/rCKi4Lft9v6Ox5MK0bBbBAUzMgkF8uNTZ 7u5G8Ie8an0lELxC+7rZwrf02YUaKvp9SRu3SVjLHqrdYoRoilxz1puFSFrJv6QZ0XYG cuv+a3y1/LqbEIHMWxQja7bZbZ0nuTj9qZqaui5bDWTIErEWhdJVU+KuFHoemBOXC387 UOMxrSoXtfLIFIJHOJFsXnjLZ1Kmq1+bp0tcScKLblAXzP+0vV3JoKWMJd2l7+cVQquj fq3SwraHn3VTA9uGUjyaGCbvmSx61a3e355UD8GGsfBAL9DZlMTFFrX9sbDZ3jf/veu9 DpmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=ZE+ypyMo7g4WbBujksqtGnmo3hS+DQcgZA2flyGTvWY=; b=plwI2U0clb/0EdxYLUgONAPu1lVRXQvLzNCzTGuP22ZIduiJ7UMLm5p0VOYYjrL2WA RDCFgiioyBD8tH/2fTuq/rCNEqBgdq/y/TxGnve3yobEKXtelTYSgFW68tuaL6lDZLNq YPTcRbq/nkJIE8bhwNccrfuHI47MXRDfGoktpi5BlEwOmulVo7rHJfIU+BsDNUzm3U15 eaL1rXWWOFPCPL3cyseqHdBbpj0k+q/bkYJVcgZxeabgTeDekVR5JAWbEn3rIYnzUHkJ F7iwzOBQMFkREIuMaL8dszIsj0mq8kbdvgBUmmmEvzwfywN+Il0rR20iNqdNH1KBRgrm bm2g== X-Gm-Message-State: AJIora8qi0+NGYtLgpNoVs6Zuqu/fxpNyMkOM100fP1V/MKAWdcYkUcT RDlyRIPYTk2ySeR84TqgU6bshglQ9cY= X-Google-Smtp-Source: AGRyM1tBZ/wtJv9CdsIJGkdK/+JayFfoy1jm4G12A62ydaUOEz3xuBXCRAO2TDJV1knWBKe+63ch3Q== X-Received: by 2002:aa7:8390:0:b0:528:5e9:9d31 with SMTP id u16-20020aa78390000000b0052805e99d31mr6375011pfm.30.1657326864783; Fri, 08 Jul 2022 17:34:24 -0700 (PDT) Received: from ryzen3950 (c-208-82-98-189.rev.sailinternet.net. [208.82.98.189]) by smtp.gmail.com with ESMTPSA id o11-20020aa7978b000000b005289fbef7c4sm179877pfp.140.2022.07.08.17.34.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jul 2022 17:34:24 -0700 (PDT) From: Matt Huszagh To: Juan Manuel =?utf-8?Q?Mac=C3=ADas?= , orgmode Cc: Subject: Re: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX? In-Reply-To: <87ilo7ztm3.fsf@posteo.net> References: <87ilo7ztm3.fsf@posteo.net> Date: Fri, 08 Jul 2022 17:34:23 -0700 Message-ID: <87tu7r5dkg.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=huszaghmatt@gmail.com; helo=mail-pf1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1657326947; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=ZE+ypyMo7g4WbBujksqtGnmo3hS+DQcgZA2flyGTvWY=; b=USlynBMzAWnoeKiWmFKZMKMt7GffyiD9sVeWJTtRQk5jTdHDJe5ugxIvGDnNpOB0KHg2x+ LVHt/UUNuBUo6/2tWnRsqzJD1fJr9pAl2SqrclF40F2sUBu2pJbNRHSYFRzDju44U6XmR+ 6hLIn+A0QpzcXpQ2Udi6cY6dPbl5DnnnpQxYf7N1r1+nDqFVZN25F8I+2wlEuhRZ2eRinv y65FjkchApjhrk8iVJmID5sPOcbMxljD04UZc9LdQ2+vtUS2EVCbjmMUaUxESeT+g3mm55 Vi/plRZ3ZJuBPhSoW7rioCxhcRbGHulTTWrn5LgVLy3IOJMW+IdGaW6voY32tg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657326947; a=rsa-sha256; cv=none; b=ZLT9t7g66JcSEUUd8zZl+lHjKhz1JBGydVtet3oWuYhEWFfnxUGN6U8uOC4P5qJQ/pkI4V hNAaioQUpbKlu2l/Qpxc5btYFz5hyA/UxFxSdKPp9ftaHV19M+w9M8kZJp/xS11EoFaH6J xzY8/RII1V+AUF9ppa2wbUPF0/mNfVkFxCPSpN3BsX7wTzn7963v7MPCYY3so4t30YCir4 gpoT3GXI7H6fYtHopFCKH5P9Sj71JzNjAsJA+GxwI3OoInxzz1yARtldMKpmo3Sa4x+4aD OeLnFg5zKEHKZJdq7mcpt6f+acoLR6Nsvrter83b9D86KyJ/u6x0adf18fxjYg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=NzJo5+Z5; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -8.25 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=NzJo5+Z5; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 05A4113168 X-Spam-Score: -8.25 X-Migadu-Scanner: scn0.migadu.com X-TUID: WGKdelYovjPt Juan Manuel Mac=C3=ADas writes: > TL;DR: A list of use cases where using LuaTeX is more advantageous than > using pdfTeX > > ------------ > > Many times Org users who frequently need to export their documents to > LaTeX, but who do not have much LaTeX experience (or their knowledge of > the TeX ecosystem is somewhat out of date), find themselves confused by > the different versions of the TeX engine: pdfTeX, XeTeX, LuaTeX=E2=80=A6 = In Org > pdfTeX is the default engine, which in 2022 has a few limitations and is > really old, but still perfectly meets the needs of a significant group > of users. However, there may be a number of cases where it is more > advantageous to compile with LuaTeX, so here I will leave a short list > of those cases where LuaTeX may be a happy choice over pdfTeX. > > But first it is worth clarifying some things about LuaTeX along with > some misunderstandings: > > =E2=80=A2 LuaTeX is the evolution of pdfTeX, therefore LuaTeX can be cons= idered > as the current de facto TeX engine. It is intended to replace pdfTeX, > and in fact many of us already consider pdfTeX obsolete and > deprecated. > > =E2=80=A2 To use LuaTeX it is not necessary to learn anything new or to k= now how > to program in Lua. LuaTeX includes a Lua interpreter and the ability > to bypass TeX primitives through Lua scripting (hence called LuaTeX). > But all of that is more on the side of developers and packagers. For > example, I am currently writing two LaTeX packages (one in > collaboration with a colleague) where 80% of the code is Lua and 20% > is (La)TeX. Of course, any user who knows Lua can take advantage of > the \directlua primitive or the luacode environment in their > documents. > > =E2=80=A2 A standard LaTeX document is always a LaTeX document, regardles= s of > the flavor of TeX used to compile that document. There will be some > minor differences. For example, in LuaLaTeX it is unnecessary to add > fontenc and inputenc commands in the preamble. > > And now we go with the non-exhaustive list of cases where compiling with > LuaTeX can be more advantageous for the user: > > 1. When you need to work in a *real* Unicode environment and not in > pdfTeX=E2=80=99s 'fake Unicode'. And, especially, when it is required = to work > with languages that use a non-Latin writing system: Greek, Arabic, > Hebrew, all the languages that use Cyrillic, oriental languages, etc. > An extreme example you can see in this small code that I wrote for > LuaTeX in order to be able to use the syllabograms of the ancient > Mycenaean script: > > > > 2. When using truetype or opentype fonts is required. The pdfTeX user is > limited to using only the included type1 fonts, the number of which > is very limited. Besides, type1 is a deprecated and pre-unicode > format. In fact, it almost always ends up leaving the default > Computer Modern font. In LuaTeX we can use not only all the fonts > installed on our system but also any font (just indicate the path), > which is an important advantage over XeTeX. A basic command could be > something like (loading the fontspec package): > > =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80 > =E2=94=82 \setmainfont{Palatino Linotype} > =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80 > > And with the latest versions of Babel we can associate fonts for > different writing systems, without the need to change languages > explicitly with a \selectlanguage. > > We can define all the font families we want or redefine the default > families. For example, with this command I define the default > monospaced font and request that it be scaled according to the > height of the lowercase of the main font: > > =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80 > =E2=94=82 \setmonofont{Iosevka Fixed Curly}[Scale=3DMatchLowercase] > =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80 > > 3. When you need to take advantage, to a greater or lesser extent, of > the opentype features of a font. For example, here we define the main > font to use old style numbers: > > =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80 > =E2=94=82 \setmainfont{Palatino Linotype}[Numbers=3DLowercase] > =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80 > > We can also load the otf tags directly: > > =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80 > =E2=94=82 \setmainfont{Palatino Linotype}[RawFeature=3D+onum] > =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80 > > The fontspec package for managing fonts in LuaTeX and XeTeX is very > versatile and powerful. We can also associate a different font as > italic for an already defined font family, use different optical > resolutions of a font, etc. If what you are looking for is precise > and absolute fine-tuning of the fonts used, of course LuaTeX is the > ideal choice. > > 4. In general, when professional-level typographic fine-tuning is needed > (and far superior to that offered by dtp programs like InDesign or > QuarkXpress). For example, we can define on the fly new position > opentype properties for a specific font, without having to edit the > font. It is a non-destructive method that uses the > fonts.handlers.otf.addfeature lua function. For example, we can > define a new kerning value for the letters A and V. We=E2=80=99ll call= it > =E2=80=99mykern=E2=80=99 > > =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80 > =E2=94=82 \directlua{ > =E2=94=82 fonts.handlers.otf.addfeature > =E2=94=82 { > =E2=94=82 name =3D"mykern", > =E2=94=82 type =3D"kern", > =E2=94=82 data =3D > =E2=94=82 { > =E2=94=82 ["A"] =3D { ["V"] =3D 270 }, > =E2=94=82 }} > =E2=94=82 } > =E2=94=82 > =E2=94=82 \setmainfont{Linux Libertine O}[RawFeature=3D+mykern] > =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80 > > Here you can see a more bizarre and vandalistic example, where I have > replaced the accent of the accented letters in Spanish with the image of > a hammer :-) > > https://i.imgur.com/iixxJmx.png > > Here I have placed the image of a dancer on the tilde of the spanish > letter =C3=B1: > > https://i.imgur.com/oIZzpbJ.png > > (The process is simply to decompose the complex characters from the > precombined form to their canonical decomposition: NFC > NFD, and then > use a png image as a diacritic :-): > > \newunicodechar{^^^^0301}{\raisebox{1.2ex}{\includegraphics[width=3D.28em= ]{martillo.png}}} > > 1. Lastly, a lot of new (increasingly) LaTeX packages are written on top > of the advanced features of LuaTeX and require LuaTeX. A very useful > package, for example, is impnattypo, for post-production fine-tuning > (). Among the many features of > impnattypo we have the ability to prevent lines from ending in > single-letter words. It also highlights in draft mode, homeoarchy > cases, which are typographically incorrect. An example in one of my > recent works: > > > > Best regards, > > Juan Manuel I typically use luatex instead of pdftex and the sole reason is performance for pgfplots. The performance gain is night and day when generating plots with many points. I forget exactly why this is. When I'm generating very simple documents I stick with pdftex, which is faster in those cases. As for lua scripting: I made some brief forays into this but found it not to be especially useful for me: the reason for that may just have been lack of persistent effort, though. When I want more modern programming features I typically use pylatex. Matt