1

I am trying to get the headings on the same page and have already tried using /nopagebreak and samepage, however it will still break the page. As to my understanding, the pdf size should be small enough for the headings to be displayed in one page.

So it should be

Anhang
A Gesetzesauszüge
A.1 Gesetzesauszug Zivilrecht: Art. 3, Abs. 1
Sōzoku no kōryoku. Sōsoku [Auswirkungen der Vererbung. Vererbung] (1947): Art. 3, Abs. 1.

in one page: used pdf

% arara: lualatex: { shell: true, synctex: true }

\documentclass[
  12pt,
  a4paper,
  headings=standardclasses,
  listof=totoc,
  numbers=noenddot
]{scrartcl}

\usepackage{showframe}
\usepackage[left=2.50cm, right=2.50cm, top=2.50cm, bottom=2.00cm, footskip=1cm]{geometry}
\usepackage[onehalfspacing]{setspace}
\usepackage[main=ngerman, english]{babel}
\usepackage[babel, german=quotes]{csquotes}
\usepackage[ngerman]{isodate}
\usepackage[ngerman]{datetime}

\renewcommand\sectionformat{\mbox{\thesection.\enskip$|$\enskip}}% 
\usepackage[ngerman]{datetime}

\RedeclareSectionCommand[
  beforeskip=2\baselineskip,% positive value, if afterindent=false is set
  afterindent=false,
  afterskip=.5\baselineskip,
  tocentrynumberformat=\def\autodot{.} % replace \autodot by a fixed dot for section entries
   ]{section}

\RedeclareSectionCommand[
  beforeskip=-1\baselineskip,
  afterskip=.5\baselineskip]{subsection}

\RedeclareSectionCommand[
  beforeskip=-1\baselineskip,
  afterskip=.5\baselineskip]{subsubsection}

\RedeclareSectionCommand[
  beforeskip=-1\baselineskip,
  afterskip=.5\baselineskip]{paragraph}

\RedeclareSectionCommand[
  beforeskip=-1\baselineskip,
  afterskip=.5\baselineskip]{subparagraph}
  \usepackage{authblk}

\usepackage[
  backend=biber,
  style=ext-authoryear,
  sorting=nyvt,
  datamodel=customstyles,
  maxnames=25,
  innamebeforetitle=true,
  usetranslator=true,
  alldates=terse,
  labeldate=year,
  dashed=false,
  isbn=false
]{biblatex}
\addbibresource{library.bib}
\usepackage[hidelinks, pdfencoding=auto]{hyperref}

\newcommand*\appendixmore{
  \clearpage
  \renewcommand{\thesubsection}{\Alph{subsection}}%
}

\usepackage{graphicx}
\graphicspath{ {./figures/} }
\usepackage[final]{pdfpages}
\usepackage{chngcntr}
\renewcommand{\listfigurename}{Abbildungsverzeichnis}
\renewcommand{\figurename}{Abb.}
\counterwithout{figure}{section}
\renewcommand{\listtablename}{Tabellenverzeichnis}
\renewcommand{\tablename}{Tab.}
\counterwithout{table}{section}

\usepackage{array}
\newcolumntype{P}[1]{>{\raggedleft\arraybackslash}p{#1}}

\begin{document}
\clearpage
\appendix
\addsec{\appendixname}
\subsection{Gesetzesauszüge}
\includepdf[pages=1,scale=0.7,pagecommand=\thispagestyle{plain}\subsubsection{Gesetzesauszug Zivilrecht: Art. 3, Abs. 1}\label{ssec:heir3} \normalsize{Sōzoku no kōryoku. Sōsoku [Auswirkungen der Vererbung. Vererbung] (1947): Art. 3, Abs. 1.}]{heir.pdf}
\includepdf[pages=2,scale=0.7,pagecommand=\thispagestyle{plain}\subsubsection{Gesetzesauszug Zivilrecht: Art. 7, Abs. 3.}\label{ssec:heir7} \normalsize{Iden no kōryoku. Hōkatsu juisha no kenri gimu [Willenswirkung. Umfassende Rechte und Pflichten der Begünstigten] (1947): Art. 7, Abs. 3}]{heir.pdf}
\end{document}
1

Move the \addsec and the \subsection command to the pagecommand option of the first page:

\documentclass[12pt,headings=Standardklasse,listof=totoc,numbers=noenddot]{scrartcl}
\usepackage{showframe}
\usepackage[left=2.50cm, right=2.50cm, top=2.50cm, bottom=2.00cm, footskip=1cm]{geometry}
\usepackage[onehalfspacing]{setspace}
\usepackage[main=ngerman, english]{babel}

\renewcommand\sectionformat{\mbox{\thesection.\enskip$|$\enskip}}% 
\RedeclareSectionCommand[
  beforeskip=2\baselineskip,% positive value, if afterindent=false is set
  afterindent=false,
  afterskip=.5\baselineskip,
  tocentrynumberformat=\def\autodot{.} % replace \autodot by a fixed dot for section entries
   ]{section}
\RedeclareSectionCommands[
  beforeskip=-1\baselineskip,
  afterskip=.5\baselineskip]{subsection,subsubsection}
\newcommand*\appendixmore{
  \clearpage
  \renewcommand{\thesubsection}{\Alph{subsection}}%
}

\usepackage[final]{pdfpages}% loads also graphicx

\begin{document}
\appendix
\includepdf[pages=1,scale=0.7,
  pagecommand=\thispagestyle{plain}%
              \addsec{\appendixname}\subsection{Gesetzesauszüge}% <- moved
              \subsubsection{Gesetzesauszug Zivilrecht: Art. 3, Abs. 1}\label{ssec:heir3}%
              %\normalsize
              {Sōzoku no kōryoku. Sōsoku [Auswirkungen der Vererbung. Vererbung] (1947): Art. 3, Abs. 1.}%
]{heir.pdf}
\includepdf[
  pages=2,scale=0.7,
  pagecommand=\thispagestyle{plain}%
              \subsubsection{Gesetzesauszug Zivilrecht: Art. 7, Abs. 3.}\label{ssec:heir7}%
              %\normalsize
              {Iden no kōryoku. Hōkatsu juisha no kenri gimu [Willenswirkung. Umfassende Rechte und Pflichten der Begünstigten] (1947): Art. 7, Abs. 3}%
]{heir.pdf}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.