From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id kOhYBoQgyGJPggAAbAwnHQ (envelope-from ) for ; Fri, 08 Jul 2022 14:18:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id CNpsBoQgyGIeNAEAauVa8A (envelope-from ) for ; Fri, 08 Jul 2022 14:18:12 +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 8FA832C645 for ; Fri, 8 Jul 2022 14:18:11 +0200 (CEST) Received: from localhost ([::1]:44368 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o9mvy-000396-4L for larch@yhetil.org; Fri, 08 Jul 2022 08:18:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46206) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9mvP-00038u-8g for emacs-orgmode@gnu.org; Fri, 08 Jul 2022 08:17:36 -0400 Received: from mout01.posteo.de ([185.67.36.65]:59117) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9mvM-0005DM-4Z for emacs-orgmode@gnu.org; Fri, 08 Jul 2022 08:17:34 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 069F1240027 for ; Fri, 8 Jul 2022 14:17:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1657282647; bh=jCc618601tpHoaflLrB3aHDpGCEPTUgyQbGf+t2Ehvo=; h=From:To:Subject:Date:From; b=rNJmpabhcuL1o+khmVZ+ScX1IWafQmkMueyBcvX9vkCBiDYAxUpMWgG2neoLu1VLV fx3uV0d2h8KtO4PSJSbeiZJQLmEhlxQlnHWA69qdb6818n1oDOYK1s6ouSAgwVtez1 M1sZlJtbTLMC9VZlhodA4jwMGFGETncgQ1l8Gsfn3ZGuD+rgD9lFT++3Q9kb2l5YWU jHv6l0WgDzwTokSE+xhpFzu9iU7HlFXaFBU85jsPYtvmzXnmUfEcpCizU7JNI8JWtG nInbV0IQkijz1Q1/KJRpu5EnjZkRO3WmXjUuqZi2B+JCUQi9ajiWkr6kRxR8xqds0u 4bNn4EIwzfBJw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4LfXN63Jltz6tmT for ; Fri, 8 Jul 2022 14:17:26 +0200 (CEST) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: orgmode Subject: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX? Date: Fri, 08 Jul 2022 12:17:24 +0000 Message-ID: <87ilo7ztm3.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.65; envelope-from=maciaschain@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 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, HOSTED_IMG_MULTI_PUB_01=2.889, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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=1657282691; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=gAcP2Oz4ujmP1MxiUUs0Crr8b7EaGdUMEDQUkO2dPOo=; b=JBHceeE/oISqssGPcjtc4f+bn7ngQRKeNBMhPXiAq3T5wcSlekeHa+XnStDH4NardteMaB TpDgZUQHzsv4QMEovPwQaaZGFsoBWGZBI/EaVpR0w0ZJ7RGvk09+KlNXg5r0AGPSh907S7 KmtMKuKacOKmXv350qAxnUI+O2bPZ4RQRLD88FMpZeFKwfsPzKzbz3OqeuVAUncyDVSqRX iB7zPXmQ6IrKDD8gbNqCG/bGGfM/ZXZd3oJMoaaKDKFuzpqGdhCmZ/q4osY32AGZZb6779 q9w7D/EpMVtIJfhDNnVtCIeZyGIHXWb1CBttNjFVsbvtcNLzDJHxMjysKdIxgg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657282691; a=rsa-sha256; cv=none; b=CoHqTLnkKwg7a11F8u1vbynZH3mkMRRhuAgHU5TOwgGop06Z1JHCHIFGcUBi7tIwnV/qS3 vD3YdLyQPSz+dTxwKx0YNIfsoU9iNUrS1zKMamR25SDW2wQUMP1LvYQHuBZtTM/MMKG8lM x69WsBFp+tE4YFzhH1xfTKX8Mxkab1mdJJMINLZN1P+C+exZ4Xh2HPlQfEnPyJhr39InKX vGHq7qAr/BpbXYf80mhE4Z/y7IOon578f8lhAR+wmwmSm6jyM4Ghtd1MScjK85XijUEgte hT6z8pwisa0KqXW5gbwZAs4FZ9Dh6G67/G35NREUkqkLcP9KOK2TFQDhsd1WOg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=rNJmpabh; dmarc=pass (policy=none) header.from=posteo.net; 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: -3.95 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=rNJmpabh; dmarc=pass (policy=none) header.from=posteo.net; 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: 8FA832C645 X-Spam-Score: -3.95 X-Migadu-Scanner: scn0.migadu.com X-TUID: 3p9qp4f2c7R9 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 consid= ered 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 kno= w 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, regardless = 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=20 =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=20