On 03/26/2016 01:14 PM, Eric S Fraga wrote: > On Saturday, 26 Mar 2016 at 10:15, Charles Millar wrote: > > [...] > >> I was not clear - I ran the exports after I made the correction to >> "mysetup", i.e. \newcommand{\\foo}{bar} > but I am confused: why the \\ for foo but \ for newcommand? My typo. Just in case I attach a copy of the "mysetup class" which I believe is now correct and which i have been using since your original response where you pointed out that \\newcommand, etc. was incorrect . I have used this as the latex class for all subsequent messages in this thread. > What is the > actual result in the output.tex file? See attached TestLatexformessage.tex >> I do agree that the one file that exports as desired must be a result >> of luck. I compared the output.tex file for each document. In each the >> first \usepackage{foo} which is inserted from the SETUPFILE is >> indented several tabs or spaces to the right and not aligned to the >> left margin. > The indentation or not itself is not the issue but only a symptom of an > error before that line, in my opinion. I place the cursor just before \usepackage{lastpage} and backspace once, the file builds without the extra page, etc. Is there a proper location for the #+SETUPFILE: line in the main org file? Charlie