[OS X TeX] need help modifying an "exercise" environment

Art Werschulz agw at comcast.net
Fri Jun 15 11:30:48 EDT 2012


Awhile back, several people on this group helped me with an "exercise" environment for a book I'm co-writing.  The main thing is that the exercise number should be outdented, e.g., 

   1.1  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent 
        venenatis mattis dignissim. Vivamus euismod lacinia dictum. Nulla 
        (a) Vestibulum ante ipsum primis in faucibus orci luctus et ultrices 
            posuere cubilia Curae.
        (b) Praesent dignissim rutrum leo, quis ornare diam hendrerit non. 

It's used as follows:

    Blah blah blah.
         Blah blah blah.

    Blah blah blah.
      \item Blah.
      \item Blah.

        \item Blah.
        \item Blah.

Here's the definition of said environment:

\newenvironment{ex at problist}{\begin{enumerate}}{\end{enumerate}} % private            
\newdimen\probindent  \probindent=20pt
\newcommand\itembox[1]{\noindent\llap{\hbox to 1.2\probindent{#1\hss}}}
  \let\problist\ex at problist                                                           
  \let\endproblist\endex at problist                                                     
  \par\itembox{\textbf{\theex.}}\nobreak \hspace{1sp}\ignorespaces}%                  

It works fine, as is.  However, we now want to change exercise numbering to include the section number, since 
	1.6 Exercises

	1.1 Prove that blah blah blah
looks a little weird.  No problem: simply change \theex to 

Our problem: Exercise numbers overlap the exercise text.  I was able to fix this by changing the definition of \itembox to be
	\newcommand\itembox[1]{\noindent\llap{\hbox to 1.6\probindent{#1\hss}}}
But the exercise number now juts out too far to the left, into the margin.

I've tried playing around with the various parameters, but to no avail.  One thing I discovered was that changing the parameter in \hskip{1sp} did nothing whatsoever.  Maybe I simply haven't found the right combination of parameters; maybe there's something else I should be doing.

Do any of you see how to handle this problem?  

Many thanks!!

Art Werschulz (8-{)}   "Metaphors be with you."  -- bumper sticker
GCS/M (GAT): d? -p+ c++ l u+(-) e--- m* s n+ h f g+ w+ t++ r- y?
Internet: agw STRUDEL comcast.net

More information about the MacOSX-TeX mailing list