You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

latex4ei_thesis.cls 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671
  1. %
  2. % Thesis class from LaTeX4EI
  3. %
  4. % Authors: Emanuel Regnath, Martin Zellner
  5. % Contact: info@latex4ei.de
  6. % Version: 1.1
  7. % License: TBD
  8. %
  9. % © 2011-2019, LaTeX4EI
  10. % ToDo:
  11. % * create \listofabbreviations \listoflistings
  12. % * Screen_version und print_version
  13. % * create title page
  14. % TUM Styleguide: Liniebasis 0.3pt Linie Pfeil 0.6pt
  15. % options: frontmatter, colors, ornaments, margin
  16. \NeedsTeXFormat{LaTeX2e}[1996/12/01]
  17. \ProvidesClass{latex4ei/latex4ei_thesis}[2014/03/15]
  18. % ======================================================================
  19. % Options
  20. % ======================================================================
  21. % forward options to latex4ei package
  22. \DeclareOption{color}{\PassOptionsToPackage{color}{latex4ei}}
  23. \DeclareOption{nocolor}{\PassOptionsToPackage{nocolor}{latex4ei}}
  24. % define baseclass
  25. \def\baseclass{scrreprt}
  26. % Options
  27. \newif\ifmarginnumbers\marginnumbersfalse
  28. \DeclareOption{marginnumbers}{\marginnumberstrue}
  29. \newcommand{\chapterallign}{\raggedright}
  30. \DeclareOption{rightchapter}{%
  31. \let\chapterallign\raggedleft
  32. }
  33. \newif\ifoptionbiblatex\optionbiblatexfalse
  34. \DeclareOption{biblatex}{\optionbiblatextrue}
  35. \newif\ifoptionglossaries\optionglossariesfalse
  36. \DeclareOption{glossaries}{\optionglossariestrue}
  37. % set default options for base class
  38. \PassOptionsToClass{a4paper, 11pt}{\baseclass}
  39. % pass unknown options to base class
  40. \DeclareOption*{%
  41. \PassOptionsToClass{\CurrentOption}{\baseclass}%
  42. }
  43. % process options
  44. \ProcessOptions\relax
  45. % load baseclass
  46. \LoadClass{\baseclass}
  47. % ======================================================================
  48. % Packages
  49. % ======================================================================
  50. % pass options to packages
  51. \PassOptionsToPackage{table}{xcolor}
  52. % load biblatex if specified
  53. \ifoptionbiblatex
  54. \RequirePackage[style=ieee, backend=biber, datamodel=ieeestandard]{biblatex}
  55. \fi
  56. % \makeatletter
  57. % \@ifpackagewith{biblatex}{backend=biber}{}
  58. % \makeatother
  59. % load latex4ei packages
  60. \RequirePackage{latex4ei/scientific} % scientific macros for LaTeX4EI
  61. \RequirePackage{latex4ei/latex4ei} % base definitions for LaTeX4EI (privat)
  62. % packages needed
  63. \RequirePackage{xspace} % For spacing behind commands
  64. \RequirePackage{remreset} % For removing counters from resets
  65. % fix for footnotes in tables
  66. \RequirePackage{footnote}
  67. \makesavenoteenv{tabular}
  68. \makesavenoteenv{table}
  69. %\shorthandoff{"} % don't convert "A to Ä!
  70. % font
  71. %\RequirePackage[osf]{mathpazo} % old style numbering
  72. %\renewcommand{\rmdefault}{ppl} % cmr, ptm, ppl, pnc, pbk
  73. %\renewcommand{\sfdefault}{cmss} % cmss, phv pag
  74. % ======================================================================
  75. % Color Scheme
  76. % ======================================================================
  77. % Set Color Scheme
  78. % ----------------------------------------------------------------------
  79. \definecolor{url}{gray}{0.6}
  80. \definecolor{chapnum}{gray}{0.6}
  81. \definecolor{ornament}{gray}{0.85}
  82. %\definecolor{col_chapter}{gray}{0.6}
  83. \colorlet{col_chapter}{tum_gray}
  84. \colorlet{col_section}{tum_blue_dark2}
  85. \colorlet{col_subsection}{tum_blue_dark2}
  86. \colorlet{col_subsubsection}{tum_blue_dark2}
  87. \colorlet{col_table}{tum_blue_dark}
  88. \colorlet{col_figure}{tum_blue_dark}
  89. \colorlet{col_link}{tum_blue}
  90. \colorlet{col_lst}{tum_blue_dark}
  91. \colorlet{col_lst_keyword}{tum_blue}
  92. \colorlet{col_lst_comment}{tum_green_leaf}
  93. \colorlet{col_lst_string}{tum_orange}
  94. \colorlet{col_lst_number}{tum_gray_dark}
  95. % ======================================================================
  96. % Fonts
  97. % ======================================================================
  98. % Font Settings
  99. % ----------------------------------------------------------------------
  100. % Initials with lettrine
  101. \RequirePackage{lettrine}
  102. % calculate linespacing based on font size
  103. % char per line: 85
  104. \RequirePackage{setspace}
  105. % \setlength{\baselineskip}{3pt}
  106. % \renewcommand{\baselinestretch}{1.5}
  107. %\linespread{1.3}\selectfont
  108. %\setstretch{1.3}
  109. \onehalfspacing
  110. %\usepackage{microtype} % Verbesserung des Kernings, Achtung kompilezeit!
  111. % ======================================================================
  112. % Bibtex
  113. % ======================================================================
  114. % Define BibTeX command
  115. \def\BibTeX{{\rmfamily B\kern-.05em{\sc i\kern-.025em b}\kern-.08em T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
  116. %\usepackage{natbib}
  117. %\bibliographystyle{natdin}
  118. % ======================================================================
  119. % Title
  120. % ======================================================================
  121. \newcommand*{\thedoctype}{}
  122. \newcommand*{\doctype}[1]{\gdef\thedoctype{#1}}
  123. % hierarchy:
  124. % university, faculty, department, institute, chair
  125. \newcommand*{\theuniversity}{}
  126. \newcommand*{\university}[1]{\gdef\theuniversity{#1}}
  127. \newcommand*{\thedepartment}{}
  128. \newcommand*{\department}[1]{\gdef\thedepartment{#1}}
  129. \newcommand*{\thechair}{}
  130. \newcommand*{\chair}[1]{\gdef\thechair{#1}}
  131. \newcommand*{\theprofessor}{}
  132. \newcommand*{\professor}[1]{\gdef\theprofessor{#1}}
  133. \newcommand*{\theadvisor}{}
  134. \newcommand*{\advisor}[1]{\gdef\theadvisor{#1}}
  135. \newcommand*{\thecoadvisor}{}
  136. \newcommand*{\coadvisor}[1]{\gdef\thecoadvisor{#1}}
  137. \newcommand*{\thesubmitdate}{}
  138. \newcommand*{\submitdate}[1]{\gdef\thesubmitdate{#1}}
  139. \newcommand*{\theauthorsaddress}{}
  140. \newcommand*{\authorsaddress}[1]{\gdef\theauthorsaddress{#1}}
  141. \newcommand*{\thestudentnumber}{}
  142. \newcommand*{\studentnumber}[1]{\gdef\thestudentnumber{#1}}
  143. \newcommand*{\thelogoheader}{}
  144. \newcommand*{\logoheader}[1]{\gdef\thelogoheader{#1}}
  145. \def\maketitle{{%
  146. \sffamily
  147. % ------------------------------------------------------------------------
  148. % Deckblatt
  149. % ------------------------------------------------------------------------
  150. \pagestyle{empty}
  151. \let\footnotesize\small\let\footnoterule\relax
  152. \thelogoheader
  153. \vspace*{8cm}
  154. \begin{center}\begin{minipage}[c]{0.8\textwidth}\begin{center}
  155. {\huge \bfseries{\@title} \par}%
  156. \vskip 3em%
  157. {\LARGE\@author}
  158. \end{center}\end{minipage}\end{center}
  159. \par
  160. \vfill
  161. \begin{center}{\LARGE \bfseries{\thedoctype}}\end{center}\par
  162. \cleardoublepage
  163. % ------------------------------------------------------------------------
  164. % Das ganze etwas genauer
  165. % ------------------------------------------------------------------------
  166. \vspace*{100pt}
  167. \begin{center}\begin{minipage}{0.7\textwidth}\centering%
  168. \vfil
  169. {\LARGE \bfseries{\@title} \par}%
  170. \vfil \vskip 2.5em
  171. {\Large \thedoctype \par}%
  172. \vfil
  173. \end{minipage}\end{center}\par
  174. \vfill \large
  175. \begin{center}%
  176. {{Supervised by \theprofessor \\ \thechair \\ \thedepartment \\ \theuniversity \\ }}
  177. \end{center}\par
  178. \vskip 1.5em
  179. \vfill
  180. \begin{tabular}{@{}l@{\hspace{1cm}}l}%
  181. \bfseries{Advisor} & \parbox[t]{9cm}{\theadvisor}\\[1.3em]
  182. \bfseries{Co-Advisor} & \parbox[t]{9cm}{{\thecoadvisor}}\\[1.3em]
  183. \bfseries{Author} & \parbox[t]{9cm}{{\@author\\ \theauthorsaddress}} \\
  184. \end{tabular}\\[2em]
  185. Submitted on \thesubmitdate
  186. }}
  187. % ======================================================================
  188. % Additional title pages
  189. % --------------------------------------------------------------------
  190. \newenvironment{acknowledgment}{%
  191. \clearpage
  192. \thispagestyle{empty}
  193. \@makeschapterhead{Acknowledgment}
  194. \sffamily
  195. }{
  196. }
  197. \newenvironment{authordecl}{%
  198. \cleardoublepage
  199. \thispagestyle{empty}
  200. \@makeschapterhead{Declaration of Authorship}
  201. \sffamily
  202. }{
  203. }
  204. % ======================================================================
  205. % Abstract
  206. % ======================================================================
  207. \def\abstract{
  208. \clearpage
  209. \thispagestyle{plain}
  210. \@makeschapterhead{\abstractname}
  211. \sffamily
  212. }{
  213. }
  214. \def\endabstract{
  215. }
  216. % ======================================================================
  217. % Glossaries
  218. % ======================================================================
  219. \ifoptionglossaries
  220. % Nomenclature with glossary, nomencl, acronym, acroterm
  221. \RequirePackage[toc, acronym, style=long, nolist, nomain, nopostdot, nogroupskip]{glossaries}
  222. \newglossarystyle{acronym}{%
  223. \renewenvironment{theglossary}{
  224. \setlength\LTleft{0pt}
  225. \setlength\LTright{0pt}
  226. \setlength{\glsdescwidth}{0.7\textwidth}
  227. \setlength{\extrarowheight}{0em}%
  228. \renewcommand*{\glossaryheader}{}% have nothing after \begin{theglossary}
  229. \renewcommand*{\glsgroupheading}[1]{}%
  230. \renewcommand*{\glsgroupskip}{}% have nothing between glossary groups
  231. \begin{longtable}{@{}ll@{}}}{\end{longtable}}%
  232. \renewcommand*{\glossaryentryfield}[5]{%
  233. \textbf{\glstarget{##1}{##2}}% the entry name
  234. ##4% the symbol
  235. & ##3% the description
  236. \space\space ##5\\}% the number list
  237. }
  238. % darker color for glossary links
  239. \renewcommand*{\glstextformat}[1]{\textcolor{tum_blue_dark2}{#1}}
  240. \fi
  241. % ======================================================================
  242. % Structure
  243. % ======================================================================
  244. \newcommand\frontmatter{%
  245. \setcounter{page}{1} % set page counter to 1
  246. \pagenumbering{Roman} % roman figures
  247. \loadgeometry{frontmatter} %
  248. \pagestyle{empty} % no numbering in the frontmatter
  249. \makeatletter
  250. \let\ps@oldplain\ps@plain % backup
  251. \let\ps@plain\ps@empty % set plain pagestyle to empty
  252. \makeatother
  253. }
  254. \newcommand\mainmatter{%
  255. \pagenumbering{arabic}
  256. \loadgeometry{mainmatter}
  257. \pagestyle{fancy}
  258. \makeatletter
  259. \fancy@setoffs % reload dimensions
  260. \makeatother
  261. }
  262. \newcommand\mainmatterplain{%
  263. \pagenumbering{arabic}
  264. \loadgeometry{mainmatterplain}
  265. \pagestyle{fancy}
  266. \makeatletter
  267. \fancy@setoffs % reload dimensions
  268. \makeatother
  269. }
  270. \newcommand\backmatter{\pagenumbering{arabic}}
  271. % ======================================================================
  272. % Layout
  273. % ======================================================================
  274. % Page Layout
  275. % ----------------------------------------------------------------------
  276. \RequirePackage{geometry}
  277. \newgeometry{
  278. layout=a4paper, % DIN-A4
  279. twoside,
  280. bindingoffset = 1cm,
  281. left=2.66cm, % whitespace left
  282. right=2.66cm, % old 2.33
  283. top=3cm,
  284. bottom=3cm,
  285. includeheadfoot
  286. } \savegeometry{frontmatter}
  287. \geometry{ %Gemometry with Margintext
  288. layout=a4paper,
  289. portrait,
  290. twoside,
  291. bindingoffset = 1cm,
  292. % 9er Teilung
  293. left=2.33cm, % whitespace left
  294. right=3.66cm,
  295. top=2.33cm,
  296. bottom=2cm,
  297. %reversemarginpar,
  298. marginparsep = 4mm,
  299. marginparwidth = 1.9cm, % witdh for marginal notes
  300. includeheadfoot % reserve space for header and footer
  301. } \savegeometry{mainmatter}
  302. \geometry{ %Gemometry without Margintext
  303. layout=a4paper,
  304. portrait,
  305. % twoside,
  306. bindingoffset = 1cm,
  307. % 9er Teilung
  308. left=2.33cm, % whitespace left
  309. right=2.33cm,
  310. top=2.33cm,
  311. bottom=3cm,
  312. includeheadfoot % reserve space for header and footer
  313. } \savegeometry{mainmatterplain}
  314. % Header and Footer
  315. % ----------------------------------------------------------------------
  316. \usepackage{fancyhdr}
  317. \pagestyle{fancy} % use fancyhdr pagestyle
  318. \fancyhf{} % clear header and footer
  319. \if@twoside %% Für Doppelseitig
  320. \fancyhead[EL]{\textcolor{black!70}{\thepage}} % gerade Seiten, links
  321. \fancyhead[ER]{\textcolor{black!70}{\leftmark}} % gerade Seiten, rechts
  322. \fancyhead[OL]{\textcolor{black!70}{\itshape\rightmark}} % ungerade Seiten, links
  323. \fancyhead[OR]{\textcolor{black!70}{\thepage}} % ungerade Seiten, rechts
  324. \else %% Für Einseitig
  325. \fancyhead[OL]{\textcolor{black!70}{\leftmark --- \itshape\nouppercase{\rightmark}}} % gerade Seiten, rechts
  326. \fancyhead[OR]{\textcolor{black!70}{\thepage}} % gerade Seiten, links
  327. \fi
  328. \renewcommand{\headrulewidth}{0pt} % Underline headers
  329. \renewcommand{\footrulewidth}{0pt} % no footer rule
  330. %\fancypagestyle{plain}{} % No chapter+section on chapter start pages
  331. \renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{#1}}{} } % redefine leftmark
  332. \renewcommand{\sectionmark}[1]{\markright{#1}{} } % redefine rightmark
  333. % Margin Notes
  334. % ----------------------------------------------------------------------
  335. \def\mparsetup{%
  336. \sffamily\scriptsize %
  337. \linespread{0.9}\selectfont%
  338. \parindent=0pt \lineskip=0pt \lineskiplimit=0pt %
  339. \tolerance=2000 \hyphenpenalty=300 \exhyphenpenalty=300%
  340. \doublehyphendemerits=100000%
  341. \finalhyphendemerits=\doublehyphendemerits}
  342. \let\oldmarginpar\marginpar % save old command
  343. \renewcommand{\marginpar}[1]{\oldmarginpar[\mparsetup\raggedleft\hspace{0pt}{#1}]{\mparsetup\raggedright\hspace{0pt}{#1}}}
  344. % Footnotes
  345. % ----------------------------------------------------------------------
  346. \long\def\@makefntext#1{%
  347. \leftskip 0pt
  348. \parindent 0pt
  349. \everypar{\parindent 0pt}%
  350. \leavevmode\llap{\@thefnmark\hskip\marginparsep}#1} % footnote number in margin
  351. \renewcommand\footnoterule{%
  352. \kern-3\p@
  353. \hrule\@width \columnwidth
  354. \kern2.6\p@}
  355. \skip\@mpfootins=4pt
  356. % Chapters and Sections
  357. % ----------------------------------------------------------------------
  358. \RequirePackage{titlesec}
  359. %\titleformat{ command }[ shape ]{ format }{ label }{ sep }{ before }[ after ]
  360. %\titlespacing*{ command }{ left }{ beforesep }{ aftersep }[ right ]
  361. \newfont{\chapterNumber}{eurb10 scaled 9000}
  362. %\titleformat{\chapter}[display]{\relax}{\raggedleft{\fontsize{100}{10}\selectfont\color{col_chapter}\thechapter} \\}{0em}{\raggedleft\sffamily\bfseries\huge}
  363. \titleformat{\chapter}[display]{\relax}{\chapterallign{\chapterNumber\color{col_chapter}\thechapter} \\}{0em}{\chapterallign\sffamily\bfseries\huge}
  364. %\titlespacing{\chapter}{0em}{0em}{2em}
  365. % star chapter version
  366. \titleformat{name=\chapter,numberless}[display]{\relax}{\relax}{0em}{\sffamily\bfseries\huge}
  367. \titlespacing{name=\chapter,numberless}{0em}{0em}{2em}
  368. % section with numbers in the margin
  369. \ifmarginnumbers
  370. \titleformat{\section}{\sffamily\Large\color{col_section}}{\llap{{\thesection}\hskip\marginparsep}}{0em}{}
  371. \titleformat{\subsection}{\sffamily\large\color{col_subsection}}{\llap{{\thesubsection}\hskip\marginparsep}}{0em}{}
  372. \titleformat{\subsubsection}{\scshape\color{col_subsubsection}}{\llap{{\thesubsubsection}\hskip\marginparsep}}{0em}{}
  373. \else
  374. \titleformat{\section}{\scshape\LARGE\color{col_section}}{\thesection\quad}{0em}{}
  375. \titleformat{\subsection}{\sffamily\Large\color{col_subsection}}{\thesubsection\quad}{0em}{}
  376. \titleformat{\subsubsection}{\scshape\color{col_subsubsection}}{\thesubsubsection\quad}{0em}{}
  377. \titleformat{\paragraph}[runin]{\sffamily\color{col_paragraph}}{\theparagraph\quad}{0em}{}
  378. \fi
  379. \titlespacing{name=\paragraph,numberless}{0em}{0.5em}{1em}[5em]
  380. \parskip = 0pt
  381. \let\oldsection\section
  382. \let\oldsubsection\subsection
  383. %\renewcommand{\section}[1]{\oldsection{#1}\label{sec:#1}}
  384. %\renewcommand{\subsection}[1]{\oldsubsection{#1}\label{sec:#1}}
  385. % for problems with the TOC: \renewcommand\contentsname{\normalfont Contents}
  386. % This way, your Table of Content’s title will stay untouched by any \titleformat command.
  387. % Epigraph
  388. % ----------------------------------------------------------------------
  389. \providecommand{\epigraph}[3][6cm]{
  390. {\vspace*{-1cm}\hfill\parbox{#1}{\linespread{1.1}\selectfont\itshape\small{#2}\\{\phantom{.}\hfill\upshape #3}\\[1em]}} }
  391. % Colophon
  392. % ----------------------------------------------------------------------
  393. \newenvironment{colophon}{\newpage\color{black!70}}{\newpage}
  394. % ======================================================================
  395. % Lists & Equations
  396. % ======================================================================
  397. %\setlength{\itemsep}{\baselineskip}
  398. \setlength{\itemsep}{0pt}
  399. \RequirePackage{enumitem}
  400. \setitemize{itemsep=0pt}
  401. \setenumerate{itemsep=0pt}
  402. % set own list item symbol
  403. \renewcommand\labelitemi{\color{col_itemize}$\blacktriangleright$}
  404. % change description label
  405. \renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\color{col_paragraph}\textsf{#1}}
  406. \setlist[description]{leftmargin=4em,labelindent=1.5em}
  407. % Equations
  408. % ----------------------------------------------------------------------
  409. \RequirePackage{remreset}
  410. \makeatletter
  411. \@removefromreset{equation}{chapter} % nor reset of equation numbers, requires remreset package
  412. \def\@eqnnum{{\normalfont \textcolor{gray}{\theequation}}} % diffrent equation number style
  413. \makeatother
  414. \AtBeginEnvironment{displaymath}{\displaystyle}
  415. % ======================================================================
  416. % Float Environments
  417. % ======================================================================
  418. \RequirePackage{caption}
  419. % Idea: short caption (for LOF) in bold, rest of caption as normal text
  420. % Figures
  421. % ----------------------------------------------------------------------
  422. %\RequirePackage{pdfpages}
  423. %\RequirePackage{media9} % for flash and 3D Objects
  424. \RequirePackage[sf,SF]{subfigure} % Subfigures, sans-serif counters
  425. \makeatletter
  426. \@removefromreset{figure}{chapter} % continous figure numbering
  427. \renewcommand\p@subfigure{\thefigure}
  428. \renewcommand{\thefigure}{\@arabic\c@figure}
  429. \renewcommand{\thesubfigure}{\alph{subfigure})}
  430. \makeatother
  431. \captionsetup[figure]{labelfont={color=col_figure,sf},textfont={sf,small}}
  432. % Captions
  433. % ----------------------------------------------------------------------
  434. % \makeatletter
  435. %\let\x@caption\caption % original \caption
  436. %\def\x@@caption[#1]#2{\x@caption[{#1}]{#1 #2}} % with optional arg
  437. %\def\x@@@caption#1{\x@caption[{#1}]{#1}} % without optional arg
  438. %\def\caption{\@ifnextchar[\x@@caption\x@@@caption} % new \caption
  439. %\makeatother
  440. % ======================================================================
  441. % Macros
  442. % ======================================================================
  443. % Names
  444. \providecommand{\name}[1]{\mbox{\textsc{#1}}}
  445. \providecommand{\Prof}{Prof.~}
  446. \providecommand{\Dr}{Dr.~}
  447. \providecommand{\DiplIng}{Dipl.-Ing.~}
  448. \providecommand{\MSc}{M.~Sc.~}
  449. \providecommand{\habil}{habil.~}
  450. \providecommand{\PD}{PD~}
  451. % Abbreviations
  452. %\newcommand{\cf}{cf.\@\xspace}
  453. \newcommand{\ea}{\& al.\@\xspace}
  454. \newcommand{\eg}{e.\,g.\@\xspace}
  455. \newcommand{\etc}{etc.\@\xspace}
  456. \renewcommand{\iff}{if and only if\xspace}
  457. \newcommand{\ie}{i.\,e.\@\xspace}
  458. \newcommand{\wrt}{with respect to\xspace}
  459. \newcommand{\wlg}{without loss of generality\xspace}
  460. \newcommand{\Wlg}{Without loss of generality\xspace}
  461. % ======================================================================
  462. % Others
  463. % ======================================================================
  464. % References and Links
  465. % ----------------------------------------------------------------------
  466. \RequirePackage{hyperref}
  467. \hypersetup{
  468. pdfcreator={LaTeX2e},
  469. pdfborder=0 0 0,
  470. breaklinks=true,
  471. bookmarksopen=true,
  472. bookmarksnumbered=true,
  473. linkcolor=col_link,
  474. urlcolor=col_link,
  475. citecolor=col_link,
  476. colorlinks=true
  477. }
  478. % backref style
  479. \ifdefined\backref
  480. \renewcommand*{\backref}[1]{cited on p. #1}
  481. \fi
  482. % Sourcecode listings
  483. % ----------------------------------------------------------------------
  484. \RequirePackage{listings}
  485. \def\postbreak{\raisebox{0ex}[0ex][0ex]{\ensuremath{\hookrightarrow\space}}}
  486. \lstset{
  487. basicstyle=\normalsize\ttfamily\lst@ifdisplaystyle\linespread{0.85}\footnotesize\fi,
  488. tabsize=4,
  489. %gobble=auto, % skip initial tabs %not supported yet
  490. numbers=left, % switch numbers on: left
  491. numberstyle=\tiny\sffamily\color{col_lst_number},
  492. numbersep=1em,
  493. keepspaces=true,
  494. breaklines=true,
  495. breakatwhitespace=true,
  496. postbreak=\postbreak,
  497. keywordstyle=\bfseries\color{tum_blue_dark},
  498. commentstyle=\color{col_lst_comment},
  499. stringstyle=\color{col_lst_string},
  500. captionpos = t,
  501. frame = tb,
  502. framextopmargin={\smallskipamount},
  503. framexbottommargin={\smallskipamount},
  504. framerule=1pt,
  505. rulecolor = \color{col_lst},
  506. }
  507. \captionsetup[lstlisting]{labelfont={color=col_figure,sf},textfont={sf,small}}
  508. % Inline code listings
  509. \let\code\lstinline
  510. \endinput