[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ox-latex.el: Unify in one single list Babel and Polyglossia

From: Max Nikulin
Subject: Re: [PATCH] ox-latex.el: Unify in one single list Babel and Polyglossia languages alists
Date: Wed, 20 Jul 2022 00:01:04 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

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

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

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

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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]