From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 sFUgIMRCy2J0kgAAbAwnHQ (envelope-from ) for ; Sun, 10 Jul 2022 23:21:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id ICRHH8RCy2KYBAAAG6o9tA (envelope-from ) for ; Sun, 10 Jul 2022 23:21:08 +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 1FD6412616 for ; Sun, 10 Jul 2022 23:21:08 +0200 (CEST) Received: from localhost ([::1]:47538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oAeMU-0000qW-Ht for larch@yhetil.org; Sun, 10 Jul 2022 17:21:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oAeLv-0000qD-7H for emacs-orgmode@gnu.org; Sun, 10 Jul 2022 17:20:31 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]:42542) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oAeLt-0005pY-KL for emacs-orgmode@gnu.org; Sun, 10 Jul 2022 17:20:30 -0400 Received: by mail-pj1-x1033.google.com with SMTP id i8-20020a17090a4b8800b001ef8a65bfbdso3262264pjh.1 for ; Sun, 10 Jul 2022 14:20:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=b6mvCgpCvnp9hX4lKmu0Sz7BOddZtiVuQa5w684uV3o=; b=blrKlTOJm27T3pcTxLfLX40Y6HT650gWwus53gD+ENYYzH16ifabpFTdVjTBkTBNWR ygoJfbZM4H/WUW802XKcl+nzQR2M6kWBeGKm7om5aJpx7uLTgk/aLFMw8v3gKnjwy3Fz +uBufZcBVaK6e/1fOXCgw3pdWP7H9j6tq5Yhzh2PZ+CRMpzLYbzVdghnxWD3gY498tUN eJ8aYRaPQ+LgAfPkvPPLoX3TWnQsFsvy+ZC/fJ92H9PsogV9cvGqG06V3Lh9lmN/gFfp q5uYxtxQJmrhWHFhnCb097ZoW9HDkd3v+CsfCm6cERkf16o/qTKSw8djE15v3XS2EfLW fTsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:cc:subject:date :in-reply-to:message-id:mime-version:content-transfer-encoding; bh=b6mvCgpCvnp9hX4lKmu0Sz7BOddZtiVuQa5w684uV3o=; b=AXNOf9JYMa1Ui2ZfzC+ZVihk7jVimwVNN6sgNipd8IdqqAMumH/nssLgSW7+tYHm+S MIRJD5dpV1+E+OEBAkgt1SQCcGRshydf8OmB0Uf8RK+e5LxLET41CFLsDT6sdEUTaDc7 +JlOZCFo3xu4DQcZ16pn/Akl1CCbA7YfF1SBWMfyUsgcP91YWqB7CVCAiMCYN4P7I2wL 6wvZnXw1hWsRatj5scd4R2C5QhhU0oHVOnU/ZzbDLc0Uvoh2AZ8Lhr/NM32u1eDC6LsR hiTpGKthgAKRVGwqZUMWdiFfyIcG+WD3Uf0ksQlTIA72XPO8vNgbRugIitnYwLwRFD60 o8zA== X-Gm-Message-State: AJIora+FJU1HFBB9x+C9xt3VF+05tHnKCbhyciHY/JdM8cJAeKptk2th 0C0XfOKGlma1Pofx1/ZeaamDs+RsBoEy9Q== X-Google-Smtp-Source: AGRyM1tJZCQLKk2r9vtjf0wmKUE4V7UgQZE2L22vYw+fb1eIjyY0QptqbPS155/LggKkvX6AxX2DNA== X-Received: by 2002:a17:90b:1643:b0:1f0:2094:57db with SMTP id il3-20020a17090b164300b001f0209457dbmr8298595pjb.140.1657488027913; Sun, 10 Jul 2022 14:20:27 -0700 (PDT) Received: from dingbat (2001-44b8-31f2-bb00-857f-4de0-ad13-9a7c.static.ipv6.internode.on.net. [2001:44b8:31f2:bb00:857f:4de0:ad13:9a7c]) by smtp.gmail.com with ESMTPSA id k88-20020a17090a3ee100b001ef8ab65052sm3225539pjc.11.2022.07.10.14.20.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Jul 2022 14:20:27 -0700 (PDT) References: <87ilo7ztm3.fsf@posteo.net> <87ilo7tp78.fsf@tsdye.online> <87o7xy8t4g.fsf@posteo.net> <87a69i8ha1.fsf@posteo.net> <87tu7qnij4.fsf@posteo.net> <87r12ssonv.fsf_-_@posteo.net> User-agent: mu4e 1.8.5; emacs 29.0.50 From: Tim Cross To: Juan Manuel =?utf-8?Q?Mac=C3=ADas?= 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 In-reply-to: <87r12ssonv.fsf_-_@posteo.net> Message-ID: <8735f81x7s.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::1033; envelope-from=theophilusx@gmail.com; helo=mail-pj1-x1033.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=1657488068; 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=b6mvCgpCvnp9hX4lKmu0Sz7BOddZtiVuQa5w684uV3o=; b=VkZ+pSunDHI+lKpQuCheKePYvDhg+Zo4XBr5Iib2XmRU9XEDwqTAxv3wR4ApHAjMugMi1q tML4R8zn74t3BuK+sI48kRcH06eO9NqRw2dQRgDYEMbLdagqqBfieYOohLzOEcP8ms63Nk rXzPsvWC0gBJ6aPQ0xUqyLGyAi/Op87dM/pUCwR6Fn5qL+LhKXOJE/J7N6P7ZradM3tD6+ D9XS5xQ1S9AybF98Iq0AtN7iFyXBUMgw+39z4DEbr9dVzeE3q43mWnLftog4tFolOBQkAt EXJIG/1HcN6JkUbzGQvL257n7jA53ZFrSgak7MRRUdMNkrCyNKtDK5QH9nRacw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657488068; a=rsa-sha256; cv=none; b=hPdFBWKBiIINj2M9QXuBv39QtiWWlokRRw89Zx3xMUBK/6YBPDhGcOl/ALSZnmOkV/5+Ha 0cZdF3zcYG9lKP9FqsushnxaQsKjlD20aCbMklPglJiw/8NXd6AtPZvdrC2cAuhWKYNj4K WzJR7nAPrtVkgNCroiHcNWbjFKfVRqa+M9G9OjvGIIHvkIY9ncDrI3FMs0irlxQeTvPOqC kE2U2RMTMD+nJ1GbTuqpp3PZNhS77zNeig0uemlnIODSHPqdRsjag2n9aXPN7Qm9aGL8/Y hXNCiHawOVcMiHSkFRcA3LJgIzdJEyK13QcCWfnj7CpFUOoKSuBSa61RRvj1Jw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=blrKlTOJ; 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: -5.75 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=blrKlTOJ; 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: 1FD6412616 X-Spam-Score: -5.75 X-Migadu-Scanner: scn0.migadu.com X-TUID: 97knvpiks40T Juan Manuel Mac=C3=ADas 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=3DMatchLowercase} > \\defaultfontfeatures[\\rmfamily]{Ligatures=3DTeX} > \\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.=20 but as I said, I know nothing....