scrlttr2 引用字段行在每一页上

scrlttr2 引用字段行在每一页上

这是我在第一页的参考字段行。

\removereffields %<- delete default order of the predefined variables
\setkomavar{date}{\today} 
\setkomavar{invoice}[Rechnungsnummer]{1234567}
\setkomavar{customer}[Kundennummer]{Kdr.12345}


\newkomavar[Bestellnummer]{ordernr}%<-- custom variables

\setkomavar{ordernr}{123456789}

\addtoreffields{invoice}   %<-- custom order of variables
\addtoreffields{customer} 
\addtoreffields{ordernr}

我想把它放在所有后续页面上,放在带有图片的页眉和连续表格之间,就像这里我用红色框标记的那样。在此处输入图片描述

既然我已经xltabular知道除了它之外不会有任何文本,也许可以把它放在 Xltable 的标题中?我只是希望它看起来和第一页一样整洁。

以下是完整的 tex 代码:

\documentclass[
  fontsize=11pt, 
  paper=a4,
  parskip=half, 
  firsthead=off,
  firstfoot=off
]{scrlttr2}

\usepackage[textwidth=\useplength{firstfootwidth}]{geometry}

%just for measure 
%\usepackage{xcolor}
%\usepackage[grid, gridunit=mm, gridcolor=blue!40, subgridcolor=blue!20]{eso-pic}

\usepackage[T1]{fontenc} 
\usepackage[ngerman]{babel} 
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage{xltabular}
\newcolumntype{R}{>{\raggedleft\arraybackslash}X}%

\usepackage{blindtext}% only for dummy text

\renewcommand*\familydefault{\sfdefault}
\renewcommand*{\raggedsignature}{\raggedright}

\newcommand{\mVorname}{stupid company GmbH} 
\newcommand{\mNachname}{\& Co. KG} 
\newcommand{\mStrasse}{Somestreet. 1} 
\newcommand{\mStadt}{Somecity} 
\newcommand{\mPLZ}{22223} 
\setkomavar{date}{} 


\setkomavar{fromname}{\mVorname{}~\mNachname{}}
\setkomavar{fromaddress}{\mStrasse{}\\{}\mPLZ{}~\mStadt{}}

\setkomavar{frombank}{SomeBank\\IBAN:DE00 0000 0000 0000 0000 00\\BIC: AAAAAAAAAAA}
\newcaptionname{ngerman}{\banknames}{Bankverbindungen}
\newkomavar[\banknames]{frombanks}
\newkomavar[\usekomavar*{frombank}]{secondfrombank}
\setkomavar{secondfrombank}{Someotherbank\\IBAN:DE00 0000 0000 0000 0000 00\\BIC: BBBBBBBBBBB}
\newkomavar[\usekomavar*{frombank}]{thirdfrombank}
\setkomavar{thirdfrombank}{Somethirdbank\\IBAN:DE00 0000 0000 0000 0000 00\\BIC: CCCCCCCCCCC}

\setkomavar{location}{\raggedright 
  Versandanschrift:\\
  \vfill
  Some Guy\\
  23423 Blablubbing\\
  Blabistan\\
  Telefon
} 

%\setplength{locvpos}{4.8cm}
\setplength{locwidth}{7.5cm}
\setplength{firstfootvpos}{250mm}


\LoadLetterOption{visualize}% loads visualize.lco to visualize boxes
\showfields{head,address,location,refline,foot}% show 

\renewcommand*\pagemark{%
  \usekomafont{pagenumber}{\pagename~\thepage~von~\letterlastpage}%
}

\setkomavar{firstfoot}{%
  \usekomafont{pageheadfoot}{% <- changed: { added
    \parbox{\useplength{firstfootwidth}}{%
      \rule{\linewidth}{.4pt}\\
      \parbox[t]{0.31\linewidth}{%
        \begin{tabular}[t]{l}
          \multicolumn{1}{@{}l@{}}{\textbf{Geschäftsinformation:}}\\ 
          persönlich haftende Gesellschafterin:\\ 
          stupid company Verwaltungs-GmbH\\
          Amtsgericht Somecity, HBR 111111 \\
          Handelsregister: Somecity HRA222222 \\
          \begin{tabular}{@{}l@{\;}l@{}}USt-IdNr.:& DE 000000000 \\
          WEEE-Nr.: & DE 00000000 \end{tabular}\\
          Geschäftsführer: Some Guy \\
          Sitz Somecity 
        \end{tabular}
      }%
      \hfill
      \parbox[t]{0.31\linewidth}{%
        \begin{tabular}[t]{l@{}}
          \multicolumn{1}{@{}l@{}}{\textbf{\usekomavar*{frombanks}:}} \smallskip \\
          \usekomavar{frombank} \smallskip \\
          \usekomavar{thirdfrombank}
        \end{tabular}%
      }%
      \hfill
      \parbox[t]{0.31\linewidth}{%
        \begin{tabular}[t]{l@{}}
          \multicolumn{1}{@{}l@{}}{} \smallskip \\ 
          \usekomavar{secondfrombank}
        \end{tabular}%
      }%
      \par\centering\pagemark\par
}}}

\setkomafont{pageheadfoot}{\scriptsize}

\usepackage{scrlayer-scrpage}
\clearpairofpagestyles
\DeclareNewLayer[
  foreground,
  textarea,
  voffset=\useplength{firstfootvpos},
  hoffset=\dimexpr.5\paperwidth-.5\useplength{firstfootwidth}\relax,
  width=\useplength{firstfootwidth},
  mode=picture,
  contents=\putUL{\raisebox{\dimexpr-\height}{\usekomavar{firstfoot}}}
]{likefirstpage.foot}

\DeclareNewLayer[
  background,
  page,
  addvoffset=20pt+.3333em,
  addhoffset=47pt+.3333em,
  addwidth=-47pt-.6666em,
  addheight=-20pt-.6666em,
  mode=picture,
  contents={%
    \putUR{\raisebox{\dimexpr-\height}{\makebox[0pt][r]{\includegraphics[height=18mm]{example-image}\hspace{10pt}}}}%
    \putUL{\raisebox{\dimexpr-\height}{\includegraphics[height=15mm]{example-image}}}%
    \putLR{\makebox[0pt][r]{\includegraphics[height=13mm]{example-image}}}%
  }
]{logos}
\AddLayersToPageStyle{@everystyle@}{logos,likefirstpage.foot}% <- add likefirstpage.foot to @everystyle@

\AtBeginLetter{\flushbottom}% maybe?

\begin{document} 
\begin{letter}{%
  Max Musterkunde\\
  Teststraße 2\\
  55555 Teststadt\\
  Schweiz\\
}
\setkomavar{subject}{BETREFF} 


\removereffields %<- delete default order of the predefined variables
\setkomavar{date}{\today} 
\setkomavar{invoice}[Rechnungsnummer]{1234567}
\setkomavar{customer}[Kundennummer]{Kdr.12345}


\newkomavar[Bestellnummer]{ordernr}%<-- custom variables

\setkomavar{ordernr}{123456789}

\addtoreffields{invoice}   %<-- custom order of variables
\addtoreffields{customer}
\addtoreffields{ordernr}

\opening{}

\begin{xltabular}{\textwidth}{R X X R R R}
    
    Firstttttttt & Second & Third & Forth & Fifth & Lasttttttt \\ \hline 
    \endfirsthead

    Firstttttttt & Second & Third & Forth & Fifth & Lasttttttt \\ \hline 
    \endhead
    
    
    \hline
    \multicolumn{6}{l}{Bla}
    \endlastfoot
    
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\ 
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\
    One & abcdef & ghjijklmn & 123.456778 & 5 & 6\\ *[\fill]
\end{xltabular}  

\end{letter}
\end{document}

相关内容