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

2022-07-28 Thread Ihor Radchenko
Juan Manuel Macías writes: > A thousand apologies for my horrible carelessness with the parentheses. > I should have checked the code. Here goes the patch again corrected. I > hope it's alright now. Thanks! Applied onto main via d37c0ee5f after adding full stop after sentences in the commit mess

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

2022-07-26 Thread Juan Manuel Macías
Hi Ihor, A thousand apologies for my horrible carelessness with the parentheses. I should have checked the code. Here goes the patch again corrected. I hope it's alright now. Ihor Radchenko writes: > Also, the original code contained the clause: > (or (get lang from the alist1) > (get lang f

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

2022-07-26 Thread Ihor Radchenko
Juan Manuel Macías writes: > Here is the new patch. I have realized that it is not necessary to put a > cond, since in this case it is only necessary to obtain the name of the > language for the metadata, so this new patch is simpler. Thanks for the update! The patch has some misplaced parenthe

Re: Improvements in the default LaTeX preamble: templates? (was: [PATCH] ox-latex.el: Unify in one single list Babel and Polyglossia languages alists)

2022-07-25 Thread Ihor Radchenko
Juan Manuel Macías writes: > I agree that adding more elements to the standard preamble is a complex > matter. LaTeX is already horribly complex and multiple, and it is > difficult to satisfy all kinds of users with a standard code. It > occurred to me that an alternative to modifying Org's code

Improvements in the default LaTeX preamble: templates? (was: [PATCH] ox-latex.el: Unify in one single list Babel and Polyglossia languages alists)

2022-07-24 Thread Juan Manuel Macías
Ihor Radchenko writes: > Adding things like paper size is a much more debatable topic. > Considering the number of expected developments in this area, including > the earlier discussion on XeLaTeX/LuaTeX and preamble generation by TEC, > adding the new specific defaults will need to be a subject o

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

2022-07-24 Thread Juan Manuel Macías
Ihor Radchenko writes: > Can you please add the comments, similar to what I requested earlier. > These magic length of 4 may be hard to grasp otherwise. Hi Ihor, Here is the new patch. I have realized that it is not necessary to put a cond, since in this case it is only necessary to obtain the n

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

2022-07-24 Thread Ihor Radchenko
Max Nikulin writes: > On 23/07/2022 12:01, Ihor Radchenko wrote: >> Juan Manuel Macías writes: >> >>> Here is a new version of the patch, with the fixes added. >> >> Thanks! Considering that the followup discussion deviated from the >> substance of the patch towards related design issues, > > I

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

2022-07-24 Thread Ihor Radchenko
Juan Manuel Macías writes: >> Hmm. You are actually right. >> Juan, can you please take a look. It looks like you missed >> "org-latex--format-spec" in the patch. It should use the new >> org-latex-language-alist variable instead. > > Attached a new patch to fix (I hope) the org-latex-language-al

Improvements in the default LaTeX preamble (was: [PATCH] ox-latex.el: Unify in one single list Babel and Polyglossia languages alists)

2022-07-23 Thread Juan Manuel Macías
Max Nikulin writes: > My vote is to configure babel by default if it is possible to provide > default preamble that allows reasonable quality of PDF for simple Org > documents with no explicit configuration. > > Ideally, the following should be possible out of the box. When no > advanced features

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

2022-07-23 Thread Juan Manuel Macías
Hi Ihor and Kai, Ihor Radchenko writes: > Hmm. You are actually right. > Juan, can you please take a look. It looks like you missed > "org-latex--format-spec" in the patch. It should use the new > org-latex-language-alist variable instead. Attached a new patch to fix (I hope) the org-latex-langu

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

2022-07-23 Thread Max Nikulin
On 23/07/2022 12:01, Ihor Radchenko wrote: Juan Manuel Macías writes: Here is a new version of the patch, with the fixes added. Thanks! Considering that the followup discussion deviated from the substance of the patch towards related design issues, I believed that the subject of discussion

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

2022-07-23 Thread Max Nikulin
On 22/07/2022 21:07, Juan Manuel Macías wrote: Forget this. On second thought, I think that the option you proposed "#+LaTeX_Header: % \usepackage{babel}" is much better. (I don't know where my head was and I didn't remember there was a string-match, so your suggestion is the shortest way. Howe

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

2022-07-23 Thread Juan Manuel Macías
Hi Kai, Kai von Fintel writes: > I do think that the code on lines 1864 and 1865 of =ox-latex.el= > (https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/lisp/ox-latex.el#n1864) > should not use the old variable names. Since you’ve now defined the > old variables in =org-compat.el=, my expor

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

2022-07-23 Thread Ihor Radchenko
Kai von Fintel writes: >>> (defun org-latex--format-spec (info) >>> "Create a format-spec for document meta-data. >>> INFO is a plist used as a communication channel." >>> (let ((language (let ((lang (plist-get info :language))) >>> (or (cdr (assoc-string lang org-latex-babel-

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

2022-07-23 Thread Kai von Fintel
On 23 Jul 2022, at 17:22, Ihor Radchenko wrote: > Kai von Fintel writes: > > Debugger entered--Lisp error: (void-variable > org-latex-babel-language-alist) > org-latex--format-spec( >>> >>> org-latex-babel-language-alist is the new variable introduced in the >>> patch. You seem t

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

2022-07-23 Thread Ihor Radchenko
Juan Manuel Macías writes: > Ihor Radchenko writes: > > Thanks, Ihor. And sorry again for my typos... No problem. > If it's okay with you, I can send another patch with the updated > information in NEWS and the Manual. And we can continue the subsequent > discussion related of babel, polyglossi

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

2022-07-23 Thread Ihor Radchenko
Kai von Fintel writes: Debugger entered--Lisp error: (void-variable org-latex-babel-language-alist) org-latex--format-spec( >> >> org-latex-babel-language-alist is the new variable introduced in the >> patch. You seem to be loading "mixed" Org versions - built-in + latest. > > No

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

2022-07-23 Thread Juan Manuel Macías
Ihor Radchenko writes: > Thanks! Considering that the followup discussion deviated from the > substance of the patch towards related design issues, I have decided to > marge the patch as is. We can decide on handling AUTO staff later - it > would be a major change to remove and the details of an a

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

2022-07-23 Thread Kai von Fintel
On 23 Jul 2022, at 16:59, Ihor Radchenko wrote: > Kai von Fintel writes: > >> I believe that that this patch has made it impossible to export to latex, >> because the function =org-latex--format-spec= in =ox-latex.el= still refers >> to the old variables, which are now not bound: >> >>> Debugge

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

2022-07-23 Thread Ihor Radchenko
Kai von Fintel writes: > I believe that that this patch has made it impossible to export to latex, > because the function =org-latex--format-spec= in =ox-latex.el= still refers > to the old variables, which are now not bound: > >> Debugger entered--Lisp error: (void-variable org-latex-babel-lan

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

2022-07-23 Thread Kai von Fintel
I believe that that this patch has made it impossible to export to latex, because the function =org-latex--format-spec= in =ox-latex.el= still refers to the old variables, which are now not bound: > Debugger entered--Lisp error: (void-variable org-latex-babel-language-alist) > org-latex--format

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

2022-07-22 Thread Ihor Radchenko
Juan Manuel Macías writes: > Here is a new version of the patch, with the fixes added. Thanks! Considering that the followup discussion deviated from the substance of the patch towards related design issues, I have decided to marge the patch as is. We can decide on handling AUTO staff later - it

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

2022-07-22 Thread Juan Manuel Macías
Juan Manuel Macías writes: > OK, so why not just: > > #+latex_header: % NOLANG > > ? Forget this. On second thought, I think that the option you proposed "#+LaTeX_Header: % \usepackage{babel}" is much better. (I don't know where my head was and I didn't remember there was a string-match, so your

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

2022-07-22 Thread Juan Manuel Macías
Max Nikulin writes: > Form my point of view it is unnecessary magic. Originally #+latex_header > is intended for valid LaTeX code OK, so why not just: #+latex_header: % NOLANG ? I think this has in its favor: a) it is simple and obvious to remember; b) it's a single string, and of course c) i

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

2022-07-22 Thread Max Nikulin
On 21/07/2022 22:39, Juan Manuel Macías wrote: Max Nikulin writes: I would vote for a custom variable, at the global level (I agree with the options you suggest) and at the document level, to economize, perhaps this would be enough to avoid the code of both babel and polyglossia: #+latex_header

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

2022-07-21 Thread Juan Manuel Macías
Max Nikulin writes: > The commented out command is a kind a hack, but I consider it as > acceptable for advanced users who have custom classes or who need to > compile document without babel (or polyglossia) for some reason. Yes, I think the ability to control this per document is also necessary.

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

2022-07-21 Thread Max Nikulin
On 21/07/2022 04:30, Juan Manuel Macías wrote: Max Nikulin writes: #+language: lang --> \usepackage[lang]{babel} But I think also users who use custom preamble templates included in org-latex-classes or those who load the entire preamble via an external file (a .sty or .tex file) will want to

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

2022-07-20 Thread Juan Manuel Macías
Max Nikulin writes: >>> 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

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

2022-07-20 Thread Max Nikulin
On 20/07/2022 02:31, Juan Manuel Macías wrote: 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)) + ((me

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

2022-07-19 Thread Juan Manuel Macías
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

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

2022-07-19 Thread Max Nikulin
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)) +

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

2022-07-19 Thread Juan Manuel Macías
Here is a new version of the patch, with the fixes added. Important: I have modified in this patch org-latex-guess-babel-language so that it recognizes the new Babel syntax alongside the old syntax. That is, it is now possible to put: #+LaTeX_Header: \usepackage[arguments,AUTO]{babel} #+LaTeX_Hea

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

2022-07-18 Thread Juan Manuel Macías
Max Nikulin writes: > On 18/07/2022 17:32, Juan Manuel Macías wrote: >> For example, something like this: >> latex-lang: babel(sorbian) variant(upper) >> provide(hebrew:import,hyphenrules=+) options(bidi=default), >> others(french,catalan) >> returns: >> \usepackage[french,catalan,uppersorbian,bid

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

2022-07-18 Thread Max Nikulin
On 18/07/2022 17:32, Juan Manuel Macías wrote: For example, something like this: latex-lang: babel(sorbian) variant(upper) provide(hebrew:import,hyphenrules=+) options(bidi=default), others(french,catalan) returns: \usepackage[french,catalan,uppersorbian,bidi=default]{babel} \babelprovide[im

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

2022-07-18 Thread Juan Manuel Macías
Juan Manuel Macías writes: > latex-lang: babel(sorbian) variant(upper) > provide(hebrew:import,hyphenrules=+) options(bidi=default), > others(french,catalan) > > returns: > > \usepackage[french,catalan,uppersorbian,bidi=default]{babel} > \babelprovide[import,hyphenrules=+]{hebrew} PS: In fact,

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

2022-07-18 Thread Juan Manuel Macías
Ihor Radchenko writes: > Do you refer to the paragraph below when saying that Org implementation > makes it hard to add new features? The rest of the above paragraph > implies that the difficulty is on LaTeX side, not on Org side. Sorry for not explaining clearly. Actually I think the problem is

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

2022-07-17 Thread Ihor Radchenko
Juan Manuel Macías writes: >> For Max's comment, using plist/alist would make things more clear >> code-wise for future developers. I always find it annoying when I need >> to go back and forth checking which element should be second or third or >> forth in the list. Especially if the variable is

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

2022-07-17 Thread Juan Manuel Macías
Ihor Radchenko writes: > For Max's comment, using plist/alist would make things more clear > code-wise for future developers. I always find it annoying when I need > to go back and forth checking which element should be second or third or > forth in the list. Especially if the variable is used all

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

2022-07-17 Thread Ihor Radchenko
Juan Manuel Macías writes: > I attach the new version of the patch with both variables declared > obsolete. Thanks! We usually declare obsolete variables in org-compat.el. > If everything is ok, I can add what is necessary to NEWS and to the Org > Manual. I have some minor comments. You can

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

2022-07-15 Thread Juan Manuel Macías
Max Nikulin writes: > I would consider structures with named fields (alists or plists) for a > case of adding some additional settings (Font name? But it is rather > defcustom than defconst) > > ("es" . (:babel "spanishmx" :poliglossia "spanish" > :poliglossia-variant "mexican") I was paying more

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

2022-07-15 Thread Juan Manuel Macías
Max Nikulin writes: > I have tried on Ubuntu-20.04 LTS focal (Latest LTS is 22.04 jammy). > Without explicit fontenc it may work, but emits a warning > > Package babel Warning: No Cyrillic font encoding has been loaded so far. > (babel)A font encoding should be declared before babe

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

2022-07-15 Thread Max Nikulin
On 15/07/2022 01:17, Juan Manuel Macías wrote: Juan Manuel Macías writes: In any case, I personally think that org-latex-language-alist, as it is now in this patch, is sufficient. I agree that the lists should be merged. My point is that with unnamed fields and variable number of them it wou

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

2022-07-14 Thread Juan Manuel Macías
Juan Manuel Macías writes: > In any case, I personally think that org-latex-language-alist, as it is > now in this patch, is sufficient. By the way, Maxim. I have been doing some tests with pdfLaTeX. I've known for a while now that it's no longer necessary to load the inputenc package. But it see

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

2022-07-14 Thread Juan Manuel Macías
Max Nikulin writes: >> Subject: [PATCH] * lisp/ox-latex.el: New variable `org-latex-language-alist' > Writing the previous message I forgot that currently there is no > default option for the fontenc package (PdfLaTeX), e.g. T2A for > Cyrillic. As a result it is not enough to specify just language

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

2022-07-14 Thread Max Nikulin
On 14/07/2022 19:34, Juan Manuel Macías wrote: Subject: [PATCH] * lisp/ox-latex.el: New variable `org-latex-language-alist' Writing the previous message I forgot that currently there is no default option for the fontenc package (PdfLaTeX), e.g. T2A for Cyrillic. As a result it is not enough to

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

2022-07-14 Thread Juan Manuel Macías
Ihor Radchenko writes: > Thanks! > This looks like an improvement. > However, we may need to preserve the old defconsts for the time being > and declare them obsolete. Hi, Ihor, I attach the new version of the patch with both variables declared obsolete. If everything is ok, I can add what is n

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

2022-07-10 Thread Max Nikulin
On 03/10/2021 22:28, Juan Manuel Macías wrote: Hi all, I'm attaching a patch with a proposal to unify in a single constant (named `org-latex-language-alist') `org-latex-polyglossia-language-alist' and `org-latex-babel-language-alist', along with some necessary (minor) modifications in `org-latex

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

2022-07-10 Thread Ihor Radchenko
Juan Manuel Macías writes: > I'm attaching a patch with a proposal to unify in a single constant > (named `org-latex-language-alist') > `org-latex-polyglossia-language-alist' and > `org-latex-babel-language-alist', along with some necessary (minor) > modifications in `org-latex-guess-polyglossia-

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

2021-10-03 Thread Juan Manuel Macías
Hi all, I'm attaching a patch with a proposal to unify in a single constant (named `org-latex-language-alist') `org-latex-polyglossia-language-alist' and `org-latex-babel-language-alist', along with some necessary (minor) modifications in `org-latex-guess-polyglossia-language' and `org-latex-guess