سلام دستور زیر رو بنویس:
به عنوان مثال صفحه 3 تا 5
\includepdf[pages=3-5]{name.pdf}
برای اطلاعات بیشتر فراخوانی pdf بسته pdfpages رو بخوان.
البته بهتره کد برنامه رو آنچه جناب سید احمد موسوی فرمودن بنویسی.
موفق باشی
\documentclass[a4paper,12pt]{report}
\usepackage{listings}
%\usepackage{color}
%\definecolor{codegreen}{rgb}{0,0.6,0}
%\definecolor{codegray}{rgb}{0.5,0.5,0.5}
%\definecolor{codepurple}{rgb}{0.58,0,0.82}
%\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
\lstdefinestyle{mystyle}{
%backgroundcolor=\color{backcolour},
%commentstyle=\color{codegreen},
%keywordstyle=\color{magenta},
%numberstyle=\tiny\color{codegray},
%stringstyle=\color{codepurple},
basicstyle=\footnotesize,
breakatwhitespace=false,
breaklines=true,
captionpos=b,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=2
}
\lstset{style=mystyle}
\begin{document}
\begin{lstlisting}[caption=Gams example]
* IN THE NAME OF GOD THE CLEMENT THE MERCIFUL
sets
j BRANCHES /j1*j3/
k DIVISIONS /DIV1*DIV4/
Q all items /q1*q7/
N(K,q) MAIN INPUTS BELONG TO EACH DIVISION
M(K,q) MAIN OUTPUTS BELONG TO EACH DIVISION
UnionsN(q)
UnionsM(q)
;
Alias (h,k);
Alias (g,k);
Alias (l,j);
*Input data files
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
TABLE Y(J,k,q) main OUTPUTS FOR ALL divisions and BRANCHES
$INCLUDE "F:\2\O.TXT";
TABLE X(J,k,q) main INPUTS FOR ALL divisions and BRANCHES
$INCLUDE "f:\2\I.TXT";
Table Z(j,k,h,q) INTERMEDIATE PRODUCTS
$INCLUDE "F:\2\IntermediateValues.TXT" ;
FILE STR /"D:\results.xls"/ ;
PUT STR;
27 *Introducing link parameters based on input data
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
LOOP(K,LOOP(q,IF(X('J1',k,q),N(K,q)=YES;);););
*Parameter CrdN(k); CrdN(k)=sum(q,N(k,q));
LOOP(K,LOOP(q,IF(Y('J1',k,q),M(K,q)=YES;);););
*Parameter CrdM(k); CrdM(k)=sum(q,M(k,q));
PARAMETER E(k,h,q) links in the network(node-incidence matrice among divisions);
LOOP(K,LOOP(H,LOOP(q, IF(Z('J1',K,H,q) ,E(k,h,q)=1;););););
parameter QI(k,q) Intermediate Input role product indices for DIVk;
LOOP(k,LOOP(q,IF (sum(h,E(h,k,q)),QI(k,q)=1;);););
*Parameter CrdQI(k); CrdQI(k)=sum(q,QI(k,q));
parameter QO(k,q) Intermediate output role product indices for DIVk;
LOOP(k,LOOP(q,IF (sum(h,E(K,H,q)),QO(k,q)=1;);););
*Parameter CrdQO(k); CrdQO(k)=sum(q,QO(k,q));
loop(q,loop(k $(N(k,q)),UnionsN(q)=yes;););
loop(q,loop(k $(M(k,q)),UnionsM(q)=yes;););
loop(q $(UnionsN(q)),put q.tl;); put /;
loop(q $(UnionsM(q)),put q.tl;); put /;
*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
PARAMETER
xx(k,q) product values with input role for DIVk of DMUo
yy(k,q) product values with output role for DIVk of DMUo
a(j,q,k)
b(j,q,k)
;
put/;
loop(j,loop(k,
loop(q $QO(k,q),b(j,q,k)=sum(h $ E(k,h,q),z(j,k,h,q)););
loop(q $QI(k,q),a(j,q,k)=sum(h $ E(h,k,q),z(j,h,k,q)););
);
);
put /;
*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
VARIABLE obj ;
positive variable la(j,k) ,alpha(k,h,q);
*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
EQUATIONS
eq1(q)
eq2(q)
eq3(k)
;
eq1(q).. sum(j, sum (k $ N(k,q), La(j,k)*x(j,k,q)))
+sum(j,sum(k $(QI(k,q)),La(j,k)*a(j,q,k)))
-sum(j,sum(k $(QO(k,q)),La(j,k)*b(j,q,k)))=l
=sum(k $ N(k,q), xx(k,q));
eq2(q).. sum(j, sum (k $ M(k,q), La(j,k)*y(j,k,q)))
-sum(j,sum(k $(QI(k,q)),La(j,k)*a(j,q,k)))
+sum(j,sum(k $(QO(k,q)),La(j,k)*b(j,q,k)))=g
=obj*sum(k $ M(k,q), YY(k,q));
eq3(k).. sum(j,la(j,k))=e=1;
*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
MODEL network /all/;
*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
LOOP(l,
put/;
put l.tl;
loop(g,
loop(q $( M(g,q)),yy(g,q)=Y(l,g,q); );
loop(q $( N(g,q)),xx(g,q)=X(l,g,q); );
);
SOLVE network USING LP Maximizing obj;
PUT obj.L:9 ;
);
\end{lstlisting}
\end{document}