Create a style file to shorten class definition

This commit is contained in:
Marcus Kammer 2023-12-14 15:56:17 +01:00
parent 409a53ab68
commit e4c857fb31
Signed by: marcuskammer
GPG key ID: C374817BE285268F
3 changed files with 36 additions and 20 deletions

View file

@ -170,26 +170,7 @@
'("koma-general" '("koma-general"
"\\documentclass[a4paper,10pt,captions=tableheading,twoside=false]{scrartcl} "\\documentclass[a4paper,10pt,captions=tableheading,twoside=false]{scrartcl}
\\linespread{1.25} \\linespread{1.25}
\\setkomafont{section}{\\Large\\bfseries\\sffamily} \\usepackage{komageneral}"
\\setkomafont{subsection}{\\large\\bfseries\\sffamily}
\\setkomafont{subsubsection}{\\normalsize\\bfseries\\sffamily}
\\RedeclareSectionCommand[beforeskip=-1sp,afterskip=0.5\\baselineskip]{section}
\\RedeclareSectionCommand[beforeskip=-1sp,afterskip=0.25\\baselineskip]{subsection}
\\RedeclareSectionCommand[beforeskip=-1sp,afterskip=0.1\\baselineskip]{subsubsection}
\\usepackage{fontspec}
\\defaultfontfeatures{Ligatures=TeX, RawFeature={+zero, +liga}}
\\setmainfont{Noto Serif Regular}[BoldFont={Noto Serif Bold},ItalicFont={Noto Serif Italic}]
\\setsansfont{Noto Sans Regular}[BoldFont={Noto Sans Bold},ItalicFont={Noto Sans Italic}]
\\setmonofont{Noto Sans Mono}[BoldFont={Noto Sans Mono Bold},Scale=0.8]
\\usepackage{geometry}
\\geometry{a4paper,left=2cm,right=2cm,top=1.6cm,bottom=1.6cm}
\\usepackage{scrlayer-scrpage}
\\pagestyle{scrheadings}
\\clearpairofpagestyles
\\automark{section}
\\ihead{\\headmark} % Inner header
\\ohead{\\thepage} % Outer header
"
("\\section{%s}" . "\\section*{%s}") ("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}")

View file

@ -0,0 +1,11 @@
(TeX-add-style-hook
"komageneral"
(lambda ()
(setq TeX-command-extra-options
"-shell-escape")
(TeX-run-style-hooks
"fontspec"
"geometry"
"scrlayer-scrpage"))
:latex)

View file

@ -0,0 +1,24 @@
\ProvidesPackage{komageneral}
% Font settings
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX, RawFeature={+zero, +liga}}
\setmainfont{Noto Serif Regular}[BoldFont={Noto Serif Bold},ItalicFont={Noto Serif Italic}]
\setsansfont{Noto Sans Regular}[BoldFont={Noto Sans Bold},ItalicFont={Noto Sans Italic}]
\setmonofont{Noto Sans Mono}[BoldFont={Noto Sans Mono Bold},Scale=0.8]
% Geometry settings
\usepackage{geometry}
\geometry{a4paper,left=2cm,right=2cm,top=1.6cm,bottom=1.6cm}
% Header and section settings
\usepackage{scrlayer-scrpage}
\pagestyle{scrheadings}
\clearpairofpagestyles
\automark{section}
\ihead{\headmark}
\ohead{\thepage}
% Section command redeclarations
\setkomafont{section}{\Large\bfseries\sffamily}
\setkomafont{subsection}{\large\bfseries\sffamily}
\setkomafont{subsubsection}{\normalsize\bfseries\sffamily}
\RedeclareSectionCommand[beforeskip=-1sp,afterskip=0.5\baselineskip]{section}
\RedeclareSectionCommand[beforeskip=-1sp,afterskip=0.25\baselineskip]{subsection}
\RedeclareSectionCommand[beforeskip=-1sp,afterskip=0.1\baselineskip]{subsubsection}