From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 mHiDIKWIy2LgeAAAbAwnHQ (envelope-from ) for ; Mon, 11 Jul 2022 04:19:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id GEdsIKWIy2LgDAAA9RJhRA (envelope-from ) for ; Mon, 11 Jul 2022 04:19:17 +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 08D773861C for ; Mon, 11 Jul 2022 04:19:17 +0200 (CEST) Received: from localhost ([::1]:49478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oAj12-0005un-67 for larch@yhetil.org; Sun, 10 Jul 2022 22:19:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50038) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oAj0a-0005uc-5Z for emacs-orgmode@gnu.org; Sun, 10 Jul 2022 22:18:48 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:33292) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oAj0Y-00069y-4D for emacs-orgmode@gnu.org; Sun, 10 Jul 2022 22:18:47 -0400 Received: by mail-pl1-x636.google.com with SMTP id v21so777630plo.0 for ; Sun, 10 Jul 2022 19:18:45 -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=r23PTMFTXl222lXejbWlsXzFfEZlAwBbYFNUJg7yB5k=; b=QWcdnKNM35XHphZooZuO77n5sq4JEy2ZiuZLgEPZDuNcUl5ULjbJ7kHZ6opFMwJjOC 8yupHRcmltlsZf0hH4yw8LRxWQf/jUO8sOwHV6DnYUtHdFntV8L0z9i+HSYxIW6C3Yag 2fZuTo+wtxHEF2+nUzzPJy+fo+bY9rnBbq2q1DmAV5Z3HEZuLPwrzA2bPKv/9yIgEUGV sbstq7hkesCRDocEEkXtVXcKZG4iJOkM8xEifEgZXqZTLszuH9gyIsBQNuaWIIEXtpGX 5eRXwXMRNeRe0FBugLr8RDxpSU28fHNNlQSXQ0YHdmnSfRiJ2z0G//sNnemxlrqI6j5n srXQ== 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=r23PTMFTXl222lXejbWlsXzFfEZlAwBbYFNUJg7yB5k=; b=EYMhvqTM4OYXC+XG+S2SN5eL2DSlAT4NPsg4W5336uI1BBtIvmCaqVteWnfOklqpnK hlFznrWTwZv/bCLK1Xyg+wnDagI6+2mFe+L5W42iTTSyQ78jlaJpFfLoBYI2wFi3tG63 SIaLsf4mgiI/0aR/w++hTz/eQUDBqayqkzde81+VjYsj37sSnM8EUWEQ4jDnVk7Xk2Ll 1fwD/7BtUK2t/zq/Ypmq5Ipbl0C++SC4L2jC0Aq9omi+YaaLoPr42Es/HiLxyrgAeayW qg227KR31Fg27D5Id0MHh1L2wbg7FFJUqR+tr1P8cS0W6i4kL5/CPdoyu4oBrXJifheF ax8Q== X-Gm-Message-State: AJIora8ULnNRWTuLn1UVSOrIYIdRVGAz1zr21TxWvhW2MQatSLRWW2iC 3f8Mn0zq5oj8ehduYTqJon8= X-Google-Smtp-Source: AGRyM1uOzDSe/h4FJg64zSkqdsMo74Y5l+cs247Is271f6ZXeavpdvPQ+jWD73JjzwD02hSiPTq1aA== X-Received: by 2002:a17:902:b107:b0:16b:d7f7:ff8a with SMTP id q7-20020a170902b10700b0016bd7f7ff8amr16019894plr.148.1657505924600; Sun, 10 Jul 2022 19:18:44 -0700 (PDT) Received: from localhost ([157.52.138.46]) by smtp.gmail.com with ESMTPSA id o15-20020aa7978f000000b00528a097aeffsm3489641pfp.118.2022.07.10.19.18.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Jul 2022 19:18:43 -0700 (PDT) From: Ihor Radchenko To: Juan Manuel =?utf-8?Q?Mac=C3=ADas?= , Timothy Cc: orgmode Subject: Re: [possible patch] Basic fontspec code for LuaLaTeX and XelaTeX (was "LaTeX export: when is it more useful...") In-Reply-To: <87r12ssonv.fsf_-_@posteo.net> 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> Date: Mon, 11 Jul 2022 10:19:51 +0800 Message-ID: <87pmicqtko.fsf@localhost> 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::636; envelope-from=yantar92@gmail.com; helo=mail-pl1-x636.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, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, 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=1657505957; 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=r23PTMFTXl222lXejbWlsXzFfEZlAwBbYFNUJg7yB5k=; b=HgWVlS14kP32+FEtWkakwHj3WCEQUXYiBO3h3IxfNiqvNWjdvEDBacktYETU7d7uqXt0f8 tUEX6pXs+F9z2uySVn6QDnJ3pcNEi8+Dd0PUNBrplCM/SasiG9fk3ihYpwDDK9ufAMDDm9 WnRqerwWlK+9XpEfLEpm8q/R+xniFc/EeFeA1p//R8X0AbYNDZXVkqPkbj2DflO2Za0EQA 8NzSPqIsk7BUYhpAgOieEPhJBJ4ZUmAwAvLNzy7y5PnoHpPYTDif8hhrHEHMkC1734gBow on43LAQFQ8Dml5iSkH5eDPPcejdU0VfO0bCqZ2Q9X2E7Bpe+LS0HAbDT4VDv3w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657505957; a=rsa-sha256; cv=none; b=q/ZwVki9ayWk6CMK3MtbyGhWQMj8tW0sq/Hh/XnUDIxopxeGu4bGvDH/OwpF29JpS2kdhv kSHGIVvLaH0C5EZddEcsylK+CBgHM3Hoc5Z/3Dksx9vbSwPgP+xGesOp2EpisKtQ1DaOji PzLh/PD92+5G2vZMoxwI+2DID60ENAYpPh8tZpHH1ACwP+h3XjnFdqrsS29M4GxFCpupeF 9BjE58TfUunrASdPg75dkTnFPmq+p/dWYuKG3ItHkZiN1M+aMW6hL9sKSFwr/EszeGpnjk yQa7eDab13K0dsHaznJ9rMGLiMZ0J/la/8E4K2YaZX0kGgKpL7oRR/p9ESlZdg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=QWcdnKNM; 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: -3.45 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=QWcdnKNM; 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: 08D773861C X-Spam-Score: -3.45 X-Migadu-Scanner: scn1.migadu.com X-TUID: 6vuH7KNF1vHl 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. +1 > 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). Does it mean that unicode text (like =D1=86=D0=B5 or =E8=BF=99=E4=B8=AA) wi= ll not be exported 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. +1 But can someone check if Free* fonts are available on Windows and Mac by default? If not, can we distribute these fonts with Org? > 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) Makes sense. Though I'd rather use format-spec instead to allow arbitrary order of variable formatting. > 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? This unified preamble approach is consistent with what we do now. However, our currently used large preambles will slow down compilation. As I recall, Timothy has been working on simplifying preamble generation. If we do not put unnecessary packages into preamble, compilation will be significantly faster. If Timothy can come up with a patch some time soon, I'd prefer to have a more targeted preamble. Otherwise, the proposed approach is the way to go. Best, Ihor