On 09/03/2011 4:31 AM, Mark Dickinson wrote:
Hi,

Not sure if you can help.  I'm a complete LaTeX novice, but need to produce 
some exam scripts using a .sty produced by our hardcore LaTeX users (as usual 
there are two camps - the LaTeX users and the MS Word users!).  I don't have 
tome to learn command line stuff hence I thought I'd try LyX.  I'm on a Mac OS 
10x and have installed MacTex and Lyx.  Seems to all work fine except when I 
try to use the attached .tex and.sty files (these are an example exam script 
for our undergraduates).  I get errors (suggesting the /question def needs a 
number and that there are missing { and }.  Needless to say these files work 
perfectly in LaTeX.  Is this a bug in LyX or some other incompatibility?

Any help gratefully received,

Ma

Hi there,

You will need either a .layout or a .module file (in your case most likely a .module file). Such files are used to customize LyX so that it will interface with custom LaTeX document class and/or packages. A description of the syntax for such files is in the customization manual that you find in LyX's help menu.

In your case, LyX doesn't know what to do with non-standard LaTeX macros---as in \question---and environments---as in this:
\begin{exam}
...
\end{exam}.
So you want to describe those in your .module file.

Besides that, in your .tex file you will want to put all the \def... lines after these two lines:
\begin{document}
\maketitle

This last point is necessary due to the way in which the .tex to .lyx converter operates. I suppose it is not general enough, and you could consider this a bug, but the workaround is simple.

--
Julien

Reply via email to