Suppose i have a complete document containing 100 pages. i want to replace 48th page with another PDF file (just one page). Replacing here means i delete the 48th page and put a new page. That new page is the PDF file that i'm talkng about. I know i can use PDF editor like Adobe Acrobat or anything else, but my point here is what if i need to change my document like revising or adding another page? So, it must be done in the raw document using TeX editor.

Idk if it's necessary, but here's my MWE (it's not 100 pages)

\usepackage{pgf, tikz}
\usepackage[a4paper, inner=4cm, outer=3cm, top=4cm, bottom=3cm]{geometry}


\renewcommand{\contentsname}{DAFTAR ISI}
\renewcommand{\listtablename}{DAFTAR TABEL}
\renewcommand{\listfigurename}{DAFTAR GAMBAR}


  • You've tagged this pdfpages, which is what you should use. Why aren't you using that in your document? (BTW, a MWE doesn't need most of those packages.)
    – Teepeemm
    Apr 9, 2021 at 22:25
  • @Teepeemm that was just a MWE that i copied from my full document and i didn't remove some packages cz i'll need it later. And about the tag, i don't really have an idea about what i should put on. So, i just writing PDF and randomly i chose that. Doesn't really know what it means. Sorry
    – user516076
    Apr 9, 2021 at 22:27
  • You need to copy all the pages but one from one document, and the page to be replaced from the other, creating a new document. Apr 9, 2021 at 22:32
  • @JohnKormylo my teacher is using some kind of plagiarism tool. If i put my whole document here, i'm going to get 100% plagiarized. Sorry but i can't. And about what page i should to change, i've tried to compile my MWE, suppose i want to change page iii. Or maybe just put a newpage and then replacing that page with another PDF file. Thanks.
    – user516076
    Apr 9, 2021 at 22:37
  • 1
    Adding a single page is easy using pdfpages. Replacing a page is plagiarism or possibly forgery. Apr 9, 2021 at 22:44

1 Answer 1


You can use the atbegshi package to tap into the shipout routine. At that stage, the page number is accurate, where you can condition on including something from a different document by placing it in the foregrounds of the current page.

enter image description here





  • +1: I hope my edit is ok, if not, then I will undo it. Apr 10, 2021 at 2:03

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.