Page LayoutKOMA-script: Layer to Pagestyle to Titlepage

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Christoph
Posts: 29
Joined: Tue Mar 22, 2022 5:22 pm

KOMA-script: Layer to Pagestyle to Titlepage

Post by Christoph »

Hey,

To get a titlepage I started a new KOMA-script Layer which I used for a pagestyle. This pagestyle I would like to use at my first titlepage. How can I do that?
For further informations see also:
https://latex.org/forum/viewtopic.php?f=47&t=34826

Code: Select all

\documentclass[
%	paper=a4,
	fontsize=12pt,%
]{scrreprt}

\usepackage[T1]{fontenc}
%\usepackage{tgadventor}
\usepackage{xcolor}
\usepackage{lipsum}
\usepackage[ngerman]{babel}

% Only if the base font of the document is to be sans serif
%\renewcommand*\familydefault{\sfdefault}

%% PAGE AND DOCUMENT LAYOUT %%
\usepackage[
	inner=2cm,
	outer=1cm,
	top=3cm,
%	includehead,
	bottom=2.5cm,
%	includefoot	
%	includeheadfoot,
	head=43.5pt
]{geometry}

\usepackage{lastpage}
\usepackage[
	headsepline,
	footsepline,
]{scrlayer-scrpage}
%\pagestyle{scrheadings} %Wird bereits mitscrlayer-scrpage mitgeladen
\clearpairofpagestyles

\setkomafont{pageheadfoot}{\normalfont\footnotesize}

\renewcommand*{\chapterpagestyle}{headings}




%% TITLE PAGES %%

\DeclareNewLayer[%
	voffset=1cm,%
	hoffset=2cm,%
	width=\paperwidth-3cm,%
	height=\paperheight-2cm,%
	background,%
	mode=picture,%
contents={%
	\putLL{\line(1,0){\LenToUnit{\layerwidth}}}%
	\putLR{\line(0,1){\LenToUnit{\layerheight}}}%
%	\putUR{\line(-1,0){\LenToUnit{\layerwidth}}}%
	\putUR{\line(-1,0){\LenToUnit{0.5\layerwidth}}}%
%	\putUL{\line(0,-1){\LenToUnit{1cm}}}%
	\putLL{\line(0,1){\LenToUnit{1,5cm}}}%
	\put(%
		\LenToUnit{0.5\layerwidth},0)%
		{\line(0,1){\LenToUnit{1,5cm}}}%
	\put(%
		\LenToUnit{0.25\layerwidth},0)%
		{\line(0,1){\LenToUnit{1,5cm}}}%
	\put(%
		\LenToUnit{0.75\layerwidth},0)%
		{\line(0,1){\LenToUnit{1,5cm}}}%
	\put(%
		0,\LenToUnit{1,5cm})%
		{\line(1,0){\LenToUnit{\layerwidth}}}%
	\put(%
		\LenToUnit{0.5\layerwidth},\LenToUnit{\layerheight})%
		{\line(0,-1){\LenToUnit{4cm}}}%
	\put(%
		0,\LenToUnit{\layerheight-4cm})%
		{\line(1,0){\LenToUnit{0.5\layerwidth}}}%
}
]{CoverPage}
\DeclareNewPageStyleByLayers{CoverPageSyle}{CoverPage}

\titlehead{Kopf der Titelei}
\subject{subject: Beispiel}
\title{Titel des Dokumentes}
\subtitle{Eine grosse Titelei als Beispiel auf goLaTeX.de}
\author{Max Muster \and goLaTeX\thanks{Fussnote zum Autor}}
\date{01.01.0001}
\publishers{Betreut und herausgegeben von Prof. Dr. rer. LaTeX}
\uppertitleback{Obiger Titelrückentitel}
\lowertitleback{Für dieses Beispiel wird keine Haftung übernommen.}
\pagestyle{CoverPageSyle}
\begin{document}

\begin{titlepage}



Auftraggeberin:\\
Forst und Wiesen GmbH\\
Am Eisenstein 5\\
1160 Gscheid\\
+43 1234 1234\\
%office@░wiesenforst.at\\
\end{titlepage}
%\makeatother
\restoregeometry


\tableofcontents
	
\chapter{Allgemeine Angaben}
\lipsum[2]


\section{Konsensinhaber}

\lipsum[5]

\subsection{Subsection}

\lipsum[3]

\subsubsection{Subsubsection}

\lipsum[2]

\paragraph{Paragraph}

\lipsum[1]

\subparagraph{Subparagraph}
\lipsum[8]



\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
MjK
Posts: 89
Joined: Fri Jan 28, 2022 6:09 pm

KOMA-script: Layer to Pagestyle to Titlepage

Post by MjK »

Environment titlepage always uses page style empty for this page. So you either have to add the layer to this page style (and remove it after the title) or just use a \thispagestyle{CoverPageSyle} inside the titlepage environment.

BTW: Some more notes not related to KOMA-Script (and so I will only state them but I'm not willing to discuss them):
  • For a single title page I would not use another page style or an extra layer but simply put the graphics as usual page contents, e.g., using a picture environment.
  • lastpage does not always work correctly and can break other packages, because it adds additional \clearpage via \AtEndDocument}. It would be better, if the package would use the general LaTeX hook enddocument/afterlastpage, but the package author has decided not to do so yet. So pageslts is sometimes the better one (but I've not inspected this package for compatibility with up-to-date LaTeX kernels).
  • If your document is in German, I would suggest to set option ngerman already at \documentclass (but still load babel), because some other packages also know the option and would see it in \documentclass (because these are options not only passed to the class but processed by all packages, that declare them).
  • Using \\ inside justified text is not recommend. You should switch to, e.g. \raggedright before.
My main topics are KOMA-Script and other questions related to my packages. If I reply to any other topic or if you've not yet added a minimal working example, please do not expect any further response. And please don't forget to tag examples as code.
Christoph
Posts: 29
Joined: Tue Mar 22, 2022 5:22 pm

KOMA-script: Layer to Pagestyle to Titlepage

Post by Christoph »

Thanks,

I´ve added

Code: Select all

\thispagestyle{CoverPageSyle}
inside the titlepage environment

I´ve started an disscussion about using picture environment OR KOMA Layers:
https://latex.org/forum/viewtopic.php?f=47&t=34831
Post Reply