Graphics, Figures & TablesInsert a pdf-file

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
rudrales
Posts: 16
Joined: Wed Mar 11, 2009 1:52 am

Insert a pdf-file

Post by rudrales »

First of all, sorry for my English. I'm not a native English speaker.

I'm writing a documentation and the documentation has an appendix. I like to add some data sheets to the appendix which I've only as a pdf-file. The pdf-file has several pages and I need all pages for my documentation.

My question: Can I include the whole pdf-file with one command to my documentation?

Thanks for all answers

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Insert a pdf-file

Post by gmedina »

Hi,

this seems to be a job for the pdfpages package. Take a look at the package documentation.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
rudrales
Posts: 16
Joined: Wed Mar 11, 2009 1:52 am

Re: Insert a pdf-file

Post by rudrales »

Thanks, I'm going to read in the doc. I hope I can solve the problem with the doc.

*************************
=> Fibonacci numbers
rudrales
Posts: 16
Joined: Wed Mar 11, 2009 1:52 am

Re: Insert a pdf-file

Post by rudrales »

I think I found the command in the doc which I was looking for:
\usepackage{pdfpages}
\includepdf[pages=-]{doc_XY.pdf}

Thank you again for the link to the doc
natlatex
Posts: 1
Joined: Thu Sep 08, 2011 11:52 am

Re: Insert a pdf-file

Post by natlatex »

Hi,

i am also trying to insert pdf files in latex using pdfpages package.

But using

\includepdf[pages..]{file_name}

it only includes empty pages.

Does anyone have any idea how to solve this?
Ailicec
Posts: 18
Joined: Wed Jan 18, 2012 12:16 pm

Insert a pdf-file

Post by Ailicec »

Have you solved this?

You need to make sure you have all the requirements in the pdfpages documentation. You also need to make sure that you do not compile to DVI and convert to PDF. You need to compile directly to PDF (with PDFLaTeX).
rommelmoros3
Posts: 2
Joined: Wed May 23, 2012 5:37 pm

Insert a pdf-file

Post by rommelmoros3 »

Hello everyone, I'm trying to include in my latex document 3 graphics that are on the same document. Pdf. I'm working under a loop, in order to generate n cycles of graphics, so I am working with the command \ includepdf {}. The problem is that it generates distorted graphics, fuzzy, messy, a total disaster. Please who can guide me to solve the problem would greatly appreciate it, took several days trying :cry: . Then I show the script that I am using:

Code: Select all

###Define the pdf files to be generated
file=paste("comunalRazPred",j,".pdf",sep="")
pdf(file=file, paper="special", width=6, height=6)

###Define the graphs to be generated (loops)
for(j in 1:length(comraz)) {
      par(mfrow=c(2,2))
      comr<-comj[comj$RAZA==names(comraz)[j],]

      for(i in 1:4) {
      comri<-comr[comr$tipo==levels(comr$tipo)[i],]
      comrti<-tapply(comri$n,comri$mesabrev,sum)
      comrti[is.na(comrti)]<-0
      comrti0<-tapply(comri$n,list(comri$comunal,comri$mesabrev),sum)
      comrti0[is.na(comrti0)]<-0
      comrti1<-round(prop.table(comrti0,2)*100,0)
      ymax<-floor(max(comrti)+(0.3*(max(comrti))))
      barcomri<-barplot(comrti0,las=1,ylab="nº de reses",ylim=c(0,ymax),
       main=paste(names(comraz[j])," ",levels(comr$tipo)[i]),cex.names=0.7,cex.axis=0.8)

        valeje<-min(b[a>ymax])
        abline(h=seq(from=0,to=ymax,by=valeje),lty=2,
          col="lightgrey")
        par(new=T)
      barcomri<-barplot(comrti0,las=1,ylim=c(0,ymax),cex.names=0.7,cex.axis=0.8)
        text(barcomri,comrti,comrti1[2,],cex=0.5,pos=3)
        legend("top",c("en explotación","en comunal"),box.lty=0,fill=grey.colors(2),
          horiz=T)
          }  }

### THEN COMES MY PROBLEMS

### INCLUSION OF THE GENERATED GRAPHICS

dev.off()

       cat("\\begin{figure}[htb]")
       cat("\\begin{center}")
       cat("\\includepdf[pages={-}]{",file,"}\n",sep="")
       cat("\\caption{Evolución mensual en el número de reses segun su raza, tipo y localización}", sep="")
       cat("\\end{center}")
       cat("\\end{figure}")
Please help!
Last edited by Stefan Kottwitz on Thu May 24, 2012 9:25 am, edited 1 time in total.
Post Reply