From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id kOJLMut94GX5IgEA62LTzQ:P1 (envelope-from ) for ; Thu, 29 Feb 2024 13:51:56 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id kOJLMut94GX5IgEA62LTzQ (envelope-from ) for ; Thu, 29 Feb 2024 13:51:55 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=nAMuHUWi; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1709211115; 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=M2louALMFAz+qY16R58tKc9lkDSyW2lcfD/wib9xK6s=; b=FKhAFlRd5Mv9Bu1bvvfrOvhiujWFlgPJU6aQpSw5mIJVlnW/6v1Ld1eL7VPCLFxKfKjz0B Adywi/7FtHeqlkgLYORmGhoDCzqDZ8XEkvitEx7TH/hewwUrtNRYsyjKv0CXrNKK+qsLYS gmn81S1vd+pDdDfwnT/nsU7kzKnSrroLWsrXwbgTNY3gFu6BMAN2d8ZrFD/AhIl4HKtxL/ wZJ9JKbHz/tHOYLESmbjTOEOsWJSM+sYFI7v0If05AtPYKjAZUoFJZakyUiKOTmhv5Lw3F KkAajg4tZh3ASsvYTaNFmZ0rYWUJXCIRZiMoLJj23/1pyghkKvWhtdn6MElW+Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=nAMuHUWi; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1709211115; a=rsa-sha256; cv=none; b=Qh9xo4ke46d4f88VUaBnknguZ0r5iXcM/+yLgnlkqUe5KKOr8BbGYGHbrJAF+11YtBrz8H QrmKJXZYyD3C3rwQLQXuyzakxwCV1BuC+wG+Sg2dcljBFHlu5xo62gba21QlIv4YDq5XkU tTpXuyVt1r23suHXw1EibYkYmx/nqqtpRyR+PoYrdNmX+G/fDywcbtS7TRqcuUuXD95TSZ g5cRSJ8GJkp/1mIt59AIyigcFMe8EtRKrpOfV7WebbVYuxFAK+yA4Rx7KnByDNN1FlTpW5 BjFawidQsLKYnRnkn21us1L/Nm9JBdNx9NbHP6OaHL6ewX2M4ZME7VNV641l7Q== 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 9477038DB1 for ; Thu, 29 Feb 2024 13:51:55 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rffsZ-00062t-LN; Thu, 29 Feb 2024 07:51:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rffsS-00062Z-QE for emacs-orgmode@gnu.org; Thu, 29 Feb 2024 07:51:08 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rffsO-00055t-OH for emacs-orgmode@gnu.org; Thu, 29 Feb 2024 07:51:08 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 5BC9C240029 for ; Thu, 29 Feb 2024 13:51:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1709211061; bh=M2louALMFAz+qY16R58tKc9lkDSyW2lcfD/wib9xK6s=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=nAMuHUWiJnj4iN9IxjUOiILPDPcP0KxeGUmvapep/68OmZqnO1KPnW6rIXwTYUqKD vyOjqDZ/hxMEdM7WTqVIVgSGBtlfgO0UY5zfoYHdedubihg2nxskaTcKc8YaxiHRXm 2rk4rCbsfURELpKbZfCT+lfW2zCyXOQ2Nqoz8gSaYvFchk1qD1+kEOLsNP7q7yCvhO bobUrbOJhusMVLF5l74Xq1amjcmpF8empxUDlabCRgaZ+2AQRv6xa3P8Uj0wdbhyrZ GmtpOCyBup+wxPQn+JLhRN0WdOjyQKBICNKspdEzu5XzdST4wv96aOvS4+UT881Jmf hPzyWMbcuMJCQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TlrgS5wNWz9rxB; Thu, 29 Feb 2024 13:51:00 +0100 (CET) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: Max Nikulin Cc: emacs-orgmode@gnu.org Subject: Re: [proof of concept] inline language blocks In-Reply-To: (Max Nikulin's message of "Thu, 29 Feb 2024 19:05:07 +0700") References: <87msrudgcn.fsf@posteo.net> <8734tmmcnv.fsf@localhost> <87edd6ytiy.fsf@posteo.net> <87sf1mrpr6.fsf@localhost> <87a5nuyo4w.fsf@posteo.net> <87frxmrmjb.fsf@localhost> <875xyhzyzl.fsf@posteo.net> <87le7dihaj.fsf@posteo.net> <87h6i1ifp7.fsf@posteo.net> <87wmqoohlr.fsf@posteo.net> <87le74noks.fsf@posteo.net> <87o7bzd02m.fsf@posteo.net> Date: Thu, 29 Feb 2024 12:50:57 +0000 Message-ID: <87jzmncu32.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: -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_H3=0.001, RCVD_IN_MSPIKE_WL=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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.98 X-Spam-Score: -9.98 X-Migadu-Queue-Id: 9477038DB1 X-Migadu-Scanner: mx13.migadu.com X-TUID: bzl40R8sMqKB Max Nikulin writes: >> Anyway, I think your example only makes sense in HTML, or at least I >> can't make sense of it in LaTeX. Why would anyone want &foo{text} to be >> passed to LaTeX as \bar{text}, instead of just &bar{text}? In HTML it >> does seem sensible to me that someone would want to change the tags. >> Maybe with a :html-tag, or something like that. > > Consider a document aimed to be exported to different formats. It is > unlikely that names of commands, elements, classes, etc. match for all > of them. It makes sense, although I have never encountered a case like this. Usually (and returning to the example of the large special blocks), if in org I put something like: #+begin_foo ... #+end_foo I try to ensure that there is a "foo" environment in LaTeX, a "foo" class in html or a "foo" style in odt (now I don't remember if the odt exporter produces paragraph styles from special blocks. I don't think so). In any case, on second thought, maybe someone wants to reuse a LaTeX preamble, css style sheets or any odt templates. I see no problem, then, in there being attributes like :latex-command, :html-tag, :odt-style :html-= attribute, etc., which override the default values. >> As for :latex-command, if I understand it correctly, I don't quite see >> how useful this could be: >> &foo[:latex-command bar]{text} =3D=3D LaTeX =3D=3D> \bar{text} >> when it is simpler to put: >> &bar{text} > > Command may require additional arguments and it should be convenient > to define shortcuts to the same command with different arguments: > > &la{text} =3D> \foreignlanguage{latin}{text} > &es{text} =3D> \foreinglanguage{spanish}{text} With the current implementation: #+options: inline-special-block-aliases:(("bar" :prelatex [bar]) ("baz" :pr= elatex [baz])) &foo[@bar@]{lorem ipsum} =3D=3D> \foo[bar]{lorem ipsum} &foo[@baz@]{lorem ipsum} =3D=3D> \foo[baz]{lorem ipsum} Your example is less verbose, but with this implementation you can do combi= nations, it's more granular, I think: &foo[@bar@ :smallcaps t]{lorem ipsum} =3D=3D> {\scshape\foo[bar]{lorem ipsu= m}} &foo[@baz@ :lang it]{lorem ipsum} =3D=3D> \foo[baz]{\foreignlanguage{italia= n}{lorem ipsum}} I think this is quite flexible and leaves a great deal of freedom to the us= er. >> The same thing happens with the anonymous variant: >> &_[:latex-command foo]{text} =3D=3D LaTeX =3D=3D> \foo{text} >> which is identical to putting &foo{text} >> The anonymous variant would be equivalent in LaTeX to a >> \begingroup...\endgroup, or rather to {...}. One could add all the >> commands one wants within the group simply with :prelatex: >> &_[:prelatex \foo\bar\vaz\blah{}]{text} >> =3D=3D> {\foo\bar\vaz\blah{}text} > > The idea is to not add \begingroup and \endgroup if LaTeX command is > specified (or to control it by a dedicated attribute). Again, consider > a document suitable for multiple export formats. Indeed, if the :latex-command attr is implemented should work in both variants. In such a way, perhaps: &_[:latex-command foo]{lorem} =3D=3D> \foo{lorem} > I think, flexibility in respect to underlying > commands/classes/elements allows to minimize changes in documents > later. Sometimes it is necessary to switch to another LaTeX package, > CSS framework, etc. It allows usage semantic names within Org > documents despite they may be exported to the same command. > >> In any case, I think that my implementation leaves open the possibility >> of extending it with everything you mentioned, or anything else. > > The question is proper balance of built-in features, flexibility, > implementation complexity. It would be unfortunate if most of users > will have to create custom backends even for basic documents. We can continue the discussion when I publish my experimental branch and share the link. I'm a little late because I want to make some corrections to the code first. --=20 Juan Manuel Mac=C3=ADas -- Composici=C3=B3n tipogr=C3=A1fica, tratamiento d= e datos, dise=C3=B1o editorial y ortotipograf=C3=ADa