From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Correct Way to Customize LaTeX Export? Date: Tue, 08 Sep 2009 17:11:25 -0400 Message-ID: <8518.1252444285@gamaville.dokosmarshall.org> References: <86hbvdb24y.fsf@pmade.com> <20090908204954.GI18897@thinkpad.adamsinfoserv.com> Reply-To: nicholas.dokos@hp.com Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ml80O-0007Ca-Ii for emacs-orgmode@gnu.org; Tue, 08 Sep 2009 17:13:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ml80J-0007CN-0F for emacs-orgmode@gnu.org; Tue, 08 Sep 2009 17:13:35 -0400 Received: from [199.232.76.173] (port=44227 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ml80I-0007CK-RP for emacs-orgmode@gnu.org; Tue, 08 Sep 2009 17:13:30 -0400 Received: from vms173015pub.verizon.net ([206.46.173.15]:58413) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ml80I-0000nU-Fb for emacs-orgmode@gnu.org; Tue, 08 Sep 2009 17:13:30 -0400 Received: from gamaville.dokosmarshall.org ([98.110.172.159]) by vms173015.mailsrvcs.net (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPA id <0KPO00KET872BCHA@vms173015.mailsrvcs.net> for emacs-orgmode@gnu.org; Tue, 08 Sep 2009 16:11:39 -0500 (CDT) In-reply-to: Message from Russell Adams of "Tue, 08 Sep 2009 15:49:54 CDT." <20090908204954.GI18897@thinkpad.adamsinfoserv.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org > On Tue, Sep 08, 2009 at 02:41:17PM -0600, Peter Jones wrote: > > I recently started exporting some org headlines to LaTeX. I poked > > around but couldn't find the best way to customize the output, e.g. add > > a call to hypersetup. The best I came up with was: > > > > > > But by doing that, I would have to update this variable when pulling > > down a new org version that might have changed the default value of > > org-export-latex-classes. > > > > Is there a better way to do stuff like insert a call to hypersetup? > > Russell Adams wrote: > That's where the export header comes in handy. > > In .emacs: > > > ,---- > > | (setq org-export-latex-classes > > | '(("article" > > | "\\documentclass[11pt]{article}" > > | ("\\section{%s}" . "\\section*{%s}") > > | ("\\subsection{%s}" . "\\subsection*{%s}") > > | ("\\subsubsection{%s}" . "\\subsubsection*{%s}") > > | ("\\paragraph{%s}" . "\\paragraph*{%s}") > > | ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))) > > `---- > > At the top of your .org file: > > #+LATEX_HEADER \\usepackage[utf8]{inputenc} > #+LATEX_HEADER \\usepackage[T1]{fontenc} > #+LATEX_HEADER \\usepackage{graphicx} > #+LATEX_HEADER \\usepackage{longtable} > #+LATEX_HEADER \\usepackage{soul} > #+LATEX_HEADER \\usepackage{hyperref} > #+LATEX_HEADER \\hypersetup{ > #+LATEX_HEADER hyperindex=true, > #+LATEX_HEADER plainpages=false, > #+LATEX_HEADER colorlinks=true, > #+LATEX_HEADER linkcolor=black > #+LATEX_HEADER } > Two things: o It needs colons after the LATEX_HEADER and single backslashes: #+LATEX_HEADER: \hypersetup{ etc. o The \usepackage commands are already (mostly) provided by the standard definition of org-export-latex-classes. The longtable \usepackage can be added by an option: #+ATTR_LaTeX: longtable Thanks, Nick