On Friday 12 October 2007 19:09:27 Gunnar Lindholm wrote:

> > What do other people use for exercises? And will this ever be built into
> > LyX? I have to use ERT to get exercise.sty working.
>
> I use
> \usepackage{answers}

Thanks Gunnar - the answers package fixes the spacing problem, so I've 
switched my document to use it. 

> To get it working more easy, I put the stuff below into my lyx
> configuration files. With this I can just press M-g u  to insert an
> exercise, and then M-g a to insert ERT (two greyblocks) so I can write the
> answer between the grey blocks.

Have had some problems with your preamble:

> \Newassociation{sol}{Svar}{ans}
> {\theorembodyfont{\upshape} \newtheorem{uppg}{Uppgift}}
> \newenvironment{ug}{\begin{uppg}\normalfont}{\end{uppg}}

Which gave an "Undefined control sequence." error:

    {\theorembodyfont
                         {\upshape} \newtheorem{uppg}{Uppgift}}
   The control sequence at the end of the top line
   of your error message was never \def'ed. If you have
   misspelled it (e.g., `\hobx'), type `I' and the correct
   spelling (e.g., `I\hbox'). Otherwise just continue,
   and I'll forget about whatever was undefined.

This example from the answers package documentation works:

   \Newassociation{sol}{Solution}{ans}
   \newtheorem{ex}{Exercise}

Also can't get the bind file to be recognized by lyx. I created a 
myShortcuts.bind file in ~/.lyx/bind with the text you gave. And I put the 
layouts text in ~/.lyx/layout/myLayout.layout. But LyX didn't seem to pick 
them up automatically. Tried Tools -> Reconfigure and restarted LyX but that 
made no difference either.

Reply via email to