1

When I compile this code

\documentclass{article}
\usepackage{blindtext}

\usepackage{color}
\usepackage{picture}
\usepackage{atbegshi}
\AtBeginShipoutInit

\AtBeginShipout{%
 \AtBeginShipoutUpperLeft{%
  \put(0,-\paperheight){{\color{red}\box\AtBeginShipoutBox}}%
 }%
}

\begin{document}
\blinddocument
\end{document}

I get (page 2)

enter image description here

Question: why labels are in black?

  • Interesting how color is a little more forgiving than xcolor. Loading the latter makes \color{red} not influence the \box\AtBeginShipoutBox. – Werner Dec 31 '15 at 18:40
  • @Werner yes, this may be will the next question I find that with xcolor the color change starting from page 2! – touhami Jan 1 '16 at 8:43
3

In order to obtain the appropriate alignment in lists (specifically for itemize and enumerate), LaTeX boxes the item labels. And once things are boxed, it's fixed and your \color command doesn't reach it.

Here's a minimal example replicating the behaviour using the temporary box \@tempboxa:

enter image description here

\documentclass{article}

\usepackage{color,picture,atbegshi}

\AtBeginShipout{%
 \AtBeginShipoutUpperLeft{%
  \put(0,-\paperheight){{\color{red}\box\AtBeginShipoutBox}}%
 }%
}

\begin{document}
\makeatletter
% Since this is boxed, it will remain black
\sbox\@tempboxa{this is some text}\usebox\@tempboxa
\makeatother

\begin{itemize}
  \item First
  \item Second
  \item Last
\end{itemize}

\end{document}
| improve this answer | |
3

If you are using pdflatex you can set the color using a \pdfliteral which affects everything, because the color is rendered in the viewer and TeX doesn't know about it.

\documentclass{article}
\usepackage{blindtext}
\usepackage{picture}
\usepackage{atbegshi}
\AtBeginShipoutInit

\AtBeginShipout{%
 \AtBeginShipoutUpperLeft{%
  \put(0,-\paperheight){%
    % Color code:        R G B
    \pdfliteral direct{q 1 0 0 rg}%
    \box\AtBeginShipoutBox%
    \pdfliteral direct{Q}%
  }%
 }%
}

\begin{document}
\blinddocument
\end{document}

enter image description here

| improve this answer | |

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.