ネストされたリストを参照する場合、項目とサブ項目のラベルの間にドットを配置するにはどうすればよいでしょうか。

ネストされたリストを参照する場合、項目とサブ項目のラベルの間にドットを配置するにはどうすればよいでしょうか。

最初の項目への参照としてAiではなくAiを使用したい

\documentclass[twoside]{book}
\usepackage{enumerate}

\begin{document}  
\begin{enumerate}[A.]
  \item\label{FirstItem} First Item
  \begin{enumerate}[i.]
    \item\label{FirstSub} First Subitem
  \end{enumerate}
\end{enumerate}%[A.]
To reference the First Item,  \ref{FirstItem} and the first subitem, \ref{FirstSub}.
\end{document}

答え1

申し訳ありませんが、以前の回答は BS でした。これは有効です:

追加するだけ\makeatletter\renewcommand{\p@enumii}{\theenumi.}\makeatother

\documentclass[twoside]{book}
\usepackage{enumerate}
\makeatletter\renewcommand{\p@enumii}{\theenumi.}\makeatother
\begin{document}  
\begin{enumerate}[A.]
\item\label{FirstItem}
First Item
\begin{enumerate}[i.]
\item\label{FirstSub}
First Subitem
\end{enumerate}
\end{enumerate}%[A.]
To reference the First Item,  \ref{FirstItem} and the first subitem, \ref{FirstSub}.
\end{document}

ここに画像の説明を入力してください


古い回答:

追加するだけ\renewcommand{\labelenumii}{\theenumi.\theenumii}

\documentclass[twoside]{book}
\usepackage{enumerate}
\renewcommand{\labelenumii}{\theenumi.\theenumii}
\begin{document}  
\begin{enumerate}[A.]
\item\label{FirstItem}
First Item
\begin{enumerate}[i.]
\item\label{FirstSub}
First Subitem
\end{enumerate}
\end{enumerate}%[A.]
To reference the First Item,  \ref{FirstItem} and the first subitem, \ref{FirstSub}.
\bigskip
I want to have A.i instead of Ai.   I could put the dot myself if I could make the reference to the subitem just print i, which I also can't figure out.
\end{document}

答え2

enumitemの代わりに、次のキーを使用enumerateできますref:

\documentclass[twoside]{book}

\usepackage{enumitem}

\begin{document}  



\begin{enumerate}[label=\Alph*.]
\item\label{FirstItem}
First Item

\begin{enumerate}[label=\roman*.,ref=\theenumi\roman*]% \theenumi is the first level counter
\item\label{FirstSub}
First Subitem
\end{enumerate}

\end{enumerate}%[A.]


To reference the First Item,  \ref{FirstItem} and the first subitem,
\ref{FirstSub}.
\bigskip

I want to have A.i instead of Ai.   I could put the dot myself if I could make the reference to the subitem just print i, which I also can't figure out.



\end{document}

ここに画像の説明を入力してください

関連情報