\includepdf
总是插入 PDF 的第一页,即使我指定了要插入哪一页。
从以下生成的三页 PDF 文件开始external.tex
:
\documentclass[a4paper]{article}
\begin{document}
Page 1
\newpage
Page 2
\newpage
Page 3
\end{document}
然后使用以下代码:
\documentclass[a4paper]{article}
\usepackage[final]{pdfpages}
\begin{document}
\includepdf[pages={2}]{external.pdf}
\end{document}
生成的文档显示“第 1 页”,而不是“第 2 页”。
xelatex
我从和获得相同的行为pdflatex
。我正在使用MikTeX,并且我的所有软件包都是最新的。编辑:我已以用户和管理员身份运行更新向导。
这类似于这个问题,但这显然是一个单独的问题,因为那里的答案不起作用:我指定要插入哪些页面,并且所有文件名都是小写的。
编辑:这是日志文件:
This is XeTeX, Version 3.14159265-2.6-0.99999 (MiKTeX 2.9.6600) (preloaded format=xelatex 2018.3.3) 4 MAR 2018 12:13
entering extended mode
**./test.tex
(test.tex
LaTeX2e <2017-04-15>
Babel <3.18> and hyphenation patterns for 73 language(s) loaded.
("D:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
("D:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\size10.clo"
File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
("D:\Program Files (x86)\MiKTeX 2.9\tex\latex\pdfpages\pdfpages.sty"
Package: pdfpages 2017/10/31 v0.5l Insert pages of external PDF documents (AM)
("D:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\ifthen.sty"
Package: ifthen 2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
)
("D:\Program Files (x86)\MiKTeX 2.9\tex\latex\tools\calc.sty"
Package: calc 2014/10/28 v4.3 Infix arithmetic (KKT,FJ)
\calc@Acount=\count87
\calc@Bcount=\count88
\calc@Adimen=\dimen103
\calc@Bdimen=\dimen104
\calc@Askip=\skip43
\calc@Bskip=\skip44
LaTeX Info: Redefining \setlength on input line 80.
LaTeX Info: Redefining \addtolength on input line 81.
\calc@Ccount=\count89
\calc@Cskip=\skip45
)
("D:\Program Files (x86)\MiKTeX 2.9\tex\latex\eso-pic\eso-pic.sty"
Package: eso-pic 2015/07/21 v2.0g eso-pic (RN)
("D:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\atbegshi.sty"
Package: atbegshi 2016/06/09 v1.18 At begin shipout hook (HO)
("D:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty"
Package: infwarerr 2016/05/16 v1.4 Providing info/warning/error messages (HO)
)
("D:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty"
Package: ltxcmds 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
)
("D:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\ifpdf.sty"
Package: ifpdf 2017/03/15 v3.2 Provides the ifpdf switch
))
("D:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\keyval.sty"
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks14
)
("D:\Program Files (x86)\MiKTeX 2.9\tex\latex\xcolor\xcolor.sty"
Package: xcolor 2016/05/11 v2.12 LaTeX color extensions (UK)
("D:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics-cfg\color.cfg"
File: color.cfg 2016/01/02 v1.6 sample color configuration
)
Package xcolor Info: Driver file: xetex.def on input line 225.
("D:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics-def\xetex.def"
File: xetex.def 2016/07/11 v4.10 LaTeX color/graphics driver for XeTeX (L3/RRM/
JK)
)
Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1348.
Package xcolor Info: Model `RGB' extended on input line 1364.
Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1366.
Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1367.
Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1368.
Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1369.
Package xcolor Info: Model `Gray' substituted by `gray' on input line 1370.
Package xcolor Info: Model `wave' substituted by `hsb' on input line 1371.
))
("D:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\graphicx.sty"
Package: graphicx 2017/06/01 v1.1a Enhanced LaTeX Graphics (DPC,SPQR)
("D:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\graphics.sty"
Package: graphics 2017/06/25 v1.2c Standard LaTeX Graphics (DPC,SPQR)
("D:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\trig.sty"
Package: trig 2016/01/03 v1.10 sin cos tan (DPC)
)
("D:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics-cfg\graphics.cfg"
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration
)
Package graphics Info: Driver file: xetex.def on input line 99.
)
\Gin@req@height=\dimen105
\Gin@req@width=\dimen106
)
\AM@pagewidth=\dimen107
\AM@pageheight=\dimen108
("D:\Program Files (x86)\MiKTeX 2.9\tex\latex\pdfpages\ppxetex.def"
File: ppxetex.def 2017/10/31 v0.5l Pdfpages driver for XeTeX (AM)
)
\AM@pagebox=\box26
\AM@global@opts=\toks15
\AM@toc@title=\toks16
\c@AM@survey=\count90
\AM@templatesizebox=\box27
) (test.aux)
\openout1 = `test.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for TU/lmr/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
\AtBeginShipoutBox=\box28
("D:\Program Files (x86)\MiKTeX 2.9\tex\latex\oberdiek\pdflscape.sty"
Package: pdflscape 2016/05/14 v0.11 Display of landscape pages in PDF (HO)
("D:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\lscape.sty"
Package: lscape 2000/10/22 v3.01 Landscape Pages (DPC)
)
("D:\Program Files (x86)\MiKTeX 2.9\tex\generic\ifxetex\ifxetex.sty"
Package: ifxetex 2010/09/12 v0.6 Provides ifxetex conditional
)
Package pdflscape Info: Auto-detected driver: dvipdfm (xetex) on input line 99.
)
File: external.pdf Graphic file (type QTm)
<use "external.pdf" >
File: external.pdf Graphic file (type QTm)
<use "external.pdf" >
File: external.pdf Graphic file (type QTm)
<use "external.pdf" >
File: external.pdf Graphic file (type QTm)
<use "external.pdf" >
File: external.pdf Graphic file (type QTm)
<use "external.pdf" >
File: external.pdf Graphic file (type QTm)
<use "external.pdf" >
File: external.pdf Graphic file (type QTm)
<use "external.pdf" >
[1
]
(test.aux) )
Here is how much of TeX's memory you used:
2095 strings out of 427846
27745 string characters out of 3151564
96275 words of memory out of 3000000
6068 multiletter control sequences out of 15000+200000
3648 words of font info for 15 fonts, out of 3000000 for 9000
1328 hyphenation exceptions out of 8191
37i,18n,39p,253b,430s stack positions out of 5000i,500n,10000p,200000b,50000s
Output written on test.pdf (1 page).
答案1
我能够通过安装该graphics-def
软件包解决这个问题。
根据@moewe的评论,我试图找出为什么我有一个旧版本的tex\latex\graphics-def\xetex.def
。这个答案建议安装graphics-def
。
据推测这是一个应该明确的依赖关系;或者可能xetex.def
应该以某种方式自动更新。