# [OS X TeX] Does {ntheorem} have a bug related to \newshadedtheorem ?

Michael Welsh yomcat at yomcat.geek.nz
Thu Jan 12 09:13:22 CET 2012

On 12/01/2012, at 4:40 PM, Don Green Dragon wrote:
> Hi Michael,
>
> On 11Jan2012, at 1:49 AM, Michael Welsh wrote:
>
>> Okay, this is weird. There's some interactions going on between pstricks, ato-pst-pdf and ntheorem that don't work right, no matter what I do. However, there is a hack, which works for me:
>
> Well, your hack works here too.

Sweet.

> However, I never would have guessed that your line
>
>> \def\theoremframecommand{\colorbox{yellow}}
>
> would allow for the yellow backgrounds!!! Would you make a few comments about \theoremframecommand or give a reference. From the terminal "texdoc theoremframecommand" gave no results and a CTAN search fared no better!

There's a throwaway line in the ntheorem documentation (page 8) about it. Both Shaded and Framed theorems use it to draw boxes. The default is the pstricks way, which doesn't play nice with pdfs. I just changed it so that pstricks wasn't needed by using the standard (I think) command \colorbox.

>
> Since you dropped the option 'thmmarks' from my code, I pasted it back into yours, and tested. OK, so 'thmmarks' is not the problem. To see if your coding would handle the 'framed' instances, I did the following:
>
> -1- Got rid of your line \theoremclass{Theorem}
>
> -2- Added the following lines so that \newframedtheorem could be tested:
>
> \theoremstyle{change}
> \theorembodyfont{\normalfont\rmfamily}
> \theoremseparator{~~~$\diamondsuit$}
>
> Upon doing so, everything was fine, including references to an instance of \newframedtheorem via both \ref{...} and \thref{...}. So despite, the comments in May & Schedler, it "appears" (???) that no reference to {pstricks} is needed.
That's right. pstricks is only needed if thereomframecommand isn't defined, as you discover below.
>
> However, your line \def\theoremframecommand{\colorbox{yellow}} is crucial if one wants to use the \newshadedtheorem guy. I commented it out and received the error message:
> ============
> ./Untitled.tex:27: Undefined control sequence.
>                                      [fillstyle=solid, fillcolor=gray, line...
>                      [Named] 	% YellowBackTheorem
> ============
>
> So why do you refer to your solution as a 'hack'?
Because it's not as elegant as I would like. It's not really a hack, but I like the word. :)

> The only defect that I suspected is that if I were to require a structure where the background was shaded magenta, then your 'fix' would not work. Not so! I threw in
>
> \def\theoremframecommand{\colorbox{magenta}}
>
> below the defintion of 'thmshaded', created an instance via 'magshade' and checked. Everything worked! Yellow guy, then framed guy, finally magenta guy and all references to any one working.
>
> I've also checked out the use of \def\theoremframecommand{\colorbox{<some colour>}} and getting rid of {pstricks} in a far more complicated document that I've spent a lot of time on, and, so far, it works great!  :-))
>
> Mind you, it is nice to know how to use these gadgets, but, at present, I have no plans for theorem-like structures with yellow, magenta, and lime backgrounds.
Please keep it that way. I have no idea why it's supported. Horrible things. :)

> However, incorporation of {ntheorem} into my regular work has been a great boon.
>
> So, many thanks for the rescue from the {pstricks} black hole and introduction to {ntheorem}.

No problem.

Michael
>
>
> Don Green Dragon
> fergdc at Shaw.ca