Update komageneral styles
This commit is contained in:
parent
e712a1fa3a
commit
78a10d0e70
2 changed files with 78 additions and 21 deletions
|
@ -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)
|
||||||
|
|
||||||
|
|
|
@ -1,24 +1,63 @@
|
||||||
\ProvidesPackage{komageneral}
|
\ProvidesPackage{komageneral}
|
||||||
% Font settings
|
|
||||||
|
% Base packages
|
||||||
\usepackage{fontspec}
|
\usepackage{fontspec}
|
||||||
|
\usepackage{geometry}
|
||||||
|
\usepackage{scrlayer-scrpage}
|
||||||
|
\usepackage{titlesec}
|
||||||
|
\usepackage{enumitem}
|
||||||
|
\usepackage{caption}
|
||||||
|
\usepackage{fancyhdr}
|
||||||
|
\usepackage{microtype}
|
||||||
|
\usepackage{biblatex}
|
||||||
|
\usepackage{graphicx} % Added for including images
|
||||||
|
\addbibresource{yourbibliography.bib}
|
||||||
|
|
||||||
|
% Font settings
|
||||||
\defaultfontfeatures{Ligatures=TeX, RawFeature={+zero, +liga}}
|
\defaultfontfeatures{Ligatures=TeX, RawFeature={+zero, +liga}}
|
||||||
\setmainfont{Noto Serif Regular}[BoldFont={Noto Serif Bold}, ItalicFont={Noto Serif Italic}]
|
\setmainfont{Noto Serif Regular}[BoldFont={Noto Serif Bold}, ItalicFont={Noto Serif Italic}]
|
||||||
\setsansfont{Noto Sans Regular}[BoldFont={Noto Sans Bold}, ItalicFont={Noto Sans 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]
|
\setmonofont{Noto Sans Mono}[BoldFont={Noto Sans Mono Bold}, Scale=0.8]
|
||||||
|
|
||||||
% Geometry settings
|
% Geometry settings
|
||||||
\usepackage{geometry}
|
|
||||||
\geometry{a4paper, left=2cm, right=2cm, top=1.6cm, bottom=1.6cm}
|
\geometry{a4paper, left=2cm, right=2cm, top=1.6cm, bottom=1.6cm}
|
||||||
% Header and section settings
|
|
||||||
\usepackage{scrlayer-scrpage}
|
% Header and footer settings with fancyhdr
|
||||||
\pagestyle{scrheadings}
|
\pagestyle{fancy}
|
||||||
\clearpairofpagestyles
|
\fancyhf{}
|
||||||
\automark{section}
|
\fancyhead[L]{\nouppercase{\leftmark}}
|
||||||
\ihead{\headmark}
|
\fancyhead[R]{\thepage}
|
||||||
\ohead{\thepage}
|
|
||||||
% Section command redeclarations
|
% Section formatting with titlesec
|
||||||
\setkomafont{section}{\Large\bfseries\sffamily}
|
\titleformat{\section}{\Large\bfseries\sffamily}{\thesection}{1em}{}
|
||||||
\setkomafont{subsection}{\large\bfseries\sffamily}
|
\titleformat{\subsection}{\large\bfseries\sffamily}{\thesubsection}{1em}{}
|
||||||
\setkomafont{subsubsection}{\normalsize\bfseries\sffamily}
|
\titleformat{\subsubsection}{\normalsize\bfseries\sffamily}{\thesubsubsection}{1em}{}
|
||||||
\RedeclareSectionCommand[beforeskip=-2\baselineskip,afterskip=0.5\baselineskip]{section}
|
|
||||||
\RedeclareSectionCommand[beforeskip=-1.5\baselineskip,afterskip=0.25\baselineskip]{subsection}
|
% List formatting with enumitem
|
||||||
\RedeclareSectionCommand[beforeskip=-1\baselineskip,afterskip=0.1\baselineskip]{subsubsection}
|
\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}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue