我尝试编译这个文件:
\documentclass[10pt,openany,titlepage]{book}%
\usepackage{lipsum}%
\usepackage{xcolor}%
\usepackage[printwatermark,default-first-page=10]{xwatermark}%
\newwatermark[oddpages,color=gray!25,angle=45,scale=3,xpos=0,ypos=0]{PRELIMINAR}%
\newwatermark[pagex={1,3},color=white,angle=45,scale=3,xpos=0,ypos=0]{PRELIMINAR}%
\newwatermark[evenpages,color=gray!25,angle=45,scale=3,xpos=0,ypos=0]{2012}%
\newwatermark[pagex={2,4},color=white,angle=45,scale=3,xpos=0,ypos=0]{2012}%
\begin{document}
\title{Test}
\author{my}
% Remove command to get current date
%\date{}
\maketitle
\cleardoublepage
\tableofcontents
\cleardoublepage
\chapter{one}
\lipsum[1-20]
\chapter{two}
\lipsum[20-40]
\chapter{three}
\lipsum[41-60]
\end{document}
如果注释xwatemark并使用--interaction=batchmode,在屏幕显示:
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/W32TeX)
restricted \write18 enabled.
entering extended mode
好的,但是如果你没有注释xwatemark并使用--interaction=batchmode,在屏幕显示:
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/W32TeX)
restricted \write18 enabled.
entering extended mode
)
(c:/texlive/2011/texmf-dist/tex/latex/base/fix-cm.sty
(c:/texlive/2011/texmf-dist/tex/latex/base/ts1enc.def))
(c:/texlive/2011/texmf-dist/tex/latex/oberdiek/picture.sty)
(c:/texlive/2011/texmf-dist/tex/latex/graphics/graphicx.sty
(c:/texlive/2011/texmf-dist/tex/latex/graphics/keyval.sty)
(c:/texlive/2011/texmf-dist/tex/latex/graphics/graphics.sty
(c:/texlive/2011/texmf-dist/tex/latex/graphics/trig.sty)
(c:/texlive/2011/texmf-dist/tex/latex/latexconfig/graphics.cfg)))
(c:/texlive/2011/texmf-dist/tex/generic/oberdiek/atbegshi.sty
(c:/texlive/2011/texmf-dist/tex/generic/oberdiek/ifpdf.sty))
(c:/texlive/2011/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty)
(c:/texlive/2011/texmf-dist/tex/latex/oberdiek/atveryend.sty)
(c:/texlive/2011/texmf-dist/tex/latex/ltxkeys/ltxkeys.sty
) (c:/texlive/2011/texmf-dist/tex/latex/framed/framed.sty) (./test.xwm))
(c:/texlive/2011/texmf-dist/tex/latex/hyperref/hyperref.sty
(c:/texlive/2011/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty
(c:/texlive/2011/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty))
(c:/texlive/2011/texmf-dist/tex/generic/ifxetex/ifxetex.sty)
(c:/texlive/2011/texmf-dist/tex/latex/oberdiek/kvoptions.sty)
(c:/texlive/2011/texmf-dist/tex/latex/hyperref/pd1enc.def)
(c:/texlive/2011/texmf-dist/tex/latex/latexconfig/hyperref.cfg)
(c:/texlive/2011/texmf-dist/tex/latex/url/url.sty))
Package hyperref Message: Driver (autodetected): hpdftex.
(c:/texlive/2011/texmf-dist/tex/latex/hyperref/hpdftex.def
(c:/texlive/2011/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty)) (./test.aux
) (c:/texlive/2011/texmf-dist/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (c:/texlive/2011/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
(c:/texlive/2011/texmf-dist/tex/latex/oberdiek/grfext.sty)
(c:/texlive/2011/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
(c:/texlive/2011/texmf-dist/tex/latex/hyperref/nameref.sty
(c:/texlive/2011/texmf-dist/tex/generic/oberdiek/gettitlestring.sty))
(./test.out) (./test.out)
(c:/texlive/2011/texmf-dist/tex/latex/psnfss/ot1bch.fd) [1{c:/texlive/2011/texm
f-var/fonts/map/pdftex/updmap/pdftex.map}] [2] (./test.toc) [3] [4]
Chapter 1.
[5] [6] [7]
Overfull \hbox (3.18568pt too wide) in paragraph at lines 19--19
[]\OT1/cmr/m/n/10 Nulla non mau-ris vi-tae wisi po-suere con-va-l-lis. Sed eu n
ulla nec eros scelerisque
[8] [9]
Chapter 2.
Overfull \hbox (2.7414pt too wide) in paragraph at lines 21--21
[]\OT1/cmr/m/n/10 Etiam pede massa, dapibus vi-tae, rhon-cus in, plac-erat po-s
uere, odio. Vestibu-
[10] [11]
Overfull \hbox (5.39873pt too wide) in paragraph at lines 21--21
\OT1/cmr/m/n/10 pul-v-inar pel-len-tesque mi. Sus-pendisse sed est eu magna mo-
lestie eges-tas. Quisque
[12] [13] [14]
Chapter 3.
[15] [16] [17] [18]
LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.
(./test.aux) )
(see the transcript file for additional information){c:/texlive/2011/texmf-dist
/fonts/enc/dvips/base/8r.enc}<c:/texlive/2011/texmf-dist/fonts/type1/bitstrea/c
harter/bchb8a.pfb><c:/texlive/2011/texmf-dist/fonts/type1/public/amsfonts/cm/cm
bx10.pfb><c:/texlive/2011/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb>
<c:/texlive/2011/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb><c:/texliv
e/2011/texmf-dist/fonts/type1/public/amsfonts/cm/cmr12.pfb><c:/texlive/2011/tex
mf-dist/fonts/type1/public/amsfonts/cm/cmr17.pfb><c:/texlive/2011/texmf-dist/fo
nts/type1/public/amsfonts/cm/cmsl10.pfb>
Output written on test.pdf (18 pages, 108757 bytes).
Transcript written on test.log.
我如何强制“批处理模式”不在屏幕上显示消息?在脚本中调用“pdftex”(多次),并且一直查看消息很乏味。问候 Pablo
答案1
catoptions.sty
这里真正的罪魁祸首似乎是被调用的包xwatermark.sty
,它将不可避免地把 TeX 放入错误停止模式。
所以看来你必须\batchmode
在之后打电话
\usepackage[printwatermark,default-first-page=10]{xwatermark}%
在你的代码中。
如果你仍然想控制外部的互动,你可以这样做
\newcount\myinteractionmode
\myinteractionmode\interactionmode
\usepackage[printwatermark,default-first-page=10]{xwatermark}%
\interactionmode\myinteractionmode
这将保存当前值并在加载xwatermark
包后恢复该值。
xwatermark
不过,恐怕您还是会看到来自 的消息。
我会将此作为错误报告给的维护者catoptions.sty
。