부록 - PDF 추가

부록 - PDF 추가

부록에는 제가 연구에 사용한 여러 PDF 문서(설문지)를 추가하고 싶습니다. 부록을 구현하고 PDF 파일을 포함했지만(어렵지 않음) 이제 해결할 수 없는 두 가지 문제가 있습니다.

  1. 내 PDF의 첫 번째 페이지가 부록 A 제목 바로 아래에 배치되는 것을 보고 싶습니다. 그러나 부록 A는 페이지 시작 부분에 단독으로 표시되고 사용되지 않은 공간이 많이 이어지며 다음 페이지가 이어집니다. PDF의 내용과 함께.
  2. 현재 PDF 페이지는 섹션 헤더를 덮고 있습니다(A 부록). 헤더와 PDF 페이지를 보고 싶습니다. 이것이 가능합니까?
\documentclass{article}
\usepackage{pdfpages}
\begin{document}
\newpage
\appendix
\section{Appendix A}

\includepdf[pages={1-2}]{Example.pdf}

\end{document}

답변1

다음은 내가 링크한 답변에 제공된 코드의 수정된 버전입니다. 사용 중인 클래스와 패키지, 그리고 PDF 페이지가 얼마나 꽉 차 있는지에 따라 이를 조정해야 합니다. 아래 코드는 보수적이며 포함된 샘플 PDF가 이 요구 사항을 충족하지 않아 페이지가 너무 비어 보이지만 페이지가 꽉 찼다고 가정합니다. 귀하의 PDF가 더 꽉 찬 것 같지만 분명히 그것은 단지 추측일 뿐입니다.

\documentclass[a4paper]{article}
\usepackage{geometry}
\usepackage{fancyhdr}
\usepackage{pdfpages}
\usepackage{xparse}
\usepackage{kantlipsum}

\makeatletter
\NewDocumentCommand\headerspdf{ O {pages=-} m }{% [options for include pdf]{filename.pdf}
  \includepdf[%
    #1,
    pagecommand={\thispagestyle{fancy}},
    scale=.7,
    ]{#2}}
\NewDocumentCommand\secpdf{somO{1}m}{% [short title]{section title}[page specification]{filename.pdf} --- possibly starred
  \clearpage
  \thispagestyle{fancy}%
  \includepdf[%
    pages=#4,
    pagecommand={%
      \IfBooleanTF{#1}{%
        \section*{#3}}{%
        \IfNoValueTF{#2}{%
          \section{#3}}{%
          \section[#2]{#3}}}},
    scale=.65,
    ]%
    {#5}}
\makeatother

\pagestyle{fancy}

\begin{document}

\newpage
\appendix

\secpdf*{PDF on Starred Section Page}[3]{/usr/local/texlive/2013/texmf-dist/doc/latex/mwe/mwe.pdf}
  \kant[2]

\section{Include PDF after Section Page}
\kant[1]
\headerspdf[pages=1-2]{/usr/local/texlive/2013/texmf-dist/doc/latex/mwe/mwe.pdf}

\secpdf{PDF on Section Page}[4]{/usr/local/texlive/2013/texmf-dist/doc/latex/mwe/mwe.pdf}
\kant[2]

\secpdf[Short Title]{PDF on Section Page with Short Title}{/usr/local/texlive/2013/texmf-dist/doc/latex/mwe/mwe.pdf}
\kant[3]
\headerspdf[pages=2-3]{/usr/local/texlive/2013/texmf-dist/doc/latex/mwe/mwe.pdf}

\end{document}

샘플 출력:

제목이 있는 섹션 제목 다음에 나오는 PDF

답변2

또는 다음과 같이 PDF를 추가합니다.

\usepackage{pdfpages}
\includepdf[pages=-,offset=75 -75]{myfile.pdf}

답변3

다른 사람이 답을 찾기 위해 이 문제를 우연히 발견한 경우를 대비해 말이죠. 나는 당신이 \section{appendix}다음의 일부로 명령을 사용할 수 있다는 것을 발견했습니다 pagecommand.

\begin{appendix}
  \centering
  \includepdf[pages=2,scale=0.9,offset=0mm -75,pagecommand={
  \begin{flushleft}  
    \section{Appendix}
  \end{flushleft}
   \section{AnyPdf}\label{AnyPdf}}linktodoc=false]{AnyPdf.pdf}

답변4

프로젝트 부록의 한 섹션 아래에 여러 PDF 페이지를 참조할 수 있는 추가 레이블이 추가되는 접근 방식을 찾는 사람을 위한 것입니다. 위의 답변으로 구성된 내 솔루션은 다음과 같습니다.

\appendix
\chapter{Appendix}

see \ref{reference}




\includepdf[pages=1,offset=0 0, pagecommand={\section{OurAppendix}\label{reference}\thispagestyle{plain}}
]{src/our.pdf}

\includepdf[pages=2-,offset=0 0, pagecommand=\thispagestyle{plain}
]{src/our.pdf}

관련 정보