0

I have the following code in my report document:

 \pagenumbering{roman} 
 \setcounter{page}{2}
 \include{Abstract}
 \include{Dedication}
 \include{Acknowledgements}
 \tableofcontents
 ......

and the file dedication includes

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

I am using hyperref

   \hypersetup{
      colorlinks,
      citecolor=black,
      filecolor=black,
      linkcolor=black,
      urlcolor=black}

My question is how I can remove the chapter header only for this file, or perhaps change its setting, while leaving other chapter headings as they are.

If I remove \chapter*{Dedication}, I have a problem with TOC, where clicking dedication does not take me to the correct page. Another option would be if I write \chapter*{To Someone}, but in this case I need to change the size of chapter header only for this page, and I do not know how.

Your help is greatly appreciated

[Added Code]

\documentclass{report}

\usepackage{comment} 
\usepackage{amssymb} 
\usepackage{xspace}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{enumerate}
\usepackage{amssymb}
\usepackage{multirow}

\usepackage[letterpaper,left=1in,right=1in,top=1in,bottom=1in]{geometry}
\usepackage{tocbibind}
\usepackage[title,titletoc,toc,page]{appendix}
\usepackage[doublespacing]{setspace}


\usepackage{hyperref}
\hypersetup{
  colorlinks,
  citecolor=black,
  filecolor=black,
  linkcolor=black,
  urlcolor=black}

\setcounter{secnumdepth}{3}

\begin{document}
 \pagenumbering{roman} 
 \setcounter{page}{2}

  \include{Abstract}
  \include{Dedication}
  \include{Acknowledgements}
  \tableofcontents
  \listoffigures

 \clearpage
 \pagenumbering{arabic}
 \setcounter{page}{1}

 \include{someChapter}

 \bibliographystyle{plain}               
 \bibliography{MyLib}                      


  \begin{appendices}
  \include{Ap1}
  \clearpage
  \include{Ap2} 
  \end{appendices}                     

   \end{document}
  • Possible duplicate of Remove chapter from ToC – Amelen Jan 16 '18 at 22:49
  • Note that I don't want to remove it from ToC. In fact I want to keep it in TOC as a chapter, however, in the file itself, I would like to either remove or change the chapter heading – Melanie A Jan 16 '18 at 22:53
  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Skillmon Jan 16 '18 at 23:32
  • Thanks. I have another open question with the code of document which is at tex.stackexchange.com/questions/410651/… – Melanie A Jan 16 '18 at 23:43
  • @MelanieA: What about \cleardoublepage \phantomsection \chapter*{Dedication} \addcontentsline{toc}{chapter}{Dedication}? – Werner Jan 16 '18 at 23:43
3

Please try the following:

\documentclass{report}

\begin{filecontents}{Dedication.tex}
%\chapter*{Dedication}
\cleardoublepage\phantomsection
\addcontentsline {toc}{chapter}{Dedication}%
To Someone
\end{filecontents}

\usepackage{comment} 
\usepackage{amssymb} 
\usepackage{xspace}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{enumerate}
\usepackage{amssymb}
\usepackage{multirow}

\usepackage[letterpaper,left=1in,right=1in,top=1in,bottom=1in]{geometry}
\usepackage{tocbibind}
\usepackage[title,titletoc,toc,page]{appendix}
\usepackage[doublespacing]{setspace}


\usepackage{hyperref}
\hypersetup{
  colorlinks,
  citecolor=black,
  filecolor=black,
  linkcolor=black,
  urlcolor=black}

\setcounter{secnumdepth}{3}

\begin{document}
 \pagenumbering{roman} 
 \setcounter{page}{2}

  %\include{Abstract}
  \include{Dedication}
  % \include{Acknowledgements}
  \tableofcontents
  \listoffigures

 \clearpage
 \pagenumbering{arabic}
 \setcounter{page}{1}

 % \include{someChapter}

 \bibliographystyle{plain}               
 \bibliography{MyLib}                      


  \begin{appendices}
  % \include{Ap1}
  \clearpage
  % \include{Ap2}
  \end{appendices}                     

   \end{document}

The stuff between \begin{filecontents} and \end{filecontents} should be the contents of your "Dedication.tex".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.