I know it is an easy and quite specific request but I've been on it all day and I cannot really understand what's wrong!
\documentclass[12pt,a4paper]{report}
\usepackage[T1]{fontenc}
\usepackage[italian]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amssymb,amsthm,mathtools}
\usepackage{amsmath, textcomp}
\usepackage{titling}
\theoremstyle{definition}
\newtheorem{Gcal}{Grande Caloria \textit{Cal} o \textit{kcal}}[section]
\theoremstyle{definition}
\newtheorem{Pcal}[Gcal]{Piccola Caloria \textit{cal}}
\theoremstyle{definition}
\newtheorem{CalS}[Pcal]{Calore Specifico}
\begin{document}
\chapter{1}
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
\chapter{2}
\section{2.1}
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
\begin{itemize}
\itemsep0em
\item[] \begin{Gcal}
blah blah blah blah blah blah blah blah blah blah blah blah blah blah
\end{Gcal}
\item[] \begin{Pcal}
blah blah blah blah blah blah blah blah blah blah blah blah blah
\end{Pcal}
\end{itemize}
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
\begin{CalS}
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
\end{CalS}
\end{document}
Errors Report
-
! LaTeX Error: No counter 'Pcal' defined.
See the LaTeX manual or LaTeX Companion for explanation.
Type H for immediate help.
…
l.22 \newtheorem{CalS}[Pcal]{Calore Specifico}
Your command was ignored. -
! LaTeX Error: Environment CalS undefined.
See the LaTeX manual or LaTeX Companion for explanation.
Type H for immediate help.
…
l.45 \begin{CalS}
Your command was ignored.
Type I to replace it with another command,
or to continue without it.
! LaTeX Error: \begin{document} ended by \end{CalS}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H for immediate help.
…
l.47 \end{CalS}
Your command was ignored. -
! LaTeX Error: \begin{document} ended by \end{CalS}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H for immediate help.
…
l.47 \end{CalS}
Your command was ignored.
Can someone explain what did I do wrong? Why only the third enviroment gives problem even if I've copyed/pasted them all?
Best Answer
When you say
you're telling LaTeX that the statement environments
abc
andxyz
must share the counter; so no counterxyz
is defined.You could do
Note that one
\theoremstyle{definition}
declaration suffices.Actually there's a better way.
You have just a generic environment for definitions and give the title at statement time rather than having a different environment for each in the preamble.