3

I want to have a centred title page for my twoside report document and I am following these instructions:

Centered title page in twoside report

Here is a minimum (not) working example:

\documentclass[twoside]{report}

\usepackage{auto-pst-pdf}
\usepackage{pdfpages}
\usepackage{ifpdf}

\ifpdf
  \usepackage{tikz}
\else
  \usepackage{pst-eucl}
\fi

\begin{document}

\includepdf{pdf-sample.pdf}

\tableofcontents

\newpage

\chapter{Introduction}

This is content.

\end{document}

But the first page appears to be blank. As soon as I remove either \ifpdf... or \usepackage{auto-pst-pdf}, the title page appears in my document. I use pdflatex --shell-escape for compiling. Unfortunately, I need both options for my document. Any help how to work around this problem will be appreciated.

Alfred
  • 31
  • Welcome to TeX.SX! What does pdf-sample.pdf contain? Is it a huge file? –  Aug 04 '14 at 14:32
  • It is just an example for testing. You can download it here: http://www.hollywood-arts.org/wp-content/uploads/2014/05/pdf-sample.pdf – Alfred Aug 04 '14 at 14:33

1 Answers1

1

that is a bug in the current tikz. Use:

\listfiles
\documentclass[twoside]{report}
\usepackage{auto-pst-pdf}
\usepackage{pdfpages}
\usepackage{tikz}
\usepackage{pst-eucl}
\begin{document}

\includepdf{pdf-sample.pdf}

\tableofcontents   
\newpage
\chapter{Introduction}

This is content.   
\end{document}

However, this gives a warning that auto-pst-pdf cant create a file. But that doesn't hurt, because there is no file to create ...

  • 1
    I tried this solution, but it does not solve the problem. The first page is still blank. – Alfred Aug 04 '14 at 15:04
  • not for me. I am using up-to-date TeXLive 2014 –  Aug 04 '14 at 15:07
  • Me too: pdfTeX 3.14159265-2.6-1.40.15 (TeX Live 2014) – Alfred Aug 04 '14 at 15:14
  • Try \ifpdf\includepdf{pdf-sample.pdf}\fi. However, here is my generated PDF: http://comedy.dante.de/~herbert/tmp/test.pdf –  Aug 04 '14 at 15:59
  • I am sorry, but the problem still there. – Alfred Aug 04 '14 at 16:10
  • Herbert, your code does nothing if auto-pst-pdf is loaded, so what is its intention? – Ulrike Fischer Aug 04 '14 at 16:17
  • provide your file list. You get it with \listfiles in the preamble at the end of your log file. And what happens if you write a single word before \includepdf? Is the empty page still there? –  Aug 04 '14 at 16:18
  • @Ulrike, I konw. But if I understand Alfred well, then the above code creates an empty page before \includepdf –  Aug 04 '14 at 16:20
  • No it creates an empty page instead of the \includepdf. \includepdf works again if one moves pdfpages behind tikz (the problem seems to be atbegshi: if is loaded before tikz, tikz reverts the atbegshi code). – Ulrike Fischer Aug 04 '14 at 16:36
  • @UlrikeFischer: Ah ok. However, I get a correct output with the included pdf page. Working under Linux and TL –  Aug 04 '14 at 16:39
  • @Alfred: my fault. I'd forgotten that I fixed the pgfutil-latex.def file of tikz in my local tree. However, put the http://comedy.dante.de/~herbert/tmp/pgfutil-latex.def into your documents directory and try again with my edited example above. –  Aug 04 '14 at 16:53
  • It make a lot more sense if the code is in the def ;-). But is it safe to disable the preview "hack" completly when auto-pst-pdf is loaded? – Ulrike Fischer Aug 05 '14 at 14:38
  • @UlrikeFischer: yes –  Aug 05 '14 at 14:42
  • And do you know why? What does auto-pst-pdf do that removes the necessity of the hack? pgf probably didn't add it only for fun ;-). – Ulrike Fischer Aug 05 '14 at 14:46