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.

  • 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 8 at 12:28
  • 2
    Hi, did you have look at this topic : tex.stackexchange.com/questions/105589/… ? It seems that the package pdfpages could solve your problem. See more over pdfpages on CTAN : ctan.org/pkg/pdfpages – Piroooh Nov 8 at 12:30
  • 1
    Hi @Sebastiano Thanks for your kind welcome. I edited my question. – Marco Ferrari Nov 8 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 8 at 13:06
  • 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 8 at 13:14

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.

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.

  • 1
    Look at the pdfpages package – JPi Nov 8 at 13:23

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.