emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Emmanuel Charpentier <emanuel.charpentier@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Possible bug in org-mode (MELPA version as of 1018-11-25) : #+language: is not (fully) honored.
Date: Wed, 28 Nov 2018 12:38:52 +0100	[thread overview]
Message-ID: <CAFG8T6VE8PtXuxLSfRRnrUW0y27KN1ZZmhjjOzG94yFp90E-wQ@mail.gmail.com> (raw)
In-Reply-To: <87pnuqrsw4.fsf@nicolasgoaziou.fr>


[-- Attachment #1.1: Type: text/plain, Size: 3396 bytes --]

Le mercredi 28 novembre 2018 à 00:40 +0100, Nicolas Goaziou a écrit :

> emanuel.charpentier@gmail.com writes:
>

> > Le mardi 27 novembre 2018 à 21:26 +0100, Nicolas Goaziou a écrit :
> >
> > [ Snip... ]
> >

> > > What happens if you remove "org-ref.el" reference?

> >
> > Same thing.
> >
> > Even after uninstalling org-ref and its dependencies.
> >
> > Sorry...

>
> OK. I got it. This has nothing to do with LANGUAGE keyword.
>
> Babel is not a default package, per `org-latex-default-packages-
> alist.
> You need to add it to `org-latex-packages-alist'.


Close, but no cigar :

I used the `customize' interface to add it to `org-latex-default-
packages-alist' (because the package to load is compiler-dependent),
which becomes:

(("AUTO" "inputenc" t
  ("pdflatex"))
 ("T1" "fontenc" t
  ("pdflatex"))
 (#1="" "graphicx" t nil)
 (#1# "grffile" t nil)
 (#1# "longtable" nil nil)
 (#1# "wrapfig" nil nil)
 (#1# "rotating" nil nil)
 ("normalem" "ulem" t nil)
 (#1# "amsmath" t nil)
 (#1# "textcomp" t nil)
 (#1# "amssymb" t nil)
 (#1# "capt-of" nil nil)
 (#1# "hyperref" nil nil)
 (#1# "babel" t
      ("pdflatex"))
 (#1# "polyglossia" t
      ("xelatex" "lualatex")))

I then retried an example (similar to the first one, but another
machine...) (see enclosed files).

  * The latex file does indeed contain "\usepackage{babel}" at the end
    of preamble

  * But the language is never set.

  * Therefore, no "frenchizing" happens...

This is due to the fact that, in order to get what I mean, the babel
loading should be "\usepackage[frenchb]{babel}", i. e. take the value
corresponding to whatever #+language: implies ("frenchb" for "fr",
etc...). I do not know how to do that.

Is there a documented way to do that, or should I dive in ox-latex
source ?

A couple of remarks :
  * If this setup is necessary to get #+langiage: honored fot LaTeX
    export, this should be done by default (i. e. in org's source
    code).

  * One might wish to allow to fully use babel's (and polyglossia's)
    abilities by specifying a set of possible #+language:s (first
    call) or switch to another language (further calls down the
    file...).

  * concerning french: I understand that "frenchb" is obsolete and
    that one should use "french" instead (better compatibility with
    ispell and flyspell-babel, among others)...

  * I suggest a '(#1# "fontspec" t '(xelatex lualatex)), and possibly
    an '(#1# "mathspec" t '(xetex luatex)) or '(#1# "unicode-math" t
                                                '(xetex luatex))
    entry(ies) to be added to the default : xetex is more and more
    used, and luatex is officially the successor to pdftex...

HTH,

--
Emmanuel Charpentier


Le mer. 28 nov. 2018 à 00:40, Nicolas Goaziou <mail@nicolasgoaziou.fr> a
écrit :

> emanuel.charpentier@gmail.com writes:
>
> > Le mardi 27 novembre 2018 à 21:26 +0100, Nicolas Goaziou a écrit :
> >
> > [ Snip... ]
> >
> >> What happens if you remove "org-ref.el" reference?
> >
> > Same thing.
> >
> > Even after uninstalling org-ref and its dependencies.
> >
> > Sorry...
>
> OK. I got it. This has nothing to do with LANGUAGE keyword.
>
> Babel is not a default package, per `org-latex-default-packages-alist.
> You need to add it to `org-latex-packages-alist'.
>
>

[-- Attachment #1.2: Type: text/html, Size: 15811 bytes --]

[-- Attachment #2: TstFrench.org --]
[-- Type: application/octet-stream, Size: 233 bytes --]

# Test de l'option #+language

#+title: Test de l'option =#+language:=
#+author: Emmanuel Charpentier
#+date: Novembre 2018
#+language: french

* Pique.

Baratin.

* Et pique...

Autre baratin.

* Et colégram!

Troisième baratin.


[-- Attachment #3: TstFrench.tex --]
[-- Type: text/x-tex, Size: 960 bytes --]

% Created 2018-11-28 mer. 11:48
% Intended LaTeX compiler: pdflatex
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\usepackage{babel}
\author{Emmanuel Charpentier}
\date{Novembre 2018}
\title{Test de l'option \texttt{\#+language:}}
\hypersetup{
 pdfauthor={Emmanuel Charpentier},
 pdftitle={Test de l'option \texttt{\#+language:}},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 27.0.50 (Org mode 9.1.14)}, 
 pdflang={French}}
\begin{document}

\maketitle
\tableofcontents


\section{Pique.}
\label{sec:orgf5d6a52}

Baratin.

\section{Et pique\ldots{}}
\label{sec:orge68ddf8}

Autre baratin.

\section{Et colégram!}
\label{sec:orgf4c826b}

Troisième baratin.
\end{document}

[-- Attachment #4: TstFrench.pdf --]
[-- Type: application/pdf, Size: 91000 bytes --]

  reply	other threads:[~2018-11-28 11:39 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-25 20:36 Possible bug in org-mode (MELPA version as of 1018-11-25) : #+language: is not (fully) honored emanuel.charpentier
2018-11-27 14:20 ` Eric S Fraga
2018-11-27 15:29   ` Emmanuel Charpentier
2018-11-27 20:26     ` Nicolas Goaziou
2018-11-27 20:55       ` emanuel.charpentier
2018-11-27 23:40         ` Nicolas Goaziou
2018-11-28 11:38           ` Emmanuel Charpentier [this message]
2018-11-28 14:06             ` Nicolas Goaziou
2018-11-29  7:21               ` emanuel.charpentier
2018-11-29 14:07                 ` Nicolas Goaziou
2018-11-29 17:31                   ` Emmanuel Charpentier
2018-11-29 19:12                     ` Nicolas Goaziou
2018-12-02 20:26                       ` emanuel.charpentier
2018-12-05 16:37                         ` Emmanuel Charpentier
2018-12-06 22:40                         ` Nicolas Goaziou
  -- strict thread matches above, loose matches on Subject: below --
2018-11-25 18:01 emanuel.charpentier
2018-11-25 15:54 Emmanuel Charpentier
2018-11-25 19:03 ` Nicolas Goaziou
2018-11-25 20:32   ` Emmanuel Charpentier
2018-11-25 22:31     ` Nicolas Goaziou
2018-11-26  3:40       ` Emmanuel Charpentier
2018-11-26  8:58         ` Nicolas Goaziou
2018-11-25 21:33   ` Emmanuel Charpentier
2018-11-27 14:19 ` Michael Welle

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=CAFG8T6VE8PtXuxLSfRRnrUW0y27KN1ZZmhjjOzG94yFp90E-wQ@mail.gmail.com \
    --to=emanuel.charpentier@gmail.com \
    --cc=emacs-orgmode@gnu.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).