General ⇒ \label placement
\label placement
I have seen this a few times:
\begin{theorem\label{mylabel}}
$2+2=4$.
\end{theorem}
and it does work.
Is it OK to do this? I mean, is this behavior official/will be always supported? Looks kinda weird to me to put a label inside of \begin{something}.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
\label placement
Code: Select all
\begin{theorem}\label{thm:label}
% theorem contents
\end{theorem}
Best regards
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10