2

I have two issues:

  1. I want to change the numeration in section, now I have:

    enter image description here

    but I would like to have:

    10 Charakteryzacje zmiennej losowej

    1. Definition
    2. Theorem

It means that the first number which indicates the section number is deleted.

  1. Second issue is connected with the numeration too. Now I have that the numeration of all the equations spreads from 1 to ... in the entire document. I want it to start from 1 in each new section.

Edit: Inside my document I have:

 \newtheorem{tw}{Theorem}[section]
 \renewcommand{\theorem}{\arabic{tw}}
 \newtheorem{stw}[tw]{Stwierdzenie}
 \newtheorem{fakt}[tw]{Fakt}
 \newtheorem{lemat}[tw]{Lemat}

 \theoremstyle{definition}
 \newtheorem{df}[tw]{Definicja}
 \newtheorem{ex}[tw]{Przykład}
 \newtheorem{uw}[tw]{Uwaga}
 \newtheorem{at}[tw]{Wniosek}

and it doesn't work in a correct way, below is the class I use:

\documentclass[12pt, a4paper]{article}
\usepackage{marginnote}
\usepackage[top=2.5cm, bottom=3.5cm, outer=2cm, inner=2cm, heightrounded, marginparwidth=2.5cm, marginparsep=2cm]{geometry}
\usepackage[polish]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[pdftex,linkbordercolor={0 0.9 1}]{hyperref}
\usepackage{amsthm,amsmath,amsfonts,amssymb,mathtools}
\usepackage{url}
\usepackage{enumerate}
\usepackage{graphicx}
\usepackage{bbm}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[R]{\textbf{\thepage}}
\fancyhead[L]{\small\sffamily \nouppercase{\leftmark}}
\renewcommand{\headrulewidth}{0.4pt} 
\renewcommand{\footrulewidth}{0.4pt}


\usepackage{chngcntr}

\counterwithin*{equation}{section}


\newtheorem{tw}{Theorem}[section]

\renewcommand{\theorem}{\arabic{tw}}

\newtheorem{stw}[tw]{Stwierdzenie}
\newtheorem{fakt}[tw]{Fakt}
\newtheorem{lemat}[tw]{Lemat}

\theoremstyle{definition}
\newtheorem{df}[tw]{Definicja}
\newtheorem{ex}[tw]{Przykład}
\newtheorem{uw}[tw]{Uwaga}
\newtheorem{at}[tw]{Wniosek}

\begin{document}
\end{document}
Ludovic C.
  • 8,888
MC2DX
  • 2,447
  • For the first question, if you have something like \newtheorem{mytheorem}{Theorem} in your document, add a line \renewcommand{\themytheorem}{\arabic{mytheorem}}. – karlkoeller Aug 10 '13 at 17:51
  • BTW: Welcome to TeX.SX! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – karlkoeller Aug 10 '13 at 17:52
  • Related/duplicate: http://tex.stackexchange.com/questions/28333/continuous-v-per-chapter-section-numbering-of-figures-tables-and-other-docume (also deals with theorems) – lockstep Aug 10 '13 at 17:56
  • For your update you need \renewcommand{\thetheorem} not \renewcommand{\theorem} – Andrew Swann Aug 10 '13 at 18:44
  • Note that this makes for awkward cross-references; you are forced to say ”Theorem 2 in Section 10” (in LaTeX code something like Theorem~\ref{thm:a} in Section~\ref{sec:b}) instead of the simpler “Theorem 10.2”. – egreg Oct 12 '13 at 16:00

1 Answers1

5

For the numbering of equations, there is a user level interface provided by the chngcntr package. Writing

\counterwithin*{equation}{section}

will reset the equation counter at the beginning of each section, without changing its printing format. [The package also has \counterwithin that would given numbering of the form "(section.equation)" which is not what you ask for.]

For the theorem numbering, the suggestion in kalkoeller's comment is the most appropriate.

Here is a minimal document:

Sample output

\documentclass{article}

\usepackage{chngcntr}
\counterwithin*{equation}{section}

\newtheorem{theorem}{Theorem}[section]

\renewcommand{\thetheorem}{\arabic{theorem}}

\begin{document}

\section{First section}

\begin{theorem}
  A theorem.
\end{theorem}

\begin{equation}
  x = ay
\end{equation}

\begin{theorem}
  New theorem.
\end{theorem}

\section{Second section}

\begin{equation}
  t = x^2
\end{equation}

\begin{theorem}
  Last theorem.
\end{theorem}

\begin{equation}
  s = t^3
\end{equation}

\end{document}
Andrew Swann
  • 95,762