From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: [PATCH][ox-latex.el] Allow AUTO argument to org-latex-guess-babel-language. Date: Tue, 04 Jun 2013 08:45:03 +0200 Message-ID: <86wqqae5n4.fsf@somewhere.org> References: <87sj12bwzj.fsf@pank.eu> <8661xvprju.fsf@somewhere.org> <87ehcj9uh7.fsf@pank.eu> <8638sz1e3b.fsf@somewhere.org> <87obbn8c36.fsf@pank.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org 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 loade= d; 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.htm= l. >> >> 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'= ) **=20 > >> * 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=E2=80=94you'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:=20 > > 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 =3D`org-latex-inputenc-alist'=3D. > > 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. =3D("AUTO" "babel" t)=3D works like ("AUTO" "inputenc" t) in >> =3D`org-latex-default-packages-alist'=3D. I.e. the default >> language is choosen (sic). >> 2. if #+LANGUAGE: mylang then then \usepackage[mylang]{babel} in >> outpu (sic).=20 > > This message in five line. . .=20=20 That's much clearer. Do I understand correctly that your patch does not cha= nge anything for people who don't use AUTO for Babel in their `org-latex-default-packages-alist'? Best regards, Seb --=20 Sebastien Vauban