Not sure if this is the right forum for this question, so feel free to direct me elsewhere... I'm trying to quit Markdown and switch to org-mode completely. To do that, I need to get my LaTeX template working with org-mode. I had a LaTeX template I cobbled together and successfully used with Pandoc for Markdown -> LaTeX -> PDF. I tried to convert my template to work with org-mode, but I haven't had any success. The .tex file it generates looks valid as far as I can tell, but when I do org-export to LaTeX and open resulting PDF, it crashes Emacs. Here's what I added to my .emacs file. Can anyone see what I've done wrong? As may be apparent, I don't really know what I'm doing. (add-to-list 'org-export-latex-classes '("salazar" "\\documentclass[12pt]{article} \\usepackage{float} \\usepackage{hyperref} \\usepackage{algorithm} \\usepackage{amsmath} \\usepackage{ifxetex} \\ifxetex \\usepackage{fontspec,xltxtra,xunicode} \\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} \\setromanfont{Adobe Garamond Pro} \\setsansfont{Arial} \\setmonofont{Courier} \\else \\usepackage[mathletters]{ucs} \\usepackage[utf8x]{inputenc} \\fi \\usepackage{microtype} \\usepackage{fancyhdr} \\pagestyle{fancy} \\pagenumbering{arabic} \\lhead{\\href{mailto:cycleofsong@gmail.com}{Peter Salazar}} \\chead{\itshape} \\rhead{\\itshape{\\nouppercase{\\@title}: {\\nouppercase\\leftmark}}} \\lfoot{} \\cfoot{\\thepage} \\rfoot{} \\usepackage{listings} \\lstnewenvironment{code}{\\lstset{language=Haskell,basicstyle=\\small\\ttfamily}}{} \\setlength{\\parindent}{0pt} \\setlength{\\parskip}{12pt plus 2pt minus 1pt} \\usepackage{fancyvrb} \\usepackage{enumerate} \\usepackage{ctable} \\setlength{\\paperwidth}{8.5in} \\setlength{\\paperheight}{11in} \\usepackage[margin=1.5in,hmargin=1.5in,vmargin=1.5in]{geometry} \\tolerance=1000 \\usepackage{tocloft} \\renewcommand{\\cftsecleader}{\\cftdotfill{\\cftdotsep}} \\usepackage[normalem]{ulem} \\newcommand{\\textsubscr}[1]{\\ensuremath{_{\\scriptsize\\textrm{#1}}}} \\usepackage[breaklinks=true,linktocpage,pdftitle={\\@title},pdfauthor={\\@author},xetex]{hyperref} \\usepackage{url} \\usepackage{graphicx} \\hypersetup{ colorlinks, citecolor=black,filecolor=black,linkcolor=black,urlcolor=blue} \\makeatletter \\def\\maketitle{ \\thispagestyle{empty} \\vfill \\begin{raggedright} \\leavevmode \\vskip 1cm \{\\fontsize{50}{60}\\selectfont \\@title\\par} \\vskip 1cm \\normalfont \{\\huge {\\@author\\par}} \\vfill \{\\Large Peter Salazar} \\newline \{\\Large \\href{mailto:cycleofsong@gmail.com}{ cycleofsong@gmail.com}} \\newline \{\\Large \\@date\\par} \\end{raggedright} \\null \\cleardoublepage \} [NO-DEFAULT-PACKAGES] [NO-PACKAGES]" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) (setq org-latex-to-pdf-process '("xelatex -interaction nonstopmode %f" "xelatex -interaction nonstopmode %f")) ;; for multiple passes