emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* FR: make LaTeX export recognize LANGUAGE option
@ 2009-05-05 13:31 Kevin Brubeck Unhammer
  2009-05-05 14:19 ` Nick Dokos
  2009-05-06  7:17 ` Carsten Dominik
  0 siblings, 2 replies; 3+ messages in thread
From: Kevin Brubeck Unhammer @ 2009-05-05 13:31 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

I couldn't find any references to babel in the mailing list nor in
org-latex.el. I have various latex export class headers, but I
sometimes write in English and sometimes in Norwegian, and this is not
bound to the classes (beamer, ps-article, pdf-article). As it is, I've
had

\usepackage[nynorsk,english]{babel}

in all my class headers, and then eg.
\selectlanguage{nynorsk}
in the org file.

But before printout I've had to go into the .tex-file and remove
whatever language I'm not using, deleting the .aux file and rerunning
latex, since Apacite doesn't recognize the \selectlanguage within the
literature list (eg. I get English "in" and "from" and such).

So, I was wondering if we could have an option to let

#+LANGUAGE: nn

make the header say

\usepackage[nynorsk]{babel}

etc., so that, at least for monolingual documents, one doesn't have to
do all this mucking about with \selectlanguage and deleting .aux
files.

If implemented, I think I might've read somewhere that babel should be
loaded early on in the header, but other people probably know this
better than me. (I guess it shouldn't be too hard to put it on the
line right after \documentclass ?)

Possibly "#+LANGUAGE: nn en" could be used for multilingual documents,
but that seems low priority to me.



best regards,
Kevin Brubeck Unhammer

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: FR: make LaTeX export recognize LANGUAGE option
  2009-05-05 13:31 FR: make LaTeX export recognize LANGUAGE option Kevin Brubeck Unhammer
@ 2009-05-05 14:19 ` Nick Dokos
  2009-05-06  7:17 ` Carsten Dominik
  1 sibling, 0 replies; 3+ messages in thread
From: Nick Dokos @ 2009-05-05 14:19 UTC (permalink / raw)
  To: Kevin Brubeck Unhammer; +Cc: emacs-orgmode

Kevin Brubeck Unhammer <p.ixiemotion@gmail.com> wrote:


> I couldn't find any references to babel in the mailing list nor in
> org-latex.el. I have various latex export class headers, but I
> sometimes write in English and sometimes in Norwegian, and this is not
> bound to the classes (beamer, ps-article, pdf-article). As it is, I've
> had
> 
> \usepackage[nynorsk,english]{babel}
> 
> in all my class headers, and then eg.
> \selectlanguage{nynorsk}
> in the org file.
> 
> But before printout I've had to go into the .tex-file and remove
> whatever language I'm not using, deleting the .aux file and rerunning
> latex, since Apacite doesn't recognize the \selectlanguage within the
> literature list (eg. I get English "in" and "from" and such).
> 
> So, I was wondering if we could have an option to let
> 
> #+LANGUAGE: nn
> 
> make the header say
> 
> \usepackage[nynorsk]{babel}
> 
> etc., so that, at least for monolingual documents, one doesn't have to
> do all this mucking about with \selectlanguage and deleting .aux
> files.
> 
> If implemented, I think I might've read somewhere that babel should be
> loaded early on in the header, but other people probably know this
> better than me. (I guess it shouldn't be too hard to put it on the
> line right after \documentclass ?)
> 
> Possibly "#+LANGUAGE: nn en" could be used for multilingual documents,
> but that seems low priority to me.
> 

Part of the problem is that if you have previous runs, the aux file and such
are going to be present and they will need cleaning up no matter what you
do at the org level.

Purely at the org level, there may be a better way, but this is what I
came up with: you can hack around this by defining your own
"class". E.g. in your org file you say

#+LaTeX_CLASS: myclass

and you add a definition for ``myclass'' to org-export-latex-classes,
something like this (I just copied the ``article'' entry, modified the name
and added the babel stuff - and you probably still need to add
the \selectlanguage more-or-less by hand, but I guess you can do it at the
org level):

(add-to-list 'org-export-latex-classes
  '("myclass"
     "\\documentclass[11pt]{article}
\\usepackage[nynorsk]{babel}
\\usepackage[utf8]{inputenc}
\\usepackage[T1]{fontenc}
\\usepackage{graphicx}
\\usepackage{longtable}
\\usepackage{hyperref}"
     ("\\section{%s}" . "\\section*{%s}")
     ("\\subsection{%s}" . "\\subsection*{%s}")
     ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
     ("\\paragraph{%s}" . "\\paragraph*{%s}")
     ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))

Does this help?

Nick

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: FR: make LaTeX export recognize LANGUAGE option
  2009-05-05 13:31 FR: make LaTeX export recognize LANGUAGE option Kevin Brubeck Unhammer
  2009-05-05 14:19 ` Nick Dokos
@ 2009-05-06  7:17 ` Carsten Dominik
  1 sibling, 0 replies; 3+ messages in thread
From: Carsten Dominik @ 2009-05-06  7:17 UTC (permalink / raw)
  To: Kevin Brubeck Unhammer; +Cc: emacs-orgmode

H Kevin,

maybe the easiest would be

#+LATEX_HEADER: \usepackage[nynorsk,english]{babel}

However, this will be inserted directly before \begin{document}
which might be too late if what you say about inserting early
is right.

Maybe we need to change the insertion point of these additions.
Any comments by the LaTeX-using people here?

- Carsten

On May 5, 2009, at 3:31 PM, Kevin Brubeck Unhammer wrote:

> Hi,
>
> I couldn't find any references to babel in the mailing list nor in
> org-latex.el. I have various latex export class headers, but I
> sometimes write in English and sometimes in Norwegian, and this is not
> bound to the classes (beamer, ps-article, pdf-article). As it is, I've
> had
>
> \usepackage[nynorsk,english]{babel}
>
> in all my class headers, and then eg.
> \selectlanguage{nynorsk}
> in the org file.
>
> But before printout I've had to go into the .tex-file and remove
> whatever language I'm not using, deleting the .aux file and rerunning
> latex, since Apacite doesn't recognize the \selectlanguage within the
> literature list (eg. I get English "in" and "from" and such).
>
> So, I was wondering if we could have an option to let
>
> #+LANGUAGE: nn
>
> make the header say
>
> \usepackage[nynorsk]{babel}
>
> etc., so that, at least for monolingual documents, one doesn't have to
> do all this mucking about with \selectlanguage and deleting .aux
> files.
>
> If implemented, I think I might've read somewhere that babel should be
> loaded early on in the header, but other people probably know this
> better than me. (I guess it shouldn't be too hard to put it on the
> line right after \documentclass ?)
>
> Possibly "#+LANGUAGE: nn en" could be used for multilingual documents,
> but that seems low priority to me.
>
>
>
> best regards,
> Kevin Brubeck Unhammer
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-05-06  7:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-05 13:31 FR: make LaTeX export recognize LANGUAGE option Kevin Brubeck Unhammer
2009-05-05 14:19 ` Nick Dokos
2009-05-06  7:17 ` Carsten Dominik

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