보이지 않는 하위 섹션은 목차의 페이지 번호를 잃습니다.

보이지 않는 하위 섹션은 목차의 페이지 번호를 잃습니다.

보이지 않는 하위 섹션은 목차에서 페이지 번호를 잃습니다. 더 정확하게는 모두 매크로가 처음 적용된 페이지인 동일한 페이지를 가리킵니다.

내 요구 사항은 요청한 것과 유사합니다. 섹션 제목을 보이지 않게 하시겠습니까?

따라서 나는 거기에 제공된 답변 중 하나를 가져와 적용한 다음 매크로를 실험했습니다.

\makeatletter
\newcommand\invisiblesubsection[1]{%
    \refstepcounter{subsection}%
    \addcontentsline{toc}{subsection}{\protect\numberline{\thesubsection}#1}%
    \subsectionmark{#1}\phantom{}}%
\makeatother

목차의 페이지 번호 매기기를 제외하고 다른 모든 것은 작동합니다. 어떡해?

편집하다:귀하의 요청에 따라 아래 예를 작성했습니다. 그러나 여기서는 동작이 변경되었습니다. 이제 행 번호는 올바르게 표시되지만 각 테이블 뒤에 빈 페이지가 삽입됩니다.

\documentclass[10pt,a4paper,oneside]{article}
\makeatletter
\newcommand\invisiblesubsection[1]{%
\refstepcounter{subsection}%
\addcontentsline{toc}{subsection} 
{\protect\numberline{\thesubsection}#1}%
\subsectionmark{#1}\phantom{}}%
\makeatother
\newcommand\tex{\textbf{(0)} \begin{tabular}[c]{c|rrrrrr}
$0$ & $0$ & & & & & \\ $0$ & $0$ & $0$ & & & & \\ $0$ & $0$ & $0$ & 
$0$ & & & \\ $0$ & $0$ & $0$ & $0$ & $0$ & & \\ $0$ & $0$ & $0$ & 
$0$ & $0$ & $0$ & \\ $0$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$ 
\end{tabular} \vspace{5mm} \newline }
\begin{document}
\section{One}
\invisiblesubsection{1} 
\begin{table}[b] \tex \tex \tex \tex \tex \caption{1} \end{table}
\clearpage \invisiblesubsection{2} 
\begin{table}[b] \tex \tex \tex \tex \tex \caption{2} \end{table}
\clearpage \invisiblesubsection{3} 
\begin{table}[b] \tex \tex \tex \tex \tex \caption{3} \end{table}
\clearpage \invisiblesubsection{4} 
\begin{table}[b] \tex \tex \tex \tex \tex \caption{4} \end{table}
\clearpage \invisiblesubsection{5} 
\begin{table}[b] \tex \tex \tex \tex \tex \caption{5} \end{table}
\clearpage \newpage \tableofcontents\label{toc}
\end{document}

답변1

b!이 코드는 테이블의 부동 위치 지정자로 사용하여 문제를 해결합니다 .

!위치 지정자의 수정자로 사용되는 경우 부동 소수점에 대한 기본 위치 규칙의 모든 제한 사항이 무시됩니다. LaTeX를 사용하면 b!페이지 하단에 플로트를 배치하기 위해 더 열심히 노력할 것입니다.

\clearpage명령은 LaTeX가 현재 페이지를 종료하고 새 페이지를 시작하도록 강제합니다. 배치 대기 중인 플로트가 있는 경우 기본 배치 규칙에 따라 새 페이지에 배치됩니다. 그러나 "!" 수정자를 사용하면 배치 대기 중인 플로트가 플로트 페이지 하단에 배치됩니다.

보다수레의 위치에 영향을 미치는 방법

비

\documentclass[10pt,a4paper,oneside]{article}
\makeatletter
\newcommand\invisiblesubsection[1]{%
    \refstepcounter{subsection}%
    \addcontentsline{toc}{subsection} 
    {\protect\numberline{\thesubsection}#1}%
    \subsectionmark{#1}\phantom{}}%
\makeatother
\newcommand\tex{\textbf{(0)} \begin{tabular}[c]{c|rrrrrr}
        $0$ & $0$ & & & & & \\ $0$ & $0$ & $0$ & & & & \\ $0$ & $0$ & $0$ & 
        $0$ & & & \\ $0$ & $0$ & $0$ & $0$ & $0$ & & \\ $0$ & $0$ & $0$ & 
        $0$ & $0$ & $0$ & \\ $0$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$ 
    \end{tabular} \vspace{5mm} \newline }
\begin{document}
    \section{One}       
    \invisiblesubsection{1} 
    \begin{table}[b!] \tex \tex \tex \tex \tex \caption{1} \end{table}
    \clearpage \invisiblesubsection{2} 
    \begin{table}[b!] \tex \tex \tex \tex \tex \caption{2} \end{table}
    \clearpage \invisiblesubsection{3} 
    \begin{table}[b!] \tex \tex \tex \tex \tex \caption{3} \end{table}
    \clearpage \invisiblesubsection{4} 
    \begin{table}[b!] \tex \tex \tex \tex \tex \caption{4} \end{table}
    \clearpage \invisiblesubsection{5} 
    \begin{table}[b!] \tex \tex \tex \tex \tex \caption{5} \end{table}
    \clearpage \newpage \tableofcontents\label{toc}
\end{document}

관련 정보