I am writing a large text using Latex, where I use chapters, sections, subsections, subsubsections and paragraphs. My problem is that I would like to write, in my text, something like "this is described in the following subsubseciton", but for obvious reasons I am reluctant to use the word "subsection" in the text, so I was wondering if that is the right word to use (I cannot use words as section, subsection, paragraph and chapter because they are already used somewhere else).
[Tex/LaTex] Latex how to call subsubsections in text
best practicescross-referencingsectioning
Related Solutions
Redefine \p@subsection
(the prefix using for the references to subsections):
\documentclass{report}
\renewcommand\thesection{\arabic{chapter}.\arabic{section}}
\renewcommand\thesubsection{\Roman{subsection}}
\makeatletter
\renewcommand\p@subsection{\thesection.}
\makeatother
\begin{document}
\chapter{Chapter}
\section{Section}
\subsection{Subsection}\label{subsection}
\noindent I have the subsections labelled in Roman in the title, because 1.1.I would just be long.
\noindent Here is a reference to the subsection: (\ref{subsection})
\end{document}
By the way, never use the combination \\ + blank line
; this will generate underfull boxes warnings.
Use the first optional argument for \newtheorem
:
\documentclass{book}
\usepackage{amsthm}
\newtheorem{theo}[subsubsection]{Theorem}
\newtheorem{defi}[subsubsection]{Definition}
\setcounter{secnumdepth}{3}
\begin{document}
\chapter{Test Chapter}
\section{Test Section}
\subsection{Test Subsection}
\subsubsection{Test Subsubsection}
\begin{theo}
test.
\end{theo}
\subsubsection{Test Subsubsection}
\begin{theo}
test.
\end{theo}
\begin{defi}
test.
\end{defi}
\subsubsection{Test Subsubsection}
\end{document}
I think this numbering schema can result hard to follow for readers (among other things, what if, for example, there's a theorem or a definition before a subsubsection is created?).
For the bonus point (and to make things even harder for the reader):
\documentclass{book}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{etoolbox}
\numberwithin{equation}{subsection}
\newtheorem{theo}[subsubsection]{Theorem}
\newtheorem{defi}[subsubsection]{Definition}
\setcounter{secnumdepth}{3}
\AtBeginEnvironment{equation}{\setcounter{equation}{\value{subsubsection}}}{}{}{}
\AtEndEnvironment{equation}{\stepcounter{subsubsection}}{}{}{}
\begin{document}
\chapter{Test Chapter}
\section{Test Section}
\subsection{Test Subsection}
\subsubsection{Test Subsubsection}
\begin{theo}
test.
\end{theo}
\subsubsection{Test Subsubsection}
\begin{theo}
test.
\end{theo}
\begin{defi}
test.
\end{defi}
\begin{equation}
a=b.
\end{equation}
\subsubsection{Test Subsubsection}
\begin{equation}
c=d.
\end{equation}
\end{document}
I would rather use a simpler numbering schema:
\documentclass{book}
\usepackage{amsthm}
\usepackage{amsmath}
\newtheorem{theo}{Theorem}[chapter]
\newtheorem{defi}[theo]{Definition}
\newtheorem{prop}[theo]{Proposition}
\setcounter{secnumdepth}{3}
\begin{document}
...
\end{document}
Best Answer
You can use the
cleveref
package and code\cref{<subsubsectionlabel>}
, which will print asSection x.y.z
. The difference between the various sectioning levels is reflected in the numbering.You also can customise the string which will appear as the subsubsection name with
These can go either in your preamble or in a
cleveref.cfg
file.