表のいくつかのセクションを目次に追加する

表のいくつかのセクションを目次に追加する

私は 5 ページに渡る長い表「longtblr」を使用しています。表は \section の下にあります。表には多くのパラメータを持つトピックがいくつかあり、つまり ITEM_a については 10 行、ITEM_b については 30 行、などです。TOC からは表の先頭にしか到達できません。また、たとえば必要なトピックが表の最後にある場合は、5 ページ下にスクロールする必要があります。

メインセクションの下の目次に表示されるテーブルリンクまたはサブセクションを追加するにはどうすればよいですか?

よろしくお願いします。

\documentclass{article}
\usepackage{blindtext}
\usepackage{titlesec}
\usepackage{longtable}
\title{Sections and Chapters}
\author{Gubert Farnsworth}
\date{ }
\begin{document}

\maketitle

\tableofcontents

\section{Introduction}


\begin{longtable}[c]{| c | c |}
\caption{Long table caption.\label{long}}\\
 \hline
 \multicolumn{2}{| c |}{Begin of Table}\\
 \hline
 Something & something else\\
 \hline
 \endfirsthead

 \hline
 \multicolumn{2}{|c|}{Continuation of Table \ref{long}}\\
 \hline
 Something & something else\\
 \hline
 \endhead

 \hline
 \endfoot

 \hline
 \multicolumn{2}{| c |}{End of Table}\\
 \hline\hline
 \endlastfoot

 ITEM\_a         & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
ITEM\_b             & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
ITEM\_c           & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
ITEM\_d           & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
ITEM\_e           & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
 \end{longtable}


\section{Second Section}

\blindtext
\end{document}

答え1

ITEM_…なぜ表のリストではなく目次にが必要なのか、まったく不明ですが、あなたはボスです...

\addcontentslineいつものように、目次に項目を追加するには を使います。あなたの場合はsubsectionレベルを使うのが最も理にかなっているので、

\addcontentsline{toc}{subsection}{ITEM\_a}

アイテムを生成するには、コマンドを使用することをお勧めします。

\documentclass{article}
\usepackage{longtable}
\usepackage{blindtext}

\title{Sections and Chapters}
\author{Gubert Farnsworth}
\date{ }

\newcommand*\ITEM[1]{%
  \addcontentsline{toc}{subsection}{ITEM\_#1}% ToC entry
  ITEM\_#1% item
}

\begin{document}

\maketitle

\tableofcontents

\section{Introduction}


\begin{longtable}[c]{| c | c |}
\caption{Long table caption.\label{long}}\\
 \hline
 \multicolumn{2}{| c |}{Begin of Table}\\
 \hline
 Something & something else\\
 \hline
 \endfirsthead

 \hline
 \multicolumn{2}{|c|}{Continuation of Table \ref{long}}\\
 \hline
 Something & something else\\
 \hline
 \endhead

 \hline
 \endfoot

 \hline
 \multicolumn{2}{| c |}{End of Table}\\
 \hline\hline
 \endlastfoot

 \ITEM{a}         & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
\ITEM{b}             & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
\ITEM{c}           & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
\ITEM{d}           & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
\ITEM{e}           & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
                 & like this\\
 \end{longtable}


\section{Second Section}

\blindtext
\end{document}

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

個人的な意見ですが、縦線や横線がたくさんある表は見苦しいだけでなく、印刷上も問題があります。2列の表と(番号付きの)項目の場合、多くの場合、パッケージenumitemより良い解決策です。

関連情報