emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [PATCH (new version)][ox-latex.el] Allow AUTO argument to org-la


From: Rasmus
Subject: Re: [O] [PATCH (new version)][ox-latex.el] Allow AUTO argument to org-latex-guess-babel-language.
Date: Tue, 04 Jun 2013 11:25:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Hi Sebastien,

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

Thanks, and sorry for not being specific enough if the first case.

> 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'?

Yes, and no, but mainly yes.

The AUTO part should be completely autonomous to the setup you
referred to.  The AUTO part is always discarded.

It changes behavior for your setup in that you can define a LANGUAGE
that isn't a known abbreviation.

Given your points the attached is a much more robust version of the
patch, so thanks a lot.  Examples, omitted from the commit message:


Behavior changes:
1.  =("AUTO" "babel" t)= works like ("AUTO" "inputenc" t) in
    =`org-latex-default-packages-alist'=. If a LANGUAGE-cookie is 
    present this will be used, otherwise the default,
    =`org-export-default-language'=  language is choose.
2. If #+LANGUAGE: mylang then then \usepackage[mylang]{babel} in
   output.

Examples: 
 1. Assume ("AUTO" "babel" t) is a member of
    =`org-latex-default-packages-alist'= and default language is en.
    If =#+LANGUAGE: fr= is in the document AUTO is replaced with french.
    If =#+LANGUAGE: mylang= then AUTO is replaced with mylang. 

2. Assume ("AUTO" "babel" t) is not a member of
   =`org-latex-default-packages-alist'= and assume LATEX_HEADER:
   \usepackage[english]{babel} and LANGUAGE: mylang.  Then the
   exported result is \usepackage[english, mylang]{babel}. 
   If \usepackage[AUTO,english]{babel} then 

As for 'robustness', the following case is handled correctly (from
emacs -q with default org-latex-default-package-alist):

#+LANGUAGE: da
#+LATEX_HEADER: \usepackage[AUTO, danish]{babel}

#+LANGUAGE: danish
#+LATEX_HEADER: \usepackage[AUTO, danish]{babel}

#+LANGUAGE: fr
#+LATEX_HEADER: \usepackage[AUTO, danish, english]{babel}

#+LANGUAGE: de
#+LATEX_HEADER: \usepackage[danish, english, AUTO]{babel}

Cheers,
Rasmus

-- 
Vote for proprietary math!

Attachment: 0001-Allow-AUTO-argument-to-org-latex-guess-babel-languag_v2.patch
Description: Text Data


reply via email to

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