从示例中可以看出,红色参考看起来不同(前两个数字和后两个数字之间没有空格)。红色无关紧要。
平均能量损失
\documentclass{article}
\usepackage{enumitem}
\usepackage[bookmarksopen,colorlinks,plainpages=false,urlcolor=blue,hypertexnames=false,unicode]{hyperref}
\def\twodigits#1{
\ifnum#1<10 0\fi
\number#1}
\begin{document}
\section{Section}
\subsection{subsection}
\subsubsection{Nice Subsection} \label{sss:nice-subsection}
\paragraph{Description}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
\paragraph{Some list}
\begin{enumerate}[label={F~--\protect\twodigits{\arabic{subsubsection}}\protect\twodigits{\theenumi}},leftmargin=*]
\item \label{item:2} Item text.
\item \label{item:1} Item text2.
\end{enumerate}
\paragraph{List two}
\begin{enumerate}[label={N~--\protect\twodigits{\arabic{subsubsection}}\protect\twodigits{\theenumi}},leftmargin=*]
\item Item text.
\item Look \ref{item:1} to \ref{item:2}.
\end{enumerate}
\end{document}
生产
答案1
如果您想要一个空格,您应该将其添加到您的标签定义中,而不是依赖于 \twodigits 定义中的虚假空格:
\documentclass{article}
\usepackage{enumitem}
\usepackage[bookmarksopen,colorlinks,plainpages=false,urlcolor=blue,hypertexnames=false,unicode]{hyperref}
\def\twodigits#1{\ifnum#1<10 0\fi \number#1}
\begin{document}
\section{Section}
\subsection{subsection}
\subsubsection{Nice Subsection} \label{sss:nice-subsection}
\paragraph{Description}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
\paragraph{Some list}
\begin{enumerate}[label={F~--~\protect\twodigits{\arabic{subsubsection}}~\protect\twodigits{\theenumi}},leftmargin=*]
\item \label{item:2} Item text.
\item \label{item:1} Item text2.
\end{enumerate}
\paragraph{List two}
\begin{enumerate}[label={N~--~\protect\twodigits{\arabic{subsubsection}}~\protect\twodigits{\theenumi}},leftmargin=*]
\item Item text.
\item Look \ref{item:1} to \ref{item:2}.
\end{enumerate}
\end{document}