Blank page when changing chapters

967 views
Skip to first unread message

tasheido

unread,
May 22, 2016, 5:33:23 PM5/22/16
to UNL Thesis
Hello All

First of all, a big thank you for the work done on this template! it did help a lot... 

My question probably is not a new but for some reason in my thesis doc, everytime there is a chapter change a blank page is inserted before and it's tottaly blank, no header and no page number. Besides this page numbering works well.

Is there a way to fix this? i don't mind the blank page but it should be numbered and include the header.

Thanks

tasheido

unread,
May 22, 2016, 8:38:24 PM5/22/16
to UNL Thesis
While looking better through the posts i found the \let\cleardoublepage=\origcleardoublepage solution.. but didn't work, maibe i placed it in the wrong place as my template.tex
is a bit modified. But re checking with the original v3.1.2 line 61 doesen't seem to be "the" place.. I tried just before the "BEGGINING OF USER CUSTOMIZATION".
The compiler does not complain but still no headers on blank pages.

Joao Lourenco

unread,
May 23, 2016, 3:14:43 AM5/23/16
to UNL Thesis
Hi Tasheido,

May I ask where are you from?  (just trying to know where the template is being used…)

Yes, that is possible.  The solution with \let\cleardoublepage=\origcleardoublepage should work.  

Since you are modifying stuff, open file "unlthesis.cls" and comment lines 48 to 51.
#   \let\origcleardoublepage=\cleardoublepage
#   \renewcommand\cleardoublepage{%
#     \newpage{\pagestyle{empty}\origcleardoublepage}%
#   }

It will make the desired blank page layout.

Let me know if it worked for you or not.

All the best.
João

tasheido

unread,
May 23, 2016, 5:19:12 AM5/23/16
to UNL Thesis
Good morning

The nickname is misleading..I am Portuguese FCT-UNL BiomedEng hehe. 

The \let\cleardoublepage=\origcleardoublepage does not work on chapter changes. I tried a solution last night that also had to do with redefining cleardoublepage page behaviour, the point there was to introduce "this page was intentionally left blank" which is not what i really want, but funny enough it worked BUT only on blank pages between cover and abstract abstract and index, etc. Blanks on "move to odd page at beggining of chapter" were still blank. 

Note that i don't mind the move to odd page behaviour (it's nice!) i just want a header and a page number on the blank page. even if it's all blank. 

I will try modifying the class as you suggest. 
(I'm not that much in to Latex.. i try to figure it out by example)

Thanks again!
Bruno

tasheido

unread,
May 23, 2016, 5:55:05 PM5/23/16
to UNL Thesis
Hello again

Just got back to the document to try out the class modification, without any luck. Commenting has the same results. I even tried leaving it and changing from 'plain' to 'headings'

\let\origcleardoublepage=\cleardoublepage
\renewcommand\cleardoublepage{%
  \newpage{\pagestyle{headings}\origcleardoublepage}%

Any ideas? also thought that maibe some file is was not being recompiled for some reason, deleted everything temporary with the same results.

On Monday, May 23, 2016 at 8:14:43 AM UTC+1, Joao Lourenco wrote:

Joao Lourenco

unread,
May 23, 2016, 6:02:18 PM5/23/16
to UNL Thesis
Hi,

Just tried this myself and it works!

In "template.tex", add
\let\cleardoublepage=\origcleardoublepage
just before the "\title{…}"

It must work for you as well.  If it doesn't, please try it in a new/fresh versions downloaded from the repository.

If it still doesn't work, than let me know.

If it does work (and it should work) and does not in your thesis, than that is due to the modifications you did to template.tex or unlthesis.cls.

João

tasheido

unread,
May 23, 2016, 6:15:33 PM5/23/16
to UNL Thesis
Hello again

I didn't change the class file at all. Only added a few extra packages to "template.tex" maibe the culprit is some conflicting package. But i'm glad it works on your version i'll try to isolate the problem. 

Oh and thanks for the help!

tasheido

unread,
May 23, 2016, 6:58:52 PM5/23/16
to UNL Thesis
For me it partially works, blank pages before chapter 1 (ex. blank between cover and copyright, abstract and resumo etc.) now have headers! My Acronyms end on a left page so no problem there, but then between chapter 1 and 2 total blank and the same between chapter 2 and 3 ... then i get headers again on blank between last chapter and annex 1. 

I "turned off" some packages that could be causing this, eg. "pdflscape" "afterpage" and i've also turned hiphenation back "on" and now the problem only shows up between chapters everywhere else blank pages show up with headers and page number.


On Monday, May 23, 2016 at 11:02:18 PM UTC+1, Joao Lourenco wrote:

tasheido

unread,
May 23, 2016, 8:33:12 PM5/23/16
to UNL Thesis
To end the matter as the document is due to print this week. I "cheated" a solution with a pdf editor. Replaced the blank pages with even pages removed from the previous section and edited the page number. It's not the elegant way but the document has to go. The problem is probably a conflict with some other package but deadlines are deadlines.

Thank you for your help once more, this template was my introduction to latex and it was a very interesting journey (with a few bumps here and there...)

I hope this little discussion can help someone else with the same "problem"

Best regards
Bruno

On Monday, May 23, 2016 at 11:02:18 PM UTC+1, Joao Lourenco wrote:

Joao Lourenco

unread,
May 24, 2016, 6:55:00 AM5/24/16
to UNL Thesis
Hey,

Just to finish this matter.  If yo want me to have a look at your files, pack them in a zip and share it with me (email, gogoledrive, dropbox).
I'll check if I can (quickly) solve the problem and have an elegant solution for you.

In alternative, you can bring your laptop and meet me in my office today afternoon, and we'll work on it together for a while.

João

Joao Lourenco

unread,
May 24, 2016, 9:22:02 AM5/24/16
to UNL Thesis
Hi Bruno,

Problem is fully diagnosed and there is a (good) solution!  :D

Two steps:

1)
In file "unlthesis.cls", search for "\unlthesis@printchapter" (probably in line 753) and in the following line replace
\InputIfFileExists{Chapters/#1}{}{ERROR: File '#1' does not exist!!!}%
with
\InputIfFileExists{Chapters/#1}{\cleardoublepage}{ERROR: File '#1' does not exist!!!}%

2)
In file "template.tex", just before the "\title{…}", add
\let\cleardoublepage=\origcleardoublepage


Now it should definitely work!  :D

Cheers,
João L.

tasheido

unread,
May 24, 2016, 7:12:39 PM5/24/16
to UNL Thesis
It worked!

I even went as far as adding this to 'template.tex' which i took from here

\makeatletter
\def\cleardoublepage{\clearpage\if@twoside%
\ifodd\c@page\else
\vspace*{\fill}
\hfill
\begin{center}
This page intentionally left blank.
\end{center}
\vspace{\fill}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi
}
\makeatother

with this and the "\let\cleardoublepage=\origcleardoublepage" i get "this page intentionally left blank" centered on the empty pages. I don't know if it's "a bit two much" for me it makes sense to be there. I have a problem with totally blank pages what do you think?

I don't know if it's a bad style practice in thesis documents. But anyway problem solved thanks!

tasheido

unread,
May 24, 2016, 7:34:34 PM5/24/16
to UNL Thesis
Another note! the bibliography also printed a totally white page:

to fix it i changed the bibliography area to:

%\newcommand{\printbib}{%}{\printbibliography}
\newcommand{\printbib}{%
\cleardoublepage
\printbibliography

Joao Lourenco

unread,
May 25, 2016, 3:31:58 AM5/25/16
to UNL Thesis
Hi Bruno,

Thanks for both the suggestions.  I will add an option to the template to provide the behaviour you wanted.  It makes sense to some people.  :)

Also, thanks for the remark on the bibliography.   The problem was actually in the "printappendixes" macro, which makes me believe you have a single Appendix, right? If you have more than one, that it is still failing.

You may definitely fix it in lines 771 to 773 with
\newcommand{\unlthesis@printappendix}[1]{%
\InputIfFileExists{Chapters/#1}{\cleardoublepage}{}%
}

João L.
Message has been deleted

Danielle Caled

unread,
Dec 5, 2019, 12:43:36 PM12/5/19
to NOVAthesis
Hello. First, let me thank you for providing this template. It is helping me a lot.

But the same "blank page" behavior happens to me.

The thing is that I have the code posted before already in the novathesis.cls file (lines 817 to 819):

\newcommand{\novathesis@
printchapter}[1]{%
    \InputIfFileExists{Chapters/#1}{\cleardoublepage}{ERROR: File '#1' does not exist!!!}%
}

Apparently the behavior is not deterministic. There is a blank page after the cover page, the abstract, the resumo, the list of figures, the list of tables, chapter 1 and chapter 3.

But it does not happen after the contents page and chapter 2, chapter 4 and chapter 5.
Is there a way to fix this? My problem with the blank pages is that they mess up with the page numbering.

Thanks!

Joao Lourenco

unread,
Dec 5, 2019, 3:56:37 PM12/5/19
to NOVAthesis
Hi Danielle,

May I ask you where (which university) are you from?  Are you using a School officially supported by the template or you added support for your own school?

Concerning your question… the blank page is aded only if necessary, so that the next chapter starts in an even (right side) page. 

Isn't this the case for you?  If it is not, please clarify the problem and let me know which version of the template are you using.

João L.

Danielle Caled

unread,
Dec 5, 2019, 4:50:20 PM12/5/19
to NOVAthesis
Hello Prof. João.

I'm from Técnico (IST/UL).
Well, in that case, I can say that all the chapters are starting in even pages.

Thank you for clarification.

Joao Lourenco

unread,
Dec 5, 2019, 4:52:37 PM12/5/19
to NOVAthesis
Great,

I'm happy to know that my template is being used in Técnico as well.  :D

And I'm happy that everything is ok with the blank pages.

Cheers,
J.L.
Reply all
Reply to author
Forward
0 new messages