emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* first #+LATEX_HEADER: in SETUPFILE not correctly exported and causes Missing \begin{document} error
@ 2016-03-26  0:56 Charles Millar
  2016-03-26  0:58 ` Charles Millar
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Charles Millar @ 2016-03-26  0:56 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-04-03 18:19 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-26  0:56 first #+LATEX_HEADER: in SETUPFILE not correctly exported and causes Missing \begin{document} error Charles Millar
2016-03-26  0:58 ` Charles Millar
2016-03-26  9:36 ` Eric S Fraga
2016-03-26 11:52   ` Charles Millar
2016-03-26 12:51     ` Eric S Fraga
2016-03-26 14:15       ` Charles Millar
2016-03-26 17:14         ` Eric S Fraga
2016-03-26 22:55           ` Charles Millar
2016-03-28 14:54           ` Charles Millar
2016-03-29 10:50             ` Eric S Fraga
2016-04-02  9:00 ` Nicolas Goaziou
2016-04-03 18:18   ` Charles Millar

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).