Skip to content
Snippets Groups Projects
HsH-standalone.cls 3.61 KiB
Newer Older
  • Learn to ignore specific revisions
  • Jan Wille's avatar
    Jan Wille committed
    \typeout{Adapted from KOMA script for use in Hochschule Hannover <2021-03-18> Jan Wille}
    
    Jan Wille's avatar
    Jan Wille committed
    \NeedsTeXFormat{LaTeX2e}
    
    \newcommand{\myClassName}{HsH-standalone}
    
    Jan Wille's avatar
    Jan Wille committed
    \ProvidesClass{\myClassName}[2021/03/18 HsH Report based on KOMA]
    
    Jan Wille's avatar
    Jan Wille committed
    
    \newcommand{\HsHlogoPath}{HSH-Logo.pdf}
    \newcommand{\HsHlogoPage}{1}
    \newcommand{\includeHsHlogohere}{\includegraphics[width=5cm,page=\HsHlogoPage]{\HsHlogoPath}}
    
    
    \newif\if@german%
    
    Jan Wille's avatar
    Jan Wille committed
    \DeclareOption{german}{%
    	\PassOptionsToPackage{ngerman}{babel}
    	\@germantrue
    }
    
    Jan Wille's avatar
    Jan Wille committed
    \DeclareOption{ngerman}{%
    	\PassOptionsToPackage{\CurrentOption}{babel}
    	\@germantrue
    }
    \DeclareOption{english}{%
    	\PassOptionsToPackage{\CurrentOption}{babel}
    
    Jan Wille's avatar
    Jan Wille committed
    }
    
    \DeclareOption{f1}{% use logo of fakulty 1
    
    Jan Wille's avatar
    Jan Wille committed
    	\renewcommand{\HsHlogoPage}{2}
    }
    
    \DeclareOption{f2}{% use logo of fakulty 2
    
    Jan Wille's avatar
    Jan Wille committed
    	\renewcommand{\HsHlogoPage}{3}
    }
    
    \DeclareOption{f3}{% use logo of fakulty 3
    
    Jan Wille's avatar
    Jan Wille committed
    	\renewcommand{\HsHlogoPage}{4}
    }
    
    \DeclareOption{f4}{% use logo of fakulty 4
    
    Jan Wille's avatar
    Jan Wille committed
    	\renewcommand{\HsHlogoPage}{5}
    }
    
    \DeclareOption{f5}{% use logo of fakulty 5
    
    Jan Wille's avatar
    Jan Wille committed
    	\renewcommand{\HsHlogoPage}{6}
    }
    
    \DeclareOption{sans}{% use san serif font
    	\renewcommand{\familydefault}{\sfdefault}
    }
    \DeclareOption{roman}{% use roman/serif font
    	\renewcommand{\familydefault}{\rmdefault}
    }
    
    Jan Wille's avatar
    Jan Wille committed
    \DeclareOption*{\PassOptionsToClass{\CurrentOption}{standalone}}
    
    \ExecuteOptions{margin=0.25cm,fontsize=11pt,a4paper,ngerman,sans} % standart options
    
    Jan Wille's avatar
    Jan Wille committed
    \ProcessOptions\relax
    
    
    \LoadClass[multi=tikzpicture,multi=circuitikz]{standalone}
    
    Jan Wille's avatar
    Jan Wille committed
    \newcommand*{\@titlehead}{}%
    \newcommand{\titlehead}[1]{\gdef\@titlehead{#1}}%
    \newcommand*{\@subject}{}%
    \newcommand*{\subject}[1]{\gdef\@subject{#1}}%
    \newcommand*{\@subtitle}{}%
    \newcommand*{\subtitle}[1]{\gdef\@subtitle{#1}}%
    
    \newcommand*{\@matrikelnr}{}%
    \newcommand{\matrikelnr}[1]{\gdef\@matrikelnr{#1}}%
    \newcommand*{\@professor}{}%
    \newcommand{\professor}[1]{\gdef\@professor{#1}}%
    
    \newcommand*{\@keywords}{}%
    \newcommand{\keywords}[1]{\gdef\@keywords{#1}}%
    
    Jan Wille's avatar
    Jan Wille committed
    \InputIfFileExists{personal.tex}{
    	\ClassInfo{\myClassName}{personal.tex was found. Using it...}
    }{
    
    Jan Wille's avatar
    Jan Wille committed
    	\ClassInfo{\myClassName}{no personal.tex! Configre the titlepage yourself}
    
    Jan Wille's avatar
    Jan Wille committed
    }
    
    % enforced options for packages
    \PassOptionsToPackage{utf8}{inputenc}
    \PassOptionsToPackage{T1}{fontenc}
    \PassOptionsToPackage{babel, german=quotes}{csquotes}
    \PassOptionsToPackage{free-standing-units}{siunitx}
    
    \PassOptionsToPackage{european,EFvoltages,straightvoltages,betterproportions}{circuitikz}
    
    Jan Wille's avatar
    Jan Wille committed
    
    
    Jan Wille's avatar
    Jan Wille committed
    % used packages:
    
    Jan Wille's avatar
    Jan Wille committed
    \RequirePackage{inputenc} % inputencoding, utf8 recomendet
    \RequirePackage{fontenc} % outputencoding, T1 recomendet
    \RequirePackage{lmodern} % font
    \RequirePackage{graphicx} % required for importing images
    \RequirePackage{babel} % required for german names
    
    \RequirePackage{amsmath} % a lot of nice Math
    
    Jan Wille's avatar
    Jan Wille committed
    \if@german\RequirePackage{ziffer}\fi % german dezimal numbers
    
    % typesetting indexes upright or standart
    
    Jan Wille's avatar
    Jan Wille committed
    \def\subinrm#1{\sb{\mathrm{#1}}}
    
    Jan Wille's avatar
    Jan Wille committed
    {\catcode`\_=13 \global\let_=\subinrm}
    \mathcode`_="8000
    \newcommand\upsubscripts{\catcode`\_=12 } % the toggle for upright subscripts
    \newcommand\normalsubscripts{\catcode`\_=8 } % the toggle for italic subscripts
    \upsubscripts % setting upright as default
    
    % keep compatible
    \providecommand{\renewcaptionname}[3]{}
    
    
    Jan Wille's avatar
    Jan Wille committed
    % load config at beginning of document
    
    Jan Wille's avatar
    Jan Wille committed
    	\makeatletter
    
    	\@ifpackageloaded{subfigure}{
    		\newcommand{\subfigureautorefname}{\figureautorefname}
    
    Jan Wille's avatar
    Jan Wille committed
    	\InputIfFileExists{config.tex}{
    		\ClassInfo{\myClassName}{config.tex was found. Using it...}
    	}{
    
    Jan Wille's avatar
    Jan Wille committed
    		\ClassInfo{\myClassName}{no config.tex!! I hope you configured it yourself.}
    
    Jan Wille's avatar
    Jan Wille committed
    	}
    
    	% provide some usefull commands:
    	\providecommand{\abs}[1]{\ensuremath{\left\vert#1\right\vert}} % Makro for vertical lines around absolute values
    
    Jan Wille's avatar
    Jan Wille committed
    	\makeatother
    }