如何将附录与 PDF 放在同一页上?

如何将附录与 PDF 放在同一页上?

我想将 PDF 格式的附录放在一页上,在页面顶部写着“附录 1”——根据我所在大学的规定,它还需要放在目录中而没有编号——我找不到任何方法(用 /appendix 分开文件,将以下代码粘贴到 main.tex 中)起作用。

主要.tex:

\chapter*{Appendix A}
\addcontentsline{toc}{chapter}{Appendix A}
\includepdf[scale=0.9]{Praca/appendix/appenix_1.pdf}

我还尝试创建一个单独的文件 appendix.tex:

\appendix
\label{appendix:Appendix_A}
\includepdf[pages=1,offset=0 0, pagecommand={\chapter*{Appendix A}\label{Appendix A_1}\thispagestyle{plain}}
]{Praca/appendix/appendix_1.pdf}

但是在文中我无法将它们称为附录A,而是出现随机数,例如10。

添加 ref 后的随机数

后一种选择几乎不错,因为在目录中它可以正确显示,但是数字而不是附录名称会破坏一切。

我必须添加几个附件 - 它们都必须放在单独的文件中吗?

编辑:我设法使用以下命令使其工作:


  \{addcontentsline{toc}{chapter}{Appendix A}

 \{includepdf[scale=1,pages=1,pagecommand=chapter*{Appendix A}{app:Appendix_A}]{Work/appendix/appendixa.pdf}

但在目录中,它显示的内容少了一页,并带您到错误的页面。具体来说,我的附录 A 在第 40 页,但在目录中,它显示为第 39 页,其中还有其他内容,单击目录中的“附录 A”会带您多到一页(即第 39 页而不是第 40 页)。

编辑

在答案的标题中,我无法添加照片,但在这里显示:

它是什么样子的:

它看起来应该是这样的(省略名称):

编辑:我正在使用模板,其中添加的内容通过以下方式解析:

\chapter*{Dodatek A}
\addcontentsline{toc}{chapter}{Appendix A}
\includepdf{meta/example-image.pdf}

在文本中,附录应该是这样的:如附录 A 所示 - 其中附录 A 是指向整个文档末尾(来源列表下)附录的超链接。

目前按照@cfr的建议我的补充如下:


    \{addcontentsline{toc}{chapter}{Addition B}

    \{includepdf[scale=1,pages=1,pagecommand=chapter*{Appendix B - Printed circuit board assembly diagram}}]{work/additions/assembly.pdf}

并且在文中它们以数字的形式呈现,而不是我提到的超链接:

错误引用(附录 B 改为 10)

编号应为“附录 B”,波兰语文本显示“示意图也包含在 10 中”,但应为“示意图也包含在附录 B 中”

代码如下:


Idea diagram is also included in~ref{app:appendix_b}.


It is worth mentioning that clicking on this 10 takes you to the appropriate place in the file where the pdf file is added by \includegraphics

My cls file:

    \newif\ifnostrict

\DeclareOption{strict}{\nostrictfalse }
\DeclareOption{nostrict}{\nostricttrue }
\ProcessOptions \relax

%--------------------------------------------------------------------
% Pobranie ustawieñ podstawowej klasy dokumentu - klasa report
%--------------------------------------------------------------------
\usepackage{polski}
\usepackage{blindtext}


\LoadClass[
  a4paper,                      % format A4
  10pt,                         % rozmiar czcionki
  twoside,                      % druk jednostronny %ALBO ONESIDE!!!!!!!!!!!!
  notitlepage,                  % brak strony tytu³owej
  openright,                    % orientacja otwierania dokumentu
]{report}

%--------------------------------------------------------------------
% Ustawienie domylnego jêzyka i kodowania
%--------------------------------------------------------------------

\RequirePackage{polski}
\RequirePackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

%--------------------------------------------------------------------
% Podstawowa czcionka - Helvetica (Zamiennik dla czcionki Arial)
%--------------------------------------------------------------------

\RequirePackage{helvet}
\renewcommand{\familydefault}{\sfdefault}

%--------------------------------------------------------------------
% Ustawienie interlinii
%--------------------------------------------------------------------

\linespread{1.3} % 1.3 odpowiada interlinii 1.5, 1.6 dla interlinii 2

%--------------------------------------------------------------------
% Ustawienie marginesów
%--------------------------------------------------------------------

\RequirePackage[%
    margin=2.5cm,
    a4paper,
    bindingoffset=1cm
]{geometry}

%--------------------------------------------------------------------
% Ustawienia akapitów
%--------------------------------------------------------------------

\RequirePackage{indentfirst}

\setlength{\parindent}{0.9cm}

%--------------------------------------------------------------------
% Numeracja stron 
%--------------------------------------------------------------------

\pagenumbering{arabic}

\RequirePackage{fancyhdr}

\fancypagestyle{plain}{
  \fancyhf{}
  \fancyfoot[C]{\fontsize{9pt}{9pt}\selectfont\thepage}%
   \renewcommand{\headrulewidth}{0.0pt}
}

\pagestyle{plain}

%--------------------------------------------------------------------
% Ustawienia nag³ówków
%--------------------------------------------------------------------
\RequirePackage[explicit, clearempty]{titlesec}

% konfiguracja dla tytu³u rozdzia³u
\titleformat{\chapter}[hang]                    
{\bfseries\fontsize{12pt}{24pt}\selectfont}
{\thechapter.\quad}
{0pt}
{\MakeUppercase{#1}}
\titlespacing*{\chapter}{0pt}{0pt}{6pt}

% konfiguracja dla tytu³u podrozdzia³u
\titleformat{\section}                          
{\fontsize{11pt}{22pt}\selectfont\bfseries\itshape}
{\thesection.\quad}
{0pt}
{#1}
\titlespacing{\section}{0pt}{6pt}{6pt}

% konfiruacja dla pod-podrozdzia³ów
\titleformat{\subsection}                      
{\normalfont\itshape}
{\thesubsection.\quad}
{0pt}
{#1}
\titlespacing{\subsection}{0pt}{6pt}{6pt}

% subsubsection
\titleformat{\subsubsection}                 
{\normalfont\itshape}
{\thesubsubsection.\quad}
{0pt}
{#1}
\titlespacing{\subsubsection}{0pt}{12pt}{6pt}

%--------------------------------------------------------------------
% Spis tresci - konfiguracja 
%--------------------------------------------------------------------

\RequirePackage{titletoc}
%\usepackage{titletoc}
%\setlength{\cftsubsecindent}{2em}

% ustawienia dla rozdzia³ów w spisie treci
\titlecontents{chapter}
    [0em] % no indentation
    {}
    {\contentslabel[\thecontentslabel.]{1.4em}} 
    {\hspace*{-1em}}                         
    {\dotfill\contentspage}
    
% ustawienia dla podrozdzia³ów w spisie treci
\titlecontents{section}
    [2em] % ie, 1.5em (chapter) + 0.5em
    {}
    {\contentslabel[\thecontentslabel.]{2em}}  
    {\hspace*{-2.3em}}                          
    {\dotfill\contentspage}

% ustawienia dla pod-podrozdzia³ów w spisie treci
\titlecontents{subsection}
    [5em] % ie, 2em (section) + 3em
    {}
    {\contentslabel[\thecontentslabel.]{3em}}  
    {\hspace*{-2.3em}}                        
    {\dotfill\contentspage}

\titlecontents{subsubsection}
    [9em] % ie, 2em (section) + 3em
    {}
    {\contentslabel[\thecontentslabel.]{4em}}  %three digits and three dots
    {\hspace*{-2.3em}}                          % !
    {\dotfill\contentspage}
%--------------------------------------------------------------------
% Konfiguracja list numerowanych i nienumerowanych
%--------------------------------------------------------------------

\RequirePackage{enumitem}

\setenumerate{
    topsep=0pt,
    nolistsep,
    noitemsep,
    }
\setenumerate[1]{label=\arabic*.}  
\setenumerate[2]{label=\alph*)}     

\setitemize{
    topsep=0pt,
    noitemsep,
    nolistsep,
}


%--------------------------------------------------------------------
% Konfiguracja prezentacji aparatu matematycznego
%--------------------------------------------------------------------

\RequirePackage{amsmath}
\RequirePackage{amssymb}
\RequirePackage{amsthm}


%%%%%%%% srodowiska twierdzeñ %%%%%%%%
\newtheoremstyle{SPPG_th1}% hname
{10pt plus5pt minus2pt}% hSpace above
{10pt plus3pt}% hSpace below
{}% hBody font
{}% hIndent amount
{\bfseries}% hTheorem head font
{.}% hPunctuation after theorem head
{.5em}% hSpace after theorem head
{}% hTheorem head spec 
\theoremstyle{SPPG_th1}

\newtheorem{definicja}{Definicja}[chapter]
\newtheorem{twierdzenie}[definicja]{Twierdzenie}
\newtheorem{lemat}[definicja]{Lemat}
\newtheorem{fakt}[definicja]{Fakt}
\newtheorem{wniosek}[definicja]{Wniosek}
\newtheorem{przyklad}[definicja]{Przyk³ad}

%--------------------------------------------------------------------
% Konfiguracja obrazków oraz tabel
%--------------------------------------------------------------------
\RequirePackage{subfig}
\RequirePackage[unicode=true]{hyperref}
\RequirePackage{setspace}
\RequirePackage[skip=2pt]{caption}
\RequirePackage{pdfpages}
\RequirePackage{multicol} % do sk³adu w dwóch kolumnach
\RequirePackage{color}
\RequirePackage{wrapfig}
\RequirePackage{graphicx} 
\usepackage{etoolbox}   


% Modyfikacja podpisu rysunków i tabel  (zmiana na Rys. X niepogrubione)
% Separator po identyfikatorze rysunku
\renewcommand{\figurename}{Rys.}
\DeclareCaptionLabelSeparator{dot}{. }
\captionsetup[figure]{justification=centering,labelfont=md} % centrowanie podpisu rysunku
\captionsetup[figure]{labelsep=dot} % kropka jako separator, bez pogrubiania
\captionsetup[table]{labelsep=dot} % kropka jako separator, bez pogrubiania

% Zmniejszenie czcionki oraz interlinii w podpisach
\captionsetup{font={small,stretch=1.0}}

\setlength{\intextsep}{3mm}      % odleg³oci separacji tekstu od rysunków/tabel
\setlength{\textfloatsep}{3mm}


%--------------------------------------------------------------------
% Dodatkowe ustawienia
%--------------------------------------------------------------------
 %???
\renewcommand\bibname{Wykaz literatury} % Zamiana na tytu³ "Wykaz literatury"

% Zmiana na tytu³ "Wykaz rysunków"
\renewcommand{\listfigurename}{Wykaz rysunków}

% Zmiana na tytu³ "Wykaz tabel"
\renewcommand{\listtablename}{Wykaz tabel}

% Brak "wdów" i "sierot"
\widowpenalty10000
\clubpenalty10000

% Nazwy rozdzia³ów w Spisie treci WIELKIMI LITERAMI
\makeatletter
\renewcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
                    \thispagestyle{plain}%
                    \global\@topnum\z@
                    \@afterindentfalse
                    \secdef\@chapter\@schapter}
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
                       \if@mainmatter
                         \refstepcounter{chapter}%
                         \typeout{\@chapapp\space\thechapter.}%
                         \addcontentsline{toc}{chapter}%
                         {\protect\numberline{\thechapter}\texorpdfstring{\MakeUppercase{#1}}{#1}}%
                       \else
                       \addcontentsline{toc}{chapter}{\texorpdfstring{\MakeUppercase{#1}}{#1}}%
                       \fi
                    \else
                    \addcontentsline{toc}{chapter}{\texorpdfstring{\MakeUppercase{#1}}{#1}}%
                    \fi
                    \chaptermark{#1}%
                    \addtocontents{lof}{\protect\addvspace{10\p@}}%
                    \addtocontents{lot}{\protect\addvspace{10\p@}}%
                    \if@twocolumn
                      \@topnewpage[\@makechapterhead{#2}]%
                    \else
                      \@makechapterhead{#2}%
                      \@afterheading
                    \fi}
\makeatother


答案1

您可以使用\AddToHookNext{shipout/background}它将整页图像与其他内容重叠。但是,\chapter*不会生成标签。您需要\refstepcounter{chapter}标签。

\documentclass{report}
\usepackage{graphicx}

\begin{document}
\tableofcontents

\appendix
\chapter*{Appendix A}
\refstepcounter{chapter}\label{AppA}
\addcontentsline{toc}{chapter}{Appendix \thechapter}

\AddToHookNext{shipout/background}{\put(0pt,-\paperheight)% relative to upper left corner
  {\includegraphics[width=\paperwidth, height=\paperheight]{example-image}}}
\newpage
\end{document}

相关内容