Graphics, Figures & TablesCan't add pages from PDF file with »pdfpages« package

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
kaiserschwarcz
Posts: 8
Joined: Sat Oct 16, 2010 1:24 am

Can't add pages from PDF file with »pdfpages« package

Post by kaiserschwarcz »

Hi, there.

I'm having a issue with adding pdf pages from an external pdf to my document. I used the package pdfpages and the command

Code: Select all

\includepdf[pages={1-11}]{01-form1_08-2010b.pdf}
But in the final pdf all that I get is 11 blank pages (at the place I'd expected to have the pdf insertion) followed by my document. What am I doing wrong? The archives are in the tar.

PS: I'm using a makefile to compile.
Attachments
01-form1_08-2010b.pdf.tar.gz
(156.93 KiB) Downloaded 468 times
part1.tar.gz
(51.84 KiB) Downloaded 459 times

Recommended reading 2024:

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

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

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Can't add pages from PDF file with »pdfpages« package

Post by frabjous »

Please reduce the problem to a minimal working example. If I simply do:

Code: Select all

\documentclass{article}
\usepackage{pdfpages}
\begin{document}
Some text beforehand

\includepdf[pages={1-11}]{01-form1_08-2010b.pdf}

Some text afterwards
\end{document}
everything works fine. Does that work for you?

Sorry but I'm too lazy to look through some large multi-file project with a Makefile and try to figure out what in there causes the problem. It would make more sense for you to work on creating a minimal example instead.
Frits
Posts: 169
Joined: Wed Feb 02, 2011 6:02 pm

Re: Can't add pages from PDF file with »pdfpages« package

Post by Frits »

That's strange. I downloaded your files and then put everything in one folder. Then excluded the '\input{title.tex}', because it gave me an error. When I compiled the main.tex, it worked fine..

EDIT: frabjous was faster... ;-)
howtoTeX.com - Your LaTeX resource site (Tips, Tricks, Templates and more!)
Follow howtoTeX on twitter
kaiserschwarcz
Posts: 8
Joined: Sat Oct 16, 2010 1:24 am

Can't add pages from PDF file with »pdfpages« package

Post by kaiserschwarcz »

Frits, that didnt work here, even without the "\input{title.tex}". I still get the blank pages.

How did you compiled? Did you used my makefile?

Here it is the minimal working example:

Code: Select all

\documentclass[11pt, titlepage, onecolumn, a4paper]{article}
\usepackage[dvips]{graphicx}
\usepackage[final]{pdfpages}
\begin{document}
\includepdf[pages={1-11}]{01-form1_08-2010b.pdf}
\include{...
....
\end{document}
Frits
Posts: 169
Joined: Wed Feb 02, 2011 6:02 pm

Re: Can't add pages from PDF file with »pdfpages« package

Post by Frits »

I compile using Pdflatex
howtoTeX.com - Your LaTeX resource site (Tips, Tricks, Templates and more!)
Follow howtoTeX on twitter
kaiserschwarcz
Posts: 8
Joined: Sat Oct 16, 2010 1:24 am

Can't add pages from PDF file with »pdfpages« package

Post by kaiserschwarcz »

Hmm. Well, pdflatex did work to include the external pdf pages :)

But it gave two other problems. I get missing bibliography references. My bibioglaphy is in a archieve called biblidoc.bib . When I tried to run bibtex I get this:

Code: Select all

$ bibtex biblidoc.bib
I couldn't open file name `biblidoc.bib.aux'
$ bibtex main2.tex
I couldn't open file name `main2.tex.aux'
Also, the table of contents is now in blank. :cry:

Minimal working example

Code: Select all

\documentclass[11pt, titlepage, onecolumn, a4paper]{article}
\usepackage[dvips]{graphicx}
\usepackage[final]{pdfpages}
\begin{document}
\includepdf[pages={1-11}]{01-form1_08-2010b.pdf}
\include{...
....
\bibliographystyle{abnt}
\bibliography{biblidoc}
\end{document}
Frits
Posts: 169
Joined: Wed Feb 02, 2011 6:02 pm

Re: Can't add pages from PDF file with »pdfpages« package

Post by Frits »

I don't work a lot with BibTeX, but I know that you'll need to do some additional stuff to get BibTeX working with pdflatex.
I use Texmaker as an editor and it has a shortcut to execute the BibTeX. Running this before compiling with pdflatex solves the problem I believe. You could also run both BibTeX and pdflatex in a makefile command.
howtoTeX.com - Your LaTeX resource site (Tips, Tricks, Templates and more!)
Follow howtoTeX on twitter
kaiserschwarcz
Posts: 8
Joined: Sat Oct 16, 2010 1:24 am

Can't add pages from PDF file with »pdfpages« package

Post by kaiserschwarcz »

UHUUUUUUUUU!!!!!!!!!! I did it!!! :D

I simply changed and simplified my make file so it now looks like this:

Code: Select all

# $Id: $

FILE = main2
# Change "main2" for your main tex document name

all:
		pdflatex  $(FILE)
		bibtex $(FILE)
		pdflatex  $(FILE)
		pdflatex  $(FILE)
		pdflatex  $(FILE)
		
clean:
	rm -f *.log *.aux *.toc *.lo[fpt] *.blg *.bbl \
	*.ind *.ilg *.idx *.glo *.gls 

allclean: clean
	rm -f $(FILE).dvi $(FILE).ps $(FILE).pdf $(FILE).tex~ $(FILE).bib~

tarball:	
		tar -zcvf defesa.tar.gz *.tex *.ps *.eps *.sty *.bib *.bst Makefile
That did all that I wanted.
The title.tex error its a simple incompatibility of pdflatex with eps images. Converting the eps images to jpg and making the apropiated changes in the code did the job.

Thank you all!!!
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: Can't add pages from PDF file with »pdfpages« package

Post by frabjous »

In case it wasn't clear from the error, you don't run bibtex on the .bib file; you run it on the .aux file that is created after you first run (pdf)latex. So if it were main.tex, you'd run pdflatex main.tex, then bibtex main.aux, etc. If you leave the extensions off, then it'll add the right ones, which I think is what you're doing now.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Can't add pages from PDF file with »pdfpages« package

Post by localghost »

kaiserschwarcz wrote:[…] I did it!!! […] I simply changed and simplified my make file so it now looks like this […] That did all that I wanted. […]
Then please mark the topic accordingly as written in Section 3 of the Board Rules (to be read before posting).
kaiserschwarcz wrote:[…] The title.tex error its a simple incompatibility of pdflatex with eps images. Converting the eps images to jpg and making the apropiated changes in the code did the job. […]
Conversion of the EPS files to PDF with the epstopdf command line tool or the epstopdf package "on the fly" would make more sense. This way you would still benefit from the vector character of the images.


Best regards and welcome to the board
Thorsten
Post Reply