28

I'm using MiKTeX 2.9 and TeXniCenter for writing my thesis. I have a lot of packages and everything was going well, until last night that a blank page with ".0" written in the top left corner kept generating before my title page and still I cannot figure out how to remove it. Is there any kind of command that I can use except \let\cleardoublepage\clearpage?

I have been searching heavily but could not find a useful way. I'd appreciate any help.

azetina
  • 28,884
Ehsan M. Kermani
  • 383
  • 1
  • 3
  • 7
  • 1
    What did you change, before this appeared? Can you post a MWE which shows this behaviour? – Chris Oct 22 '13 at 22:01
  • 1
    @Michael I only added the appendix section which I don't think have anything to do with the blank page. Actually, I'm using a template for it and have not seen anyone facing such an issue. Regarding MWE, I don't think I'm able to do that! – Ehsan M. Kermani Oct 22 '13 at 22:06
  • 1
    Btw, one more thing is that I'm not using \thanks in \author (there's only one author), so it's not about it if someone is thinking so. – Ehsan M. Kermani Oct 22 '13 at 22:08
  • 2
    Something changed. But without more information, this seems like a very open-ended question. You should start by stripping away things you may have changed in the last couple of days to try and narrow down the problem. For example, remove any reference to the appendix (file) and recompile. If that still shows a problem, remove all the chapters except for the title content, and so forth... – Werner Oct 22 '13 at 22:22
  • @Werner Yes, I think ultimately I have to do this. Out of curiosity, is there a way to remove a page from a pdf file? – Ehsan M. Kermani Oct 22 '13 at 22:27
  • 4
    @ehsanmo: Yes, you can discard it using atbegshi's \AtBeginShipoutDiscard. I've done something similar in Compiling only a page range or page selection. The pagesel package can also help in that regard. – Werner Oct 22 '13 at 22:31
  • Such a thing can happen if a counter is erroneously assigned a value with a decimal point. Something like \setcounter{page}{1.0}. This could happen in your own file or be a bug in some package. In the latter case it would likely also generate an error message. – Dan Oct 22 '13 at 23:12
  • Do you get a "Missing begin document" error message? That would indicate an error in one of the \usepackage files. – John Kormylo Oct 23 '13 at 13:01
  • @JohnKormylo No, I'm not getting such a message. Tnx btw – Ehsan M. Kermani Oct 23 '13 at 17:35
  • @Werner Thank you for your help. I've used your code, but I do not know what number should I write in \discardpages{?} because the blank page is before the title page I assumed number zero should work, but it didn't. Number one discarded the title page though! – Ehsan M. Kermani Oct 23 '13 at 17:55
  • @Dan Thanks, but there's no such a thing in my \setcounter. – Ehsan M. Kermani Oct 23 '13 at 17:58
  • @ehsanmo: I didn't say there was an erroneous \setcounter in your file, or even that it was necessarily in a \setcounter command. A lot of counter settings are done by other commands. You really can provide a MWE: You start by reducing to just the title page. Then you remove packages and \newcommands one at a time until that blank page disappears. Put back the last thing you removed and start removing more. Eventually you'll have your MWE. – Dan Oct 23 '13 at 18:15
  • @Werner, that simply worked, thank you for saving my life :) – Ehsan M. Kermani Oct 23 '13 at 19:12
  • Although we don't have a MWE here; but the cause of the problem could be something like this. – Azuru Nov 14 '17 at 10:10
  • I had a similar issue and found that it was because I was using \paragraph in my abstract. Resolved very neatly using suggestion here: https://tex.stackexchange.com/questions/74371/subdividing-structured-abstracts – gkennos Aug 06 '20 at 01:35
  • Future visitors of this page might find the more direct question useful: https://tex.stackexchange.com/questions/161876/thanks-in-ieeetran-adds-an-extra-page?noredirect=1&lq=1 I've put the \thanks outside the \author command. – Horror Vacui Oct 31 '20 at 16:44

9 Answers9

45

For what it's worth or if all else fails, you can always remove the first page by adding the following to your document preamble:

\usepackage{atbegshi}% http://ctan.org/pkg/atbegshi
\AtBeginDocument{\AtBeginShipoutNext{\AtBeginShipoutDiscard}}

This should affect only the next shipout at the document start, which defaults to the first page.

Werner
  • 603,163
31

Instead of chucking out the problem page, you should avoid generating it in the first place.

You're getting an extra page because something is producing output before \maketitle. You can even see the output: .0, as you report. So, my guess is that somewhere in your header you're assigning a decimal number to a counter that only accepts integers: E.g., 10.0 instead of just 10. The leftovers are treated as text, and printed on the first page. Examine your compilation messages (or .log file if necessary), and you should be able to spot the error. (If the error is ahead of \begin{document}, you'll get a very obvious complaint about that.)

If you have no such assignment in your preamble, then it's hidden in one of the packages you include. How could this happen? Most likely, one package redefines a command that another package then (mis)uses. A bit of experimenting should discover the two culprits. You can often avoid such problems by simply reversing their order of inclusion.

alexis
  • 7,961
  • 2
    Moving \begin{flushleft} from before to after \maketitle fixed the problem for me. I only found out by trial and error. There was no warning or error stating that \begin{flushleft} was the problem. – keithphw May 25 '20 at 02:50
4

I just discovered the following. Two blank pages before the title were generated when I tried to put blank lines (\ \\) between \author{} and \date{} commands. Namely, the following code generated the extra blank pages:

\title{title}

\author{name}
\ \\
\ \\
\date{year}

\maketitle

and this one did not:

\title{title}

\author{name}
\date{year}

\maketitle
Troy
  • 13,741
ostap
  • 41
2

I keep on generating the numbered blank front page upon adding a one-page pdf as external material that served as the document's cover page. I was able to remove the blank front page when I added an even number of pdf pages, indicating the addition of two pages in the options tab with the command:

pages={1-2}

I am using the Tufte template, with two-sided document setting. Adding an odd-numbered appendix would have caused the blank front page.

patrego
  • 21
1

Try clear all temporary files, then recompile your .Tex file.

Anderson
  • 2,333
  • 4
  • 17
  • 19
1

Also consider .tex file encoding and line endings. Especially if developing goes under different platforms. For example, I solved similar problem just re-saving .tex file with UTF-8 encoding.

dvvrd
  • 111
  • 1
0

I solved the problem by writing

\begin{titlepage}

\title {My title plus the footnotes}

i.e. I put inside the brackets title plus footnotes and it worked!

Troy
  • 13,741
-2

Use either titlepage or \maketitle but not both.

Schweinebacke
  • 26,336
  • 1
    This is more a kind of comment. Can you at least explain, whats the problem with using both and show how removing either titlepage or \maketitle can help. And please have a look into our Help Center, e.g., to learn how to use markdown and how to write good answers. – Schweinebacke Dec 01 '17 at 10:31
-2

If you found symbol ~ in LaTeX file before or after \title, please remove it because it generate blank page before title page

Mensch
  • 65,388