hi

there's a latex package called examdesign which works quite well does
exactally what you need. But I don't know any implementation fot
lyx. Actually I use it in pure latex.  

[]s
lima-lopes
--------------------
R.E. de Lima-Lopes
[EMAIL PROTECTED]
GNU/Linux Registered User # 182240

On Mon, 21 May 2001, Dekel Tsur wrote:

> Date: Mon, 21 May 2001 22:38:51 +0300
> From: Dekel Tsur <[EMAIL PROTECTED]>
> To: Julien Puydt <[EMAIL PROTECTED]>,
>      LyX users <[EMAIL PROTECTED]>
> Subject: Re: Splitting exercices' questions and solutions
> 
> On Mon, May 21, 2001 at 02:03:35PM +0200, Julien Puydt wrote:
> > Bonjour,
> > 
> > I think you may be able to help me on this: I would like to type an
> > exercise with its solution in my text, and have the dvi display something
> > like "Exercise 172.91: <the question(s)>" at the right place, and in a
> > last section of the chapter, "Solution of 172.91: <the solution(s)>".
> > 
> > It would involve being able to store the solutions (with the numbers of
> > the exercises they correspond to) until the end of the chapter, and then
> > dump everything in an automatically-added section, but since I'm no latex
> > guru and just a lyx beginner, I'm quite unable to do it...
> 
> I'm assuming you already use an "exercise" paragraph style that gives you the
> numbering of your exercises.
> Suppose that your exercise counter is called xca (as in the amsbook class).
> Put the following in the preamble:
> 
> \usepackage{ifthen}
> \newcommand{\store}[2]{\expandafter\def\csname sol#1\endcsname{#2}}
> \newcommand{\showstored}[1]{\csname sol#1\endcsname}
> \newcounter{tmp}
> \newcommand{\showall}{\setcounter{tmp}{1}%
>   \whiledo{\not\(\value{tmp}>\value{xca}\)}{%
>     \noindent\textbf{Solution of exercise \thechapter.\arabic{tmp}:}%
>     \showstored{\arabic{tmp}}\par%
>     \addtocounter{tmp}{1}}}
> \newcommand{\solution}[1]{\store{\arabic{xca}}{#1}}
> 
> Then, put the solution for an exercise inside a \solution{} command,
> namely \solution{<the solution...>}.
> 
> Furthermore, put \showall at the end of the chapter.
> 

Reply via email to