From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 kG1SALMMzGLPgAAAbAwnHQ (envelope-from ) for ; Mon, 11 Jul 2022 13:42:43 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id MMEdALMMzGKsGwAA9RJhRA (envelope-from ) for ; Mon, 11 Jul 2022 13:42:43 +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 8BD093AC06 for ; Mon, 11 Jul 2022 13:42:42 +0200 (CEST) Received: from localhost ([::1]:46730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oAroH-0000JZ-MA for larch@yhetil.org; Mon, 11 Jul 2022 07:42:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35728) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oArll-0000I3-V3 for emacs-orgmode@gnu.org; Mon, 11 Jul 2022 07:40:06 -0400 Received: from mout02.posteo.de ([185.67.36.66]:60707) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oArlj-0005h3-LI for emacs-orgmode@gnu.org; Mon, 11 Jul 2022 07:40:05 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id ABB0324010C for ; Mon, 11 Jul 2022 13:40:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1657539600; bh=P7OnsYRfgSvx9vbtvrCYpN4/DbYS7ZF3JKhUlCS26p0=; h=From:To:Cc:Subject:Date:From; b=QbSS54Cz638q3LFocHIZOnqPHVC/pPpEChUN5iTnakHu3UCuJ5onp9NZQ+KApTrGv gsP+TUS076m9790MJEvb3iyAW2b1SPSdfdY1YK4QQq3N46kyp6zhtg6rD1zZeOvcUe 9qHsLKZ7cOlrweqOR71B31civNSIkd3lvu743ajabQj8ZvG1t3UWKJSqm+y3RL5FxE 2T5a28Ad7+K1B6noIH2xd2PV8DRB3NyAN9DR5rSI+z3/KNLEGm7DoB5vJi64rQc7ys LO9IZN9wgOI9t96RKRvWXALGqc04yo12m4K9fvxfDTu1Kli2kZjqLswnu1l1p3UMDH rQyynXuN+Wzsg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4LhMPW54N8z6tmM; Mon, 11 Jul 2022 13:39:59 +0200 (CEST) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: Stefan Nobis Cc: Ihor Radchenko , Greg Minshall , orgmode Subject: Re: [possible patch] Basic fontspec code for LuaLaTeX and XelaTeX (was "LaTeX export: when is it more useful...") 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 11:39:57 +0000 In-Reply-To: (Stefan Nobis's message of "Mon, 11 Jul 2022 10:05:01 +0200") Message-ID: <877d4jj2sy.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.66; envelope-from=maciaschain@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, 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=1657539762; 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=rc0+ILLCmGO8UJELAThBAmA1SzyQm79PbTCuBJios5A=; b=R8ioczg+r9Q0g3/hvC+kT88xkDqpVa5HhyHuHYEOqHqW1yU4b4/xKL0kAF/RCG6i7H8CO9 35ySv7bIyfS/VNDjRVqZn2DS8dcocf091DwNZWFodUcnrrT32AgrFaq2rt2bPzYxcQse1j +m4+ImxhEXDtu6z02aSSJuTnjsj8qrZ1hl+XS0CWIOQCHlVw/JZ9NkMuG3nffzjQKQpL/V 84nbId9rjh+Q3rgCBC9l0EVbGBRU9Mteho137TyjZVY+XDvK2QfYWQcWdSsThQ32PGVQ9W XYt6lBk1NJav/0b/vZmBv/NgH7Rmp8aFezX+SnPzOKfFn7J4gF5diGWX6ufcvA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657539762; a=rsa-sha256; cv=none; b=bT/68tXNgZtP1nHNREyjambfy5jjjCEuahtKMR5+p3Y432uc24kH2/vhlMPRFHrovHen1/ F5pk5hENpLO/dqGg/5/9jx2VR/R35k1dNtZQwDzb0lygyCvlBre+E66WMetGfNNsnnpQ7q ha6Eyn4XFia6PzWHNyHCzpZ3u3/RYUvoHlEAY9thXcyDdrrbvR6LCvgfLraN5rsLrzEvoP PPxxONkv9smCEzTqEf3gLSB4yx9Z4uRPnKumAb/EMf+kDC7fC3AqJT14Y6Zc0c/RMdyNbC t0E6EVFnm8wxVCUII16P28MhchQbYL94nMWOGTeGKnkTQmjZ+YrnnSrjzuuKgw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=QbSS54Cz; 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: -4.15 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=QbSS54Cz; 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: 8BD093AC06 X-Spam-Score: -4.15 X-Migadu-Scanner: scn1.migadu.com X-TUID: 0HFcf7cf7W58 Stefan Nobis writes: > Juan Manuel Mac=C3=ADas writes: > >> 1. There could be a defcustom, something like 'org-latex-use-fontspec' >> (I would vote for nil by default). > > I would vote to activate this by default. I voted nil because of the available fonts issue. But I think what you say below is a good idea, so it could be activated by default >> (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) > > I would prefer to make it easier to stick with the default fonts. So > only add the font selection commands (including defaultfontfeatures) > when the font variables are non-nil. If no font has been explicitly > chosen, just use the default (in case of lualatex Latin Modern). > > For me, it does not matter whether the 'org-latex-fontspec-*' > variables have a default of nil or set to the Free* fonts or something > else. For my configuration, I would set these variable to nil in order > to get the LaTeX default fonts and would like to go with the default > preamble of Org and then add to this on a per document basis. > > This way, the whole configuration would be a little more composable, I > think. Sounds like a good idea and I agree. If I understand correctly, if the sans, roman, and mono font variables (or any of them) are non-nil, enable font selection. Otherwise, leave the default Latin Modern font. By the way, although I've already commented on it in some post in the parent thread, i think this package I wrote might be useful for doing a quick visual test of a font (including opentype features test), using org-latex-preview (compiling with LuaTeX). It can be done on any font marked in dired. There are three options: insert arbitrary characters, insert the Unicode code of the characters, or display a specimen of the font. The default specimen is in the file specimen.tex, which can be edited to add examples and languages. Some screenshots: https://i.imgur.com/3faKSjA.png https://i.imgur.com/OJfUcO9.png To create font tables I often use the LaTeX package unicodefonttable. An example of usage within Org: #+header: :headers '("\\usepackage{unicodefonttable}") #+begin_src latex :imagemagick yes :iminoptions -density 600 :results raw := results file :file -2256080143431736233.png \displayfonttable*[range-start=3D1F00,range-end=3D1FFE]{Old Standard} \displayfonttable*[range-start=3D0600,range-end=3D06FF]{FreeSerif} #+end_src A screenshot: https://i.imgur.com/Fwsg7bb.png Maybe it could also be added as an emergency fallback font GNU Unifont: https://unifoundry.com/ Best regards, Juan Manuel=20