From 83939a88ada553c0548e5bf9df2301959bd834ad Mon Sep 17 00:00:00 2001 From: Tobias Hilfiker Date: Thu, 16 Jan 2025 18:30:26 +0100 Subject: [PATCH] section about importing pdf-files into latex file --- README.md | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c1382a3..d8b609b 100644 --- a/README.md +++ b/README.md @@ -409,4 +409,42 @@ again. See the example below for clarification. This is a text for this header. \input{} -``` \ No newline at end of file +``` + +## Importing external pdf's + +Importing pdfs is especially interesting for attaching sources to your documentation. The most practical way is to use a +special configuration of the `\includegraphics` command. + +```latex +\includegraphics[height=0.9\textheight]{} +``` + +With this configuration you also have enough room to add a header above the included pdf. + +### Importing a selection of pdf pages + +There is a possibility to import only two pages of a pdf into your document. Use the following configuration for this: + +```latex +\includepdf[pages={}, noautoscale=true, scale=0.9, pagecommand={\thispagestyle{fancy}}]{} +``` + +In page range its possible to use a number-range. To include from the first to for example 3rd page you can also use the +keyword `first`. The same is possible with the last page by using the keyword `last`. + +### Importing the whole multipage pdf document + +To import a full pdf document with multiple pages, you need a combination of the above standing commands. This is +because if you want to have a title above the first page, you need to make space for the title. With the +`\includegraphics` command, we make that space by making the height of the float smaller. + +So to import multiple pages of the same document, use the following syntax: + +```latex +\includegraphics[height=0.9\textheight]{} +\includepdf[pages={2-last}, noautoscale=true, scale=0.9, pagecommand={\thispagestyle{fancy}}]{} +``` + +The first command imports the first page of your pdf. The second command includes the 2nd to last page into your main +file. You can also change the page-range of the second command, in case you don't want all pages to the last inculded. \ No newline at end of file