Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Originally, I have these types of numbering:

\newtheorem{theorem}{Theorem}[section]
\newtheorem{definition}[theorem]{Definition}
\newtheorem{lemma}[theorem]{Lemma} 
\newtheorem{proposition}[theorem]{Proposition} 
\newtheorem{corollary}[theorem]{Corollary} 
\newtheorem{example}[theorem]{Example}

\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\thesection}{\arabic{section}}

Now because of the box theorem function, I modified them to below:

\newboxedtheorem[boxcolor=orange, background=blue!5, titlebackground=blue!20,titleboxcolor = black]{theorem}{Theorem}{mycounter}
\newboxedtheorem[boxcolor=orange, background=blue!5, titlebackground=blue!20,titleboxcolor = black]{definition}{theorem}{mycounter}
\newboxedtheorem[boxcolor=orange, background=blue!5, titlebackground=blue!20,titleboxcolor = black]{lemma}{theorem}{mycounter}
\newboxedtheorem[boxcolor=orange, background=blue!5, titlebackground=blue!20,titleboxcolor = black]{proposition}{theorem}{mycounter}
\newboxedtheorem[boxcolor=orange, background=blue!5, titlebackground=blue!20,titleboxcolor = black]{corollary}{theorem}{mycounter}
\newboxedtheorem[boxcolor=orange, background=blue!5, titlebackground=blue!20,titleboxcolor = black]{example}{theorem}{mycounter}

\renewcommand{\themycounter}{\arabic{section}.\arabic{mycounter}}

\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\thesection}{\arabic{section}}

My numbering system is now messed up.

For example: Hope I am right in explaining like this: Originally, before I add in the function that will "box theorem" I have the following numbering system: Chapter I, Section 1, Theorem 1 will be identified as Theorem 1.1. If you use eqnarray then it will be listed as I.1.1. For subsection, there is no effect, the theorem number will just move on like Theorem 1.2, Theorem 1.3 and so forth but once I have new section, the cycle will restart, in other words Theorem 2.1, Theorem 2.2, etc and when using eqnarray, I will have I.2.1, I.2.2
Now in the second chapter, the theorem will be II.1.1 for Chapter 2, Section 1, Theorem 1, and so forth.

But now after I add in the "box theorem" function, my numbering messed up in other words the theorem just move on like. 1.1, 1.2, 1.3 then 2.4, 2.5, 2.6 rather than 2.1, 2.2, 2.3.

ORIGINAL HEADER

\documentclass[11pt,a4paper,twoside]{report}
\usepackage{t1enc,mathrsfs,latexsym,amsmath,amsxtra,amsthm,amssymb,makeidx,graphics}
\usepackage[latin1]{inputenc}
\usepackage[english]{babel}
%\usepackage{arabtex}
%\pagestyle{plain}
\usepackage{graphicx}
\usepackage{color, fontenc, titlesec,amsfonts}

MODIFIED HEADER

\documentclass[11pt,a4paper,twoside]{report}
\usepackage{t1enc,mathrsfs,latexsym,amsmath,amsxtra,amsthm,amssymb,makeidx,graphics}
\usepackage[latin1]{inputenc}
\usepackage[english]{babel}
%\usepackage{arabtex}
%\pagestyle{plain}
\usepackage{graphicx}
\usepackage{color, fontenc, titlesec,amsfonts,boiboites}
share|improve this question
1  
Welcome to TeX.SX! Can you turn those code snippets into a minimal example? –  egreg Apr 16 '12 at 13:49
    
Hi egreg, I am sorry, I am very new to this forum and I don't know how to put into example other than to describe it as above. –  Sandra Apr 16 '12 at 13:51
3  
@sandra: A "minimal example" would be a LaTeX file that actually generates the problems or issues you're encountering. The code snippets you've posted, by themselves, aren't really sufficient to generate the problem behavior. A "minimal example", then, would include a \documentclass command, the loading of all relevant packages and the set-ups of all macros you're using for the case at hand (including a definition of the counter "mycouner"), plus a \begin{document} [some commands that generate the problems] \end{document}. –  Mico Apr 16 '12 at 13:54
1  
What's the package that provides \newboxedtheorem? –  egreg Apr 16 '12 at 14:04
2  
Have you tried putting \numberwithin{mycounter}{section} instead of \renewcommand{\themycounter}{\arabic{section}.\arabic{mycounter}? You have to load package amsmath or mathtools to make it work. –  yo' Apr 16 '12 at 14:05

3 Answers 3

up vote 3 down vote accepted

A shot in the dark

I asked Google about the comment \newboxedtheorem and found the following page:

Nice boxes for your theorems with LaTeX using tikz

There the unsupported package boiboites can be found. The code is very transparent and you can see that the command \newboxedtheorem doesn't support the manipulation of counters like \netheorem. You can set only one counter. The default usage is:

\newboxedtheorem{defi}{Definition}{thCounter}

So your code fails

\newboxedtheorem[]{example}{theorem}{mycounter}

because you have to many arguments.

To allow the possibility of \newtheorem you have to change the code of boiboites.sty.


As discussed in the chat the package has no license information and must be classified as non-free. So you can download the code and use but I don't know whether we can manipulate this code here.

share|improve this answer
    
Hi Marco, I am a newbie in tex, so I don't know how to change the code. Can we edit style file? –  Sandra Apr 16 '12 at 14:13
    
@sandra: Please see my edit (last lines). You can have a look at the package tcolorbox. –  Marco Daniel Apr 16 '12 at 14:22
    
Oh I see. Thanks. Sorry for not knowing this in advance and glad you let me know about this. –  Sandra Apr 16 '12 at 14:25

You should put

\numberwithin{mycounter}{section}

instead of

\renewcommand{\themycounter}{\arabic{section}.\arabic{mycounter}

You have to load package amsmath or mathtools to make it work.

share|improve this answer

If you want the numbering of your theorems to go back to zero whenever you enter a new section in your document, you should use this option in the \newboxedtheorem macro:

thcounter=section

Just add it along with the color options. Then, you can do:

\renewcommand{\themycounter}{\arabic{section}.\arabic{mycounter}}

share|improve this answer
    
Welcome to TeX.SX! You don't have to sign with your name since it automatically appears in the lower right corner of your post. –  Adam Liter Mar 8 at 21:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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