1

Why does the code below produce a first page with the header Chapter 0? I need to eliminate that.

A MWE which reproduces the error-

\documentclass[12pt,twoside
%,draft descomentando produce el pdf sin imágenes
]{report}
\usepackage[headheight=18pt,a4paper, width=150mm, top=25mm, bottom=25mm, bindingoffset=6mm, headsep=18pt]{geometry}
%aca utilizo la geometría de la hoja 
\usepackage[spanish,es-noquoting]{babel}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 
\usepackage[hypcap=false]{caption}

\usepackage[activate={true,nocompatibility},final,tracking=true,kerning=true,spacing=true,factor=1100,stretch=10,shrink=10]{microtype}
\usepackage[hyphens]{url} %hyphens permite que se corten los url ( y quiza otras cosas) en algunos puntos, porque sino se alteran las oraciones.

\usepackage{caption}
\usepackage{csquotes} %"para citar bien"
\emergencystretch=2em

\title{\vspace{-6.0cm}{\small A}\\~\\
{\Large B} \\~\\
    {\large C}\\
    {\small D}\\
    {\small E}\\~\\
    }

\usepackage[pagestyles]{titlesec}
\newpagestyle{mystyle}{%
\headrule\footrule
\sethead[\small\itshape\thesection.\enspace\MakeUppercase{\sectiontitle}][][]{}{\small\itshape\MakeUppercase{\chaptername~\thechapter.\enspace \chaptertitle}}{}
\setfoot{}{\thepage}{}
}
\pagestyle{mystyle}

\begin{document}

\begin{center}
\maketitle
\end{center}

\titleformat{\chapter}[display]
{\normalfont\large\bfseries}{\chaptertitlename\ \thechapter}{0pt}{}
\titleformat{\section}
{\normalfont\Large\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}
{\normalfont\large\bfseries}{\thesubsection}{1em}{}

\titlespacing{\chapter}{0pt}{-50pt}{0pt}
\titlespacing{\section}{0pt}{2.5ex plus 1ex minus .2ex}{1.3ex plus .2ex}
\titlespacing{\subsection}{0pt}{2ex plus 1ex minus .2ex}{1.0ex plus .2ex}
%formato de los títulos principales para cada capítulo(el formato de los subtítulos se indica dentro de cada capítulo
\tableofcontents

\chapter{Intro}
\end{document}
Johannes_B
  • 24,235
  • 10
  • 93
  • 248

2 Answers2

3

Just use \maketitle without environment center:

\begin{document}
\maketitle
Heiko Oberdiek
  • 271,626
  • But If I don't use it, title is not centered, am I wrong? I need it to be centered –  Sep 02 '17 at 13:23
  • @HernanMiraola If you do not want to try it, then take a look at the definition of \maketitle in report.cls. There, you will find \begin{center} and \end{center}. – Heiko Oberdiek Sep 02 '17 at 13:27
1

Just move line 30: \pagestyle{mystyle} ;under \maketitle command and it's centering.

Edit

Remove centering too from \maketitle

koleygr
  • 20,105
  • great, but there appears a blank page yet, isn't it? I don't want that.. –  Sep 02 '17 at 13:22
  • If for some reason in other cases it doesn't center use \centering before \maketitle and place both inside {} and not \begin{center} and \end{center} – koleygr Sep 02 '17 at 13:27