I am writing lecture notes in different files. So I want the theorems in the Lecture 1 file like

Theorem 1.1

Theorem 1.2


And, theorems in Lecture 2 file like

Theorem 2.1

Theorem 2.2


Thank you in advance for the help.

  • Welcome to TeX.SE.
    – Mico
    Dec 30, 2022 at 21:54

1 Answer 1


I will assume that you're using a package such as amsthm or ntheorem and use commands such as \newtheorem to create theorem-like environments. If this is the case, I suggest you create a LaTeX counter called, say, lecturenum, set this counter to the appropriate number (e.g., 3), and then use \newtheorem directives to create theorem-like environments that use the value of lecturenum as a prefix to the theorem numbers.

That way, the only setup instruction that has to be adjusted across the preambles of the lecture_n.tex files is the instruction

\setcounter{lecturenum}{n} % this is lecture "n" (e.g, 3)

enter image description here

\documentclass{article} % or some other suitable document class

\setcounter{lecturenum}{5} % this is lecture 5

\usepackage{amsthm} % or 'ntheorem'


\begin{theorem} bla bla bla \end{theorem}
\begin{theorem} ble ble ble \end{theorem}

  • Thank you! This is exactly what I need.
    – Heterodim
    Dec 30, 2022 at 23:26

You must log in to answer this question.

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