scrlttr2 - definir nextfoot igual ao firstfoot

scrlttr2 - definir nextfoot igual ao firstfoot

Estou tentando obter o mesmo rodapé em todas as páginas da primeira página do scrlttr2. Depois de pesquisar um pouco no Google, descobri este código:

\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}

Você tem que preencher o comentário com lorem ispum ou outra coisa para gerar uma segunda página!

Mas tenho os seguintes problemas:

  1. \pagestyle{headings}também insere os cabeçalhos na próxima página. Eu não quero isso!
  2. O rodapé da próxima página não foi renderizado corretamente. Se parece com isso:

Rodapé errado

enquanto na primeira página fica assim:

Bom rodapé

Por que?

Responder1

Para remover o cabeçalho nas próximas páginas use

\setkomavar{nexthead}{}

Para o segundo problema use um \parboxinteriorfirstfoot

\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}%
    }%
}%

Observe que firstfoot também é uma variável e o comando \firstfootestá depreciado.

Mas o rodapé ainda terá posição e largura diferentes nas duas páginas:

insira a descrição da imagem aqui


Estilo de página plaincom pacotescrlayer-scrpage

Eu carregaria o pacote scrlayer-scrpagee usaria um estilo de página simples em todas as páginas.

Os exemplos a seguir usam o plainestilo normal. Apenas o footsepline está um pouco deslocado para cima.

\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}

insira a descrição da imagem aqui

Mas você também pode alterar a posição vertical e a largura do rodapé de acordo com suas necessidades. Aqui está um exemplo semelhante às firstfootconfigurações normais.

\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}

insira a descrição da imagem aqui

informação relacionada