Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
83

Loading the graphicx package in the preamble it is possible to import PDF images in the document: \documentclass{article} \usepackage{graphicx} \begin{document} \includegraphics[<options>]{filename.pdf} \end{document} Here <options> can be e.g. width=<width>, height=<height or page=<page number>. See the Graphics Guide for ...


77

You can crop/trim a pdf when including it using the trim=left botm right top. Full example: \begin{figure}[htbp] \centering \includegraphics[clip, trim=0.5cm 11cm 0.5cm 11cm, width=1.00\textwidth]{gfx/BI-yourfile.pdf} \caption{Title} \label{fig:somthing} \end{figure} Note: Figuring out how far to trim can take time. To speed things ...


53

I did it this way with package pdfpages: \includepdf[pages=-,pagecommand={},width=\textwidth]{file.pdf}


48

\includepdf[pages=1-10, angle=90, pagecommand={}]{requirements/Requirements.pdf} Add pagecommand={} as one of your options


47

I found the solution : \setboolean{@twoside}{false} And \includepdf[pages=-, offset=75 -75]{file.pdf} And it works !


37

pdfpages provides the pagecommand option for \includepdf, which can be used to apply a page style for each page, to print headings and more. For example, add plain page style or your own page style to get page numbers on all included pages: \includepdf[pages=-,pagecommand=\thispagestyle{plain}]{filename}


36

You can use the pagecommand key to declare the desired page style for the included pages: \documentclass{book} \usepackage[a6paper]{geometry}% just for the example \usepackage{fancyhdr} \usepackage{pdfpages} \pagestyle{fancy} \fancyhf{} \fancyhead[C]{Some centered header} \fancyfoot[C]{\thepage} \begin{document} \includepdf[pages=-,pagecommand={\...


31

For me the following worked just fine: \includepdf[pages=1,pagecommand=\section{Section Heading}]{testpdf} \includepdf[pages=2-,pagecommand={}]{testpdf}


30

Have a look at the pdfpages package \documentclass{article} \usepackage{pdfpages} \begin{document} \includepdf[<options>]{<file>} Your Text \end{document} Edit Miguel suggested graphicx to include a graphic which is correct, the difference between graphicx and pdfpages is that graphicx puts the PDF as a graphic on a text page (maybe ...


28

As already said by others in the comments you need to use \includegraphics directly because \includepdf uses a page of its own. You can use a tabular to get the 2x2 layout and use the page=<number> key to select the page: \documentclass{article} \usepackage{graphicx} \usepackage{blindtext} \begin{document} \blindtext \begin{figure}[h] \centering ...


27

If you need page numbers at the bottom, \includepdf[pagecommand={\thispagestyle{plain}}, pages=1-10, angle=90]{requirements/Requirements.pdf} Change "plain" to "headings" if you are in the report or book class and want for the included pages the same style as the others.


27

The inserted link is a hyper-link, not a LaTeX \label. Therefore the \hyperlink macro works but not the \pageref. I don't think you can get the page information from a hyper-link, so I think you need to add \labels manually. This can be done best using the pagecommand key and a custom counter: \documentclass{article} \usepackage{hyperref} \usepackage{...


27

EDIT ... include a more sinister version... I'm not sure if this is what you want. Strictly speaking, this file does not include itself. It includes its own output. This is what your images suggest you want but your description is ambiguous. Anyway, since you mention using this with bashful, I thought I might as well use bashful. This needs to be ...


24

Using your current settings, the pdfpages inserts the pages of an external PDF file as full page additions to your existing document. That is, the external file page setup is copied to the "main" output PDF on a page-by-page basis. The "main" file's page setup (including header/footer) is ignored. If you wish to include the same header/footer style of your ...


22

You can create entries in the table of contents (TOC) when importing a PDF. Here is an example: \documentclass{article} \usepackage{pdfpages} \begin{document} \tableofcontents \includepdf[pages=-,addtotoc={ 1,section,1,First Section Entry,p1, 1,subsection,1,Subsection Entry,p2, 2,section,1,Second Section Entry,p3}] {publishing-...


21

Apologies to David Gilmour \documentclass[tikz,border=4mm]{standalone} \begin{document} \def\dsotm{\node[scale around={\x:(0,-1)}, draw=white,ultra thin] at(0,0){\includegraphics[height=4cm]{dsotm}};} \tikz{\foreach\x in{2,1.75,...,0.25}{\dsotm}} \end{document}


20

\documentclass[a4paper]{article} \usepackage[1-10]{pagesel} \begin{document} % text \end{document} Thanks to Heiko Oberdiek. Remember, though, that references and table of contents will be incomplete. An alternative way is to compile the whole document and load its first ten pages in another one via pdfpages.


20

As mentioned by JLDiaz, you should use the nup option. According to the pdfpages documentation, the syntax of the option is: nup=(xnup)x(ynup), where (xnup) and (ynup) specify the number of logical pages in horizontal and vertical direction. You may also want to use the landscape option in order to switch to landscape orientation and avoid twisting the neck ...


19

If the coordinates of the valuable parts in your PDF images is fixed, then the following method can be automated. Use the following template to trim or crop images and compile it with xelatex. You will get 2 pages, one for navigation and the other one is the cropped image. % cropping.tex \documentclass{article} \usepackage{pstricks} \usepackage{graphicx}...


18

Use in the document with pdfpages \pdfinclusioncopyfonts=1. (The source of the problem is that two fonts of libertine now have the same internal fontname, and this leads to problems).


18

About the tilde: Apparently the ~ is taken in its usually meaning, not as literal ~. I get a Package pdfpages Error: Cannot find file `test\nobreakspace {}it' error for a test~it file. Taking the filename verbatim should help. This can be done by \Verbdef from the newverbs package: \usepackage{newverbs} % ... \Verbdef\filename{C:/Users/MYUSER~1/AppData/...


18

Spaces at file names of PDF files at \includegraphics or \includepdf are allowed, if you are using package grffile: \usepackage{grffile} \usepackage{pdfpages} % … \includepdf[pages=-]{test this.pdf} And for more verbatim interpretation of the file name you may use \detokenize: \usepackage{grffile} \usepackage{pdfpages} % … \includepdf[pages=-]{\detokenize{...


18

The default pagecommand uses \thispagestyle{empty} which disables page numbers, headers and footers etc. You can use pagecommand={} to overwrite this and get normal layout for these pages.


18

You either need to specify the full path e.g.: \includepdf[pages={1-7}]{/home/bob/Documents/MyFolder/Resources/myfile.pdf} or specify it relative to the current directory e.g. suppose your document is /home/jane/mydirectory/mydoc.tex and you need to include /home/jane/myotherdirectory/Resources/myfile.pdf then: \includepdf[pages={1-7}]{../myotherdirectory/...


18

A bit out of topic, since it is a MetaPost example and it is not strictly speaking a picture including itself recursively but I could not resist to have a go at it, however clumsy, the visual effects being addictive! I've borrowed the original heart-shaped picture's coding from the documentation of Stephan Hennig's wonderful texpath package, and slightly ...


17

You could use the pagecommand option of \includepdf: \includepdf[pages=1,pagecommand={\section{title}}]{filename} \includepdf[pages=2-]{filename} Extend pagecommand as desired. The second \includepdf line includes the remaining pages without the page command. You could also use the pagecommand option for setting hyperlink targets or bookmarks using ...


17

You can use pdfpages package. \documentclass{article} \usepackage{pdfpages} \begin{document} \includepdf[pages=2]{bplot.pdf} \end{document} The [pages=2] displayes the first page. To insert multiple pages, insert a list such as [pages={1,4}] or a range such as [pages={1-4}]. Check the pdfpages manual for details on package and command options.


Only top voted, non community-wiki answers of a minimum length are eligible