LyX ⇒ Why is there a blank first page on my book?
-
- Posts: 128
- Joined: Wed Jul 04, 2012 5:34 pm
Why is there a blank first page on my book?
I tried to add the front cover, and I succeeded. However, Lyx also adds another completely blank page before my cover page, so that the first page of my ebook is completely blank!
Why is it doing that, and how can I delete the blank page?
Why is it doing that, and how can I delete the blank page?
FYI:
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10344
- Joined: Mon Mar 10, 2008 9:44 pm
Why is there a blank first page on my book?
One possible reason is that what you put on the cover page is too big, i.e. if it's a big image, it goes to the next place and the first one remains blank.
There are more possible reasons, but I need to see how the beginning is done before I know which issue causes it. Perhaps post a reduced copy of the LyX document (same settings, just with the cover), as attachment, if it shows that behavior. Or a LaTeX exported file which does, as a
minimal working example.
Stefan
There are more possible reasons, but I need to see how the beginning is done before I know which issue causes it. Perhaps post a reduced copy of the LyX document (same settings, just with the cover), as attachment, if it shows that behavior. Or a LaTeX exported file which does, as a

Stefan
LaTeX.org admin
-
- Posts: 128
- Joined: Wed Jul 04, 2012 5:34 pm
Re: Why is there a blank first page on my book?
Thanks mate. I've deleted most everything, and kept the settings the same, so that the lyx file I attached only works out to about 24 pdf pages.
- Attachments
-
- Alternative Crops for Drylands - Ebook - Copy.lyx
- (63.08 KiB) Downloaded 2528 times
FYI:
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class
- Stefan Kottwitz
- Site Admin
- Posts: 10344
- Joined: Mon Mar 10, 2008 9:44 pm
Why is there a blank first page on my book?
Did you already see my answer here and tried my suggestion? It should also work with jpg files.
Otherwise, please also post the file you include in your cover, for a real test.
Stefan
Otherwise, please also post the file you include in your cover, for a real test.
Stefan
LaTeX.org admin
-
- Posts: 128
- Joined: Wed Jul 04, 2012 5:34 pm
Re: Why is there a blank first page on my book?
If you look at the lyx file I attached, you can see that I used the pdfpages function to insert the one-page cover file. This generates the extra blank page at the beginning.
Even if I select the jpg file using pdfpages, I will still get a blank first page.
Even if I select the jpg file using pdfpages, I will still get a blank first page.
FYI:
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class
-
- Posts: 128
- Joined: Wed Jul 04, 2012 5:34 pm
Why is there a blank first page on my book?
What do you mean by this? You want me to attach the one-page pdf file of the cover? The cover was produced by creating a new document, setting all margins to zero, and then inserting the jpg file as a graphic float. Then I opened up a new document and used pdf pages to select the second page of that document, since the first page was the auto-generated blank page.Stefan_K wrote: Otherwise, please also post the file you include in your cover, for a real test.
Either way, it's too complicated.
If I insert the jpg using pdfpages I get the first page blank.
If I insert the pdf using pdfpages I get the first page blank.
If I insert the jpg as a float I get the first page blank. (even when I set all margins to zero for the entire document).
If I just insert the jpg as a graphic (no float) I get the first page blank.
I think your original hypothesis is correct, and it has something to do with document thinking what I insert is too big.
FYI:
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class
- Stefan Kottwitz
- Site Admin
- Posts: 10344
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Why is there a blank first page on my book?
In case there would be no fix, the first page in the final pdf file could be taken out, either using tools such as pdfsam or pdfjam or a final LaTeX document which just includes page 2-xx.
Perhaps there are further ideas, or a fix could be tested if the cover would also be attached to a post here.
Stefan
Perhaps there are further ideas, or a fix could be tested if the cover would also be attached to a post here.
Stefan
LaTeX.org admin
Why is there a blank first page on my book?
Hi.
From what I see the problem is that the cover page you want to insert is placed centered as normal text. This has at least two possible problems. The first: the
However, since you already use custom page settings LyX has loaded geometry which will allow us to temporarily set the page margins to zero and restore the previous geometry after inserting the pdf. For this place
and call
This worked for me in a test file based on the one you posted earlier.
Regards
From what I see the problem is that the cover page you want to insert is placed centered as normal text. This has at least two possible problems. The first: the
{center}
environment that LyX uses might insert additional vertical space which is unwanted here. So revert the paragraph for the included page to normal (= justified) settings and make also sure that no indent is inserted. The second: the page has none-zero margins which means the inserted pdf is still to big.However, since you already use custom page settings LyX has loaded geometry which will allow us to temporarily set the page margins to zero and restore the previous geometry after inserting the pdf. For this place
\newgeometry{margin=0pt}
before the include pdf and \restoregeometry
after it. Keep in mind that \restoregeometry
internally calls \clearpage
which means that now you'll get an empty page after the cover page. If you don't want that (although it is very common for many books) some patching is necessary. Put the following code into your preamble:
Code: Select all
Code, edit and compile here:
\usepackage{etoolbox}\let\oldgeometry\restoregeometry\patchcmd\oldgeometry{\clearpage}{}{}{}
\oldgeometry
after the included pdf instead.This worked for me in a test file based on the one you posted earlier.
Regards
site moderator & package author
-
- Posts: 128
- Joined: Wed Jul 04, 2012 5:34 pm
Why is there a blank first page on my book?
I don't think it has anything to do with having it centered. I set the thing to default (i.e. left justified). And it still generates a blank page. As a side note, (because I don't want to get into it here) when I adjust the inserted jpg or pdf so that its left justified and not centered, it also automatically left justifies the title on the next page as if they were both the same unit.
Cgnieder, you are telling me many things. I'm not sure if I'm supposed to pick one specific thing you mentioned. Or do I do all of those things at the same time?
Edit: I figured out I needed to set paragraph settings to default (left justified) and then enter the preamble:
as well as \newgeometry{margin=0pt} before and \oldgeometry after the inserted document. This actually worked, but now I have the problem I described above where the title on the second page is also automatically left justified.
I would upload the cover file, but apparently the pdf version and the jpg version each exceed the maximum allowed size of 400KiB
Cgnieder, you are telling me many things. I'm not sure if I'm supposed to pick one specific thing you mentioned. Or do I do all of those things at the same time?
Edit: I figured out I needed to set paragraph settings to default (left justified) and then enter the preamble:
Code: Select all
Code, edit and compile here:
\usepackage{etoolbox}\let\oldgeometry\restoregeometry\patchcmd\oldgeometry{\clearpage}{}{}{}
as well as \newgeometry{margin=0pt} before and \oldgeometry after the inserted document. This actually worked, but now I have the problem I described above where the title on the second page is also automatically left justified.
I would upload the cover file, but apparently the pdf version and the jpg version each exceed the maximum allowed size of 400KiB
FYI:
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class
-
- Posts: 128
- Joined: Wed Jul 04, 2012 5:34 pm
Why is there a blank first page on my book?
Just thought I'd bump this, because I'm still completely stumped by this. When I left justify the cover image I get the desired outcome (no blank first page), however the left justification also automatically left justifies the title on the following page, which needs to be centered. It's as if Lyx is treating the cover image and the title on the following page as one unit.insipidtoast wrote: I figured out I needed to set paragraph settings to default (left justified) and then enter the preamble:Code: Select all
Code, edit and compile here:\usepackage{etoolbox}\let\oldgeometry\restoregeometry\patchcmd\oldgeometry{\clearpage}{}{}{}
as well as \newgeometry{margin=0pt} before and \oldgeometry after the inserted document. This actually worked, but now I have the problem I described above where the title on the second page is also automatically left justified.
I would upload the cover file, but apparently the pdf version and the jpg version each exceed the maximum allowed size of 400KiB
How can I get lyx so that it does not left justify the title on the following page when I left justify the cover image?
FYI:
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class