Theses, Books, Title pagesMissing items in theorem styles

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
Post Reply
templateuser
Posts: 679
Joined: Tue Mar 03, 2015 4:01 pm

Missing items in theorem styles

Post by templateuser »

In structure.tex, there is a Theorem Styles block.
In this there are a lot of useful things, theorems, proposition, exercise, etc.
What is suprising, there is no Proof, Solution.
I'm beginner in latex, so I would be very grateful if someone could give me some details.

vesszabo

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Vel
Site Moderator
Posts: 463
Joined: Fri Jun 29, 2012 1:20 am

Missing items in theorem styles

Post by Vel »

Hi,

While the template doesn't have an example of a proof, you can add one in the same way as any of the other elements you listed with the following lines:

Code: Select all

\begin{proof}
$x + 1 = y$
\end{proof}
In order to create a new environment such as for a Solution, go into structure.tex and add \newtheorem{solution}{Solution}[chapter] on line 144 (after \theoremstyle{ocrenum}). Once again, you can then use it in the document with \begin{solution}\end{solution}. You can do the same for any other element you might wish to add!

Cheers,
Vel
Founder and administrator of LaTeXTemplates.com and LaTeXTypesetting.com
templateuser
Posts: 679
Joined: Tue Mar 03, 2015 4:01 pm

Missing items in theorem styles

Post by templateuser »

Hi,
Thanks, everything is ok.
There is one more question (hopefully the last one, if not, sorry for me), a little bit more difficult.
I want to obtain 2.1.1 Theorem, 2.1.2 Corollary, etc., where 2.1 is the section number, and in a new section starting from the beginning. So the counting would be linearly increasing (in a given section) and the number first then the word. If I'm right, then we should modify in structure.tex line 128 \thmnumber somehow,

Code: Select all

{\small\sffamily{\tiny\ensuremath{\blacksquare}}\ \thmname{#1}\thmnumber{\@ifnotempty{#1}{ }\@upn{#2}} % Theorem text (e.g. Theorem 2.1)
and, similarly, in line 139,

Code: Select all

{\small\sffamily\thmname{#1}\thmnumber{\@ifnotempty{#1}{ }\@upn{#2}} % Theorem text (e.g. Theorem 2.1)
Besides of these, we should modify \newtheorem{problem}{Problem}[chapter] also.
I tried with section instead of chapter, but it is not good, and the number appears first not the word Problem.

Cheers,
Sandor
templateuser
Posts: 679
Joined: Tue Mar 03, 2015 4:01 pm

Missing items in theorem styles

Post by templateuser »

To have a section-based numbering for the theorem, corollary, proposition, definition, all with the same counter, in structure.tex, create a dummy counter within section and use it as the counter of the targeted environments, ie something like below for instance

Code: Select all

% Defines the theorem text style for each type of theorem to one of the three styles above
\theoremstyle{ocrenum}
\newcounter{dummy} 
\numberwithin{dummy}{section}
\newtheorem{theoremeT}[dummy]{Theorem}
\newtheorem{proposition}[dummy]{Proposition}
\newtheorem{problem}[dummy]{Problem}
\newtheorem{exerciseT}[dummy]{Exercise}
\theoremstyle{blacknumex}
\newtheorem{exampleT}[dummy]{Example}
\theoremstyle{blacknum}
\newtheorem{vocabulary}[dummy]{Vocabulary}
\newtheorem{definitionT}[dummy]{Definition}
\newtheorem{corollaryT}[dummy]{Corollary}
you can create as many counters as you wish.

To have the number before the word, replace

Code: Select all

\small\sffamily{\tiny\ensuremath{\blacksquare}}\ \thmname{#1}\thmnumber{\@ifnotempty{#1}{ }\@upn{#2}}
by

Code: Select all

\small\sffamily\color{ocre}\thmnumber{\@ifnotempty{#1}{}\@upn{#2}}\nobreakspace\thmname{#1} 
where needed. This should work.

Mathias
Post Reply