In the example below you can see that both environments get the same caption.

How to prevent this? You will get the same result if you use an other package like amsthm, theorem or thmtools.





enter image description here


Of course: the second \def overrides the meaning of the first one: \tempA is expanded only when \begin{game} and \begin{example} are used, not when defined. At that time, \tempA expands to Example.


will do, but it's rather cumbersome

| improve this answer | |
  • +1 -- Works well. Maybe somebody knows a solution which isn't cumbersome ;-) – Marco Daniel Sep 6 '11 at 13:31
  • 2
    Please, be more specific about your problem; in the shown form it's quite easy: write Game and Example instead of \tempA in the definitions. – egreg Sep 6 '11 at 13:43
  • Yes that is true ;-) -- The problem base on this question: Own command to create new environment. I used this answer for my package but this simple question demonstrate my bug. – Marco Daniel Sep 6 '11 at 13:47
  • I've added another answer to that question – egreg Sep 6 '11 at 14:14

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.