5

I am using the solution presented in Q/A 132582 to produce a transparent foreground watermark. With success most of the time. But on some rare occasions, a part of the main text is embedded into the watermark, as seen here

Problem with watermark

The text in black in the watermark should appear at the beginning of the first line of the next page instead. It is the title of a ntheorem theorem.

Thanks to Ulrike Fischer we now have a MWE :

\documentclass{article}
\usepackage{xcolor}
\usepackage[printwatermark]{xwatermark}
\newwatermark*[allpages,angle=45,scale=3,xpos=0,ypos=0]{CORRIGÉ}
\usepackage{lipsum,listings}
\usepackage{ntheorem}
\newtheorem{question}{Question}[section]
\begin{document}
\lipsum[1-4]
abc\\abc\\abc\\abc
\begin{lstlisting}
abc
abc
abc
abc
abc
\end{lstlisting}

\begin{question}blblbabc\end{question}

\end{document}

This a MWE in the sense that if you abstain from using ntheorem or replace the lstlisting with a verbatim, the problem disappears.

  • How are you making the frames? – Ulrike Fischer Dec 11 '17 at 22:31
  • With the listings package's rounded frame feature. Other documents include frames made with mdframed, but not this one. – ysalmon Dec 11 '17 at 22:45
3

This is certainly not an answer but a workaround, which may work for you if you are willing to load tikz. (The other package I am loading, eso-pic, gets loaded by the xwatermark package, so this is not an additional package.)

\documentclass{article}
\usepackage{tikz}
\usepackage{eso-pic}
\usepackage{lipsum,listings}
\usepackage{ntheorem}
\AddToShipoutPictureBG{
\tikz[overlay]{\node[rotate=45,scale=6,text=gray!50] at (current page.center){CORRIG\'E};}}
\newtheorem{question}{Question}[section]
\begin{document}
\lipsum[1-4]
abc\\abc\\abc\\abc
\begin{lstlisting}
abc
abc
abc
abc
abc
\end{lstlisting}

\begin{question}blblbabc\end{question}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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