2

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.

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

1 Answer 1

3

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

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

\usepackage{amsthm} % or 'ntheorem'
\newtheorem{theorem}{Theorem}[lecturenum]

\begin{document}

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

\end{document}
1
  • 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 .