enter code here
Could you help me please to create a paper which appears in the following way:
The Newton's Law – section
1 Definition – \begin{definition} \end{definition}
2 Theorem – \begin{theorem} \end{theorem}
The conjecture of Poincare – section
1 Definition – \begin{definition} \end{definition}
2 Theorem – \begin{theorem} \end{theorem}
For me it is hard to create different sections which have same numbering, and also to put the number in front of the theorem or of the definition. Thanks!
\documentclass[a4paper,12pt]{article}
\usepackage{amsfonts}
\usepackage{amssymb}
%\usepackage{amsthm}
\usepackage{mathrsfs}
\usepackage{amsmath}
\usepackage[usenames,dvipsnames]{color}
\usepackage{color,graphicx}
\usepackage{algorithmic}
\usepackage{algorithm}
\usepackage{hyperref}
\usepackage{variations}
\usepackage[romanian]{babel}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern,amsthm}
\swapnumbers
\newtheorem{definition}{Definition}
\newtheorem{theorem}[definition]{Theorem}
\let\origsection\section
\renewcommand\section{\setcounter{definition}{0}\origsection}
\newtheorem{lemma}[theorem]{Lem\u a}
\newtheorem{corollary}[theorem]{Corolar}
\newtheorem{proposition}[theorem]{Not\u a}
%\theoremstyle{definition}
\theoremstyle{remark}
\newtheorem{remark}[theorem]{Consecin\c t\u a}
\newtheorem{example}[theorem]{Exemplul}
\newtheorem*{acknowledgements}{Observa\c{t}ie}
Best Answer
One way to achieve your objective would be to (i) make sure that the
definition
andtheorem
environments share the same counter and (ii) redefine the\section
command in a way that resets this counter to 0, regardless of whether the sections are numbered or not. The example below does these things, while using theamsthm
package.