From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id UF4vNmMW/2KPAAEAbAwnHQ (envelope-from ) for ; Fri, 19 Aug 2022 06:49:39 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id kIUENmMW/2J5oAAAauVa8A (envelope-from ) for ; Fri, 19 Aug 2022 06:49:39 +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 5A56F1E8A7 for ; Fri, 19 Aug 2022 06:49:39 +0200 (CEST) Received: from localhost ([::1]:53600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oOtwt-0008C1-Ab for larch@yhetil.org; Fri, 19 Aug 2022 00:49:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33834) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oOtup-0008B5-OR for emacs-orgmode@gnu.org; Fri, 19 Aug 2022 00:47:30 -0400 Received: from mail-oa1-x34.google.com ([2001:4860:4864:20::34]:46889) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oOtul-0002pv-TG for emacs-orgmode@gnu.org; Fri, 19 Aug 2022 00:47:26 -0400 Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-11c5505dba2so4047931fac.13 for ; Thu, 18 Aug 2022 21:47:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc; bh=AMThBg9TCblH7vhF5zaYiCMWVAPEs+SQ8GtS5rxgyKk=; b=lOGU/jr4TOxJ8gnmjg37NTn9dREr/I07lsyT0KqaOLxYzZKdQrkJ6UKoChcaCvQeSU 5qKVUAkxgBPctOhLI/IBGHXEId4EOhUMqHTMsZP1vpcg2/505L7XcsvWEyBg8740/pBE BE6tNYEVhwxhyy7c4S4HIStB07CY025/itbQgzqZQt7JS9X1J4iYh9hexfzp2ocD94OS Y1GKuqo7P6mCxhZ4Z+8Rq6Gc9w1jqJT5sws9MnIoObM7TYPsEwfwbsp8pxFZV7MU9p2Q NdpbLZEW+PecbemXH2hIydJ5pn2QWICXfzPNWmMG+fn+K1h/b49snpzSC3sNCw/yDZKl BZpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=AMThBg9TCblH7vhF5zaYiCMWVAPEs+SQ8GtS5rxgyKk=; b=0d6pPk3qH1sz/UZe1X/kObqA9Fgoh+aR5GTQnlB1W109DwgA62x0ro7hwcT8UQfmj9 sN6te5MadTJHSzfCekh1QJ/jlp/NEpxBp5GO5CelFw3JWkn9vW+wEV/JA+nGFFy/E+n3 UXh4zUnQGlctEjImWK3b7Y7NSwUeff95fFhQjxz7n2vP+5dGBFnvCzWl8DwTGVYxSWIT BCanGU+V2DjoIqlDJ6H7QhpRrYh68dnd+umRLCTMIRZrJ1oskSuYl6BgN6Ln42Yp7H67 YbBKRFtV/PvwihrgpCqUb578ISrXkW9Sj3M3iwXsYZtSUSCSXDemG2NIAyGjt/8gY4SF tI8Q== X-Gm-Message-State: ACgBeo07mOFpjNgx9S6/f7VbRMndjNvfC1kZFT8KA4OF2lUxFlEo3bmD 2JSoz19iEo/vQY/wfdISNwI= X-Google-Smtp-Source: AA6agR7s1skbuGxE9O9kTvhMi7gjCDTDYwIINjhZotjAMBXzSWSLRjewvNk06aXBIjW3ng3B8QSFng== X-Received: by 2002:a05:6870:5b8f:b0:11c:6ff9:c28e with SMTP id em15-20020a0568705b8f00b0011c6ff9c28emr3084378oab.102.1660884441705; Thu, 18 Aug 2022 21:47:21 -0700 (PDT) Received: from localhost ([115.154.175.57]) by smtp.gmail.com with ESMTPSA id q5-20020a9d6545000000b0063711d42df5sm890652otl.30.2022.08.18.21.47.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 21:47:21 -0700 (PDT) From: Ihor Radchenko To: Rudolf =?utf-8?Q?Adamkovi=C4=8D?= Cc: Nicolas Goaziou , emacs-orgmode@gnu.org Subject: Re: [PATCH] Re: No mathematics in Texinfo exports In-Reply-To: References: <87o80v3qzw.fsf@localhost> <87mtgedh98.fsf@nicolasgoaziou.fr> <87a6cezrhm.fsf@localhost> <87bkwud6ni.fsf@nicolasgoaziou.fr> <87czhazhfz.fsf@localhost> <87k0amb4qf.fsf@localhost> <87v8twscml.fsf@localhost> <874k1ae5tz.fsf@localhost> <87bkv75mgo.fsf@localhost> <87edzlxdsq.fsf@localhost> Date: Fri, 19 Aug 2022 12:48:26 +0800 Message-ID: <87pmgwq1np.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2001:4860:4864:20::34; envelope-from=yantar92@gmail.com; helo=mail-oa1-x34.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=1660884579; 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=AMThBg9TCblH7vhF5zaYiCMWVAPEs+SQ8GtS5rxgyKk=; b=mWOB5M7y3wokutQYbkHG3SpnewpcujPh7zWG3NEwJjXav0nDPAK2GTrHO24SwuemDyOYov +GzRTlUZL+bMvy0mBPoeLVpqthYimpjOlacQFmhVDUrJ5Z7+TtgPR/lOcYtTj6Q1dwQZ0/ HdWVKkEG7LBfpcO9b5u40J8n2uzHjZeA56BK00afom6aTUVMtOph4z3c5NuYefHiUvdvPy BelpF6gzHU4TC3wFiEg1NHr628TPN+iwZnIneuS+F1PvSpiVqTbkCwGdC6qAxm7FKUMoeJ Z4y8p4Ni5HiBIPWyfIdDUJYhDXye4Kl9buru9GzSJ5ZnWl3ph2rIT/hJRvQBsA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1660884579; a=rsa-sha256; cv=none; b=g7q7qj3cW9gt26b3sOOr7BV2NGkHt9UDcTyC7IZuaZN+kbM6lTbflgYXtNq6mJ005F980g moZoNUMsxQhjZNe066pUpm0aP4blAkLy/GJYzFraM46flcjxIMA0kFChE9ZlOuJzOhCUqW CKXSEXGBJEvHissIOgn9oZIG1BrQITu627vlYDYcKw30XLSvQ87wc07oc78lyAXYgEnbw9 YemCoNZyv8LnCo/fVbVlzx2MfZCi2uy62BAOdI20KBoohGinipnMOKoMAK1zkPaoZnBLJH T3O1zbDz2097ZgsS6QgXb6qA+LcWEUPbQ6Bd9Zx2JojjTBy85qPDyMUKDJ9SEQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="lOGU/jr4"; 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: -4.85 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="lOGU/jr4"; 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: 5A56F1E8A7 X-Spam-Score: -4.85 X-Migadu-Scanner: scn0.migadu.com X-TUID: KiXrnFYSRuEx Rudolf Adamkovi=C4=8D writes: >> First of all, checking version should probably be controlled by some >> customization. Especially when we export to .texi (which does not >> involve calling makeinfo), not to .info. > > I could not figure out how to tell between the two kinds of export. > > My attempt, in 'org-texinfo-latex-environment': > > (message "filename1: %s" (plist-get info :output-file)) > (message "filename2: %s" (plist-get info :texinfo-filename)) > > I always got the following, not matter what: > > filename1: test.texi > filename2: nil I did not mean that the behaviour should necessarily be different. In any case, you cannot really distinguish this easily. The difference between info and texinfo exports is simply in the arguments to org-export-to-file. When exporting to info, the normal texinfo export is post-processed using org-texinfo-compile. See org-texinfo-export-to-info and org-texinfo-export-to-texinfo. >> This customization might be set to 'auto by default, making ox-texinfo >> check makeinfo version. > > We now set the customization to 'detect. If you think 'auto makes for a > better name, for consistency or some other reason, please let me know. 'detect is OK. > --- a/etc/ORG-NEWS > +++ b/etc/ORG-NEWS > @@ -270,6 +270,7 @@ example, >=20=20 > prints a sub-bibliography containing the book entries with =3Dai=3D among > their keywords. > +*** Support for LaTeX mathematics in Texinfo exports Please provide a bit mode info here. At least, mention the new customization and its default value. > +(defcustom org-texinfo-with-latex (and org-export-with-latex 'auto) I guess that you meant (and org-export-with-latex 'detect). > + "If non-nil, the Texinfo exporter attempts to process LaTeX math. > + > +When set to t, the exporter always processes LaTeX environments > +and fragments as Texinfo \"@displaymath\" and \"@math\" commands > +respectively. Alternatively, when set to 'detect, the exporter 'detect will trigger unescaped quote warning in Emacs 29. Use `detect'. > +(defun org-texinfo-latex-environment (environment _contents info) > + "Transcode a LaTeX ENVIRONMENT from Org to Texinfo. CONTENTS is > +nil. INFO is a plist holding contextual information." > +(defun org-texinfo-latex-fragment (fragment _contents info) > + "Transcode a LaTeX FRAGMENT from Org to Texinfo. CONTENTS is > +nil. INFO is a plist holding contextual information." Please Use a single sentence at the first line of the docstring. "CONTENTS is nil" is misleading. If you want to mention CONTENTS argument at all, just say that it is ignored. > +(defun org-texinfo-supports-math-p () > + "Return t if the installed version of Texinfo supports \"@math\"." This function may be called frequently. Its value should better be cached. We really only need to calculate it once per Emacs session and store in some variable. > + ;; inline TeX fragment Please use full sentences in comments. Start sentences with capitalized words and end with ".". > + (should > + (equal "@math{a^2 =3D b}" > + (org-texinfo-latex-fragment > + (org-element-create 'latex-fragment > + '(:value "$a^2 =3D b$")) > + nil > + '(:with-latex t)))) Please note that the test results may depend on the installed texinfo version. Please guard the tests with (let ((org-texinfo-with-latex t)) ...) --=20 Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92