2017-09-08 13 views
0

私はRMarkdownを使用して、さまざまな.pdfを1つの中央ファイルに変換しています。これらの.pdfは複数ページの長さです。私が使用していたコードは次のとおりです。複数ページの.pdfをRMarkdownに結合

--- 
title: <center> <h1>Analysis Data</h1> </center> 
mainfont: Arial 
output: 
    pdf_document: 
    latex_engine: xelatex 
sansfont: Arial 
fig_crop: false 
toc: true 
classoption: landscape 
fontsize: {10} 
geometry: margin=0.30in 
header-includes: 
- \usepackage{booktabs} 
- \usepackage{sectsty} \sectionfont{\centering} 
- \renewcommand{\contentsname}{}\vspace{-2cm} 
--- 
# File One 
\begin{center} 
\includegraphics[width=9.5in]{~/Desktop/DatasetOne.pdf} 
\end{center} 
\newpage 
# File Two 
\begin{center} 
\includegraphics[width=9.5in]{~/Desktop/DatasetTwo.pdf} 
\end{center} 

しかし、私は一緒に、最終的なPDFファイルを編む際に、それぞれの.pdf文書(「DatasetOne.pdf」と「DatasetTwo.pdf」)の最初のページのみが含まれています文書全体ではありません。

最初のページではなく、PDF全体を読み込むことはできますか?

ありがとうございます。

+0

はhttps://stackoverflow.com/questions/2739159/inserting-a-pdf-fileを参照してください。 -in-latex – Marius

+0

残念ながら、pdfpagesパッケージを使用しようとすると、次のエラーが表示されます。 $がありません。 <挿入されたテキスト> $ l.137 ... esktop/DatasetOne.pdf} pandoc:pandocのドキュメント変換 実行は、私が働いてあなたの例を得ることができた – user2716568

+0

をhalted' 43エラーで失敗しました: エラーはエラー生成PDF私の終わりに、私の答えを見てください。 – Marius

答えて

1

私は成功しpdfpagesを使用して、ドキュメント例では二つの異なる複数ページのPDFファイルを含めることができるよ:

--- 
title: <center> <h1>Analysis Data</h1> </center> 
mainfont: Arial 
output: 
    pdf_document: 
    latex_engine: xelatex 
sansfont: Arial 
fig_crop: false 
toc: true 
classoption: landscape 
fontsize: {10} 
geometry: margin=0.30in 
header-includes: 
    - \usepackage{booktabs} 
    - \usepackage{sectsty} \sectionfont{\centering} 
    - \renewcommand{\contentsname}{}\vspace{-2cm} 
    - \usepackage{pdfpages} 
--- 

# File One 

\includepdf[pages={-}]{pdf1.pdf} 

\newpage 

# File Two 

\includepdf[pages={-}]{pdf2.pdf} 
関連する問題