0

I have the following lines:

\documentclass[a4paper, 12pt, twoside]{thesis}

\usepackage{verbatim} 
\usepackage{amssymb,amsmath}
\usepackage{amsthm,amsfonts,amscd,amsrefs}
\newtheoremstyle{component}{}{}{}{}{\itshape}{.}{.5em}{\thmnote{#3}#1}
    \theoremstyle{component}
    \newtheorem*{component}{}

\begin{document}
\chapter{New Chapter}

\begin{definition}
This is a definition.
\end{definition}

\begin{theorem}
This is a theorem.
\end{theorem}

\begin{example}
This is an example.
\end{example}

\end{document}
  1. What exactly does \theoremstyle{component}{} do?
  2. How do I make it so that example's counter follow from theorems/definitions/lemma and only refresh at new section?
5
  • 1
    Welcome to TeX.SX! Please add a minimal working example (MWE) that illustrates your problem, starting with \documentclass{...} and ending with \end{document}.
    – Pier Paolo
    Commented Mar 18, 2015 at 21:57
  • 1
    if you have \newtheorem{definition}{Definition}[...] replace it by \newtheorem{definition}[theorem]{Definition}
    – touhami
    Commented Mar 18, 2015 at 22:17
  • @touhami those I quoted above are the only \newtheorem{} lines I can find in the preamble (?) of the document. If I add in your comment will it cause any major problems for me?
    – jh4
    Commented Mar 18, 2015 at 22:52
  • Could you post any \newtheorem{} lines that might be inside thesis.cls?
    – summer
    Commented Mar 19, 2015 at 1:22
  • Btw, the \newtheoremstyle{component} is defining a new style for theorem-like environments (one in which the header is in italics, followed by a point, and is not numbered, among other characteristics); \theoremstyle{component} ensures that any new theorem defined below follows that style. So if you write below it \newtheorem{ntheo}{My thing}, then you can use in your document \begin{ntheo} Blah blah \end{ntheo} and it will display "My thing. Blah blah" (with "My thing" in italics following the "component" style)
    – summer
    Commented Mar 19, 2015 at 1:29

1 Answer 1

2

add to your preamble

\let\theexample\thetheorem
\let\oldexample\example\let\eoldexample\endexample
\renewenvironment{example}{%
\refstepcounter{theorem}\oldexample}{\eoldexample}
1
  • Note that this solution will fail if "theorem" is following another counter, namely if it is defined through e.g. \newtheorem{theorem}[definition]{Theorem}. Thus it might be necessary to replace the two instances of "theorem" in the above solution by "definition" or "lemma" or whichever is the main counter.
    – summer
    Commented Mar 19, 2015 at 12:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .