Pdfpages 不工作-替代方案/原因?

Pdfpages 不工作-替代方案/原因?

嘿,我想知道为什么 includepdf / pdfpages 不起作用......

在孤立的情况下,文件运行正常:

\documentclass{tudelft-report}
\usepackage{pdfpages}

\begin{document}
\frontmatter
\title[Control, fuel and landing gears]{WP3 Wing subsystems}

\author{D06}
\affiliation{Technische Universiteit Delft}
\coverimage{cover/cover}
%\makecover

\mainmatter
\chapter{Schematic of parts} 
\label{app:schematic parts}
In this appendix a schematic view of all part positions and their shape is show. Table lists the reference values.
\clearpage
\includepdf[pages={1}]{graphs_tables_figures/schematic_parts.pdf}




\end{document}

但是,一旦我取消注释该命令,\makecoverpdfpages 就会失败(只显示空白页而不是 pdf)。我如何才能找到其中的错误?或者是否有其他方法可以轻松地将图像“缩放”到整页?

编辑:浏览我们的“官方”样式文件,我发现这是\makecover

%% Define the options for the makecover command.
\define@boolkey{cover}{back}[true]{}
\define@boolkey{cover}{nospine}[true]{}
\define@boolkey{cover}{frontbottom}[true]{}
\define@key{cover}{spinewidth}{\setlength\@cover@spinewidth{#1}}
\define@key{cover}{frontboxwidth}{\setlength\@cover@frontboxwidth{#1}}
\define@key{cover}{frontboxheight}{\setlength\@cover@frontboxheight{#1}}
\define@key{cover}{backboxwidth}{\setlength\@cover@backboxwidth{#1}}
\define@key{cover}{backboxheight}{\setlength\@cover@backboxheight{#1}}
\define@key{cover}{x}{\setlength\@cover@x{#1}}
\define@key{cover}{y}{\setlength\@cover@y{#1}}
\define@key{cover}{margin}{\setlength\@cover@margin{#1}}

\newcommand*\makecover[1][]{%
    \setkeys{cover}{#1}%
    %% Create a purple empty page without margins.
    \clearpage%
    \newgeometry{margin=0pt}%
    \pagecolor{tudelft-purple}%
    \thispagestyle{empty}%
    %% We need the this to perform coordinate calculations in TikZ.
    \usetikzlibrary{calc}%
    \begin{tikzpicture}[remember picture,overlay]
        \ifKV@cover@nospine
            \setlength\@cover@spinewidth{0pt}
        \fi
        %% If a back cover is present, stretch the cover image to extend onto
        %% the spine.
        \ifKV@cover@back
            \setlength\@cover@imagewidth{0.5\paperwidth}
            \addtolength\@cover@imagewidth{0.5\@cover@spinewidth}
        \else
            \setlength\@cover@imagewidth{\paperwidth}
        \fi
        %% If a cover image was specified, attach it to the top right of the
        %% front cover.
        \ifx\@cover@image\undefined\else
            \node at (current page.north east)[anchor=north east,inner sep=0pt]{
                \includegraphics[width=\@cover@imagewidth]{\@cover@image}
            };
        \fi
        %% The 'bies' with the TU Delft logo is inserted on top of the over
        %% image. If a back cover is present, insert the appropriate image there
        %% as well. To ensure the full bies is visible, we anchor the images to
        %% the bottom of the page.
        \ifKV@cover@back
            \node at (current page.south west)[anchor=south west,inner sep=0pt]{
                \includegraphics{cover/back}
            };
            \node at (current page.south east)[anchor=south east,inner sep=0pt]{
                \includegraphics{cover/front}
            };
        \else
            \node at (current page.south west)[anchor=south west,inner sep=0pt]{
                \includegraphics{cover/front}
            };
        \fi
        %% Calculate the coordinate of the top left corner of the front cover.
        \ifKV@cover@back
            \coordinate (top left) at ($(current page.north)+(0.5\@cover@spinewidth,0pt)$);
        \else
            \coordinate (top left) at (current page.north west);
        \fi
        \ifKV@cover@back\ifKV@cover@nospine\else
            %% If a back cover is present, calculate the coordinates of the
            %% spine box.
            \coordinate (spine top left) at ($(top left)-(\@cover@spinewidth,0pt)$);
            \coordinate (spine bottom right) at ($(top left)+(0pt,-\@cover@y)$);
            \ifKV@cover@frontbottom
                \coordinate (spine bottom right) at ($(spine bottom right)+(0pt,\@cover@backboxheight)$);
            \fi
            \coordinate (spine bottom center) at ($(spine bottom right)+(-0.5\@cover@spinewidth,0pt)$);
            %% Extend the spine box by 1pt to the left to ensure it completely
            %% covers the cover image.
            \coordinate (spine top left) at ($(spine top left)-(1pt,0pt)$);
            %% Draw a black box on the spine.
            \fill[fill=tudelft-black](spine top left) rectangle (spine bottom right);
            %% Print the title on the center right of the spine box.
            \node at (spine bottom center)[rotate=-90,anchor=east,inner sep=\@cover@margin]{
                \tudrmfamily\color{tudelft-white}\LARGE\@title
            };
        \fi\fi
        %% Calculate the coordinate of the corner where the front and back boxes
        %% meet.
        \coordinate (corner) at ($(top left)+(\@cover@x,-\@cover@y)$);
        %% Calculate the top left and bottom right coordinates of the front and
        %% back boxes.
        \ifKV@cover@frontbottom
            \coordinate (front top left) at (corner);
            \coordinate (back top left) at ($(corner)+(-\@cover@backboxwidth,\@cover@backboxheight)$);
        \else
            \coordinate (front top left) at ($(corner)+(0pt,\@cover@frontboxheight)$);
            \coordinate (back top left) at ($(corner)+(-\@cover@backboxwidth,0pt)$);
        \fi
        \coordinate (front bottom right) at ($(front top left)+(\@cover@frontboxwidth,-\@cover@frontboxheight)$);
        \coordinate (back bottom right) at ($(back top left)+(\@cover@backboxwidth,-\@cover@backboxheight)$);
        %% Draw the front box in black.
        \fill[fill=tudelft-black](front top left) rectangle (front bottom right);
        %% Calculate the width and height of the front text box.
        \setlength\@cover@fronttextwidth{\@cover@frontboxwidth}
        \addtolength\@cover@fronttextwidth{-2\@cover@margin}
        \setlength\@cover@fronttextheight{\@cover@frontboxheight}
        \addtolength\@cover@fronttextheight{-2\@cover@margin}
        %% Create the front text box.
        \node at (front top left)[anchor=north west,inner sep=\@cover@margin]{
            \begin{minipage}[t][\@cover@fronttextheight]{\@cover@fronttextwidth}
                %% Print the title and optional subtitle at the top in white.
                \tudrmfamily\color{tudelft-white}\Huge\@title
                \ifx\@subtitle\undefined\else
                    \\
                    \LARGE\@subtitle
                \fi
                %% Print the author at the bottom in cyan.
                \vfill
                \color{tudelft-cyan}\LARGE\@author
            \end{minipage}
        };
        %% Draw the back box in cyan.
        \fill[fill=tudelft-cyan](back top left) rectangle (back bottom right);
        %% Print the affiliation.
        \ifx\@affiliation\undefined\else
            \node at (back bottom right)[rotate=90,anchor=south west,inner sep=\@cover@margin]{
                \tudsffamily\color{tudelft-white}\@affiliation
            };
        \fi
        \ifKV@cover@back\ifx\@cover@text\undefined\else
            %% Calculate the width and height of the back text box.
            \setlength\@cover@backtextwidth{\@cover@backboxwidth}
            \addtolength\@cover@backtextwidth{-2\@cover@margin}
            \setlength\@cover@backtextheight{\@cover@backboxheight}
            \addtolength\@cover@backtextheight{-2\@cover@margin}
            %% Create the back text box.
            \node at (back top left)[anchor=north west,inner sep=\@cover@margin]{
                \begin{minipage}[t][\@cover@backtextheight]{\@cover@backtextwidth}
                    \tudsffamily\color{tudelft-white}\@cover@text
                \end{minipage}
            };
        \fi\fi
    \end{tikzpicture}%
    %% Restore the margins and turn the page white again.
    \restoregeometry%
    \pagecolor{white}%
}

完整样式链接:风格+示例使用

答案1

您需要指定页面颜色正在加载pdfpages。颜色是什么并不重要。pdfpages有关为什么需要这样做的信息,请参阅文档第 11 页。

\documentclass{tudelft-report}
\pagecolor{green}
\usepackage{pdfpages}

\begin{document}
\frontmatter
\title[Control, fuel and landing gears]{WP3 Wing subsystems}

\author{D06}
\affiliation{Technische Universiteit Delft}
\coverimage{example-image-b}%cover/cover}
\makecover

\mainmatter
\chapter{Schematic of parts}
\label{app:schematic parts}
In this appendix a schematic view of all part positions and their shape is show. Table lists the reference values.
\clearpage
\includepdf[pages={1}]{example-image-a}%graphs_tables_figures/schematic_parts.pdf}


\end{document}

显然,我的输出包括标准图像,因为我没有您的 PDF,但它显示该解决方案确实适用于我选择的“绿色”:

输出包含 pdf

相关内容