TOC에 헌정 장을 추가하는 방법은 무엇입니까?

TOC에 헌정 장을 추가하는 방법은 무엇입니까?

이 헌정서에 장 이름을 추가하고 TOC에 추가하려면 어떻게 해야 합니까?

\newenvironment{dedication}
  {\clearpage           % we want a new page
   \thispagestyle{empty}% no header and footer
   \vspace*{\stretch{1}}% some space at the top 
   \slshape             % the text is in italics
   \raggedleft          % flush to the right margin
  }
  {\par % end the paragraph
   \vspace{\stretch{3}} % space at bottom is three times that at the top
   \clearpage           % finish off the page
  }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{dedication}
ABC \\ DEF
\end{dedication}

나는 보고서 클래스를 사용하고 있습니다. 정말 감사합니다!

답변1

당신이 사용할 수있는

\chapter*{Dedication}
 \addcontentsline{toc}{chapter}{Dedication}

전체 코드:

\documentclass{report}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\newenvironment{dedication}
  {%\clearpage           % we want a new page             %%%<===== Comment this line
   \thispagestyle{empty}% no header and footer
   \vspace*{\stretch{1}}% some space at the top
   \itshape             % the text is in italics
   \raggedleft          % flush to the right margin
  }
  {\par % end the paragraph
   \vspace{\stretch{3}} % space at bottom is three times that at the top
   \clearpage           % finish off the page
  }
\begin{document}
 \pagenumbering{roman}
 \tableofcontents 
 \chapter*{Dedication}
 \addcontentsline{toc}{chapter}{Dedication}
  \begin{dedication}
    ABC 
    \par   %% or a blank line
    \vspace{2\baselineskip}
    DEF

    \vspace{\baselineskip}
    \usefont{T1}{LobsterTwo-LF}{bx}{it}
    John
  \end{dedication}
  \pagenumbering{arabic}
\end{document}

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

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

관련 정보