From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: how putting \begin{document} at the right place to export a specific latex class ? Date: Mon, 11 Jun 2018 15:17:15 -0400 Message-ID: <874li9m8uc.fsf@alphaville.usersys.redhat.com> References: <87muw1a40g.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSSJl-0003el-RS for emacs-orgmode@gnu.org; Mon, 11 Jun 2018 15:17:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSSJg-0001z9-To for emacs-orgmode@gnu.org; Mon, 11 Jun 2018 15:17:29 -0400 Received: from [195.159.176.226] (port=39104 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fSSJg-0001yc-MK for emacs-orgmode@gnu.org; Mon, 11 Jun 2018 15:17:24 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fSSHX-0005IZ-5m for emacs-orgmode@gnu.org; Mon, 11 Jun 2018 21:15:11 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Joseph Vidal-Rosset writes: > Here is my problem: for a specific latex class (xxllp.cls), I have > difficulties to get the \begin{document} at the right place in this > add-to-list: > > (add-to-list 'org-latex-classes > '("xxllp" > "\\documentclass\[oumk,xs]\{xxllp\} > [NO-DEFAULT-PACKAGES] > [NO-PACKAGES] > \\usepackage{amsmath} > \\usepackage{amssymb} > \\usepackage{blabla} > \\usepackage{blablabla} > \\pagestyle{myheadings}\\markboth{Author}{Title of the paper} > \\LaLPonline{??} \\setcounter{page}{1} \\thispagestyle{LLPrrobezissn} \\label{p} > \\AuthorTitle{Joseph Vidal-Rosset}{\\uppercase{Title of the paper}}" > ("\\section\{%s\} . \\section*\{%s\}") > ("\\subsection\{%s\} . \\subsection*\{%s\}") > )) > > > For this class, the \begin{document} should be just after > \\pagestyle{myheadings}\\markboth{Author}{Title of the paper} > and just before > \\LaLPonline{??} \\setcounter{page}{1} \\thispagestyle{LLPrrobezissn} > \\label{p} > I don't think you can do that with org-latex-classes: you can define the header part (i.e. some of what goes before the \begin{document}_ and you can define how to map headers at different depths to the latex sectioning structure, but you cannot do precise placement the way that you are trying to. There may be a better way now, but in the old days I used to redefine the org-latex-title-command variable. It gets emitted after the \begin{document} so you can do something like this (setq org-latex-title-command "\\foo\\maketitle") to insert additional stuff. -- Nick "There are only two hard problems in computer science: cache invalidation, naming things, and off-by-one errors." -Martin Fowler