Como remover a página em branco antes do novo capítulo do meu relatório?

Como remover a página em branco antes do novo capítulo do meu relatório?

Esse problema começou depois que adicionei o código a seguir no preâmbulo para definir a fonte padrão do título do capítulo ("INTRODUÇÃO" no código a seguir), que era grande, em negrito e ousado que eu não gostei, na fonte de texto normal padrão.

\usepackage[rm,tiny]{titlesec} %added this to change the chapter title's font as default regular text font.
\titleformat{\chapter}{\normalfont\centering}{}{0pt}{}
\titlelabel{}
\titlespacing*{\chapter}{0pt}{-20pt}{4pt}

O que aconteceu é que eu poderia mudar a fonte do meu capítulo, mas uma página em branco (com a página nº 1 no cabeçalho) apareceu antes da página “Introdução”. A página de introdução agora tem o número da página. 2 no rodapé, em vez do cabeçalho que formatei para aparecer. Todos os outros números de página estão no cabeçalho.

Essa tendência continua sempre que formato os demais capítulos (revisão de literatura, metodologia, etc.) com o \chapter{}comando. Uma página em branco é criada e a nova seção é empurrada uma página para baixo, com o número da página no rodapé e não no cabeçalho.

Aqui está o código mais completo:

\documentclass[12pt]{report}
\usepackage[left=1.5in, right=1in, top=1in, bottom=1.5in]{geometry}
\usepackage{setspace}
\usepackage{amsbsy}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{enumitem}
\usepackage{textcomp}
\usepackage{lscape}
\usepackage{amsmath}
\usepackage{calc}
\newlength{\depthofsumsign}
\setlength{\depthofsumsign}{\depthof{$\sum$}}
\newlength{\totalheightofsumsign}
\newlength{\heightanddepthofargument}

\usepackage[rm,tiny]{titlesec} %added this to change the chapter title's font as default regular text font.

\usepackage{pdflscape,booktabs}
\usepackage[flushleft]{threeparttable}
\renewcommand\TPTtagStyle{\textit} 
\usepackage[font=it,skip=0.5\baselineskip]{caption}

%to put page numbers in the header
\fancyhf{}
\fancyhead[C]{\thepage}
\pagestyle{fancy}

\titleformat{\chapter}{\normalfont\centering}{}{0pt}{}
\titlelabel{}
\titlespacing*{\chapter}{0pt}{-20pt}{4pt}

\begin{document}
\setlength{\headheight}{50pt} %to note where the header lies.
\setlength{\headsep}{15pt} %to set the distance between header and the first line after it.

\renewcommand{\headrulewidth}{0pt}
\doublespacing
\thispagestyle{empty}
\begin{center}
\vspace*{0.2in}
MY TITLE\\
\vspace*{0.4in}
by\\
My name\\\

\vspace*{1.4in}
\singlespacing
A thesis submitted in partial fulfillment\\
of the requirements for the degree\\
\doublespacing
of\\
My degree\\
in\\
My discipline\\\

\vspace*{1in}
MY UNIVERSITY\\
University, Location\\
\vspace*{0.2in}
April 2019
\end{center}
\pagebreak

\pagenumbering{gobble}
\begin{center}
\vspace*{1in}
\textcopyright COPYRIGHT\\
by\\
My name\\
2019\\
All Rights Reserved
\end{center}
\pagebreak

\pagenumbering{arabic}
\setcounter{page}{1}
\begin{center}
\chapter{INTRODUCTION}
\end{center}

My introduction section's first paragraph...

\end{document}

As duas primeiras páginas estão bem (a primeira página é a capa com o nome da tese, etc., e a segunda página é a seção de direitos autorais). Essas páginas não têm número de página (e, portanto, o \pagenumbering{gobble}código da segunda página).

Editar: resolvi o problema da página em branco removendo o \begin{center} ... \end{center}código, mas o número da página com o capítulo ainda aparece no rodapé e não no cabeçalho. Todas as outras páginas possuem números no cabeçalho. Algum jeito de arrumar isso?

Responder1

As páginas dos capítulos usam o estilo de página plainpor padrão. Se você quiser ajustar ambos os estilos plaine usar fancypagestyle . Se o conteúdo for diferente em alguns dos campos de cabeçalho e/ou rodapé, use .fancyplainfancy\fancyplain{<content for plain style>}{<content for fancy style>}

\documentclass[12pt]{report}
\usepackage[left=1.5in, right=1in, top=1in, bottom=1.5in]{geometry}
\usepackage{setspace}
\usepackage{amsbsy}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{enumitem}
\usepackage{textcomp}
\usepackage{lscape}
\usepackage{amsmath}
\usepackage{calc}
\newlength{\depthofsumsign}
\setlength{\depthofsumsign}{\depthof{$\sum$}}
\newlength{\totalheightofsumsign}
\newlength{\heightanddepthofargument}

\usepackage[rm,tiny]{titlesec} %added this to change the chapter title's font as default regular text font.

\usepackage{pdflscape,booktabs}
\usepackage[flushleft]{threeparttable}
\renewcommand\TPTtagStyle{\textit} 
\usepackage[font=it,skip=0.5\baselineskip]{caption}

%to put page numbers in the header
\fancyhf{}
\fancyhead[C]{\thepage}
%\fancyfoot[C]{\fancyplain{plain style}{fancy style}}% <- to show the usage of \fancyplain
\pagestyle{fancyplain}% <- changed

\titleformat{\chapter}{\normalfont\centering}{}{0pt}{}
\titlelabel{}
\titlespacing*{\chapter}{0pt}{-20pt}{4pt}

\setlength{\headheight}{50pt} %to note where the header lies.
\setlength{\headsep}{15pt} %to set the distance between header and the first line after it.

\renewcommand{\headrulewidth}{0pt}

\begin{document}
\doublespacing
\thispagestyle{empty}
\begin{center}
\vspace*{0.2in}
MY TITLE\\
\vspace*{0.4in}
by\\
My name\\\

\vspace*{1.4in}
\singlespacing
A thesis submitted in partial fulfillment\\
of the requirements for the degree\\
\doublespacing
of\\
My degree\\
in\\
My discipline\\\

\vspace*{1in}
MY UNIVERSITY\\
University, Location\\
\vspace*{0.2in}
April 2019
\end{center}
\clearpage

\thispagestyle{empty}
\begin{center}
\vspace*{1in}
\textcopyright COPYRIGHT\\
by\\
My name\\
2019\\
All Rights Reserved
\end{center}
\cleardoublepage

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

\chapter{INTRODUCTION}
\lipsum

\end{document}

Resultado

captura de tela

Responder2

Aqui está uma correção usando um código que redefine \chaptero comando e adiciona \thispagestyle{fancy}a cada chamada de (cada versão do) comando de capítulo:

\documentclass[12pt]{report}
\usepackage[left=1.5in, right=1in, top=1in, bottom=1.5in]{geometry}
\usepackage{setspace}
\usepackage{amsbsy}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{enumitem}
\usepackage{textcomp}
\usepackage{lscape}
\usepackage{amsmath}
\usepackage{calc}
\newlength{\depthofsumsign}
\setlength{\depthofsumsign}{\depthof{$\sum$}}
\newlength{\totalheightofsumsign}
\newlength{\heightanddepthofargument}

\usepackage[rm,tiny]{titlesec} %added this to change the chapter title's font as default regular text font.
\usepackage{lipsum}
\usepackage{pdflscape,booktabs}
\usepackage[flushleft]{threeparttable}
\renewcommand\TPTtagStyle{\textit} 
\usepackage[font=it,skip=0.5\baselineskip]{caption}

%to put page numbers in the header
\fancyhf{}
\fancyhead[C]{\thepage}
\fancyfoot{}
\pagestyle{fancy}

\titleformat{\chapter}{\normalfont\centering}{}{0pt}{}
\titlelabel{}
\titlespacing*{\chapter}{0pt}{-20pt}{4pt}


%koleygr: Redefining chapter to include \thispagestyle{fancy}
\let\oldchapter\chapter
\makeatletter
\def\chapter{%
\@ifstar{\@Starred}{\@nonStarred}%
}
\def\@Starred{%
\@ifnextchar[%
{\GenericWarning{}{Warning: A starred section can not have parameters. I am going to ignore them!}\@StarredWith}%
{\@StarredWithout}%
}      
\def\@StarredWith[#1]#2{%
\oldchapter*{#2}%
\thispagestyle{fancy}
}
\def\@StarredWithout#1{
\oldchapter*{#1}%
\thispagestyle{fancy}
}
\def\@nonStarred{%
\@ifnextchar[%
{\@nonStarredWith}%
{\@nonStarredWithout}%
}
\def\@nonStarredWith[#1]#2{%
\oldchapter[#1]{#2}%
\thispagestyle{fancy}
}
\def\@nonStarredWithout#1{%
\oldchapter{#1}%
\thispagestyle{fancy}
}
\makeatother


\begin{document}
\setlength{\headheight}{50pt} %to note where the header lies.
\setlength{\headsep}{15pt} %to set the distance between header and the first line after it.

\renewcommand{\headrulewidth}{0pt}
\doublespacing
\thispagestyle{empty}
\begin{center}
\vspace*{0.2in}
MY TITLE\\
\vspace*{0.4in}
by\\
My name\\\

\vspace*{1.4in}
\singlespacing
A thesis submitted in partial fulfillment\\
of the requirements for the degree\\
\doublespacing
of\\
My degree\\
in\\
My discipline\\\

\vspace*{1in}
MY UNIVERSITY\\
University, Location\\
\vspace*{0.2in}
April 2019
\end{center}
\pagebreak

\pagenumbering{gobble}
\begin{center}
\vspace*{1in}
\textcopyright COPYRIGHT\\
by\\
My name\\
2019\\
All Rights Reserved
\end{center}
\pagebreak

\pagenumbering{arabic}
\setcounter{page}{1}
%\begin{center}

\chapter{INTRODUCTION}
%\end{center}

My introduction section's first paragraph...
\lipsum[1-5]

\chapter{Another Chapter}
\lipsum[1-5]
\end{document}

PS: usei minha resposta antiga deaquipara redefinir o comando do capítulo, mas você poderia usar a resposta de @GonzaloMedina deaquiem vez disso, se você não gostar do meu código ...

informação relacionada