emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Juan Manuel Macías" <maciaschain@posteo.net>
To: Max Nikulin <manikulin@gmail.com>
Cc: orgmode <emacs-orgmode@gnu.org>, Ihor Radchenko <yantar92@gmail.com>
Subject: Re: [PATCH] ox-latex.el: Unify in one single list Babel and Polyglossia languages alists
Date: Tue, 19 Jul 2022 19:31:17 +0000	[thread overview]
Message-ID: <87h73c527u.fsf@posteo.net> (raw)
In-Reply-To: <tb6o0h$n4v$1@ciao.gmane.io> (Max Nikulin's message of "Wed, 20 Jul 2022 00:01:04 +0700")

Max Nikulin writes:

> On 19/07/2022 22:01, Juan Manuel Macías wrote:
>> +			 (replace-match
>> + (mapconcat (lambda (option) (if (equal "AUTO" option) language
>> option))
>> + (cond ((member language options) (delete "AUTO" options))
>> + ((member "AUTO" options) options)
>> + (t (append options (list language))))
>> +				     ", ")
>
> In my opinion this code should not attempt to be excessively clever.
> If user skipped AUTO then do not append language. Test for duplicated
> options is redundant as well. Such cases may still be a reason to
> issue a warning (e.g. by `org-lint').

I completely agree. I've kept that old part of the code for backwards
compatibility and because, at the end of the day, it doesn't break
anything new. I mean, if a user declares the main language using
babelprovide and this code (too intrusive) puts the main language in the
Babel argument too (something the user doesn't want in origin), that
syntax is supported by Babel. Babel simply takes into account the main
language declared with babelprovide, if the 'main' option has been
added. But even if it doesn't return any errors, it's unnecessary
redundancy.

Anyway, yes, it's too intrusive. I am in favor of removing that part,
but I don't know if it will have any effect on backwards compatibility.

(BTW, I think I didn't explain in this thread the advantages of using
babelprovide over the traditional ldf file system. With ini files the
user has more control over the loaded language and there are many
options, including the ability to associate a font with a script.
Furthermore the user can create his own custom ini files, and define his
own languages. For example, I could write an ini file with specific
values for Spanish, or even an imaginary language. On the one hand, it
is an important advance. But on the other hand it adds more fuel to the
current great latex pandemic: multiplicity).

> On the other hand I would consider adding babel by default without
> explicit header. To suppress loading users may add
> #+latex_header: % \usepackage{babel}

I don't understand this very well. What would happen, then, to users who
prefer to use Polyglossia, or those who prefer to explicitly add babel
or polyglossia code?

> I like that you decided to avoid inventing of a DSL just to have
> org-like options that are translated to to a couple of preamble
> commands. From my point of view it would not help novices and would
> make things more complicated for experienced LaTeX users.

Yes, in the end I realized that this was getting into a slippery slope,
especially for the reasons you mention...

>> #+latex_class: article
>> #+latex_class_options: [11pt,draft,AUTO]
>> #+LaTeX_Header: \usepackage{babel}
>> #+language: ru
>
> While AUTO is suitable for \usepackage{babel} and \babelprovide, for
> class option the placeholder should be clearly associated with babel,
> e.g. BABEL_LANG instead of AUTO.

What you say makes sense. However, this was ultimately not implemented
in the current version of the patch because the argument of
org-latex-guess-babel-language is a #+latex_header keyword.

> I am not familiar enough with setting used to generate preview of
> equations or images from LaTeX source blocks, so I am not completely
> sure that suggested changes do not affect these features in some
> negative way.

I think that shouldn't affect previsualization, because if I remember
correctly the preamble used for previews is the value of
org-format-latex-header. But I'm not sure...

Best regards,

Juan Manuel 


  reply	other threads:[~2022-07-19 19:32 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-03 15:28 [PATCH] ox-latex.el: Unify in one single list Babel and Polyglossia languages alists Juan Manuel Macías
2022-07-10  9:25 ` Ihor Radchenko
2022-07-14 12:34   ` Juan Manuel Macías
2022-07-14 15:12     ` Max Nikulin
2022-07-14 15:53       ` Juan Manuel Macías
2022-07-14 18:17         ` Juan Manuel Macías
2022-07-15 12:18           ` Max Nikulin
2022-07-15 14:36             ` Juan Manuel Macías
2022-07-17  9:55     ` Ihor Radchenko
2022-07-17 14:48       ` Juan Manuel Macías
2022-07-18  6:44         ` Ihor Radchenko
2022-07-18 10:32           ` Juan Manuel Macías
2022-07-18 11:01             ` Juan Manuel Macías
2022-07-18 15:37             ` Max Nikulin
2022-07-18 16:21               ` Juan Manuel Macías
2022-07-19 15:01       ` Juan Manuel Macías
2022-07-19 17:01         ` Max Nikulin
2022-07-19 19:31           ` Juan Manuel Macías [this message]
2022-07-20 16:12             ` Max Nikulin
2022-07-20 21:30               ` Juan Manuel Macías
2022-07-21 14:36                 ` Max Nikulin
2022-07-21 15:39                   ` Juan Manuel Macías
2022-07-22 12:16                     ` Max Nikulin
2022-07-22 12:49                       ` Juan Manuel Macías
2022-07-22 14:07                         ` Juan Manuel Macías
2022-07-23 15:19                           ` Max Nikulin
2022-07-23 17:15                             ` Improvements in the default LaTeX preamble (was: [PATCH] ox-latex.el: Unify in one single list Babel and Polyglossia languages alists) Juan Manuel Macías
2022-07-24 12:06                               ` Improvements in the default LaTeX preamble: templates? " Juan Manuel Macías
2022-07-25  9:31                                 ` Ihor Radchenko
2022-07-25 10:45                                   ` Improvements in the default LaTeX preamble: templates? Juan Manuel Macías
2022-07-23  5:01         ` [PATCH] ox-latex.el: Unify in one single list Babel and Polyglossia languages alists Ihor Radchenko
2022-07-23 13:44           ` BUG " Kai von Fintel
2022-07-23 13:59             ` Ihor Radchenko
2022-07-23 14:07               ` Kai von Fintel
2022-07-23 14:22                 ` Ihor Radchenko
2022-07-23 14:39                   ` Kai von Fintel
2022-07-23 14:50                     ` Ihor Radchenko
2022-07-23 15:53                       ` Juan Manuel Macías
2022-07-24  7:15                         ` Ihor Radchenko
2022-07-24 11:29                           ` Juan Manuel Macías
2022-07-26 11:58                             ` Ihor Radchenko
2022-07-26 16:19                               ` Juan Manuel Macías
2022-07-28 12:36                                 ` Ihor Radchenko
2022-07-23 14:53                     ` Juan Manuel Macías
2022-07-23 14:11           ` Juan Manuel Macías
2022-07-23 14:25             ` Ihor Radchenko
2022-07-23 15:29           ` Max Nikulin
2022-07-24  7:23             ` Ihor Radchenko
2022-07-10 10:51 ` Max Nikulin
2022-07-15 15:38   ` Juan Manuel Macías

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=87h73c527u.fsf@posteo.net \
    --to=maciaschain@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=manikulin@gmail.com \
    --cc=yantar92@gmail.com \
    /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).