# Change section name twice (or make a section appear in TOC only, not in text)?

I am trying to have a document with TOC:

1 Introduction

2 blabla

3 Conclusion

Bibliography

Appendix 1

I want the Bibliography to start with title "Bibliography" but I do not want the Appendix 1 to start with title "Appendix 1". I just want to include some PDF pages without a title preceeding them. I, however, want both Bibliography and Appendix 1 to have headings specifying whether the page is a part of bibliography or Appendix 1.

Test document is as follows:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english,czech]{babel}
\usepackage[nottoc]{tocbibind}
\usepackage{fancyhdr}
\usepackage{pdfpages}
\usepackage{appendix}

\let\stdsection\section
\renewcommand\section{\newpage\stdsection}

\begin{document}
\tableofcontents
\clearpage

\pagestyle{fancy}
\section{Úvod}
blabla

\section{Závěr}
bleble

\newpage

\renewcommand{\refname}{Bibliography}
\begin{thebibliography}{9}
bli
\end{thebibliography}
\appendix
\renewcommand{\appendixtocname}{Appendix 1}
\renewcommand{\appendixpagename}{Appendix 1}
\noappendicestocpagenum
\renewcommand{\refname}{Appendix 1}
\newpage
bla
\includepdf[scale=0.85,pages={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16},pagecommand={\thispagestyle{fancy},\fancyfoot{}}]{original.pdf}
\end{document}


The bibliography looks right: I would like the heading of page 5 to be "Appendix 1" (see the command \renewcommand{\refname}{Appendix} before includepdf), but it is "Bibliography" like this:

I do not understand why \renewcommand works for the first time but not for the second.

Alternative way to achieve what I want would be to start a section without it being printed in the actual document but only in the TOC - I have not managed to google how to do that.

-

Because you're using the babel package, you can't use the "standard LaTeX" method of setting

\newnewcommand{\refname}{blabla}


Instead, given that you've specified czech as the language when loading babel, you should include the following command in the preamble:

\addto{\captionsczech}{\renewcommand{\refname}{blabla}}


(where, of course, "blabla" should be replaced with whatever text string may be appropriate).

Separately, you write that

I do not understand why \renewcommand works for the first time but not for the second.

Actually, it doesn't work the first time either! It just doesn't do anything, given that you're using babel. But, as the default name of the bibliography section is already Bibliography, the error doesn't become apparent.

-
I updated the question with screenshots of the actual rendering. –  sup Jun 14 '12 at 15:07
I had to put in a \newpage after \end{thebibliography} but with that it works, so thanks! –  sup Jun 14 '12 at 16:40
@sup: I'm glad you were able to work out that you needed an additional \newpage command before issuing the instruction \fancyhead[L]{\MakeUppercase{\appendixtocname}}. –  Mico Jun 14 '12 at 17:09

I suggest to define some new page styles:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english,czech]{babel}
\usepackage[nottoc]{tocbibind}
\usepackage{fancyhdr}
\usepackage{pdfpages}
\usepackage{appendix}

\fancypagestyle{normal}{
}
\fancypagestyle{appendix}{
}

\let\stdsection\section
\renewcommand\section{\newpage\stdsection}

\begin{document}
\tableofcontents
\clearpage

\pagestyle{normal}

\section{Úvod}
blabla

\section{Závěr}
bleble

\newpage

\renewcommand{\refname}{Bibliography}
\begin{thebibliography}{9}
bli
\end{thebibliography}

\newpage
\appendix
\renewcommand{\appendixtocname}{Appendix 1}
\renewcommand{\appendixpagename}{Appendix 1}
\noappendicestocpagenum
\renewcommand{\refname}{Appendix 1}

\pagestyle{appendix}

bla

\shorthandoff{-}
\includepdf[pages=-,pagecommand={\thispagestyle{appendix}},scale=0.85]{original.pdf}
\end{document}


Notice the \shorhandoff command necessary to be able to use pages=-, and the \setlength{\headheight}{14.5pt} for adjusting the head height.

-
Thanks for the \shorhandoff, I felt stupid to list all the pages to include but it kept giving back errors when using dash. (I actually use \setlength but I excluded it from the example file, but thanks anyway.) I guess your solution would work too, but the above one is working already, thanks for replying anyway. –  sup Jun 14 '12 at 16:44