emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Max Nikulin <manikulin@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [proof of concept] inline language blocks
Date: Thu, 29 Feb 2024 19:05:07 +0700	[thread overview]
Message-ID: <urprtl$ro3$1@ciao.gmane.io> (raw)
In-Reply-To: <87o7bzd02m.fsf@posteo.net>

On 29/02/2024 17:41, Juan Manuel Macías wrote:
> Max Nikulin writes:
>>
>> I do not try to dispute \foo and class="foo" as default behavior. I
>> suggest to implement possibility to override default behavior of
>> &foo{text} to \bar{text} and <bar>text</bar>. The same is applicable
>> for anonymous objects
>>
>>       &_[:latex_command bar :html_element bar]{text}
> 
> Maxim, I insist that I follow the logic of the "large" special blocks.

Export of special blocks may be extended as well.

> 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.

> As for :latex-command, if I understand it correctly, I don't quite see
> how useful this could be:
> 
> &foo[:latex-command bar]{text} == LaTeX ==> \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} => \foreignlanguage{latin}{text}
&es{text} => \foreinglanguage{spanish}{text}

> The same thing happens with the anonymous variant:
> 
> &_[:latex-command foo]{text} == LaTeX ==> \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}
> 
> ==> {\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.

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.



  reply	other threads:[~2024-02-29 12:37 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-20 20:35 [proof of concept] inline language blocks Juan Manuel Macías
2024-02-21  8:42 ` Ihor Radchenko
2024-02-21 10:57   ` Juan Manuel Macías
2024-02-21 12:00     ` Ihor Radchenko
2024-02-21 12:53       ` Juan Manuel Macías
2024-02-21 13:10         ` Ihor Radchenko
2024-02-21 14:13           ` Juan Manuel Macías
2024-02-21 20:32             ` [proof of concept] inline-special-block (was: [proof of concept] inline language blocks) Juan Manuel Macías
2024-02-21 23:29               ` [proof of concept] inline-special-block Juan Manuel Macías
2024-02-22 22:03               ` Juan Manuel Macías
2024-02-21 22:11             ` [proof of concept] inline language blocks Samuel Wales
2024-02-21 22:28               ` Juan Manuel Macías
2024-02-21 22:55                 ` Samuel Wales
2024-02-21 23:02                 ` Juan Manuel Macías
2024-02-28 10:29                   ` Max Nikulin
2024-02-28 13:15                     ` Juan Manuel Macías
2024-02-28 17:21                       ` Max Nikulin
2024-02-28 23:42                         ` Juan Manuel Macías
2024-02-29  7:05                           ` Max Nikulin
2024-02-29 10:41                             ` Juan Manuel Macías
2024-02-29 12:05                               ` Max Nikulin [this message]
2024-02-29 12:50                                 ` Juan Manuel Macías
2024-02-21 23:33         ` Suhail Singh
2024-03-31 14:56 ` Daniel Clemente
2024-03-31 15:20   ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='urprtl$ro3$1@ciao.gmane.io' \
    --to=manikulin@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).