emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: [PATCH][ox-latex.el] Allow AUTO argument to org-latex-guess-babel-language.
Date: Tue, 04 Jun 2013 08:45:03 +0200	[thread overview]
Message-ID: <86wqqae5n4.fsf@somewhere.org> (raw)
In-Reply-To: 87obbn8c36.fsf@pank.eu

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

  reply	other threads:[~2013-06-04  6:45 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-31 22:33 [PATCH][ox-latex.el] Allow AUTO argument to org-latex-guess-babel-language Rasmus
2013-06-01  5:31 ` Achim Gratz
2013-06-01 13:59   ` Rasmus
2013-06-01 14:07     ` Rasmus
2013-06-03  7:44 ` Sebastien Vauban
2013-06-03 13:47   ` Rasmus
2013-06-03 14:08     ` Sebastien Vauban
2013-06-03 15:10       ` Rasmus
2013-06-04  6:45         ` Sebastien Vauban [this message]
2013-06-04  9:25           ` [PATCH (new version)][ox-latex.el] " Rasmus
2013-06-05 13:35             ` Nicolas Goaziou
2013-06-06  7:46               ` Sebastien Vauban
2013-06-06  9:28                 ` Rasmus
2013-06-06  9:36               ` Rasmus
2013-06-06 21:30               ` [PATCH (v3)][ox-latex.el] " Rasmus
2013-06-07 12:35                 ` Nicolas Goaziou
2013-06-07 13:16                   ` Rasmus
2013-06-07 13:25                     ` Nicolas Goaziou
2013-06-07 15:26                   ` Rasmus
2013-06-09  7:55                     ` Nicolas Goaziou
2013-06-11 23:12                       ` [PATCH (v5)][ox-latex.el] " Rasmus
2013-06-12 13:27                         ` Nicolas Goaziou
2013-06-12 14:32                           ` Rasmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86wqqae5n4.fsf@somewhere.org \
    --to=sva-news-d0wtavr13harg/idocfnwg@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).