0

I write a letter with scrlttr2 and try to colorize the background of the header.

For some reason, I need some crop marks. So I maximize my letter from DIN-A4 to DIN-A3 with the package crop. But now, the colorized header background is too large.

I think the problem is the definition of the layer. I realized that with scrlayer-scrpage. I mean, I just copy+pasted it from an example I found somewhere at the Internet without understanding what really happened there ...

I hope someone can solve my problem :)

MWE:

\documentclass[paper=a4]{scrlttr2}
\RequirePackage[utf8]{inputenc} 
\usepackage[T1]{fontenc}
\usepackage{xcolor}
\usepackage{lipsum}
\usepackage[automark]{scrlayer-scrpage}
\DeclareLayer[{%
    background,%
    align=lt,%
    area={0pt}{0pt}{\paperwidth}{\dimexpr\voffset+1in+\topmargin+\headheight\relax},
    contents={\color{green}\rule{\layerwidth}{\layerheight}}
}]{scrheadings.head.background}
\AddLayersAtBeginOfPageStyle{@everystyle@}{scrheadings.head.background}

\setkomavar{subject}{MWE}
\usepackage[cam,a3,center]{crop}
\begin{document}
\begin{letter}{adress 1\\
   adress 2\\
   adress 3\\
   adress 4\\
   adress 5}
\opening{Hi,}

\lipsum[1]

\closing{kindly regards}
\end{letter}
\end{document}

letter (original A4)

letter with activated crop-option; header background is too height

1 Answer 1

3

Welcome to TeX.SX! The culprit seems to be \voffset which is obviously redefined by the crop package when the additional space is added above the actual page frame. I think, you can safely delete it, since in your original set up it has 0pt. (You can check this by putting \the\voffset somewhere on your page and load or unload the crop package.)

You may want to add some bleed of 3mm to the right, left and upper edge of the green block. So, you should be fine with the following:

\documentclass[paper=a4]{scrlttr2}
\RequirePackage[utf8]{inputenc} 
\usepackage[T1]{fontenc}
\usepackage{xcolor}
\usepackage{lipsum}
\usepackage[automark]{scrlayer-scrpage}
\DeclareLayer[{%
    background,%
    align=lt,%
    area={-3mm}{-3mm}{\paperwidth+6mm}{\dimexpr(1in+\topmargin+\headheight+3mm)\relax},
    contents={\color{green}\rule{\layerwidth}{\layerheight}}
}]{scrheadings.head.background}
\AddLayersAtBeginOfPageStyle{@everystyle@}{scrheadings.head.background}

\setkomavar{subject}{MWE}
\usepackage[cam,a3,center]{crop}

\begin{document}
\begin{letter}{adress 1\\
   adress 2\\
   adress 3\\
   adress 4\\
   adress 5}
\opening{Hi,}

\lipsum[1]

\closing{kindly regards}
\end{letter}
\end{document}

enter image description here

1
  • It works, thank you very much :) Your explanations were very helpful.
    – Bigga
    Mar 30, 2021 at 6:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .