Re: [O] [PATCH][ox-latex.el] Allow AUTO argument to org-latex-guess-babel-language.
Rasmus writes: > This patch allows ox-latex to make a guess on which language to use > if babel is a default package. See the head of the patch. What's the status of your copyright assignment? You're neither listed as a contributor nor as one of the people whose papers are in processing (see http://orgmode.org/worg/org-contribute.html) although you've mentioned that you might consider assigning copyright just recently. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ SD adaptation for Waldorf rackAttack V1.04R1: http://Synth.Stromeko.net/Downloads.html#WaldorfSDada
Re: [O] [PATCH][ox-latex.el] Allow AUTO argument to org-latex-guess-babel-language.
Dear Achim, > Rasmus writes: >> This patch allows ox-latex to make a guess on which language to use >> if babel is a default package. See the head of the patch. > > What's the status of your copyright assignment? You're neither listed > as a contributor nor as one of the people whose papers are in processing > (see http://orgmode.org/worg/org-contribute.html) although you've > mentioned that you might consider assigning copyright just recently. I'm not assigned but I'm happy to. Should I start the process? I haven't made any significant contributions to "org-core". –Rasmus -- When in doubt, do it!
Re: [O] [PATCH][ox-latex.el] Allow AUTO argument to org-latex-guess-babel-language.
Rasmus writes: > Dear Achim, > >> Rasmus writes: >>> This patch allows ox-latex to make a guess on which language to use >>> if babel is a default package. See the head of the patch. >> >> What's the status of your copyright assignment? You're neither listed >> as a contributor nor as one of the people whose papers are in processing >> (see http://orgmode.org/worg/org-contribute.html) although you've >> mentioned that you might consider assigning copyright just recently. > > I'm not assigned but I'm happy to. Should I start the process? I > haven't made any significant contributions to "org-core". I've send an email to assing at gnu just now. -- Powered by magic pixies!
Re: [O] [PATCH][ox-latex.el] Allow AUTO argument to org-latex-guess-babel-language.
Hello Rasmus, Rasmus wrote: > 1. As far as I remember, if more than one language is loaded the > order is not neutral one one should issue a \selectlanguage{LANG}. If there are multiple languages, the main language is the latest loaded; that is `english' in the following example: \RequirePackage[frenchb,english]{babel} Best regards, Seb -- Sebastien Vauban
Re: [O] [PATCH][ox-latex.el] Allow AUTO argument to org-latex-guess-babel-language.
"Sebastien Vauban" writes: > Hello Rasmus, > > Rasmus wrote: >> 1. As far as I remember, if more than one language is loaded the >> order is not neutral one one should issue a \selectlanguage{LANG}. > > If there are multiple languages, the main language is the latest loaded; that > is `english' in the following example: > > \RequirePackage[frenchb,english]{babel} So if a #+LANGUAGE: LANG cookie is present I guess it should be loaded last. Or a \selectlanguage{LANG} should be issued. Non-rigorous testing suggests that it will do the former now on master and thus presumably also in the patch. –Rasmus -- El Rey ha muerto. ¡Larga vida al Rey!
Re: [O] [PATCH][ox-latex.el] Allow AUTO argument to org-latex-guess-babel-language.
Rasmus wrote: > "Sebastien Vauban" writes: >> Rasmus wrote: >>> 1. As far as I remember, if more than one language is loaded the >>> order is not neutral one one should issue a \selectlanguage{LANG}. >> >> If there are multiple languages, the main language is the latest loaded; that >> is `english' in the following example: >> >> \RequirePackage[frenchb,english]{babel} > > So if a #+LANGUAGE: LANG cookie is present I guess it should be loaded > last. Or a \selectlanguage{LANG} should be issued. > > Non-rigorous testing suggests that it will do the former now on master > and thus presumably also in the patch. AFAICT, this is so since a while. Nicolas implemented the above described behavior months ago... See http://lists.gnu.org/archive/html/emacs-orgmode/2012-06/msg00387.html. Doesn't that work for you already in Org core as it is? Best regards, Seb -- Sebastien Vauban
Re: [O] [PATCH][ox-latex.el] Allow AUTO argument to org-latex-guess-babel-language.
Dear Sebastien, 1. As far as I remember, if more than one language is loaded the order is not neutral one one should issue a \selectlanguage{LANG}. >>> >>> If there are multiple languages, the main language is the latest loaded; >>> that >>> is `english' in the following example: >>> >>> \RequirePackage[frenchb,english]{babel} >> >> So if a #+LANGUAGE: LANG cookie is present I guess it should be loaded >> last. Or a \selectlanguage{LANG} should be issued. >> >> Non-rigorous testing suggests that it will do the former now on master >> and thus presumably also in the patch. > > AFAICT, this is so since a while. Nicolas implemented the above described > behavior months ago... > > See http://lists.gnu.org/archive/html/emacs-orgmode/2012-06/msg00387.html. > > Doesn't that work for you already in Org core as it is? I'm sorry, I guess the changelog is too sparse or too unclear. Let me try to annotate it. ** Goal: make bable work similar to inputenc (and try to be less 'smart') ** > * ox-latex.el (org-latex-guess-babel-language): ignore AUTO > if argument. I can now add ("AUTO" "babel" t) to org-latex-default-packages-alist—you'll recognize this syntax from inputenc (see org-latex-default-packages-alist). This means allows me to load babel every time I export a LaTeX document. Babel is important enough that I want I always want to load it. Due to the exists of org-export-default-language there is's always a replacement for AUTO. Let's consider an example: 1. Say, org-export-default-language is "en". 2. In my document #+LANGUAGE: fr. Using this patch AUTO is replaced by 'french' when I have a LANGUAGE-cookie. When no LANGUAGE is present, it defaults to org-export-default-language. Thus, I only load one language and I can have a more general org-latex-default-packages-alist. > * ox-latex.el (org-lat ex-guess-babel-language): use language > if is not in =`org-latex-inputenc-alist'=. Let's just continue the example above, but suppose I now want to write a German document. For instance with German there is both german and ngerman, and apparently a germanb. Through the LANGUAGE-cookie I can only get ngerman (de-de) and germanb (de). But I might want to get german for whatever reason. So I might try #+LANGUAGE: german Currently it's discarded. But why not just pass it along when the value of LANGUAGE is not in org-latex-babel-language-alist and assume I know what I am doing? > * ox-latex.el (org-latex-guess-babel-language): retain case in final > regexp of function. Needed for AUTO to replacing everything with uppercase. I hope the above makes the purpose of the patch clear. I'll try to write better change logs in the future. > Behavior changes: > 1. =("AUTO" "babel" t)= works like ("AUTO" "inputenc" t) in > =`org-latex-default-packages-alist'=. I.e. the default > language is choosen (sic). > 2. if #+LANGUAGE: mylang then then \usepackage[mylang]{babel} in > outpu (sic). This message in five line. . . Cheers, Rasmus -- m-mm-mmm- bacon!
Re: [O] [PATCH][ox-latex.el] Allow AUTO argument to org-latex-guess-babel-language.
Hello Rasmus, Rasmus wrote: > 1. As far as I remember, if more than one language is loaded the > order is not neutral one one should issue a \selectlanguage{LANG}. If there are multiple languages, the main language is the latest loaded; that is `english' in the following example: \RequirePackage[frenchb,english]{babel} >>> >>> So if a #+LANGUAGE: LANG cookie is present I guess it should be loaded >>> last. Or a \selectlanguage{LANG} should be issued. >>> >>> Non-rigorous testing suggests that it will do the former now on master >>> and thus presumably also in the patch. >> >> AFAICT, this is so since a while. Nicolas implemented the above described >> behavior months ago... >> >> See http://lists.gnu.org/archive/html/emacs-orgmode/2012-06/msg00387.html. >> >> Doesn't that work for you already in Org core as it is? > > I'm sorry, I guess the changelog is too sparse or too unclear. Let me > try to annotate it. > > ** Goal: make bable work similar to inputenc (and try to be less 'smart') ** > >> * ox-latex.el (org-latex-guess-babel-language): ignore AUTO >> if argument. > > I can now add ("AUTO" "babel" t) to > org-latex-default-packages-alist—you'll recognize this syntax from > inputenc (see org-latex-default-packages-alist). > > This means allows me to load babel every time I export a LaTeX > document. Babel is important enough that I want I always want to load > it. > > Due to the exists of org-export-default-language there is's always a > replacement for AUTO. > > Let's consider an example: > > 1. Say, org-export-default-language is "en". > > 2. In my document #+LANGUAGE: fr. Using this patch AUTO is replaced >by 'french' when I have a LANGUAGE-cookie. When no LANGUAGE is >present, it defaults to org-export-default-language. Thus, I only >load one language and I can have a more general >org-latex-default-packages-alist. > >> * ox-latex.el (org-lat ex-guess-babel-language): use language >> if is not in =`org-latex-inputenc-alist'=. > > Let's just continue the example above, but suppose I now want to write > a German document. > > For instance with German there is both german and ngerman, and > apparently a germanb. Through the LANGUAGE-cookie I can only get > ngerman (de-de) and germanb (de). But I might want to get german for > whatever reason. So I might try > > #+LANGUAGE: german > > Currently it's discarded. But why not just pass it along when the > value of LANGUAGE is not in org-latex-babel-language-alist and assume > I know what I am doing? > >> * ox-latex.el (org-latex-guess-babel-language): retain case in final >> regexp of function. > > Needed for AUTO to replacing everything with uppercase. > > > I hope the above makes the purpose of the patch clear. I'll try to > write better change logs in the future. > >> Behavior changes: >> 1. =("AUTO" "babel" t)= works like ("AUTO" "inputenc" t) in >> =`org-latex-default-packages-alist'=. I.e. the default >> language is choosen (sic). >> 2. if #+LANGUAGE: mylang then then \usepackage[mylang]{babel} in >> outpu (sic). > > This message in five line. . . That's much clearer. Do I understand correctly that your patch does not change anything for people who don't use AUTO for Babel in their `org-latex-default-packages-alist'? Best regards, Seb -- Sebastien Vauban