1

I'm trying to add titles at a specific location (over a letterhead) for a number of pages (1-2) and then add a new title to the following 2. I have two problems. First AtBegShi starts at the second page \AtBeginShipoutFirst doesn't fix this, and secondly \AtBeginShipoutDiscard doesnt reset AtBegShi so it has Rhubarb and Custard superimposed.

Any thoughts on this would be extremely gratefully received. thanks

\documentclass[10pt]{article}
\usepackage{atbegshi}
\usepackage{textpos}
\AtBeginShipoutInit

\def\mycontent{rhubarb}

\AtBeginShipout{
    \begin{textblock}{6}[0,0](0.1,-0.15)
    \mycontent
    \end{textblock}
    }
    \AtBeginShipoutFirst{
    \begin{textblock}{6}[0,0](0.1,-0.15)
    \mycontent
    \end{textblock}
    }

\begin{document}

blah
\newpage
blah
\newpage
\def\mycontent{custard}

blah
\newpage
blah
\end{document} 
  • 1
    It's more convenient to replace Rhubarb/Custard with a macro, say \sometext, and then redefine \sometext appropriately. – Werner Feb 17 '13 at 05:29
  • Try xwatermark package. – Ahmed Musa Feb 17 '13 at 06:52
  • thanks @Werner, that is extremely elegant! Would you happen to know how to get the shipout to start from page 1? – Tahnoon Pasha Feb 17 '13 at 09:26
  • thanks @AhmedMusa. Looking at the documentation for xwatermark now. Looks very powerful, but struggling to get to grips with the fontseries options. It hangs if I put \textbf\textsc{mytext} in the {} braces, and hangs if I use the fontseries=\bfseries\scshape formulation. I'm trying to find the series spec for the \FancyPageNos macro but a google search hasn't had results. Do you know where the documentation might be available? – Tahnoon Pasha Feb 17 '13 at 09:29
  • Please can you give a minimal non-working example? – Ahmed Musa Feb 18 '13 at 17:05
  • Hi @AhmedMusa. MWE changed to MNWE. I've adopted Werner's recommendation for changing the reference for AtBegShi which works extremely well. Now I just need to figure out how to get it to show up on the first page too. – Tahnoon Pasha Feb 19 '13 at 00:31

1 Answers1

2

I don't know what you need textpos for, but I was able to generate the following. The watermark appears on pages 1 and 3. You can adjust the key values of \newwatermark and \xwmcolorbox to suit your need.

\documentclass[10pt]{article}
\usepackage[printwatermark]{xwatermark}
\usepackage{xcolor}
\usepackage{lipsum}
\def\mycontent{rhubarb}
\newwatermark[coord-unit=cm,pagex={1,3},xpos=0,ypos=4]{%
  \xwmcolorbox[framesep=4pt,innerframerule=4pt,outerframerule=2pt,
    fillcolor=brown!70!yellow!55,innerframecolor=white,
    outerframecolor=blue,height=1cm,width=.8\paperwidth,
    depth=.4cm,textalign=center,textcolor=blue]{%
      \scalebox{2.5}{\textbf{\mycontent}}%
  }%
}

\begin{document}
\lipsum[1-5]
\newpage
\lipsum[1-5]
\newpage
\def\mycontent{custard}
\lipsum[1-5]
\newpage
\lipsum[1-5]
\end{document} 

enter image description here

Ahmed Musa
  • 11,742
  • thanks @AhmedMusa, that works and I've marked it as answered for all your help. I would still like to now how to get a shipout payload on the first page using AtBegShi. Perhaps I'll put it in a separate question. – Tahnoon Pasha Feb 19 '13 at 03:28
  • See the answers at http://tex.stackexchange.com/questions/73938/tikz-and-atbegshi. – Ahmed Musa Feb 19 '13 at 18:31