3

So, I recently picked up a .tex-template from some website and added some stuff for my own needs. For some reason the counter starts from 2, and I've attempted some counterresets found online without luck.

MWE

\documentclass[paper=a4, fontsize=11pt]{scrartcl}

\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage[english]{babel}
\usepackage{amsmath,amsfonts,amsthm}

\usepackage{lipsum}

\usepackage{sectsty}
\allsectionsfont{\centering \normalfont\scshape}

\usepackage{fancyhdr} % Custom headers and footers
\pagestyle{fancyplain} % Makes all pages in the document conform to the custom headers and footers
\fancyhead{} % No page header - if you want one, create it in the same way as the footers below
\fancyfoot[L]{} % Empty left footer
\fancyfoot[C]{} % Empty center footer
\fancyfoot[R]{\thepage} % Page numbering for right footer
\renewcommand{\headrulewidth}{0pt} % Remove header underlines
\renewcommand{\footrulewidth}{0pt} % Remove footer underlines
\setlength{\headheight}{0pt} % Customize the height of the header


\setlength\parindent{0pt}



\newcommand{\horrule}[1]{\rule{\linewidth}{#1}}
\theoremstyle{plain}
 \newtheorem{theorem}[subsection]{Theorem}
 \newtheorem{conjecture}[subsection]{Conjecture}
 \newtheorem{proposition}[subsection]{Proposition}
 \newtheorem{lemma}[subsection]{Lemma}
 \newtheorem{corollary}[subsection]{Corollary}

\theoremstyle{remark}
 \newtheorem{remarks}[subsection]{Remarks}

\theoremstyle{definition}
 \newtheorem{definition}[subsection]{Definition}
\newtheorem{exercise}{Exercise}
 \newtheorem{remark}{Remark}



\title{
\normalfont \normalsize
\textsc{} \\ [25pt]
\horrule{0.5pt} \\[0.4cm]
\huge Notes for Some Subject \\
\horrule{2pt} \\[0.5cm]
}

\author{Some Guy}

\date{\normalsize Spring 2015}

\begin{document}
\maketitle
Notes for a course in Blabla.
\section{Representations of finite groups}
\subsection{Blah}
% This becomes definition 1.2
\begin{definition} A {\it group}
\end{definition}
\end{document}
3
  • 1
    That is because the template asks the theorems to reuse the subsection counter for numbering the theorems, and not a general counter for theorems.
    – daleif
    Jan 12, 2015 at 12:19
  • 1
    Please always give minimal examples! I needed to install several packages just in order to help here. If you had reduced you code, you would have found the culprit line in a glance. (just as advice for the future)
    – LaRiFaRi
    Jan 12, 2015 at 12:22
  • 1
    I will keep that in mind @LaRiFaRi, thank you. Jan 12, 2015 at 12:27

1 Answer 1

8

You have to write

\newtheorem{definition}{Definition}[subsection]

and not

\newtheorem{definition}[subsection]{Definition}

In your declaration you are letting the definition environment share the same counter as \subsection.

Instead, in the correct way, you are letting the definition counter count within the counter subsection.

As a side note, never use \it in a LaTeX document, but \textit or \itshape. See for example "Correct" way to bold/italicize text? for reference.

2
  • 1
    not explicit here, but after you redefine definition, if you want all your theorem-class objects to share the same counter, you should now redefine them to use the definition counter, not subsection. for example, \newtheorem{theorem}[definition]{Theorem}. however, since theorem comes first, if all these objects are to share the same counter, it would be better to use theorem as the "master". Jan 12, 2015 at 13:14
  • Yes, I took note of that and fixed it accordingly. Thanks. Jan 12, 2015 at 16:05

You must log in to answer this question.

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