\NeedsTeXFormat{LaTeX2e} \ProvidesPackage{ntnu}[Personal styles for NTNU exercises] \RequirePackage[dvipsnames]{xcolor} \definecolor{ntnublue}{RGB}{0,80,158} \RequirePackage{graphicx} \RequirePackage[utf8]{inputenc} % ░█░█░█░█░█▀█░█▀▀░█▀▄░█░░░▀█▀░█▀█░█░█░█▀▀ % ░█▀█░░█░░█▀▀░█▀▀░█▀▄░█░░░░█░░█░█░█▀▄░▀▀█ % ░▀░▀░░▀░░▀░░░▀▀▀░▀░▀░▀▀▀░▀▀▀░▀░▀░▀░▀░▀▀▀ \RequirePackage{hyperref} \hypersetup{ colorlinks=true, linkcolor=blue, filecolor=magenta, urlcolor=blue, } % ░█▀▀░█▀▀░█▀█░█▄█░█▀▀░▀█▀░█▀▄░█░█ % ░█░█░█▀▀░█░█░█░█░█▀▀░░█░░█▀▄░░█░ % ░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀▀▀░░▀░░▀░▀░░▀░ \RequirePackage{geometry} \geometry{ a4paper, left=15mm, right=15mm, top=30mm, bottom=20mm, } % ░▀█▀░▀█▀░▀█▀░█░░░▀█▀░█▀█░█▀▀ % ░░█░░░█░░░█░░█░░░░█░░█░█░█░█ % ░░▀░░▀▀▀░░▀░░▀▀▀░▀▀▀░▀░▀░▀▀▀ \RequirePackage{titling} \RequirePackage[many]{tcolorbox} % \author{\theAuthor} % \title{\theTitle} \pretitle{ \begin{flushleft} \LARGE } \posttitle{ \par \end{flushleft} } \preauthor{ \begin{flushleft} \large } \postauthor{ \par \end{flushleft} } \predate{ \begin{flushleft} \large } \postdate{ \par \end{flushleft} } \newtcolorbox{@ntnutitlebox}{ % tikznode, % tcbox width=auto limited, % capture=hbox, enhanced, colback=ntnublue, coltext=white, arc=0pt, boxrule=0pt, parbox=false, top=5mm, bottom=5mm } \newcommand{\ntnuTitle}{ \begin{minipage}{0.80\textwidth} \begin{@ntnutitlebox} \Huge\thetitle \LARGE\theauthor \end{@ntnutitlebox} \end{minipage} \hfill \begin{minipage}{0.10\textwidth} \vspace*{2mm} \centering \includegraphics[scale=1.2]{$HOME/texmf/tex/latex/local/ntnu/graphics/ntnu_logo.pdf} \end{minipage} \vspace*{2cm} } % ░█░█░█▀▀░█▀█░█▀▄░░░█░█▀▀░█▀█░█▀█░▀█▀ % ░█▀█░█▀▀░█▀█░█░█░▄▀░░█▀▀░█░█░█░█░░█░ % ░▀░▀░▀▀▀░▀░▀░▀▀░░▀░░░▀░░░▀▀▀░▀▀▀░░▀░ \RequirePackage{fancyhdr} \newcommand{\ntnu@pageword}{Page} \pagestyle{fancy} \fancyhf{} \rhead{\theauthor} \lhead{\thetitle} \rfoot{\ntnu@pageword\ \thepage} \renewcommand{\headrulewidth}{1pt} \renewcommand{\footrulewidth}{1pt} % ░█▀▀░█░█░█▀▀░█▀▄░█▀▀░▀█▀░█▀▀░█▀▀░█▀▀ % ░█▀▀░▄▀▄░█▀▀░█▀▄░█░░░░█░░▀▀█░█▀▀░▀▀█ % ░▀▀▀░▀░▀░▀▀▀░▀░▀░▀▀▀░▀▀▀░▀▀▀░▀▀▀░▀▀▀ \RequirePackage{enumitem} \renewcommand{\theenumi}{\arabic{enumi}} \renewcommand{\labelenumi}{\Large\fbox{\theenumi}} \newenvironment{excs}{ \begin{enumerate} } { \end{enumerate} } \newcommand{\setexc}[1]{\setcounter{enumi}{#1}} \newcommand{\exc}{ \item\ \addcontentsline{toc}{subsection}{Oppgave \theenumi} } %--------------------------% \renewcommand{\theenumii}{\alph{enumii})} \renewcommand{\labelenumii}{\textbf{\theenumii}} \newenvironment{subexcs}{ \begin{enumerate} }{ \end{enumerate} } \newcommand{\setsubexc}[1]{\setcounter{enumii}{#1}} \newcommand{\subexc}{ \vspace*{0.5cm} \item\ \addcontentsline{toc}{subsubsection}{\theenumii} } %--------------------------% \renewcommand{\theenumiii}{\roman{enumiii})} \renewcommand{\labelenumiii}{\textbf{\theenumiii}} \newenvironment{ssubexcs}{ \begin{enumerate} }{ \end{enumerate} } \newcommand{\setssubexc}[1]{\setcounter{enumiii}{#1}} \newcommand{\ssubexc}{ \vspace*{0.5cm} \item\ \addcontentsline{toc}{subsubsubsection}{\theenumiii} } % ░█▀▄░▀█▀░█▀█░█▀▀░█▀▄░█▀█░█▄█░█▀▀ % ░█░█░░█░░█▀█░█░█░█▀▄░█▀█░█░█░▀▀█ % ░▀▀░░▀▀▀░▀░▀░▀▀▀░▀░▀░▀░▀░▀░▀░▀▀▀ \RequirePackage{xparse} \RequirePackage{xkeyval} \newtcolorbox{coloredgraphbox}[1][]{ colframe=ntnublue, arc=0pt, outer arc=0pt colback=white, boxrule=3pt, #1 } %TODO: Make resizable and float \newenvironment{mgraphbox}[1][]{ \begin{center} \begin{coloredgraphbox}[#1] }{ \end{coloredgraphbox} \end{center} } \newcommand{\pic}[1]{ \begin{figure}[H] \includegraphics[width=\linewidth, cfbox=ntnublue 3pt 3pt]{#1} \end{figure} } \newcommand{\@ifdefined}[2]{ \@ifundefined{#1}{}{#2} } \define@key{inputDiagram}{width}{\def\id@width{#1}} \define@key{inputDiagram}{scale}{\def\id@scale{#1}} \define@key{inputDiagram}{caption}{\def\id@caption{#1}} \define@key{inputDiagram}{label}{\def\id@label{#1}} \define@boolkey{inputDiagram}{pdf}{} \NewDocumentCommand{\includeDiagram}{ o m }{ \begingroup \setkeys{inputDiagram}{width=\linewidth, scale=1, pdf=false} \IfValueT{#1}{\setkeys{inputDiagram}{#1}} \begin{mgraphbox}[width=\id@width] \begin{figure}[H] \begin{center} \scalebox{\id@scale}{ \ifKV@inputDiagram@pdf \includegraphics{#2} \else \input{#2} \fi } \@ifdefined{id@caption}{\caption{\id@caption}} \@ifdefined{id@label}{\label{\id@label}} \end{center} \end{figure} \end{mgraphbox} \endgroup } % ░█▄█░▀█▀░█▀▀░█▀▀ % ░█░█░░█░░▀▀█░█░░ % ░▀░▀░▀▀▀░▀▀▀░▀▀▀ \RequirePackage{float} \RequirePackage[export]{adjustbox} \setlength{\parindent}{0cm} \RequirePackage{pifont} \newcommand{\cmark}{\ding{51}}% \newcommand{\xmark}{\ding{55}}% \newcommand{\vcheck} {{\color{ForestGreen}\cmark}} \newcommand{\xcheck} {{\color{red}\xmark}} % ░█▀█░█▀█░▀█▀░▀█▀░█▀█░█▀█░█▀▀ % ░█░█░█▀▀░░█░░░█░░█░█░█░█░▀▀█ % ░▀▀▀░▀░░░░▀░░▀▀▀░▀▀▀░▀░▀░▀▀▀ \newif\ifntnu@mylang\ntnu@mylangfalse \DeclareOption{norsk}{\ntnu@mylangtrue} \DeclareOption*{\OptionNotUsed} % discard any undeclared option \ProcessOptions\relax \ifntnu@mylang \RequirePackage[english, norsk]{babel} \renewcommand{\ntnu@pageword}{Side} \else \RequirePackage[norsk, english]{babel} %% the default \fi