¿Cómo agregar un capítulo de dedicación al TOC?

¿Cómo agregar un capítulo de dedicación al TOC?

¿Cómo puedo agregar un nombre de capítulo a esta dedicatoria y agregarlo al TOC, por favor?

\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}

Estoy usando la clase de informe. ¡Muchas gracias!

Respuesta1

Puedes usar

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

Código completo:

\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}

ingrese la descripción de la imagen aquí

ingrese la descripción de la imagen aquí

información relacionada