emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* trying to get xetex working with org-mode
@ 2010-08-13  6:59 Christian Wittern
  2010-08-13 12:50 ` Scot Becker
  0 siblings, 1 reply; 6+ messages in thread
From: Christian Wittern @ 2010-08-13  6:59 UTC (permalink / raw)
  To: Org Mode Mailing List

Hi there,

This has come up before, but a search in the archive did not produce enough
information for me to solve the problem.  I want to export to PDF via XeTex
on Mac OS X (Emacs 23.2) and org-mode 7.01g.  After studying the manual and
looking at this message in the archive:

<quote>
(from: http://osdir.com/ml/emacs-orgmode-gnu/2010-04/msg00856.html)
[...]
And you can customize org-export-latex-classes to make the class headers
look like this:

\TeXXeTstate=1
\usepackage{fontspec,xunicode}
\defaultfontfeatures{Numbers=OldStyle,Scale=MatchLowercase,Mapping=tex- text}
\setmainfont{Sabon LT Std}
\setromanfont[Mapping=tex-text]{Sabon LT Std}
\setsansfont[Scale=MatchUppercase]{Myriad Pro}
\usepackage{xltxtra}
[DEFAULT-PACKAGES]
[PACKAGES]
[EXTRA]

And you can change things around any way you like.
HTH
- Carsten
</quote>

I started experimenting with customizing org-export-latex-classes.  Here is
what I put into the section for article:

\TeXXeTstate=1
\usepackage{fontspec,xunicode}
\defaultfontfeatures{Numbers=OldStyle,Scale=MatchLowercase,Mapping=tex-text}
\setromanfont[Mapping=tex-text]{Hoefler Text}
\newfontfamily{\J}[Scale=0.85]{Osaka}

(I removed the following lines:
[DEFAULT-PACKAGES]
[PACKAGES]
[EXTRA])
Now, what I get with C-c C-e l at the beginning of my tex file is:
<example>
\documentclass[11pt]{article}
\TeXXeTstate=1
\usepackage{fontspec,xunicode}
\defaultfontfeatures{Numbers=OldStyle,Scale=MatchLowercase,Mapping=tex- text}
\setromanfont[Mapping=tex-text]{Hoefler Text}
\newfontfamily{\J}[Scale=0.85]{Osaka}
\usepackage{xltxtra}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{soul}
\usepackage{t1enc}
\usepackage{textcomp}
\usepackage{marvosym}
\usepackage{wasysym}
\usepackage{latexsym}
\usepackage{amssymb}
\usepackage{hyperref}
\tolerance=1000
</example>
 There are some more lines I did not ask for and do not want, like for
example the \usepackage[utf8]{inputenc} which does not work with XeTeX.
Now the number of possible relevant variables etc is just too complex for me
to understand.  I would appreciate if some kind soul would explain to me how
to trim this down to use only the packages I need.

All the best,

Christian

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

* Re: trying to get xetex working with org-mode
  2010-08-13  6:59 trying to get xetex working with org-mode Christian Wittern
@ 2010-08-13 12:50 ` Scot Becker
  2010-08-13 13:47   ` Bastien
  2010-08-13 23:43   ` Christian Wittern
  0 siblings, 2 replies; 6+ messages in thread
From: Scot Becker @ 2010-08-13 12:50 UTC (permalink / raw)
  To: Christian Wittern; +Cc: Org Mode Mailing List

2010/8/13 Christian Wittern <cwittern@gmail.com>

> There are some more lines I did not ask for and do not want, like for
> example the \usepackage[utf8]{inputenc} which does not work with XeTeX.
> Now the number of possible relevant variables etc is just too complex for me
> to understand.  I would appreciate if some kind soul would explain to me how
> to trim this down to use only the packages I need.

Ain't that the truth.  The new LaTeX header system is very flexible,
but it multiplies the places you can put header stuff, and because of
the way XeLaTeX headers are structured, not all of them work.

This is what I do.  The following is a little hastily written.  I'm
happy to come back to anything that doesn't make sense.

First, I set org-export-latex-classes like so.  The relevant stanzas
are 5-7, staring with "mythesis"
Note that I explicitly exclude ORG's default set of loaded packages,
so i can include my own set.
Also note that it's a pretty small header.  For some reason I couldn't
get things to work if I put all of the XeTeX header stuff in there,
nor could I get it to work by putting in a bunch of #+Latex_header
lines (or whatever their syntax is).

(setq org-export-latex-classes
  '(("article"
     "\\documentclass[11pt, a4paper]{article}"
     ("\\section{%s}" . "\\section*{%s}")
     ("\\subsection{%s}" . "\\subsection*{%s}")
     ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
     ("\\paragraph{%s}" . "\\paragraph*{%s}")
     ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
    ("report"
     "\\documentclass[11pt]{report}"
     ("\\part{%s}" . "\\part*{%s}")
     ("\\chapter{%s}" . "\\chapter*{%s}")
     ("\\section{%s}" . "\\section*{%s}")
     ("\\subsection{%s}" . "\\subsection*{%s}")
     ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
    ("book"
     "\\documentclass[11pt, a4paper]{book}"
     ("\\part{%s}" . "\\part*{%s}")
     ("\\chapter{%s}" . "\\chapter*{%s}")
     ("\\section{%s}" . "\\section*{%s}")
     ("\\subsection{%s}" . "\\subsection*{%s}")
     ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
    ("beamer"
     "\\documentclass{beamer}"
     org-beamer-sectioning)
  ;; Here starts my personal latex classes
  ;; use them with:  #+LaTeX_CLASS: mythesis
    ("mythesis"
     "%!TEX TS-program = xelatex\n%!TEX encoding = UTF-8
Unicode\n\\documentclass[12pt,oneside,a4paper]{book}\n\\usepackage{fontspec}\n\\usepackage{xunicode}\n\\usepackage{xltxtra}\n\n%
Load My Thesis Defaults\n\\input{/home/scot/lin/tex/thesis-header.tex}\n%
Don't Load Org's standard list for this
class\n[NO-DEFAULT-PACKAGES]\n\\defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text}
% converts LaTeX specials (``quotes'' --- dashes etc.) to
unicode\n\\setromanfont{Gentium}\n\\setsansfont{Liberation Sans}
%change this, if you even use it."
     ("\\chapter{%s}" . "\\chapter*{%s}")
     ("\\section{%s}" . "\\section*{%s}")
     ("\\subsection{%s}" . "\\subsection*{%s}")
     ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
     ("\\paragraph{%s}" . "\\paragraph*{%s}")
     ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
    ("mychapter"
     "%!TEX TS-program = xelatex\n%!TEX encoding = UTF-8
Unicode\n\\documentclass[12pt,oneside,a4paper]{book}\n\\usepackage{fontspec}\n\\usepackage{xunicode}\n\\usepackage{xltxtra}\n\n%
Load My Thesis Defaults\n\\input{/home/scot/lin/tex/thesis-header.tex}\n%
Don't Load Org's standard list for this
class\n[NO-DEFAULT-PACKAGES]\n\\defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text}
% converts LaTeX specials (``quotes'' --- dashes etc.) to
unicode\n\\setromanfont{Gentium}\n\\setsansfont{Liberation Sans}
%change this, if you even use it."
     ("\\section{%s}" . "\\section*{%s}")
     ("\\subsection{%s}" . "\\subsection*{%s}")
     ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
     ("\\paragraph{%s}" . "\\paragraph*{%s}")
     ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
    ("mytextchunk"
     "%!TEX TS-program = xelatex\n%!TEX encoding = UTF-8
Unicode\n\\documentclass[12pt,oneside,a4paper]{article}\n\\usepackage{fontspec}\n\\usepackage{xunicode}\n\\usepackage{xltxtra}\n\n%
Load My Thesis Defaults\n\\input{/home/scot/lin/tex/thesis-header.tex}\n%
Don't Load Org's standard list for this
class\n[NO-DEFAULT-PACKAGES]\n\\defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text}
% converts LaTeX specials (``quotes'' --- dashes etc.) to
unicode\n\\setromanfont{Gentium}\n\\setsansfont{Liberation Sans}
%change this, if you even use it."
     ("\\section{%s}" . "\\section*{%s}")
     ("\\subsection{%s}" . "\\subsection*{%s}")
     ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
     ("\\paragraph{%s}" . "\\paragraph*{%s}")
     ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))))

Then I have the following in my thesis-header.tex file.

% Standard org stuff which I have to include by hand
% since I didn't want the other (font handling, entities) bits:
\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{float}
\usepackage{wrapfig}
%\usepackage{soul}
\usepackage{hyperref}
\tolerance=1000

That seems to produce a header that works with xetex.

I haven't yet set org up to run xelatex automatically, but that's possible too.

Scot

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

* Re: trying to get xetex working with org-mode
  2010-08-13 12:50 ` Scot Becker
@ 2010-08-13 13:47   ` Bastien
  2010-08-13 15:52     ` Scot Becker
  2010-08-13 23:43   ` Christian Wittern
  1 sibling, 1 reply; 6+ messages in thread
From: Bastien @ 2010-08-13 13:47 UTC (permalink / raw)
  To: Scot Becker; +Cc: Christian Wittern, Org Mode Mailing List

Scot Becker <scot.becker@gmail.com> writes:

> That seems to produce a header that works with xetex.

If so, it would be good to document it in Worg.

I quickly grep'ed the Worg dir and there is no mention of XeTeX...

-- 
 Bastien

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

* Re: trying to get xetex working with org-mode
  2010-08-13 13:47   ` Bastien
@ 2010-08-13 15:52     ` Scot Becker
  0 siblings, 0 replies; 6+ messages in thread
From: Scot Becker @ 2010-08-13 15:52 UTC (permalink / raw)
  To: Bastien; +Cc: Christian Wittern, Org Mode Mailing List

Noted.  I'll see what I can do (but nobody be afraid to beat me to it, OK?)

Scot


On Fri, Aug 13, 2010 at 2:47 PM, Bastien <bastien.guerry@wikimedia.fr> wrote:
> Scot Becker <scot.becker@gmail.com> writes:
>
>> That seems to produce a header that works with xetex.
>
> If so, it would be good to document it in Worg.
>
> I quickly grep'ed the Worg dir and there is no mention of XeTeX...
>
> --
>  Bastien
>

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

* Re: trying to get xetex working with org-mode
  2010-08-13 12:50 ` Scot Becker
  2010-08-13 13:47   ` Bastien
@ 2010-08-13 23:43   ` Christian Wittern
  2010-08-14  2:19     ` Thomas S. Dye
  1 sibling, 1 reply; 6+ messages in thread
From: Christian Wittern @ 2010-08-13 23:43 UTC (permalink / raw)
  To: Scot Becker; +Cc: Org Mode Mailing List

Scot,

Thanks a lot, this helps a lot and is getting me on the right track.
I was getting lost in the Customize-Groups-Browser hell and now see
that I can have it much easier.  Great.
And when it comes to avoiding unwanted packages, I guess
[NO-DEFAULT-PACKAGES]
is really what I was looking for.

All the best,

Christian


-- 
Christian Wittern, Kyoto

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

* Re: trying to get xetex working with org-mode
  2010-08-13 23:43   ` Christian Wittern
@ 2010-08-14  2:19     ` Thomas S. Dye
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas S. Dye @ 2010-08-14  2:19 UTC (permalink / raw)
  To: Christian Wittern; +Cc: Org Mode Mailing List


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

Aloha Christian and Scot,

I'm interested in adding a brief section describing a plain vanilla  
XeTeX export to the Worg tutorial on LaTeX export: http://orgmode.org/worg/org-tutorials/org-latex-export.php

If one or both of you could help out by editing the Worg page directly  
or by sending draft materials to me or to the list when you're  
confident of a reasonable solution, I'd much appreciate it.

All the best,
Tom



On Aug 13, 2010, at 1:43 PM, Christian Wittern wrote:

> Scot,
>
> Thanks a lot, this helps a lot and is getting me on the right track.
> I was getting lost in the Customize-Groups-Browser hell and now see
> that I can have it much easier.  Great.
> And when it comes to avoiding unwanted packages, I guess
> [NO-DEFAULT-PACKAGES]
> is really what I was looking for.
>
> All the best,
>
> Christian
>
>
> -- 
> Christian Wittern, Kyoto
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode


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

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please 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] 6+ messages in thread

end of thread, other threads:[~2010-08-14  2:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-13  6:59 trying to get xetex working with org-mode Christian Wittern
2010-08-13 12:50 ` Scot Becker
2010-08-13 13:47   ` Bastien
2010-08-13 15:52     ` Scot Becker
2010-08-13 23:43   ` Christian Wittern
2010-08-14  2:19     ` Thomas S. Dye

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