将 scrlttr2 文档类的折叠标记扩展到更多页面

将 scrlttr2 文档类的折叠标记扩展到更多页面

我正在使用扩展到多页的文档类撰写一封较长的信件scrlttr2。我在类选项中激活了 foldmarks 参数。

但是,折叠标记不会出现在第二页及之后的页面上。如何将折叠标记扩展到第一页以外的其他页面?


编辑:正如 esdd 的评论所说,该帖子在页边距添加标记线提供了一种解决方法。

答案1

scrlttr2仅支持在信件首页上使用折叠标记。它们以与发件人信息、地址、徽标等相同的方式(使用伪长度)放在第一页上。

但你可以加载包scrlayer-scrpage并使用其伪长度为折叠标记定义新层

\usepackage[manualmark]{scrlayer-scrpage}% sets automatically page style scrheadings
\DeclareNewLayer[%
  background,
  innermargin,
  oddpage,
  height=\useplength{tfoldmarkvpos}+.5\useplength{foldmarkthickness},
  hoffset=\useplength{foldmarkhpos},
  mode=picture,
  contents=\putLL{\rule{\useplength{tfoldmarklength}}{\useplength{foldmarkthickness}}}
]{tfoldmark}
\DeclareNewLayer[%
  clone=tfoldmark,
  height=\useplength{bfoldmarkvpos}+.5\useplength{foldmarkthickness},
  contents=\putLL{\rule{\useplength{bfoldmarklength}}{\useplength{foldmarkthickness}}}
]{bfoldmark}
\DeclareNewLayer[%
  clone=tfoldmark,
  height=.5\paperheight+.5\useplength{foldmarkthickness},
  contents=\putLL{\rule{\useplength{pfoldmarklength}}{\useplength{foldmarkthickness}}}
]{pfoldmark}

然后,您必须将图层添加到后续页面使用的页面样式中:

\AddLayersToPageStyle{scrheadings}{tfoldmark,bfoldmark,pfoldmark}
%\AddLayersToPageStyle{plain.scrheadings}{tfoldmark,bfoldmark,pfoldmark}

请注意,信件的第一页采用的是页面样式empty

梅威瑟:

\documentclass{scrlttr2}
\usepackage{lipsum}% only for dummy text

\usepackage[manualmark]{scrlayer-scrpage}% sets automatically page style scrheadings
% declare new layers for the fold marks on subsequent pages using their pseudo-lengths
\DeclareNewLayer[%
  background,
  innermargin,
  oddpage,
  height=\useplength{tfoldmarkvpos}+.5\useplength{foldmarkthickness},
  hoffset=\useplength{foldmarkhpos},
  mode=picture,
  contents=\putLL{\rule{\useplength{tfoldmarklength}}{\useplength{foldmarkthickness}}}
]{tfoldmark}
\DeclareNewLayer[%
  clone=tfoldmark,
  height=\useplength{bfoldmarkvpos}+.5\useplength{foldmarkthickness},
  contents=\putLL{\rule{\useplength{bfoldmarklength}}{\useplength{foldmarkthickness}}}
]{bfoldmark}
\DeclareNewLayer[%
  clone=tfoldmark,
  height=.5\paperheight+.5\useplength{foldmarkthickness},
  contents=\putLL{\rule{\useplength{pfoldmarklength}}{\useplength{foldmarkthickness}}}
]{pfoldmark}
% add the wanted fold marks to the layer page style(s) used on subsequent pages
\AddLayersToPageStyle{scrheadings}{tfoldmark,bfoldmark,pfoldmark}
%\AddLayersToPageStyle{plain.scrheadings}{tfoldmark,bfoldmark,pfoldmark}

\begin{document}
\begin{letter}{address}
\opening{Hello}
\lipsum
\closing{Bye}
\end{letter}
\end{document}

在此处输入图片描述

相关内容