質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
PDF

PDF(Portable Document Format)とはISOによって国際標準として制定されている電子ドキュメント用の拡張子です。

LaTeX

LaTeXは、レスリー・ランポートが開発したテキストベースの文書整形システムです。 電子製版ソフトウェアである「TeX」にマクロパッケージを組み込む形で構成されており、 通常のTeXより扱いやすくなっているのが特徴です。

Q&A

解決済

1回答

4674閲覧

PDFPagesによるPDFファイルの挿入ができない

frodo821

総合スコア322

PDF

PDF(Portable Document Format)とはISOによって国際標準として制定されている電子ドキュメント用の拡張子です。

LaTeX

LaTeXは、レスリー・ランポートが開発したテキストベースの文書整形システムです。 電子製版ソフトウェアである「TeX」にマクロパッケージを組み込む形で構成されており、 通常のTeXより扱いやすくなっているのが特徴です。

0グッド

0クリップ

投稿2018/02/09 16:01

編集2018/02/10 16:39

前提・実現したいこと

今回初めてpdfpagesを採用するため、右も左もよくわかっていないのでお手柔らかにお願いいたします。
pdfpagesで複数のPDFファイルをまとめようと思い、以下のようなLaTeXファイルを作成してコンパイルしました。

\documentclass[a4paper,dvipdfm]{jsbook} \usepackage{pdfpages} \usepackage[top=3truecm, bottom=3truecm, left=2.5truecm, right=2.5truecm]{geometry} \usepackage{fancyhdr} \usepackage[tocflat]{tocstyle} \usetocstyle{standard} \makeatletter \renewcommand\tableofcontents{% \center{% \Large{目次}\% \normalsize% \emph{Table of Contents}\% \noindent\rule{\textwidth}{0.4pt}% }\par \@starttoc{toc}% } \makeatother \pagestyle{fancy} \lhead{} \chead{} \rhead{} \lfoot{} \cfoot{\thepage} \rfoot{} \renewcommand{\headrulewidth}{0pt} \begin{document} \enlargethispage{\paperwidth} \thispagestyle{empty} \vspace*{-1truein} \vspace*{-\topmargin} \vspace*{-1.15\headheight} \vspace*{-\headsep} \vspace*{-\topskip} \noindent\hspace*{-1.16in}\hspace*{-\oddsidemargin} \begin{center} \vspace{15ex} \fontsize{52pt}{0pt}\selectfont タイトル\ \normalsize \emph{The club member's note} \end{center} \newpage \setcounter{tocdepth}{0} \tableofcontents \newpage \addcontentsline{toc}{chapter}{PDFファイル1} \includepdf[pages=-, noautoscale=true,scale=0.9,pagecommand={},lastpage=7]{file_01.pdf} \addcontentsline{toc}{chapter}{PDFファイル2} \includepdf[pages=-, noautoscale=true,scale=0.9,pagecommand={},lastpage=5]{file_02.pdf} % 以下、挿入するファイルを列挙 \end{document}

その後生成されたPDFファイルを開いたところ、挿入したいPDFファイルではなく空のPDFが挿入されていました。(空のPDFが挿入されていると判断した根拠はあとで述べます。)
この時コンパイルに使った環境とコマンドです。

  • 環境
C:\Users\username\> platex -v e-pTeX 3.14159265-p3.8.0-180121-2.6 (sjis) (TeX Live 2017/W32TeX) kpathsea version 6.2.3 ptexenc version 1.3.5 Copyright 2018 D.E. Knuth. There is NO warranty. Redistribution of this software is covered by the terms of both the e-pTeX copyright and the Lesser GNU General Public License. For more information about these matters, see the file named COPYING and the e-pTeX source. Primary author of e-pTeX: Peter Breitenlohner.
C:\Users\username\ver> platex ver.tex This is e-pTeX, Version 3.14159265-p3.8.0-180121-2.6 (sjis) (TeX Live 2017/W32TeX) (preloaded format=platex) restricted \write18 enabled. entering extended mode (./ver.tex pLaTeX2e <2017/10/28>+4 (based on LaTeX2e <2017-04-15>) Babel <3.17> and hyphenation patterns for 84 language(s) loaded. (c:/LaTeX/Tex/share/texmf-dist/tex/latex/base/article.cls Document Class: article 2014/09/29 v1.4h Standard LaTeX document class (c:/LaTeX/Tex/share/texmf-dist/tex/latex/base/size10.clo)) Enter package name(s): \pkgverPkgName=pdfpages (c:/LaTeX/Tex/share/texmf-dist/tex/latex/pdfpages/pdfpages.sty (c:/LaTeX/Tex/share/texmf-dist/tex/latex/base/ifthen.sty) (c:/LaTeX/Tex/share/texmf-dist/tex/latex/tools/calc.sty) (c:/LaTeX/Tex/share/texmf-dist/tex/latex/eso-pic/eso-pic.sty (c:/LaTeX/Tex/share/texmf-dist/tex/generic/oberdiek/atbegshi.sty (c:/LaTeX/Tex/share/texmf-dist/tex/generic/oberdiek/infwarerr.sty) (c:/LaTeX/Tex/share/texmf-dist/tex/generic/oberdiek/ltxcmds.sty) (c:/LaTeX/Tex/share/texmf-dist/tex/generic/oberdiek/ifpdf.sty)) (c:/LaTeX/Tex/share/texmf-dist/tex/latex/graphics/keyval.sty) (c:/LaTeX/Tex/share/texmf-dist/tex/latex/xcolor/xcolor.sty (c:/LaTeX/Tex/share/texmf-dist/tex/latex/graphics-cfg/color.cfg) (c:/LaTeX/Tex/share/texmf-dist/tex/latex/graphics-def/dvipdfmx.def))) (c:/LaTeX/Tex/share/texmf-dist/tex/latex/graphics/graphicx.sty (c:/LaTeX/Tex/share/texmf-dist/tex/latex/graphics/graphics.sty (c:/LaTeX/Tex/share/texmf-dist/tex/latex/graphics/trig.sty) (c:/LaTeX/Tex/share/texmf-dist/tex/latex/graphics-cfg/graphics.cfg))) (c:/LaTeX/Tex/share/texmf-dist/tex/latex/pdfpages/ppdvipdfmx.def)) No file ver.aux. (c:/LaTeX/Tex/share/texmf-dist/tex/latex/oberdiek/pdflscape.sty (c:/LaTeX/Tex/share/texmf-dist/tex/latex/graphics/lscape.sty) (c:/LaTeX/Tex/share/texmf-dist/tex/generic/ifxetex/ifxetex.sty)) (./ver.aux) *File List* pldefs.ltx 2017/11/06 v1.6j pLaTeX Kernel (Default settings) jy1mc.fd 1997/01/24 v1.3 KANJI font defines jy1gt.fd 1997/01/24 v1.3 KANJI font defines jt1mc.fd 1997/01/24 v1.3 KANJI font defines jt1gt.fd 1997/01/24 v1.3 KANJI font defines kinsoku.tex article.cls 2014/09/29 v1.4h Standard LaTeX document class size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option) pdfpages.sty 2017/10/31 v0.5l Insert pages of external PDF documents (AM) ifthen.sty 2014/09/29 v1.1c Standard LaTeX ifthen package (DPC) calc.sty 2014/10/28 v4.3 Infix arithmetic (KKT,FJ) eso-pic.sty 2015/07/21 v2.0g eso-pic (RN) atbegshi.sty 2016/06/09 v1.18 At begin shipout hook (HO) infwarerr.sty 2016/05/16 v1.4 Providing info/warning/error messages (HO) ltxcmds.sty 2016/05/16 v1.23 LaTeX kernel commands for general use (HO) ifpdf.sty 2017/03/15 v3.2 Provides the ifpdf switch keyval.sty 2014/10/28 v1.15 key=value parser (DPC) xcolor.sty 2016/05/11 v2.12 LaTeX color extensions (UK) color.cfg 2016/01/02 v1.6 sample color configuration dvipdfmx.def 2017/06/24 v5.0g Graphics/color driver for dvipdfmx graphicx.sty 2017/06/01 v1.1a Enhanced LaTeX Graphics (DPC,SPQR) graphics.sty 2017/06/25 v1.2c Standard LaTeX Graphics (DPC,SPQR) trig.sty 2016/01/03 v1.10 sin cos tan (DPC) graphics.cfg 2016/06/04 v1.11 sample graphics configuration ppdvipdfmx.def 2017/10/31 v0.5l Pdfpages driver for dvipdfmx (AM) pdflscape.sty 2016/05/14 v0.11 Display of landscape pages in PDF (HO) lscape.sty 2000/10/22 v3.01 Landscape Pages (DPC) ifxetex.sty 2010/09/12 v0.6 Provides ifxetex conditional *********** ) No pages of output. Transcript written on ver.log.
  • コマンド
pdfplatex template.tex --dvipdfm

発生している問題・エラーメッセージ

template.texをコンパイルした後に生成される、template.logを見たところ次のような記述があり、空のPDFが挿入されていると判断しました。

Package pdfpages Warning: I will use a dummy \includepdf command which (pdfpages) will insert empty pages instead of the actual PDF, (pdfpages) because we are running in DVI mode or with (pdfpages) dvips driver.

とりあえず、Googleにて原因と思われる"DVI mode"や"pdfpages not working"などのキーワードで検索してみましたが有効な解決策を得ることができませんでした。
dvipsがドライバとして使われている可能性については考える必要がないと思います。\documentclass[a4paper,dvipdfm]{jsbook}と直接ドライバを指定しているためです。
ログを全て載せようと思ったのですが、文字数制限に引っかかったためできません。

試したこと

  • includeするページの直接指定
  • lastpageの指定
  • pdfファイルの絶対パス指定
  • scaleを縮小
  • pdfの余白トリミング

そもそも何故挿入できないのかがわからないため、試せていることは多くありません。
今回初めてpdfpagesを採用するためLaTeX自体は初心者ではありませんが、このパッケージについて右も左もわかっていないのでお手柔らかにお願いいたします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

\documentclass[a4paper,dvipdfmx]{jsbook}という風にドライバをdvipdfmxにしてコンパイルしたあと、dvipdfmで変換すると入りました。

投稿2018/02/13 01:28

frodo821

総合スコア322

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問