2

When I make reference to paragraphs in Latex, I'd actually like it to say "subsubsubsubsection" (not my choice of formatting) instead of referring to "paragraph 1.0.0.1" in the document produced by the MWE. How can I replace the word "paragraph" in my document?

\documentclass{article}
\usepackage{hyperref}
\setcounter{secnumdepth}{4}

\begin{document} \section{Section} \label{sec:section} Section here

\paragraph{paragraph} \label{par:sample_par} This is a reference to \autoref{par:sample_par}.

\end{document}

Lisa
  • 123

1 Answers1

8

To make \autoref work properly you need to add

\def\paragraphautorefname{subsubsubsubsection}

or better, if you use babel(for example \usepackage[english]{babel}) :

\addto\extrasenglish{%
\def\paragraphautorefname{subsubsubsubsection}%
}

MWE

\documentclass{article}
\setcounter{secnumdepth}{4}
\usepackage{hyperref}

\newcommand{\subsubsubsection}{\paragraph} \def\paragraphautorefname{subsubsubsection}

\begin{document} \section{Section} \label{sec:section} Section here

\subsubsubsection{subsubsubsubsection} \label{par:sample_par} This is a reference to \autoref{par:sample_par}.

\end{document}

which gives:

enter image description here

Ivan
  • 4,368