From mboxrd@z Thu Jan 1 00:00:00 1970 From: Charles Millar Subject: first #+LATEX_HEADER: in SETUPFILE not correctly exported and causes Missing \begin{document} error Date: Fri, 25 Mar 2016 20:56:18 -0400 Message-ID: <56F5DE32.1090107@verizon.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajcX7-00048U-Ne for emacs-orgmode@gnu.org; Fri, 25 Mar 2016 20:56:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ajcX4-0006Xy-G8 for emacs-orgmode@gnu.org; Fri, 25 Mar 2016 20:56:53 -0400 Received: from vms173015pub.verizon.net ([206.46.173.15]:33130) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajcX4-0006Vq-BE for emacs-orgmode@gnu.org; Fri, 25 Mar 2016 20:56:50 -0400 Received: from vz-proxy-m004.mx.aol.com ([64.236.83.5]) by vms173015.mailsrvcs.net (Oracle Communications Messaging Server 7.0.5.32.0 64bit (built Jul 16 2014)) with ESMTPA id <0O4M0078WFXVKY10@vms173015.mailsrvcs.net> for emacs-orgmode@gnu.org; Fri, 25 Mar 2016 19:56:20 -0500 (CDT) 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org I have a #+SETUPFILE which starts as follows #+LATEX_HEADER: \usepackage{lastpage} #+LATEX_HEADER: \usepackage{scrpage2} #+LATEX_HEADER: \pagestyle{scrheadings} #+LATEX_HEADER: \setkomafont{pagefoot}{\normalfont\rmfamily} #+LATEX_HEADER: \ifoot{foobar} #+LATEX_HEADER: \cfoot[\pagemark]{\hspace{1.0in} Page \thepage\ of \pageref{LastPage}} #+OPTIONS: H:5 #+LATEX_CLASS: mysetup "mysetup" class is (add-to-list 'org-latex-classes '("mysetup" "\\documentclass[fontsize=11pt,letterpaper,twoside=false]{scrartcl} \\usepackage{verbatim} % \\usepackage[T1]{fontenc} % \\usepackage{charter,parskip,setspace,layout} \\usepackage{charter,setspace,layout} \\usepackage{array,graphicx} \\usepackage{tabularx,tabulary} \\usepackage{longtable} \\usepackage{numprint} \\npstyleenglish \\usepackage[at]{easylist} \\usepackage{csquotes} %\\usepackage[letterpaper,margin=1.00in]{geometry} \\usepackage[letterpaper,left=1.00in,right=1.00in,top=1.00in,bottom=1.00in]{geometry} % \\usepackage[top=1.0in,bottom=0.4in,left=1.2in,nohead]{geometry} %\\pagestyle{empty} \\pagenumbering{arabic} \\newcommand\\foo{bar} [NO-DEFAULT-PACKAGES] [NO-PACKAGES] [EXTRA]" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) I do obtain the expected pdf output except that an extra page is added to the very beginning of the document. Investigating and running the output.tex file in TeXStudio throws an error - Missing \begin{document} (Same result also typeset in TeXWorks is run) Investigating the output.tex shows the following - please note how \usepackage{lastpage} is misaligned % Created 2016-03-25 Fri 20:41 % Intended LaTeX compiler: pdflatex \documentclass[fontsize=11pt,letterpaper,twoside=false]{scrartcl} \usepackage{verbatim} % \usepackage[T1]{fontenc} % \usepackage{charter,parskip,setspace,layout} \usepackage{charter,setspace,layout} \usepackage{array,graphicx} \usepackage{tabularx,tabulary} \usepackage{longtable} \usepackage{numprint} \npstyleenglish \usepackage[at]{easylist} \usepackage{csquotes} %\usepackage[letterpaper,margin=1.00in]{geometry} \usepackage[letterpaper,left=1.00in,right=0.75in,top=1.00in,bottom=1.00in]{geometry} % \usepackage[top=1.0in,bottom=0.4in,left=1.2in,nohead]{geometry} %\pagestyle{empty} \pagenumbering{arabic} \newcommand\foo{bar} \usepackage{lastpage} \usepackage{scrpage2} \pagestyle{scrheadings} \setkomafont{pagefoot}{\normalfont\rmfamily} \ifoot{Sergi, F. Estate} \cfoot[\pagemark]{\hspace{1.0in} Page \thepage\ of \pageref{LastPage}} If I edit the output.tex file in TeXStudio by moving the \usepackage{lastpage} all the way to the left margin both problems are fixed, i.e. when I run build and view in TeXStudio there is no "Missing \begin{document}" error and there is no extra page is created at at the beginning of the document. So, is my SETUPFILE not correct or is there a problem with the exporter in that extra spaces are added to the first line of the SETUPFILE upon export or do I have incompatible packages, etc.? Charlie Millar