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}
Melanie A
  • 201
  • 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 https://tex.stackexchange.com/questions/410651/blank-page-with-a-title-before-appendices – 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
  • @Werner I tried adding your suggestion to beginning of my Dedication file. The output still contains the chapter header. – Melanie A Jan 16 '18 at 23:50
  • @MelanieA: And I assume that chapter header is not on the first page of the chapter, but on subsequent pages within the dedication... and may even reference what preceded it (like the Abstract)...? – Werner Jan 17 '18 at 00:00
  • Plz see the revised code. I have separate files for each of dedication, abstract, etc. Inside the dedication file, I have \chapter*{Dedication} \addcontentsline{toc}{chapter}{Dedication} Followed by the name of the person and at the end \endinput – Melanie A Jan 17 '18 at 00:04
  • I am open to any types of suggestions that helps me have a page where I just add a name and the page shows up in my table of contents as a chapter. – Melanie A Jan 17 '18 at 00:05
  • @Werner I think you misinterpreted the question. The question is about having a working link in the PDF without the actual heading (so without the use of \chapter*). – Skillmon Jan 17 '18 at 00:45

1 Answers1

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".

Skillmon
  • 60,462