Update komageneral styles

This commit is contained in:
Marcus Kammer 2024-09-30 13:47:09 +02:00
parent e712a1fa3a
commit 78a10d0e70
Signed by: marcuskammer
GPG key ID: C374817BE285268F
2 changed files with 78 additions and 21 deletions

View file

@ -1,11 +1,29 @@
;; -*- lexical-binding: t; -*-
(TeX-add-style-hook (TeX-add-style-hook
"komageneral" "komageneral"
(lambda () (lambda ()
(setq TeX-command-extra-options (setq TeX-command-extra-options
"-shell-escape") "-shell-escape")
(TeX-add-to-alist 'LaTeX-provided-package-options
'(("fontspec" "") ("geometry" "") ("scrlayer-scrpage" "") ("titlesec" "") ("enumitem" "") ("caption" "") ("fancyhdr" "") ("microtype" "") ("biblatex" "") ("graphicx" "") ("etoolbox" "")))
(TeX-run-style-hooks (TeX-run-style-hooks
"fontspec" "fontspec"
"geometry" "geometry"
"scrlayer-scrpage")) "scrlayer-scrpage"
"titlesec"
"enumitem"
"caption"
"fancyhdr"
"microtype"
"biblatex"
"graphicx"
"etoolbox")
(TeX-add-symbols
'("TitlePage" 2)
'("code" 1)
'("important" 1))
(LaTeX-add-bibliographies
"yourbibliography"))
:latex) :latex)

View file

@ -1,24 +1,63 @@
\ProvidesPackage{komageneral} \ProvidesPackage{komageneral}
% Font settings
% Base packages
\usepackage{fontspec} \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 Condensed}[BoldFont={Noto Sans Mono Condensed Bold},Scale=0.8]
% Geometry settings
\usepackage{geometry} \usepackage{geometry}
\geometry{a4paper,left=2cm,right=2cm,top=1.6cm,bottom=1.6cm}
% Header and section settings
\usepackage{scrlayer-scrpage} \usepackage{scrlayer-scrpage}
\pagestyle{scrheadings} \usepackage{titlesec}
\clearpairofpagestyles \usepackage{enumitem}
\automark{section} \usepackage{caption}
\ihead{\headmark} \usepackage{fancyhdr}
\ohead{\thepage} \usepackage{microtype}
% Section command redeclarations \usepackage{biblatex}
\setkomafont{section}{\Large\bfseries\sffamily} \usepackage{graphicx} % Added for including images
\setkomafont{subsection}{\large\bfseries\sffamily} \addbibresource{yourbibliography.bib}
\setkomafont{subsubsection}{\normalsize\bfseries\sffamily}
\RedeclareSectionCommand[beforeskip=-2\baselineskip,afterskip=0.5\baselineskip]{section} % Font settings
\RedeclareSectionCommand[beforeskip=-1.5\baselineskip,afterskip=0.25\baselineskip]{subsection} \defaultfontfeatures{Ligatures=TeX, RawFeature={+zero, +liga}}
\RedeclareSectionCommand[beforeskip=-1\baselineskip,afterskip=0.1\baselineskip]{subsubsection} \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
\geometry{a4paper, left=2cm, right=2cm, top=1.6cm, bottom=1.6cm}
% Header and footer settings with fancyhdr
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\nouppercase{\leftmark}}
\fancyhead[R]{\thepage}
% Section formatting with titlesec
\titleformat{\section}{\Large\bfseries\sffamily}{\thesection}{1em}{}
\titleformat{\subsection}{\large\bfseries\sffamily}{\thesubsection}{1em}{}
\titleformat{\subsubsection}{\normalsize\bfseries\sffamily}{\thesubsubsection}{1em}{}
% List formatting with enumitem
\setlist[itemize]{noitemsep, topsep=0pt}
\setlist[enumerate]{noitemsep, topsep=0pt}
% Caption settings
\captionsetup{font=small, labelfont=bf}
% Custom quote environment
\usepackage{etoolbox}
\AtBeginEnvironment{quote}{\itshape}
% Custom formatting commands
\newcommand{\important}[1]{\textbf{#1}}
\newcommand{\code}[1]{\texttt{#1}}
% Title page settings
\newcommand{\TitlePage}[2]{ % #1 - Logo file, #2 - Company name
\begin{titlepage}
\centering
\vspace*{1cm}
\includegraphics[width=0.3\textwidth]{#1}\par\vspace{1cm}
{\Huge\bfseries\sffamily #2\par}
\vspace{2cm}
{\Large\itshape An Elegant and Professional Document\par}
\vfill
{\large \today\par}
\end{titlepage}
}