I have a dissertation template for students at my University. There is a
main thesis document and then the separate chapters are in subdirectories. (
http://crmda.ku.edu/node/555)

Currently, in version, "KU-thesis-20190201.zip
<http://crmda.dept.ku.edu/guides/43.KU_Thesis/KU-thesis-20190201.zip>", it
appears to work for everybody to use LyX to edit either the main document
or the individual chapters.

However, I have students who want to use the dissertation template as raw
LaTexX files, rather than within LyX.  Here I run into a bad problem.

In my 20190201 version, the people who want to edit the exported LaTeX file
in raw LaTeX could not compile the document.  There's an error about
commands in the chapter heading that are only allowed in the document
preamble.  From that error message, I tracked back to changes I made and I
understand what is going wrong.

If I start with the master document and do Export to LaTeX (pdflatex), the
individual chapter .tex files are created.  They are not free-standing
documents. At the top, there was no preamble. It starts in line 1 with the
chapter name

\chapter{Elementary Regression}

and also the includegraphics lines have full project paths:

\includegraphics[width=4in]{Chapter2/importfigs/carinced}

Those chapters could not be compiled individually.

I thought I'd get around this problem by using LyX to individually
exporting each separate chapter as a tex document. I did not realize that
caused an entirely different export than I got by starting with the master
document in LyX and doing export LaTeX(pdflatex).

My individually exported chapter files allows the users to edit the
individual .tex chapters, but when they try to compile the master document,
they get errors caused by the fact that the individual chapters have their
own preambles AND the graphics paths are incorrect.

Because I individually exported the .tex files within the Chapter
directories, then the master document level Export to LaTeX does not
replace the existing chapters.  Thus I am allowed to zip up the directory
and have a master document that does not compile because the child
documents have preambles in them.

Now that I understand the problem, I wonder if other people have noticed
this and if they have suggestions for a fix?

I wondered if perhaps we might have the necessary preamble created as a
separate file in each chapter with some if/then magic in each chapter
preamble to specify whether or not the master file is in control.

Some fix about the figure paths is necessary as well, I don't have a guess
about that.

pj

-- 
Paul E. Johnson   http://pj.freefaculty.org
Director, Center for Research Methods and Data Analysis http://crmda.ku.edu

To write to me directly, please address me at pauljohn at ku.edu.

Reply via email to