목차에 문제가 있습니다. 섹션/하위 섹션을 포함하세요.

목차에 문제가 있습니다. 섹션/하위 섹션을 포함하세요.

을(를) 사용하여 내가 가지고 있는 모든 섹션과 하위 섹션에 대한 내 문서의 색인을 만들려고 하는데 \tableofcontents왜 두 가지 문제가 있는지 이해가 되지 않습니다.

내 색인 페이지에 이 코드가 있습니다.

\newpage 
\tableofcontents

첫 번째 문제)하지만 여기에는 관계 작성자의 제목과 이름만 표시되며 이러한 정보가 내 색인에 포함되는 것을 원하지 않습니다. 어떻게 수정할 수 있나요?

여기에 이미지 설명을 입력하세요

빨간색 원 안의 내용(제목, 저자)을 보고 싶지 않아요...


결정된두 번째 문제) 섹션과 하위 섹션을 색인에 추가하고 싶습니다. 각 섹션/하위 섹션 아래에서 사용해야 한다는 내용을 읽었습니다.

\addcontentsline{toc}{section/subsection}{name of section/subsection}

그래서 이렇게 Intro 섹션에 추가했습니다.

\newpage
\section{Intro}
\labelsec{Intro}
\addcontentsline{toc}{section}{Intro}

하지만 저는 \tableofcontents바뀌지 않고 관계의 제목만 표시됩니다... 이러한 문제에 대한 다양한 질문을 읽었지만 문제를 해결한 솔루션이 없습니다.

두 번째 문제에 대한 해결책: 내가 추가했고 \setcounter{secnumdepth}{3}\setcounter{tocdepth}{3}전에\begin{document}

이것은 전체 코드입니다(섹션에 텍스트 없음).

\documentclass{llncs}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% package sillabazione italiana e uso lettere accentate
\usepackage[T1]{fontenc}
\usepackage[italian]{babel}
\usepackage[utf8]{inputenc}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{url}
\usepackage{xspace}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{manifest}

\makeatother

\usepackage{enumitem} %%per elenchi puntati

\usepackage{fancyhdr} %%per numero di pagina

%%%%%%%%%%%%%%%%% NUMERO DI PAGINA
\pagestyle{fancy}
\usepackage{lastpage}
\fancyhf{}
\rhead{Relazione progetto di "Ingegneria dei Sistemi Software"}
\rfoot{Page \thepage\ of \pageref{LastPage}}

%%%%%%%
 \newif\ifpdf
 \ifx\pdfoutput\undefined
 \pdffalse % we are not running PDFLaTeX
 \else
 \pdfoutput=1 % we are running PDFLaTeX
 \pdftrue
 \fi
%%%%%%%
 \ifpdf
 \usepackage[pdftex]{graphicx}
 \graphicspath{ {img/} } 
 \else
 \usepackage{graphicx}
 \graphicspath{ {img/} } 
 \fi
%%%%%%%%%%%%%%%
 \ifpdf
 \DeclareGraphicsExtensions{.pdf, .jpg, .tif}
 \else
 \DeclareGraphicsExtensions{.eps, .jpg}
 \fi
%%%%%%%%%%%%%%%

\newcommand{\java}{\textsf{Java}}
\newcommand{\contact}{\emph{Contact}}
\newcommand{\corecl}{\texttt{corecl}}
\newcommand{\medcl}{\texttt{medcl}}
\newcommand{\msgcl}{\texttt{msgcl}}
\newcommand{\android}{\texttt{Android}}
\newcommand{\dsl}{\texttt{DSL}}
\newcommand{\jazz}{\texttt{Jazz}}
\newcommand{\rtc}{\texttt{RTC}}
\newcommand{\ide}{\texttt{Contact-ide}}
\newcommand{\xtext}{\texttt{XText}}
\newcommand{\xpand}{\texttt{Xpand}}
\newcommand{\xtend}{\texttt{Xtend}}
\newcommand{\pojo}{\texttt{POJO}}
\newcommand{\junit}{\texttt{JUnit}}

\newcommand{\action}[1]{\texttt{#1}\xspace}
\newcommand{\code}[1]{{\small{\texttt{#1}}}\xspace}
\newcommand{\codescript}[1]{{\scriptsize{\texttt{#1}}}\xspace}

% Cross-referencing
\newcommand{\labelsec}[1]{\label{sec:#1}}
\newcommand{\xs}[1]{\sectionname~\ref{sec:#1}}
\newcommand{\xsp}[1]{\sectionname~\ref{sec:#1} \onpagename~\pageref{sec:#1}}
\newcommand{\labelssec}[1]{\label{ssec:#1}}
\newcommand{\xss}[1]{\subsectionname~\ref{ssec:#1}}
\newcommand{\xssp}[1]{\subsectionname~\ref{ssec:#1} \onpagename~\pageref{ssec:#1}}
\newcommand{\labelsssec}[1]{\label{sssec:#1}}
\newcommand{\xsss}[1]{\subsectionname~\ref{sssec:#1}}
\newcommand{\xsssp}[1]{\subsectionname~\ref{sssec:#1} \onpagename~\pageref{sssec:#1}}
\newcommand{\labelfig}[1]{\label{fig:#1}}
\newcommand{\xf}[1]{\figurename~\ref{fig:#1}}
\newcommand{\xfp}[1]{\figurename~\ref{fig:#1} \onpagename~\pageref{fig:#1}}
\newcommand{\labeltab}[1]{\label{tab:#1}}
\newcommand{\xt}[1]{\tablename~\ref{tab:#1}}
\newcommand{\xtp}[1]{\tablename~\ref{tab:#1} \onpagename~\pageref{tab:#1}}
% Category Names
\newcommand{\sectionname}{Section}
\newcommand{\subsectionname}{Subsection}
\newcommand{\sectionsname}{Sections}
\newcommand{\subsectionsname}{Subsections}
\newcommand{\secname}{\sectionname}
\newcommand{\ssecname}{\subsectionname}
\newcommand{\secsname}{\sectionsname}
\newcommand{\ssecsname}{\subsectionsname}
\newcommand{\onpagename}{on page}

\newcommand{\xauthA}{Nicola Casadei}
\newcommand{\xauthB}{Marco Benedetti}
\newcommand{\xauthC}{Erica Marchi}
\newcommand{\xauthD}{Mattia Ricci}
\newcommand{\xfaculty}{II Faculty Engineering and Informatic Science}
\newcommand{\xunibo}{Alma Mater Studiorum -- University of Bologna}
\newcommand{\xaddrCE}{via Sacchi 3}
\newcommand{\xcityCE}{47023 Cesena, Italy}

%
% Comments
%

%%% \newcommand{\todo}[1]{\bf{TODO:}\emph{#1}}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}


     \begin{document}

        \title{Esame finale A.A. 2016/2017\\
         Ingegneria dei Sistemi Software}

        %%% \author{\xauthA \and \xauthB}
        \author{\xauthA \\ \xauthB \\ \xauthC \\ \xauthD}

        \institute{%
        %%%  \xunibo\\\xaddrCE, \xcityCE\\\email{\{nameA.studentA, nameB.studentB\}@studio.unibo.it}
          \xunibo\\\xaddrCE, \xcityCE\\\email\ [email protected]
        }

        \maketitle

        %==================INDEX
        \newpage 
        \tableofcontents

        \newpage
        \setcounter{page}{1}
        \section{Intro}
        \labelsec{Intro}

        \section{Vision}
        \labelsec{Vision}

        ..... other sections

        \end{document}

코드를 더 추가해야 한다면 알려주세요. 미리 감사드립니다!

답변1

\maketitlefrom llncsclass는 제목과 저자 이름을 ToC자동으로 추가합니다.

\maketitle이는 (여기서는 너무 깁니다) 재정의나 패치를 통해 방지할 수 있습니다 .

\usepackage{xpatch}



\makeatletter
\xpatchcmd{\maketitle}{%
  \addtocontents{toc}{\noexpand\protect\noexpand\authcount{\the\c@auco}}%
  \addcontentsline{toc}{author}{\toc@uthor}%
}{% Replace by 'nothing'
}{\typeout{success}}{\typeout{failed}}

\xpatchcmd{\maketitle}{%
  \if!\the\toctitle!\addcontentsline{toc}{title}{\@title}\else
  \addcontentsline{toc}{title}{\the\toctitle}\fi
}{%
  % Replace by nothing
}{\typeout{Success}}{\typeout{Failed patching!}}
\makeatother

코드는 명령 \addcontentsline에서 ... 등을 제거합니다 \maketitle.

여기서는 쌍이 \makeatletter...\makeatother필수적입니다. 그렇지 않으면 패치가 실패합니다.

게다가 '템플릿'은 종종 '템플릿'의 경우처럼 디자인이 잘 되어 있지 않습니다.

\documentclass{llncs}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% package sillabazione italiana e uso lettere accentate
\usepackage[T1]{fontenc}
\usepackage[italian]{babel}
\usepackage[utf8]{inputenc}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{url}
\usepackage{xspace}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
%\usepackage{manifest}

\makeatother

\usepackage{enumitem} %%per elenchi puntati

\usepackage{fancyhdr} %%per numero di pagina

%%%%%%%%%%%%%%%%% NUMERO DI PAGINA
\pagestyle{fancy}
\usepackage{lastpage}
\fancyhf{}
\rhead{Relazione progetto di "Ingegneria dei Sistemi Software"}
\rfoot{Page \thepage\ of \pageref{LastPage}}

%%%%%%%
 \newif\ifpdf
 \ifx\pdfoutput\undefined
 \pdffalse % we are not running PDFLaTeX
 \else
 \pdfoutput=1 % we are running PDFLaTeX
 \pdftrue
 \fi
%%%%%%%
 \ifpdf
 \usepackage[pdftex]{graphicx}
 \graphicspath{ {img/} } 
 \else
 \usepackage{graphicx}
 \graphicspath{ {img/} } 
 \fi
%%%%%%%%%%%%%%%
 \ifpdf
 \DeclareGraphicsExtensions{.pdf, .jpg, .tif}
 \else
 \DeclareGraphicsExtensions{.eps, .jpg}
 \fi
%%%%%%%%%%%%%%%

\newcommand{\java}{\textsf{Java}}
\newcommand{\contact}{\emph{Contact}}
\newcommand{\corecl}{\texttt{corecl}}
\newcommand{\medcl}{\texttt{medcl}}
\newcommand{\msgcl}{\texttt{msgcl}}
\newcommand{\android}{\texttt{Android}}
\newcommand{\dsl}{\texttt{DSL}}
\newcommand{\jazz}{\texttt{Jazz}}
\newcommand{\rtc}{\texttt{RTC}}
\newcommand{\ide}{\texttt{Contact-ide}}
\newcommand{\xtext}{\texttt{XText}}
\newcommand{\xpand}{\texttt{Xpand}}
\newcommand{\xtend}{\texttt{Xtend}}
\newcommand{\pojo}{\texttt{POJO}}
\newcommand{\junit}{\texttt{JUnit}}

\newcommand{\action}[1]{\texttt{#1}\xspace}
\newcommand{\code}[1]{{\small{\texttt{#1}}}\xspace}
\newcommand{\codescript}[1]{{\scriptsize{\texttt{#1}}}\xspace}

% Cross-referencing
\newcommand{\labelsec}[1]{\label{sec:#1}}
\newcommand{\xs}[1]{\sectionname~\ref{sec:#1}}
\newcommand{\xsp}[1]{\sectionname~\ref{sec:#1} \onpagename~\pageref{sec:#1}}
\newcommand{\labelssec}[1]{\label{ssec:#1}}
\newcommand{\xss}[1]{\subsectionname~\ref{ssec:#1}}
\newcommand{\xssp}[1]{\subsectionname~\ref{ssec:#1} \onpagename~\pageref{ssec:#1}}
\newcommand{\labelsssec}[1]{\label{sssec:#1}}
\newcommand{\xsss}[1]{\subsectionname~\ref{sssec:#1}}
\newcommand{\xsssp}[1]{\subsectionname~\ref{sssec:#1} \onpagename~\pageref{sssec:#1}}
\newcommand{\labelfig}[1]{\label{fig:#1}}
\newcommand{\xf}[1]{\figurename~\ref{fig:#1}}
\newcommand{\xfp}[1]{\figurename~\ref{fig:#1} \onpagename~\pageref{fig:#1}}
\newcommand{\labeltab}[1]{\label{tab:#1}}
\newcommand{\xt}[1]{\tablename~\ref{tab:#1}}
\newcommand{\xtp}[1]{\tablename~\ref{tab:#1} \onpagename~\pageref{tab:#1}}
% Category Names
\newcommand{\sectionname}{Section}
\newcommand{\subsectionname}{Subsection}
\newcommand{\sectionsname}{Sections}
\newcommand{\subsectionsname}{Subsections}
\newcommand{\secname}{\sectionname}
\newcommand{\ssecname}{\subsectionname}
\newcommand{\secsname}{\sectionsname}
\newcommand{\ssecsname}{\subsectionsname}
\newcommand{\onpagename}{on page}

\newcommand{\xauthA}{Nicola Casadei}
\newcommand{\xauthB}{Marco Benedetti}
\newcommand{\xauthC}{Erica Marchi}
\newcommand{\xauthD}{Mattia Ricci}
\newcommand{\xfaculty}{II Faculty Engineering and Informatic Science}
\newcommand{\xunibo}{Alma Mater Studiorum -- University of Bologna}
\newcommand{\xaddrCE}{via Sacchi 3}
\newcommand{\xcityCE}{47023 Cesena, Italy}

%
% Comments
%

%%% \newcommand{\todo}[1]{\bf{TODO:}\emph{#1}}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}

\usepackage{xpatch}



\makeatletter
\xpatchcmd{\maketitle}{%
  \addtocontents{toc}{\noexpand\protect\noexpand\authcount{\the\c@auco}}%
  \addcontentsline{toc}{author}{\toc@uthor}%
}{% Replace by 'nothing'
}{\typeout{success}}{\typeout{failed}}

\xpatchcmd{\maketitle}{%
  \if!\the\toctitle!\addcontentsline{toc}{title}{\@title}\else
  \addcontentsline{toc}{title}{\the\toctitle}\fi
}{%
  % Replace by nothing
}{\typeout{Success}}{\typeout{Failed patching!}}
\makeatother

\begin{document}

\title{Esame finale A.A. 2016/2017\\
  Ingegneria dei Sistemi Software}

%%% \author{\xauthA \and \xauthB}
\author{\xauthA \\ \xauthB \\ \xauthC \\ \xauthD}

\institute{%
  %%% \xunibo\\\xaddrCE, \xcityCE\\\email{\{nameA.studentA, nameB.studentB\}@studio.unibo.it}
  \xunibo\\\xaddrCE, \xcityCE\\\email\ [email protected]
}

\maketitle

% ==================INDEX
\newpage 
\tableofcontents

\newpage
\setcounter{page}{1}
\section{Intro}
\labelsec{Intro}

\section{Vision}
\labelsec{Vision}

..... other sections

\end{document}

관련 정보