[OS X TeX] Tried comment environment in Memoir

Ross Moore ross at ics.mq.edu.au
Mon Apr 6 18:06:27 EDT 2009


Hi Alain,

On 07/04/2009, at 5:11 AM, Alain Schremmer wrote:

>>
>> \newenvironment{genericout}[1]{%
>>   \@bsphack
>>   \ifodd\theexercise
>>     \addtostream{#1}{\protect\begin{oddexercise}{\theexercise}}%
>>   \else
>>     \addtostream{#1}{\protect\begin{evenexercise}{\theexercise}}%
>>   \fi
>>   \def\genericoutfile{#1}%
>>   \writeverbatim{#1}%
% <-------- here
>> }{%
>>
>>   \endwriteverbatim
>>   \ifodd\theexercise
>>     \addtostream{\genericoutfile}{\protect\end{oddexercise}}%
>>   \else
>>     \addtostream{\genericoutfile}{\protect\end{evenexercise}}%
>>   \fi
>>   \@esphack
% <-------- here
% <-------- here
>> }
>>
>> \newenvironment{backanswer}{%
>>   \genericout{backansout}%
% <-------- here
% <-------- here
>> }{%
>>   \endgenericout
>> }%
>>
>> \newenvironment{solution}{%
>>   \genericout{solutionsout}%
% <-------- here
% <-------- here
>> }{%
>>   \endgenericout
>> }%
>>
>> \newenvironment{oddexercise}[1]{\par\noindent\textbf{#1.}}{}
>> \newenvironment{evenexercise}[1]{\par\noindent\textbf{#1.}}{}
>> %\includecomment{oddexercise}
>> \excludecomment{evenexercise}
>>

> Out of sheer curiosity, I tried the above but  got the error
>
> LaTeX Font Warning: Font shape `OT1/cmss/m/it' in size <12> not  
> available
> (Font)              Font shape `OT1/cmss/m/sl' tried instead on  
> input line 72.
>
> 	Runaway argument?
> 	! Paragraph ended before \verbatim at start was complete.
> 	<to be read again>
> 	                   \par
> 	l.90 \begin{backanswer}

Just get rid of those blank lines in the \newenvironment
definitions, as indicated above.

It should work fine with those removed.

>
> Of course, I don't even know if memoir is anywhere in Mac's guts so  
> I tried book instead and got the error

You would have seen other errors if it wasn't ...

>
> 	Excluding comment 'comment')


  ... such as these!

> 	! Undefined control sequence.
> 	<recently read> \chapterstyle
>
> 	l.5 \chapterstyle
> 	                 {bianchi}
> 	?
>
> That looked plausible so I commented out
> 	\chapterstyle{bianchi}
>
> which gave me this time
>
> 	Excluding comment 'comment')
> 	! Undefined control sequence.
> 	l.7 \newoutputstream
>                     {backansout}
> 	?
>
> But now I have no idea even what to try.

The error message says it all:

> 	! Paragraph ended before \verbatim at start was complete.
> 	<to be read again>

Paragraphs are typically ended by blank lines.
Having blank lines in command or environment definitions
is a real no-no --- unless you have taken special steps
to handle that possibility.

The verbatim at ...  stuff is being requested in these new
environments. So it's easy to see where the problem lies.


BTW, thanks to Ulrich for providing that last missing bit,
so that the LaTeX source remains neat and obviously balanced.

Also, David, you load  \usepackage{amsmath}
so within the solutions why not use \tfrac12  \tfrac24 etc.,
whenever you have fractions with small numerators and denominators?
This gives a significant improvement, IMHO, to the visual appeal
of solutions and working of the kind that you are doing here.



>
> Merely curious regards
> --schremmer


Hope this helps,

	Ross

------------------------------------------------------------------------
Ross Moore                                       ross at maths.mq.edu.au
Mathematics Department                           office: E7A-419
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------






More information about the MacOSX-TeX mailing list