I have a (simple?) question. I use the ams theorem environment for most of my theorems, but I want to box my definitions and find here a nice way to do it, simpler for me than mdframed. My problem is I want the numbering of the theorems to be consistent with each other.

More precisely, here is my preamble about the theorem :

\newboxedtheorem[thcounter=thm,titleboxcolor = white]{defn}{D\'efinition}{thcounter}

Then I tried to change the counter thcounter to thm, or similar, but it didn't work.

Does anybody have any idea of how I can do so that the numbering of my definitions follows the ones of my theorems, lemma...

  • Could you include a MWE. I don't know what packages your working with. – A.Ellett Jan 23 '13 at 3:20

After following your link I notice the following about what you're trying to do.

  • The first optional argument seems to be used for setting and defining tikZ styles for the theorem box.
  • The first argument is not where you define a new counter. You can define a new counter in the 4th argument.

So the arguments seem to be as follows:

  • The first is optional and used for setting tikZ parameters and styles.

  • the second is for assigning the environment name.

  • The third is for setting the name of the environment: i.e., Theorem, Definition, Corollary etc.

  • The 4th argument is for creating a counter specific to the named environment.

So to get something like what you want try:

                 titleboxcolor = black]

                 titleboxcolor = black]

                 titleboxcolor = black]

  \begin{theo}[Title for the theorem]
        \TeX\ is obsure.

  \begin{defn}[Title for the definition]
        \LaTeX\ is fun.

  \begin{coro}[Title for the corollary]
        \LaTeX\ is fun.


enter image description here

I'm not entirely sure what you mean by the numbering of my definitions follows the ones of my theorems,... What I've done above is made the defn environment use the same counter as theo. Is that what you want?

| improve this answer | |
  • Is it possible to do this but give an input flag for black and white boxes for b&w printing? – masfenix Jan 23 '13 at 3:49
  • @masfenix. "input flag"? I'm not sure what you mean. Do you want the color, but if printed to black-and-white a different setting? You can always use a gray-scale instead of colors. And I think using xcolor you can define your own color scheme. Using xcolor and some conditionals you should be able to switch from color to a black-gray-white output. – A.Ellett Jan 23 '13 at 3:52
  • @masfenix. Personally, I find the colors distracting. That's not to say I don't use them, I do. But only when I'm modeling something that my students see it their textbooks. – A.Ellett Jan 23 '13 at 3:55
  • Awesome, thanks a lot for your answer, that's indeed exactly what I wanted. My mistake was to put the name of the counter inside the "options" of the command \newboxedtheorem[thcounter=thm,titleboxcolor = white]{defn}{D\'efinition}{thcounter} – Antoine Jan 23 '13 at 9:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.