Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I try to compile this file:

\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}

If coment xwatemark and use --interaction=batchmode, in screen display:

This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/W32TeX)
 restricted \write18 enabled.
entering extended mode

OK, but if your no comment xwatemark and use --interaction=batchmode, in screen display:

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.

how I can force "batch mode" to not display messages on screen? call "pdftex" within a script (many times) and is tedious viewing messages all the time. regards Pablo

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

The real culprit here seems to be the package catoptions.sty, called by xwatermark.sty, which will inevitably put TeX into errorstopmode.

So it seems you have to call \batchmode after

\usepackage[printwatermark,default-first-page=10]{xwatermark}%

in your code.

If you still want to control interaction from outside, you could do

\newcount\myinteractionmode
\myinteractionmode\interactionmode
\usepackage[printwatermark,default-first-page=10]{xwatermark}%
\interactionmode\myinteractionmode

which will save the current value and restore it after loading the xwatermark package.

Still, you'll see the messages from xwatermark, I'm afraid.

I'd report this as an error to the maintainer of catoptions.sty.

share|improve this answer
    
Thanks for reply, your solution it's more elegant than pdflatex --interaction=batchmode test.tex >/dev/null 2>&1 –  Pablo González L Aug 10 '12 at 11:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.