2

I am using pdfinclude package for including pdf file into latex document.

The problem is: The pdf file is being pushed into the next page and not being able to attach it into the same page. I want to make it to resize itself as per the space it has.

Can it be done?

Here is the reproducible code:

\documentclass[paper=a4, fontsize=11pt]{scrartcl} % A4 paper and 11pt font size

\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage{fourier} % Use the Adobe Utopia font for the document
\usepackage[english]{babel} % English language/hyphenation 
\usepackage[final]{pdfpages}
\usepackage{graphicx}

\section{Problem Statement}

\includepdf[pages=1-]{problem}
\end{document}
  • 3
    The reason is: the section title "Problem Statement" takes some space on a page. Yet \includepdf inserts a full new page: there is thus not enough space for both of them on a single page. The only way for \includepdf to have an empty page to fill is to start a new one. As an alternative solution, you might want to include the first page of this pdf as an image via \includegraphics. – ebosi Jun 21 '17 at 16:53
  • Glad I helped. Would you mind providing a full minimal working example (MWE) in your answer? This will help futur users use your contribution (e.g. make them not forget to write \usepackage{graphicx})? – ebosi Jun 21 '17 at 17:05
  • Thank you for posting a working example! At the same time, much of your code does not seem to be relevant to the question you're asking here. Please limit the example to only the code required for your issue to appear. You can have a look at this guide for how to prune your code for this purpose. – Martin Schröder Jun 22 '17 at 8:45
2

As "@ebo" mentioned in the comment.

I used graphicx package which has lot of options.

The guide for graphicx package can be found here

The solution for the above question is just to scale the pdf file:

\includegraphics[scale=0.6, page=1]{problem.pdf}

So the complete code would be:

%----------------------------------------------------------------------------------------
%   LOAD PACKAGE SECTION
%----------------------------------------------------------------------------------------

\documentclass[paper=a4, fontsize=11pt]{scrartcl} % A4 paper and 11pt font size

\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage{fourier} % Use the Adobe Utopia font for the document
\usepackage[english]{babel} % English language/hyphenation 
\usepackage[final]{pdfpages}
\usepackage{graphicx}

%----------------------------------------------------------------------------------------
%   PROBLEM 1
%----------------------------------------------------------------------------------------

\section{Problem Statement}

\includegraphics[scale=0.6, page=1]{problem.pdf}

%----------------------------------------------------------------------------------------

\end{document}
  • 1
    Not just to scale, but use includegraphics instead of includepdf, which applies \clearpage first. I would also recommend posting a complete code to the answer, i. e. anybody can copy-paste it to work. And at last: you should type @ebo, not "ebo", if you want to reference a person. An the last thing: names of the packages are usually put in ` signs to look like this. – Michael Fraiman Jun 21 '17 at 17:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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