私が読んでいる本の目次には次のようなことが書かれています。
...
2.2 サブセクションのタイトル
2.3 サブセクションのタイトル
2.3.A サブセクションのタイトル
2.4 サブセクションのタイトル
...
どうすればそれを実現できるでしょうか? 2.3.A もサブセクションであり、2.3 に属するサブサブセクションではないことに注意してください。
前もって感謝します!
答え1
次のことを実行することをお勧めします。
序文では、int命令を発行する
\let\origthesubsection\thesubsection
この命令は、サブセクションカウンタの表現のデフォルト形式を「保存」します。
サブセクション 2.3A の開始直前に、次の指示を発行します。
\renewcommand\thesubsection{\origthesubsection A} \addtocounter{subsection}{-1}
次の「標準番号」サブセクションの開始直前に、次の指示を発行します。
\renewcommand\thesubsection{\origthesubsection}
このアプローチは、hyperref
およびcleveref
パッケージで機能し、命令を使用して目次を作成することもできます\tableofcontents
。
\documentclass{article}
\usepackage[colorlinks,allcolors=blue]{hyperref}
\usepackage[noabbrev,nameinlink]{cleveref}
\crefname{subsection}{subsection}{subsections}
\setlength\parindent{0pt}
\let\origthesubsection\thesubsection
\begin{document}
\setcounter{section}{2}
\tableofcontents
\subsection{AAA}
\subsection{BBB}
\subsection{CCC}
\renewcommand\thesubsection{\origthesubsection A}
\addtocounter{subsection}{-1}
\subsection{DDD} \label{sec:ddd}
\renewcommand\thesubsection{\origthesubsection}
\subsection{EEE} \label{sec:eee}
\subsection{FFF} \label{sec:fff}
\ref{sec:ddd}, \ref{sec:fff}
\autoref{sec:ddd}, \autoref{sec:fff}
\cref{sec:ddd}, \cref{sec:fff}
\cref{sec:ddd,sec:fff}
\end{document}