TransWikia.com

How to create a Tex file whose only content is a referenced pdf file

TeX - LaTeX Asked by nemesisfixx on December 9, 2020

This could as be a hypothetical use case, however, I found myself needing this:

Take a pdf file, PDF1, originally created from say an MS Word document WD1, and then create a tex source file, TS1, that can also produce the exact contents of PDF1.

This is somewhat hackish, but if tex can render images linked to in the tex source, then perhaps it can also render linked pdfs. Thus, where a pdf already exists, the tex for producing the pdf can be authored thus. However, if there is a more direct method of creating a TS1 from WD1 without the intermediate PDF1, that should be a better method.

Thanks.

One Answer

If I understand you correctly, you want to include a PDF to your LaTeX document as you would include a picture.

This is possible with the pdfpages package.

The usage of the package is very straight forward:

documentclass{article}
usepackage{pdfpages}

begin{document}

    includepdf[⟨options⟩]{⟨filename⟩}

end{document}

There are various options to choose from, for example the pages. As a default, the first page of your document will be included, but you can also include all the pages by setting pages = -, or the first 3 pages with pages = {1-3}.

Have a look at the manual for all the options.

Correct answer by Sam on December 9, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP