2

I need to color the background of the page. Unfortunately, command \pagecolor cancels trims. Is it possible to fix this? I'm using LuaLaTex.

Here I put an example:

\documentclass[9pt,a4paper,showtrims]{memoir}

\quarkmarks

\usepackage[italian]{babel}
\usepackage{color}

\setstocksize{178mm}{115mm}
\settrimmedsize{148mm}{100mm}{*}
\settrims{15mm}{15mm}

\begin{document}

\pagecolor{yellow}
Lorem ipsum dolor sit amet

\end{document}

The output page, when command \pagecolor{yellow} is commented looks like this:

enter image description here

When the \pagecolor{yellow} command is enabled, trims are cancelled:

enter image description here

With reference to the question posted in this question, I remark that the same problem holds using package {background} with the option {opacity = 1}.

1 Answers1

2

Just a fix... but don't ask about the numbers added in my tikz command:

\documentclass[9pt,a4paper,showtrims]{memoir}

\quarkmarks

\usepackage[english]{babel}
\usepackage{color}
\usepackage{bophook}

\setstocksize{178mm}{115mm}
\settrimmedsize{148mm}{100mm}{*}
\settrims{15mm}{15mm}
\usepackage{tikz}
\makeatletter
\AtBeginPage{\begin{tikzpicture}[overlay,remember picture]\node%[red]
at(current page.north west) {\ifodd\thepage\settrims{10.4mm}{-10.4mm}\else\relax\settrims{10.4mm}{39.9mm}
\fi%
\trimmarks};\end{tikzpicture}}
\makeatother
\begin{document}
\pagecolor{yellow}
Lorem ipsum dolor sit amet
\pagebreak

Lorem ipsum dolor sit amet
\pagebreak

Lorem ipsum dolor sit amet
\end{document}

You can use it for this specific settings just to do your job... Later may be I will try to find a real formula but for the moment I just found the numbers by testing and had no time to search and really understand the .cls code.

PS: Other users can feel free to use the idea (of the overlay) and post a better answer.

koleygr
  • 20,105
  • I had the same idea about the current page anchors etc, but wondered about the strange output. –  Feb 01 '18 at 18:25
  • @ChristianHupfer I tried midway of north and north west and was close (one of the axis was almost perfect tuned... but the other didn't) – koleygr Feb 01 '18 at 18:29