1

i've got an issue. I'm writing a LaTeX document, i would like to make a page of my final document as a pdf file (that is a text). I searched on this site but no one of the existing topic helped me.

I tried to use \input, \include, and \includegrapics{file.pdf} but it doesn't work.

If i use the latest command (\includegraphics) it looks like: results

So the image respect my margins and my page style.

How can I solve this??

Thanks

Update with the code:

   \documentclass[11pt]{article}
   \usepackage{graphicx}
   \usepackage{fancyhdr}
   \usepackage{vmargin}
   \setmarginsrb{2 cm}{2.5 cm}{2 cm}{2.5 cm}{1 cm}{1.5 cm}{1 cm}{1.5 cm}
   \pagestyle{fancy}
   \fancyhf{}
   \rhead{}
   \lhead{}
   \cfoot{\thepage}
   \begin{document}
   \input{Lab3/Lab3}
   \newpage
   \includegraphics{Lab4/traccia4.pdf}
   \newpage
   \input{Lab4/Lab4}
   \end{document}

I'm working with \input.

BambOo
  • 8,801
  • 2
  • 20
  • 47
  • 1
    Welcome into TeX.SE users' site. Welcome again to our site. Please can you put your complete code (see MWE) or add the code you're working on? Thank you. – Sebastiano Nov 08 '18 at 12:28
  • 2
    Hi, did you have look at this topic : https://tex.stackexchange.com/questions/105589/insert-pdf-file-in-latex-document ? It seems that the package pdfpages could solve your problem. See more over pdfpages on CTAN : https://ctan.org/pkg/pdfpages – Piroooh Nov 08 '18 at 12:30
  • 1
    Hi @Sebastiano Thanks for your kind welcome. I edited my question. – Marco Ferrari Nov 08 '18 at 13:04
  • Hi @Piroooh i had a look at that topic, i will try again, but i though that there is a faster way to do it. – Marco Ferrari Nov 08 '18 at 13:06
  • As @Piroooh suggests i tried the answer to that topic with : \usepackage{ifthen} \setboolean{@twoside}{false} \includepdf[pages=1, offset=75 -75]{Lab4/traccia4.pdf} – Marco Ferrari Nov 08 '18 at 13:14
  • 4
    @MarcoFerrari, \input and \include bascally insert a tex file into another one so this is not what you need. You should use pdfpages for your needs – BambOo Nov 08 '18 at 13:14

2 Answers2

2

You want to include a PDF file who is not a .tex file. The two commands \input and \include just put a .tex file at the position of the command. Really convenient to shorten a .tex project and separate parts but useless to include pdf.

\includegraphics[]{} is for picture. PDF file can act like a picture but the command will respect your previous geometry option. As if you put a normal picture.

What you are looking for is to include a PDF as a part of your PDF file. The package pdfpages can help you.

You do not have to include ifthen package. Try this following code :

   \documentclass[11pt]{article}
   \usepackage{graphicx}
   \usepackage{fancyhdr}
   \usepackage{vmargin}
   \setmarginsrb{2 cm}{2.5 cm}{2 cm}{2.5 cm}{1 cm}{1.5 cm}{1 cm}{1.5 cm}
   \pagestyle{fancy}
   \fancyhf{}
   \rhead{}
   \lhead{}
   \cfoot{\thepage}
   \begin{document}
   \input{Lab3/Lab3}
   \newpage
   \includepdf[pages=-, offset=50 -75]{Lab4/traccia4.pdf}
   \newpage
   \input{Lab4/Lab4}
   \end{document}

And change the offset option as you want. First value sets an horizontal space and second one a vertical space.

Piroooh
  • 1,197
1

As @Piroooh suggests i tried the answer to that topic with :

   \usepackage{ifthen}
   \setboolean{@twoside}{false}
   \includepdf[pages=1, offset=75 -75]{Lab4/traccia4.pdf}

And it works, but it's not the same page as the pdf file, it is good, but a little different.