9

Is there a way to suppress the first page of my output pdf in latex and start on the second page?

Thank you

6
  • 1
    I am not sure I follow: do you want to import an existing PDF file into your document, beginning with page 2? Or suppress the first page of your output? – Ingmar Apr 11 at 9:59
  • 3
    What exactly are you trying to do? Do you want to include an external pdf into your tex document? How do you want to include your file (includepdf, includegraphics, ...)? – Οὖτις Apr 11 at 10:02
  • 1
    I am trying to suppress the first page of my output. – Sarah Apr 11 at 12:32
  • 2
    But why are you trying to do this? The first page is the most useful part of the document. Are you trying to have a different first page? What will it be? How are you intending to create the final document with the different first page? Or is there something else going on? – Teepeemm Apr 11 at 16:44
  • 2
    What exactly is on the first page? Is it a titlepage, for example created through the \make title command? – leandriis Apr 12 at 5:50
19

The simplest way is to use the pagesel package. In your preamble write:

\usepackage[2-:]{pagesel}

In the optional argument, the 2-: means print pages 2 through the end of the document. Other options include giving a single number to print a single page, a range, e.g., 2-4, or writing -4 will be from the beginning through page 4. Multiple ranges can be specified, separated by commas, e.g., 3, 5-7, 14-:.

11

EDIT: As inspired by Frank Mittelbach's comment below (but he has a typo in it), this can be simplified to:

\AddToHookNext{shipout/before}{\DiscardShipoutBox}

If you mean not outputting the first page that LaTeX generates to the PDF file, but only pages 2 and following:

\AddToHook{shipout/before}[nofirstpage]{\SkipFirstPage}
\newcommand\SkipFirstPage{\DiscardShipoutBox\RemoveFromHook{shipout/before}[nofirstpage]}

You put both commands best before \begin{document}. \AddToHook is a command that specifies that something has to be done at a specific point in the future, in this case just before a page is written to the PDF (or DVI) file. And in this case it specifies to throw away the page (\DiscardShipoutBox), and then not to do this on the following pages (by removing the hook code).

5
  • Thank you, but I do not know what: \AddtoHook is, I know that I have to put the second one before \begin{document}, but where do I put \AddtoHook ? – Sarah Apr 11 at 12:36
  • 1
    I have added some explanation to my answer. – Pieter van Oostrum Apr 11 at 16:40
  • I was going to suggest putting the first page into a savebox. I forgot that it already IS in a savebox. – John Kormylo Apr 11 at 16:46
  • Given that we know it is the "first" page we want to drop you can simply use \AddtoHookNext{shipout/before}{\DiscardShipoutBox} – Frank Mittelbach Apr 13 at 18:54
  • @Sarah for \AddToHook read texdoc lthooks-doc and texdoc ltshipout-doc – Frank Mittelbach Apr 13 at 18:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.