# Emacs+Xetex org-latex-export-to-pdf to create pdfs out of txt files saved as org

Please advise if there is a simpler way to do this but I'm hoping to use Emacs + Xetex for turning a text file into a pdf. So far I am saving the text file as .org and I currently have

#+LATEX_CLASS: article
#+LATEX_CLASS_OPTIONS: [12pt]

#+begin_latex
\begin{huge}
#+end_latex

Chapter 100

Beginning
Story
Plot

Chapter 101
More Story
Twist
Satisfying Ending

#+begin_latex
\end{huge}
#+end_latex


My goal is having the end pdf to be 24pt font, Arial, with some spacing between paragraphs (not each line). 12pt + encapsulating everything in \huge works quite well for 24pt. I'm trying to use Xetex for the Arial font but I get

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! Fatal fontspec error: "cannot-use-pdftex"
!
! The fontspec package requires either XeTeX or LuaTeX to function.
!
! You must change your typesetting engine to, e.g., "xelatex" or "lualatex"
! instead of plain "latex" or "pdflatex".
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................

l.41  }

) )
(see the transcript file for additional information)
No pages of output.


I have Xetex installed but I'm not sure how to switch the typesetting engine. I have

(setq-default TeX-engine 'xetex)


in my .emacs but that doesn't seem to do it. Beginner at latex and org exporting to latex here, is there a simpler way of doing what I want to accomplish? Thanks.

• According to the docs, you have to adjust the variable org-latex-pdf-process. TeX-engine is in effect when you open a .tex file and let AUCTeX pass your file to compiler. – Arash Esbati Jul 4 '16 at 8:40

Emacs-fu blog presented a solution to use XeTeX to import with emacs.

You need to set org-latex-to-pdf-process to XeTeX, XeLaTeX or any other engine:

(setq org-latex-to-pdf-process
'("xelatex -interaction nonstopmode %f"
"xelatex -interaction nonstopmode %f")) ;; for multiple passes


Also, if you can use an "Arial like" you can have a look at helvet package as stated in this answer and comments.

• As mentioned by @MikeHoss, this variable name has changed. Also, you may want to add -output-directory %o before the file name, which the default variable value also includes. – Ivan Perez Jul 1 '18 at 0:01

The variable has been changed to org-latex-pdf-process (note there is no to in the name). If you use customize-variable you will get a dropdown where you choose xelatex, etc.

• Welcome to TeX.SX! Here you can find some tips for answering questions here – Bobyandbob Aug 7 '17 at 19:37