当我在 Latex 中引用段落时,我实际上希望它显示“subsubsubsubsection”(不是我选择的格式),而不是引用 MWE 生成的文档中的“段落 1.0.0.1”。我怎样才能替换文档中的“段落”一词?
\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}
答案1
为了\autoref
正常工作,您需要添加
\def\paragraphautorefname{subsubsubsubsection}
或者更好,如果你使用babel
(例如\usepackage[english]{babel}
):
\addto\extrasenglish{%
\def\paragraphautorefname{subsubsubsubsection}%
}
平均能量损失
\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}
这使: