
나는 scrlttr2의 첫 번째 페이지와 동일한 바닥글을 모든 페이지에 얻으려고 노력하고 있습니다. 인터넷 검색 끝에 다음 코드를 생각해 냈습니다.
\documentclass{scrlttr2}
\begin{document}
\firstfoot{\footnotesize%
\rule[3pt]{\textwidth}{.4pt} \\
\begin{tabular}[t]{l@{}}%
Super Man\\
Super Straße 30\\
12345 Super Town
\end{tabular}%
\hfill
\begin{tabular}[t]{l@{}}%
Telefon: +49123456789\\
[email protected]\\
\end{tabular}%
\hfill
\begin{tabular}[t]{l@{}}%
Bankverbindung: \\
IBAN: DEXX XXXX XXXX XXXX XX\\
BIC: XXXXXXXXXXXXX
\end{tabular}%
}%
\addtokomafont{pagefoot}{\normalfont}
\pagestyle{headings}
\nextfoot{\usekomavar{firstfoot}}
\begin{letter}{Addr}
\opening{}
% You have to fill enough text to get to the second page
\closing{}
\end{letter}
\end{document}
두 번째 페이지를 생성하려면 lorem ispum이나 다른 것으로 댓글을 채워야 합니다!
하지만 다음과 같은 문제가 있습니다.
\pagestyle{headings}
또한 다음 페이지에 헤더를 삽입합니다. 나는 그것을 원하지 않는다!- 다음 페이지의 바닥글이 올바르게 렌더링되지 않습니다. 다음과 같습니다.
첫 번째 페이지에는 다음과 같습니다.
왜?
답변1
다음 페이지에서 헤더를 제거하려면 다음을 사용하십시오.
\setkomavar{nexthead}{}
두 번째 문제의 경우 \parbox
내부 를 사용하십시오.firstfoot
\setkomavar{firstfoot}{\usekomafont{pageheadfoot}\usekomafont{pagefoot}%
\parbox[t]{\textwidth}{%
\rule[3pt]{\linewidth}{.4pt} \\
\begin{tabular}[t]{l@{}}%
Super Man\\
Super Straße 30\\
12345 Super Town
\end{tabular}%
\hfill
\begin{tabular}[t]{l@{}}%
Telefon: +49123456789\\
[email protected]\\
\end{tabular}%
\hfill
\begin{tabular}[t]{l@{}}%
Bankverbindung: \\
IBAN: DEXX XXXX XXXX XXXX XX\\
BIC: XXXXXXXXXXXXX
\end{tabular}%
}%
}%
firstfoot도 변수이며 command는 \firstfoot
가치가 떨어집니다.
그러나 바닥글은 두 페이지에서 여전히 다른 위치와 너비를 갖습니다.
plain
패키지가 포함된 페이지 스타일scrlayer-scrpage
패키지를 로드 scrlayer-scrpage
하고 모든 페이지에 일반 페이지 스타일을 사용하겠습니다.
다음 예에서는 일반 plain
스타일을 사용합니다. 풋스플라인만 약간 위쪽으로 이동합니다.
\documentclass[
firstfoot=false,%<- no first foot
footheight=48pt
]{scrlttr2}
\usepackage{blindtext}% dummy text
\usepackage[footsepline,plainfootsepline]{scrlayer-scrpage}
\ModifyLayer[
addvoffset=-1ex
]{plain.scrheadings.foot.above.line}% shift the footsepline up
\addtokomafont{pagefoot}{\normalfont\footnotesize}
\clearpairofpagestyles
\cfoot*{
\begin{tabular}[t]{l@{}}%
Super Man\\
Super Straße 30\\
12345 Super Town
\end{tabular}%
\hfill
\begin{tabular}[t]{l@{}}%
Telefon: +49123456789\\
[email protected]\\
\end{tabular}%
\hfill
\begin{tabular}[t]{l@{}}%
Bankverbindung: \\
IBAN: DEXX XXXX XXXX XXXX XX\\
BIC: XXXXXXXXXXXXX
\end{tabular}%
}
\pagestyle{plain}
\usepackage{xpatch}
\xapptocmd\opening{\thispagestyle{plain}}{}{}% <- first pages will have pagestyle plain too
\begin{document}
\setkomavar{fromname}{Name}
\setkomavar{firsthead}{It is still possible to set a firsthead.}% <- firsthead still works
\begin{letter}{Addr}
\opening{}
\Blindtext
\closing{}
\end{letter}
\end{document}
그러나 필요에 따라 바닥글의 세로 위치와 너비를 변경할 수도 있습니다. 다음은 일반 설정과 유사한 예입니다 firstfoot
.
\documentclass[
firstfoot=false,%<- no first foot
footheight=48pt
]{scrlttr2}
\usepackage{blindtext}% dummy text
\usepackage[footsepline,plainfootsepline]{scrlayer-scrpage}
\KOMAoptions{footwidth=\useplength{firstfootwidth}}
\ForEachLayerOfPageStyle*{plain.scrheadings}{%
\ifstrstart{#1}{plain.scrheadings.foot}{%
\ModifyLayer[
voffset={\useplength{firstfootvpos}-1em}
]{#1}
}{}
}% shift the footer down
\ModifyLayer[
addvoffset=-1ex
]{plain.scrheadings.foot.above.line}% shift the footsepline up
\addtokomafont{pagefoot}{\normalfont\footnotesize}
\clearpairofpagestyles
\cfoot*{
\begin{tabular}[t]{l@{}}%
Super Man\\
Super Straße 30\\
12345 Super Town
\end{tabular}%
\hfill
\begin{tabular}[t]{l@{}}%
Telefon: +49123456789\\
[email protected]\\
\end{tabular}%
\hfill
\begin{tabular}[t]{l@{}}%
Bankverbindung: \\
IBAN: DEXX XXXX XXXX XXXX XX\\
BIC: XXXXXXXXXXXXX
\end{tabular}%
}
\pagestyle{plain}
\usepackage{xpatch}
\xapptocmd\opening{\thispagestyle{plain}}{}{}% <- first pages will have pagestyle plain too
\begin{document}
\setkomavar{fromname}{Name}
\setkomavar{firsthead}{It is still possible to set a firsthead.}% <- firsthead still works
\begin{letter}{Addr}
\opening{}
\Blindtext
\closing{}
\end{letter}
\end{document}