Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to write a report class document, I numbering in the ToC for sections is not printing also how to hide or remove the word "chapter" for instance, my code is :

\documentclass[letter,titlepage,doublesided]{report}

\usepackage{xcolor}
\usepackage{hyperref}
\usepackage{fancyhdr}
\usepackage{lastpage}
\usepackage[margin=0.6in,bottom=0.8in, top=0.8in]{geometry}
\usepackage{titlesec}
\usepackage{url}
\usepackage{tikz}
\usepackage{fix-cm}
\usepackage{graphicx}
\usepackage{pbox}
\usepackage{titletoc}

\newcommand\mybox[2][]{\tikz[overlay]\node[fill=blue!20,inner sep=2pt, anchor=text, rectangle, rounded corners=1mm,#1] {#2};\phantom{#2}}

\title{REPORT}
\author{\includegraphics[width=0.1\textwidth]{logo.png}}
\date{Revision 5}
\pagestyle{fancy}
\lhead{\large{\bf{\it{xxx}}}}
\chead{}
\rhead{\large{\bf{\it{xxx}}}}
\lfoot{\small\it{{xxx}}}
\cfoot{\small\it{{xxx}}}
\rfoot{\small\it{Page \thepage{} of \pageref{LastPage}}}
\renewcommand{\headrulewidth}{0.3pt}
\renewcommand{\footrulewidth}{0.4pt}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                       Colored Section Headings                        %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\colorsection}[1]{%
  \colorbox{blue!20}{\parbox{\dimexpr\textwidth-2\fboxsep}{\thesection\ #1}}}

\newcommand{\colorsubsection}[1]{%
  \colorbox{gray!20}{\parbox{\dimexpr\textwidth-2\fboxsep}{\thesubsection\ #1}}}

  \titleformat{\section}[block]
  {\sffamily\huge}
  {}
  {0pt}
  {\colorsection}
\titlespacing*{\section}{0pt}{\baselineskip}{\baselineskip}

\titleformat{\subsection}[block]
  {\sffamily\Large}
  {}
  {0pt}
  {\colorsubsection}
\titlespacing*{\subsection}{0pt}{\baselineskip}{\baselineskip}

\titleformat{\subsubsection}[block]
  {\sffamily\large}
  {}
  {0pt}
  {\colorsubsection}
\titlespacing*{\subsubsection}{0pt}{\baselineskip}{\baselineskip}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                     / Colored Section Headings                        %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\newcommand{\hdr}[1]{{\bf\huge{#1}}}


\begin{document}    
     \centering\Huge{REPORT}

     \vspace{5em}


     \cleardoublepage

\tableofcontents

\chapter{Scope}
![enter image description here][1]
\section{test}
text!
\end{document}

I am not able to upload a picture but in the page 2, 3. I am not able to see the header and footer as it is in the Page 1. I want to remove the word chapter in Page 3.

share|improve this question
    
Welcome to TeX.SX. A tip: If you indent lines by 4 spaces, then they're marked as a code sample. You can also highlight the code and click the "code" button ({}) or select your code and hit Ctrl+K. –  Jubobs Mar 8 '13 at 19:49
    
if you use \chapter*{...} the word "chapter" will be omitted. i'll leave the questions about headers/footers to someone else. –  barbara beeton Mar 8 '13 at 20:30
    
\renewcommand{\chaptername}{}? –  hpesoj626 Mar 8 '13 at 20:43
add comment

2 Answers

Are you attempting to put the page numbers in your title page/table of contents page? I would advise you not to. But if that is really what you want, then add this line to your preamble.

% For the desired chapter heading formatting
\titleformat{\chapter}
{\normalfont\Huge\bfseries}
{\thechapter} {0.5em} {\thispagestyle{myfancypage}} %Remove \thispagestyle{myfancypage} if you don't want the fancy headers to appear in your chapter page and table of contents page

myfancypage is set up as

\fancypagestyle{myfancypage}{
\fancyhf{}
\lhead{\large{\textbf{\textit{xxx}}}}
\chead{}
\rhead{\large\textbf{\textit{xxx}}}
\lfoot{\small\textit{xxx}}
\cfoot{\small\textit{xxx}}
\rfoot{\small\textit{Page \thepage{} of \pageref{LastPage}}}}

References

I have also deleted some repeated lines in your code and added

\newpage
text!

to illustrate myfancypage

The full revised code

\documentclass[letter,titlepage,twoside]{report}

\usepackage{xcolor}
\usepackage{hyperref}
\usepackage{fancyhdr}
\usepackage{lastpage}
\usepackage[margin=0.6in,bottom=0.8in, top=0.8in]{geometry}
\usepackage{titlesec}
\usepackage{url}
\usepackage{tikz}
\usepackage{fix-cm}
\usepackage{graphicx}
\usepackage{pbox}
\usepackage{titletoc}

\newcommand\mybox[2][]{\tikz[overlay]\node[fill=blue!20,inner sep=2pt, anchor=text, rectangle, rounded corners=1mm,#1] {#2};\phantom{#2}}

\title{REPORT}
\author{\includegraphics[width=0.1\textwidth]{logo.png}}
\date{Revision 5}
\fancypagestyle{myfancypage}{
\fancyhf{}
\lhead{\large{\textbf{\textit{xxx}}}}
\chead{}
\rhead{\large\textbf{\textit{xxx}}}
\lfoot{\small\textit{xxx}}
\cfoot{\small\textit{xxx}}
\rfoot{\small\textit{Page \thepage{} of \pageref{LastPage}}}}
\renewcommand{\headrulewidth}{0.3pt}
\renewcommand{\footrulewidth}{0.4pt}

% For the desired chapter formatting
\titleformat{\chapter}
{\normalfont\Huge\bfseries}
{\thechapter} {0.5em} {\thispagestyle{myfancypage}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                       Colored Section Headings                        %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\colorsection}[1]{%
  \colorbox{blue!20}{\parbox{\dimexpr\textwidth-2\fboxsep}{\thesection\ #1}}}

\newcommand{\colorsubsection}[1]{%
  \colorbox{gray!20}{\parbox{\dimexpr\textwidth-2\fboxsep}{\thesubsection\ #1}}}

  \titleformat{\section}[block]
  {\sffamily\huge}
  {}
  {0pt}
  {\colorsection}
\titlespacing*{\section}{0pt}{\baselineskip}{\baselineskip}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                     / Colored Section Headings                        %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\newcommand{\hdr}[1]{{\bfseries\huge{#1}}}

\begin{document}    
    \begin{center}
    \Huge{REPORT}
    \end{center}


     %\vspace{5em}


     %\cleardoublepage
\begingroup
\let\clearpage\relax
\tableofcontents
\endgroup

%\tableofcontents
\pagestyle{myfancypage}
\chapter{Scope}
![enter image description here][1]
\section{test}
text!
\newpage
text!
\end{document}
share|improve this answer
    
Also the doublesided option doesn't exist and it's twoside. –  egreg Mar 8 '13 at 23:32
    
@egreg Thanks for your eagle's eyes. I didn't see that. :) –  hpesoj626 Mar 9 '13 at 0:03
add comment
  1. Your problem is that \pagestyle{fancy} sets the current page style to fancy and all subsequent page style modifications will apply to fancy and nothing else. But \chapter by default issues a \thispagestyle{plain}. What you could do is to redefine the plain style as well.
  2. \large{\bf{\it{xxx}} does not do what you think it does. This should be written as {\large\bfseries\itshape xxx} or as {\large \textbf{\textit{xxx}}}.
  3. Your example is far too long and filled with irrelevant stuff. This is an issue with how to use fancyhdr. Everything else in your code dump is just noise. http://www.minimalbeispiel.de/mini-en.html
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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