# Set Pagestyle for new chapter types

I have created my own chapter command sheet and want to use it in the same document as a normal chapter. Both should have separate pagestyles. For the first pages of the both chapter types I found a solution. But is there a way to change the pagestyle for the rest of the sheet?

\documentclass{scrbook}
\usepackage{scrlayer-scrpage}
\RequirePackage{pageslts}
\pagenumbering{arabic}
\usepackage{lipsum}

\DeclareNewSectionCommand[%
level=0,
font=\usekomafont{chapter},
tocindent=0em,
tocnumwidth=5.75em,
style=chapter,%
tocstyle=chapter%
]{sheet}

\ofoot*{\pagemark/\lastpageref{LastPage}}
}

\ofoot*{\pagemark}
}

\renewcommand*{\chapterpagestyle}{chapter}
\renewcommand*{\sheetpagestyle}{sheet}
\pagestyle{chapter}
\begin{document}
\chapter{Chapter 1}
\lipsum[1-10]
\sheet{Sheet 1}
\lipsum[1-10]
\chapter{Chapter 2}
\lipsum[1-10]
\sheet{Sheet 2}
\lipsum[1-10]
\end{document}


I know the pagenumbering seems to make no sense in this example. I just wanted to have a little difference to keep the example as simple as possible.

KOMA-Script classes scrbook and scrreprt provide commands and options only for the first page of a heading with style=chapter or style=part. AFAIK there is no simple command or option to change the page style of the following pages.

But you could patch \chapter and \sheet and maybe \part to change the page style of following pages:

\usepackage{xpatch}
\xpretocmd\chapter{\clearpage\pagestyle{chapter}}{}{}
\xpretocmd\sheet{\clearpage\pagestyle{sheet}}{}{}


The \clearpage ensures that the page style is not changed on the last page of the previous chapter or sheet.

Example:

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

\usepackage{scrlayer-scrpage}
\usepackage{pageslts}
\pagenumbering{arabic}

\DeclareNewSectionCommand[%
level=\chapternumdepth,
font=\usekomafont{chapter},
tocindent=0em,
tocnumwidth=5.75em,
style=chapter,%
tocstyle=chapter,%
]{sheet}

\renewcommand*\chapterpagestyle{chapter}

\ofoot*{\pagemark/\lastpageref{LastPage}}
}

\ofoot*{\pagemark}
}

\usepackage{xpatch}
\xpretocmd\chapter{\clearpage\pagestyle{chapter}}{}{}
\xpretocmd\sheet{\clearpage\pagestyle{sheet}}{}{}

\begin{document}
\chapter{Chapter 1}
\lipsum[1-10]
\sheet{Sheet 1}
\lipsum[1-10]
\chapter{Chapter 2}
\lipsum[1-10]
\sheet{Sheet 2}
\lipsum[1-10]
\end{document}


Result: