1

How do I to add a chapter-name to this dedication and to add it to TOC, please?

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

I'm using report class. Thanks a lot!

1
  • Please post complete code. All questions should include a Minimal (non-)Working Example. Unless the problem is that it won't compile, the code should compile. This makes it easier for people to understand your question and easier to help you.
    – cfr
    Mar 25, 2014 at 2:09

1 Answer 1

1

You can use

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

Full code:

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

enter image description here

enter image description here

7
  • for chapter*, I'm using this definition: \def\@makeschapterhead#1{% \vspace*{10\p@}% {\parindent \z@ {\raggedleft \reset@font \scshape \vphantom{\@chapapp{} \thechapter} \par\nobreak}% \par\nobreak \vspace*{30\p@} \interlinepenalty\@M \usefont{OT1}{ptm}{b}{n} {\raggedright \Huge #1}% \par\nobreak \par\nobreak \vskip 45\p@ }} So, when I use your solution, I'm getting the chapter's title in one page and the dedication in another one.
    – dgs
    Mar 25, 2014 at 1:38
  • @user3289501 So you do not want it formatted consistently with other chapters. Perhaps it should be a section or something instead? Normally dedications are not treated in this way so I'm not very clear what effect you are looking for.
    – cfr
    Mar 25, 2014 at 2:11
  • @user3289501 You have to comment the first line in your dedication environment definition i.e., %\clearpage. I have marked it in the code. Did you do it?
    – user11232
    Mar 25, 2014 at 2:14
  • @cfr, on which way might they be treated, please?
    – dgs
    Mar 25, 2014 at 2:19
  • 1
    @user3289501 Well look at a book of any kind. The dedication is not usually a chapter which shows up in the table of contents. In some cases, it might have a title (e.g. in a thesis or dissertation). Usually, in most books, it isn't even formatted that way. Rather the wording itself makes its role clear e.g. 'This work is dedicated to...' or 'In memory of...' or 'With gratitude to...' or whatever. A book I just picked up just says 'To So-and-So\\For putting up with such-and-such for so many years...' Acknowledgements are sometimes listed but not the dedication.
    – cfr
    Mar 25, 2014 at 2:42

Not the answer you're looking for? Browse other questions tagged .