From 15497619ddab4949867c33e256010e13846de7cf Mon Sep 17 00:00:00 2001 From: Derek Christ Date: Thu, 28 Apr 2022 17:43:10 +0200 Subject: [PATCH] Initial template --- Bachelorarbeit.kilepr | 67 ++++++++ README.md | 5 + doc.bib | 8 + doc.tex | 223 ++++++++++++++++++++++++++ floatflt.sty | 348 +++++++++++++++++++++++++++++++++++++++++ img/TUKL_LOGO.pdf | Bin 0 -> 7849 bytes inc/0.titlepage.tex | 47 ++++++ inc/1.introduction.tex | 21 +++ inc/appendix.tex | 195 +++++++++++++++++++++++ minted.sty | 227 +++++++++++++++++++++++++++ 10 files changed, 1141 insertions(+) create mode 100644 Bachelorarbeit.kilepr create mode 100644 README.md create mode 100644 doc.bib create mode 100644 doc.tex create mode 100644 floatflt.sty create mode 100644 img/TUKL_LOGO.pdf create mode 100644 inc/0.titlepage.tex create mode 100644 inc/1.introduction.tex create mode 100644 inc/appendix.tex create mode 100644 minted.sty diff --git a/Bachelorarbeit.kilepr b/Bachelorarbeit.kilepr new file mode 100644 index 0000000..033c534 --- /dev/null +++ b/Bachelorarbeit.kilepr @@ -0,0 +1,67 @@ +[General] +bib_extensions=.bib +bibliographyBackendAutoDetected= +bibliographyBackendUserOverride= +def_graphic_ext=eps +img_extIsRegExp=false +img_extensions=.eps .jpg .jpeg .png .pdf .ps .fig .gif +kileprversion=3 +kileversion=2.9.93 +masterDocument=doc.tex +name=Bachelorarbeit +pkg_extIsRegExp=false +pkg_extensions=.cls .sty .bbx .cbx .lbx +src_extIsRegExp=false +src_extensions=.tex .ltx .latex .dtx .ins + +[Tools] +MakeIndex= +QuickBuild= + +[item:doc.bib] +archive=true +encoding=UTF-8 +highlight=BibTeX +mode=BibTeX + +[item:doc.tex] +archive=true +encoding=UTF-8 +highlight=LaTeX +mode=LaTeX + +[item:floatflt.sty] +archive=true +encoding=UTF-8 +highlight=LaTeX +mode=LaTeX + +[item:img/TUKL_LOGO.pdf] +archive=true +encoding= +highlight= +mode= + +[item:inc/0.titlepage.tex] +archive=true +encoding=UTF-8 +highlight=LaTeX +mode=LaTeX + +[item:inc/1.introduction.tex] +archive=true +encoding=UTF-8 +highlight=LaTeX +mode=LaTeX + +[item:inc/appendix.tex] +archive=true +encoding=UTF-8 +highlight=LaTeX +mode=LaTeX + +[item:thesis.kilepr] +archive=true +encoding= +highlight=None +mode=Normal diff --git a/README.md b/README.md new file mode 100644 index 0000000..d999168 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +## Use document in Kile +The option `-shell-escape` has to be appended to the PDFLatex command line. As of writing this note, the live preview does not work even after adding the option in the `kilerc` file. + +~~Update: +Don't use the package `minted` that comes with the template. Instead use the one from the package manager. Then also the LivePreview works together with the `-shell-escape` command. The option `[cache=false]` is not required.~~ \ No newline at end of file diff --git a/doc.bib b/doc.bib new file mode 100644 index 0000000..9371647 --- /dev/null +++ b/doc.bib @@ -0,0 +1,8 @@ +@Article{ weiser91, + title = "{The Computer for the 21st Century}", + author = "Mark Weiser", + journal = "Scientific American", + pages = "94--104", + month = sep, + year = "1991" +} diff --git a/doc.tex b/doc.tex new file mode 100644 index 0000000..1eb8c2f --- /dev/null +++ b/doc.tex @@ -0,0 +1,223 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Inlucudings: % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%{{{% +\documentclass[11pt,english,a4paper,chapterprefix]{scrartcl} +%\usepackage[T1]{fontenc} +\usepackage[bigcaptions]{listing} +%\usepackage[latin1]{inputenc} +\usepackage[small,bf,hang]{caption} +\usepackage[english]{babel} +%\usepackage{epsfig} +\usepackage{wrapfig} +%\usepackage{caption} +\usepackage{psfrag} +\usepackage[rflt]{floatflt} +\usepackage[usenames]{color} +\usepackage{graphicx} +\emergencystretch = 10pt +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{setspace} +%\usepackage{calc} +\usepackage{tocloft} +\usepackage{listing} +\usepackage{listings} +\usepackage{trsym} +\usepackage{trfsigns} +\usepackage{minted} +\usepackage{multirow} +\usepackage{fancyhdr} +\usepackage{nomencl} +\usepackage{todonotes} +%\usepackage{float} +\usepackage{subfig} +\usepackage{url} +\usepackage{hyperref} +%\usepackage{listings} +%\input{subsections.sty} +\setcounter{secnumdepth}{5} +\setcounter{tocdepth}{5} +\numberwithin{equation}{section} +\numberwithin{figure}{section} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}}}% +% New Commands and Configurations: % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%{{{% +%\setkomafont{section}{\Large\rmfamily} +%\setkomafont{subsection}{\large\rmfamily} +%\setkomafont{subsubsection}{\normalsize\rmfamily} +\setkomafont{paragraph}{\footnotesize} +\numberwithin{table}{section} +\numberwithin{listing}{section} +\setlength\textheight{24cm} +\definecolor{orange}{rgb}{1 , 0.5 , 0} +\definecolor{blue}{rgb}{0, 0 , 1} +\definecolor{green}{rgb}{0, 1 ,0} +\newcommand{\cb}{\textcolor{blue}} +\newcommand{\subsubsubsection}{\paragraph} +\newcommand{\subsubsubsubsection}{\subparagraph} +\clubpenalty = 10000 +\widowpenalty = 10000 +\displaywidowpenalty = 10000 +\parindent0pt % No Indent +\makenomenclature +% Document Head +\begin{document} +%\restylefloat{figure} +\pagestyle{fancy} +\rhead{} + +\definecolor{light-gray}{gray}{0.90} + +%\lstset{ % +%language=C, % choose the language of the code +%basicstyle=\small\ttfamily +%, % the size of the fonts that are used for the code +%%numbers=left, % where to put the line-numbers +%numberstyle=\footnotesize, % the size of the fonts that are used for the line-numbers +%stepnumber=2, % the step between two line-numbers. If it's 1 each line +% % will be numbered +%numbersep=5pt, % how far the line-numbers are from the code +%backgroundcolor=\color{light-gray}, % choose the background color. You must add \usepackage{color} +%showspaces=false, % show spaces adding particular underscores +%showstringspaces=false, % underline spaces within strings +%showtabs=false, % show tabs within strings adding particular underscores +%frame=single, % adds a frame around the code +%rulecolor= \color{light-gray}, +%tabsize=2, % sets default tabsize to 2 spaces +%captionpos=b, % sets the caption-position to bottom +%breaklines=true, % sets automatic line breaking +%breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace +%title=\lstname, % show the filename of files included with \lstinputlisting; +% % also try caption instead of title +%escapeinside={\%*}{*)}, % if you want to add a comment within your code +%xleftmargin=1cm, +%xrightmargin=1cm, +%morekeywords={*,...} % if you want to add more keywords to the set +%} +% +\newminted{perl}{linenos, bgcolor=light-gray, fontsize=\scriptsize} +\newminted{cpp}{bgcolor=light-gray, fontsize=\scriptsize} +\newminted{tcl}{bgcolor=light-gray, fontsize=\scriptsize} +\newminted{sh}{bgcolor=light-gray, fontsize=\scriptsize} +\newminted{basemake}{bgcolor=light-gray, fontsize=\scriptsize} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}}}% +% fancy nomenclautur: +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%{{{% +%\setlength{\nomlabelwidth}{.20\hsize} +%\renewcommand{\nomlabel}[1]{#1 \dotfill} + +%<*sample05> +\def\@@@nomenclature[#1]#2#3{% + \def\@tempa{#2}\def\@tempb{#3}% + \protected@write\@nomenclaturefile{}% + {\string\nomenclatureentry{#1\nom@verb\@tempa @[{\nom@verb\@tempa}]% + |nompageref{\begingroup\nom@verb\@tempb\protect\nomeqref{\theequation}}}% + {\thepage}}% + \endgroup + \@esphack} +%\def\nompageref#1#2{% +% \if@printpageref\pagedeclaration{#2}\else\null\fi +% \linebreak#1\nomentryend\endgroup} +\def\pagedeclaration#1{\dotfill\nobreakspace ~#1} +%\def\nomentryend{.} +\def\nomlabel#1{\textbf{#1}\hfil} +\makeatletter +\renewcommand*\dotfill{\leavevmode% + \leaders\hbox{$\m@th + \mkern \@dotsep mu\hbox{.}\mkern \@dotsep + mu$}\hfill\kern\z@} +\makeatother +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}}}% +% Abbr Commands! +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%{{{% +\newcommand{\abbr}[2]{\textit{#2} (#1)\nomenclature{#1}{#2 \nomrefpage}} +\newcommand{\shortabbr}[2]{\nomenclature{#1}{#2 \nomrefpage}} +\newcommand{\revabbr}[2]{#1 (\textit{#2})\nomenclature{#1}{#2 \nomrefpage}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}}}% +% Titlepage % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%{{{% +\input{inc/0.titlepage} +\newpage +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}}}% +% Table of Contents % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%{{{% +\tableofcontents +\newpage +\setcounter{page}{1} +\newpage +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}}}% +% Chapters % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%{{{% +%\onehalfspacing % Stelle 1.5er Abstand ein +%\setstretch{1.1} +\input{inc/1.introduction} +\newpage +\clearpage +%\input{2.usw.usw} +%\newpage +%\clearpage +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}}}% +% Appendix % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%{{{% +\newpage +\clearpage + +%clear headers +\fancyhead{} +\fancyfoot{} +\fancyfoot[C] {\thepage} + +%\section{Appendix} + +%%%%%%%%%%%%%%%% >INSERT YOUR APPENDIX HERE> +\input{inc/appendix} +\newpage +\clearpage +%\addcontentsline{toc}{section}{Appendix} +%List of Figures +\vspace{-20pt} +\begingroup + \addcontentsline{toc}{subsection}{List of Figures} + \setlength{\cftparskip}{10pt} + \listoffigures +\endgroup +\newpage +\clearpage +%List of Tables +\begingroup + \addcontentsline{toc}{subsection}{List of Tables} + \setlength{\cftparskip}{10pt} + \listoftables +\endgroup +\newpage +\clearpage +%List of Listings +%\renewcommand{\lstlistlistingname}{Verzeichnis der Quellcodes} +\begingroup + \addcontentsline{toc}{subsection}{List of Listings} + \setlength{\itemsep}{20pt} + \setlength{\parskip}{10pt} + \renewcommand{\listlistingname}{List of Listings} + \listoflistings +\endgroup +\newpage +\clearpage +%List of Abbreviations +\begingroup + \addcontentsline{toc}{subsection}{List of Abbreviations} + \renewcommand{\nomname}{List of Abbreviations} + \renewcommand{\nompreamble}{\vspace{10pt}} + %\setlength{\nomitemsep}{8pt} + \printnomenclature[2cm] +\endgroup +\newpage +\clearpage +%Literatur: +\addcontentsline{toc}{subsection}{References} +\bibliographystyle{unsrt} +\bibliography{doc} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}}}% +\end{document} diff --git a/floatflt.sty b/floatflt.sty new file mode 100644 index 0000000..4396042 --- /dev/null +++ b/floatflt.sty @@ -0,0 +1,348 @@ +%% +%% This is file `floatflt.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% floatflt.dtx (with options: `paketkod') +%% +%% Copyright (c) 1994-1998 by Mats Dahlgren . +%% All rights reserved. See the file `floatflt.ins' for information +%% on how you may (re-)distribute the `floatflt' package files. +%% You are not allowed to make any changes to this file without +%% explicit permission from the author. +%% +\NeedsTeXFormat{LaTeX2e}[1996/12/01] +\ProvidesPackage{floatflt}[1997/07/16 v. 1.31] +\newcounter{OptionTest} +\setcounter{OptionTest}{0} +\DeclareOption{rflt}{\setcounter{OptionTest}{1}} +\DeclareOption{lflt}{\setcounter{OptionTest}{2}} +\DeclareOption{vflt}{\setcounter{OptionTest}{0}} +\DeclareOption*{\OptionNotUsed} +\ProcessOptions +\newbox\figbox +\newbox\tabbox +\newbox\pagebox +\newcount\ffigcount +\newcount\ftabcount +\newcount\fftest +\newcount\hangcount +\newcount\nosuccesstryfig +\newcount\nosuccesstrytab +\newdimen\figgutter \figgutter=1truepc +\newdimen\tabgutter \tabgutter=1truepc +\newdimen\htdone \htdone=0pt +\newdimen\pageht +\newdimen\startpageht +\newdimen\tabbredd +\newdimen\floatfltwidth +\newdimen\fltitemwidth +\newif\iftryingfig \tryingfigfalse +\newif\iftryingtab \tryingtabfalse +\newif\ifdoingfig \doingfigfalse +\newif\ifdoingtab \doingtabfalse +\newif\iffigprocessing \figprocessingfalse +\newif\iftabprocessing \tabprocessingfalse +\newif\ifpageafterfig \pageafterfigfalse +\newif\ifpageaftertab \pageaftertabfalse +\newif\ifoddpages +\newif\ifoutput +\newtoks\outputpretest +\newenvironment{floatingfigure}[2][v]% +{\@tfor \@tempa :=#1\do + {\if\@tempa r\global\oddpagestrue\fi + \if\@tempa l\global\oddpagesfalse\fi + \if\@tempa p% + \ifodd\c@page\global\oddpagestrue + \else\global\oddpagesfalse\fi + \fi + \if\@tempa v% + \ifnum\theOptionTest=0 + \ifodd\c@page\global\oddpagestrue + \else\global\oddpagesfalse\fi + \else + \ifodd\theOptionTest\global\oddpagestrue + \else\global\oddpagesfalse\fi + \fi + \fi + } + \expandafter\ifx\csname oldoutput\endcsname\relax% ref. TeXbook Ex.7.7 + \PackageError{floatflt}{The `floatflt' package is not initialized} + {Try to reinstall the `floatflt' package.\MessageBreak + Type `x' to quit or to try to go on.}\@@end\fi + \global\everypar={\tryfig\oldeverypar}% must be set globally! + \global\advance\ffigcount by 1 + \iffigprocessing + {\count0=\ffigcount\advance\count0 by -1 + \PackageWarningNoLine{floatflt}{Floating figures \the\count0\space% + \space and \the\ffigcount\space colliding}% + }% + \fi + \iftabprocessing \PackageWarningNoLine{floatflt}{Floating figure % + \the\ffigcount\space and floating table \the\ftabcount\space colliding} + \fi + \def\@captype{figure} + \global\setlength{\floatfltwidth}{#2} + \global\figprocessingtrue + \global\setbox\figbox=\vbox\bgroup% begin of figbox + \hrule height 0pt width #2 depth 0pt% + \hsize=#2% +} +{ +\egroup +\figinsert\par% +} +\newenvironment{floatingtable}[2][v]% +{\@tfor \@tempa :=#1\do + {\if\@tempa r\global\oddpagestrue\fi + \if\@tempa l\global\oddpagesfalse\fi + \if\@tempa p% + \ifodd\c@page\global\oddpagestrue + \else\global\oddpagesfalse\fi + \fi + \if\@tempa v% + \ifnum \theOptionTest=0 + \ifodd\c@page\global\oddpagestrue + \else\global\oddpagesfalse\fi + \else + \ifodd\theOptionTest\global\oddpagestrue + \else\global\oddpagesfalse\fi + \fi + \fi + } +\expandafter\ifx\csname oldoutput\endcsname\relax% ref. TeXbook Ex.7.7 + \PackageError{floatflt}{The `floatflt' package is not initialized} + {Try to reinstall the `floatflt' package.\MessageBreak + Type `x' to quit or to try to go on.}\@@end\fi +\global\setbox\tabbox=\vbox\bgroup\hrule height 0pt width 0pt depth 0pt% + \hsize=0pt\egroup + \global\everypar={\trytab\oldeverypar} + \global\advance\ftabcount by 1 + \iftabprocessing + {\count0=\ftabcount\advance\count0 by -1 + \PackageWarningNoLine{floatflt}{Floating tables \the\count0\space% + \space and \the\ftabcount \space colliding}% + } + \fi + \iftabprocessing \PackageWarningNoLine{floatflt}{Floating table % + \the\ffigcount\space and floating figure \the\ftabcount\space colliding} + \fi + \settowidth{\tabbredd}{#2} + \global\setlength{\floatfltwidth}{\tabbredd} + \def\@captype{table} + \global\tabprocessingtrue + \global\setbox\tabbox=\vbox\bgroup% begin of tabbox + \hrule height 0pt width\tabbredd depth 0pt% + \hsize=\tabbredd +\noindent\ifnum\ftabcount >1\ifoddpages\else\hspace*{-12pt}\fi\fi% +#2\vspace{0.2\baselineskip}% +} +{ +\egroup% end of \tabbox +\tabinsert\par% +} +\AtBeginDocument{% +\edef\oldoutput{\the\output}% +\output={\the\outputpretest% + \ifoutput\oldoutput\fi} +\outputpretest={\outputtrue} +\edef\oldeverypar{\the\everypar} +} +\def\dofigtest{% + \ifnum\outputpenalty=-10005 + \setbox\pagebox=\vbox{\unvbox255}% + \global\pageht=\ht\pagebox + \global\outputfalse + \unvbox\pagebox + \else + \global\outputtrue + \ifdoingfig + \global\pageafterfigtrue + \fi + \fi}% +\def\dotabtest{% + \ifnum\outputpenalty=-10005 + \setbox\pagebox=\vbox{\unvbox255}% + \global\pageht=\ht\pagebox + \global\outputfalse + \unvbox\pagebox + \else + \global\outputtrue + \ifdoingtab + \global\pageaftertabtrue + \fi + \fi}% +\def\tryfig{% + \iftryingfig + {\everypar={\relax}\setbox0=\lastbox% + \parindent=\wd0 \parskip=0pt \par% + \penalty-10005 \leavevmode}% + \dimen0=\vsize% + \advance\dimen0 by -\pageht% + \advance\dimen0 by -2\baselineskip% + \ifdim\dimen0>\ht\figbox% + \dimen0=0.3\baselineskip + \vrule depth \dimen0 width 0pt + \vadjust{\kern -\dimen0% + \vtop to \dimen0{% + \baselineskip=\dimen0% + \vss \vbox to 1ex{% + \ifoddpages% + \hbox to \hsize{\hss\copy\figbox}% + \else% leftsetting + \hbox to \hsize{\copy\figbox\hss}% + \fi% \ifodd\count0 + \vss}\null}}% + \global\tryingfigfalse% + \global\doingfigtrue + \global\startpageht=\pageht + \global\htdone=0pt + \dohangf + \ifnum\nosuccesstryfig>0% + \typeout{floatflt Message: Flt. fig. \the\ffigcount\space set on page + \the\count0, shifted \the\nosuccesstryfig\space par(s) forward.}% + \else + \typeout{Package floatflt Message: Floating figure \the\ffigcount + \space set on page \the\count0}% + \fi + \else + \global\advance\nosuccesstryfig by 1 + \fi + \else% + \ifdoingfig + {\everypar={\relax}\setbox0=\lastbox + \parindent=\wd0 \parskip=0pt \par + \penalty-10005 \leavevmode}% + \global\htdone=\pageht + \global\advance\htdone by -\startpageht + \ifpageafterfig + \global\doingfigfalse + \else + \dimen0=\ht\figbox% + \advance\dimen0 by 0.5\baselineskip% + \ifdim\htdone<\dimen0% + \dohangf + \else + \global\doingfigfalse + \fi + \fi + \ifdoingfig\relax\else\global\figprocessingfalse\fi + \else + \global\outputpretest={\outputtrue}% + \fi +\fi +} +\def\trytab{% + \iftryingtab% + {\everypar={\relax}\setbox0=\lastbox% + \parindent=\wd0 \parskip=0pt \par% + \penalty-10005 \leavevmode}% + \dimen0=\vsize% + \advance\dimen0 by -\pageht% + \advance\dimen0 by -2\baselineskip% + \ifdim\dimen0>\ht\tabbox% + \dimen0=0.3\baselineskip + \vrule depth \dimen0 width 0pt + \vadjust{\kern -\dimen0% + \vtop to \dimen0{% + \baselineskip=\dimen0% + \vss \vbox to 1ex{% + \ifoddpages% + \hbox to \hsize{\hss\copy\tabbox}% + \else% leftsetting + \hbox to \hsize{\copy\tabbox\hss}% + \fi% \ifodd\count0 + \vss}\null}}% + \global\tryingtabfalse% + \global\doingtabtrue + \global\startpageht=\pageht + \global\htdone=0pt + \dohangt + \ifnum\nosuccesstrytab>0% + \typeout{floatflt Message: Flt. tab. \the\ftabcount\space set on page + \the\count0, shifted \the\nosuccesstrytab\space par(s) forward.}% + \else + \typeout{Package floatflt Message: Floating table \the\ftabcount\space + set on page \the\count0}% + \fi + \else + \global\advance\nosuccesstrytab by 1 + \fi + \else + \ifdoingtab + {\everypar={\relax}\setbox0=\lastbox + \parindent=\wd0 \parskip=0pt \par + \penalty-10005 \leavevmode}% + \global\htdone=\pageht + \global\advance\htdone by -\startpageht + \ifpageaftertab + \global\doingtabfalse + \else + \dimen0=\ht\tabbox% + \advance\dimen0 by 0.5\baselineskip% + \ifdim\htdone<\dimen0% + \dohangt + \else + \global\doingtabfalse + \fi + \fi + \ifdoingtab\relax\else\global\tabprocessingfalse\fi + \else + \global\outputpretest={\outputtrue}% + \fi +\fi +} +\def\figinsert{% + \global\nosuccesstryfig=0% + \global\outputpretest={\dofigtest}% + \global\tryingfigtrue \global\doingfigfalse% + \global\pageafterfigfalse}% +\def\tabinsert{% + \global\nosuccesstrytab=0% + \global\outputpretest={\dotabtest}% + \global\tryingtabtrue \global\doingtabfalse% + \global\pageaftertabfalse}% +\def\dohangf{% + \dimen0=\ht\figbox% + \advance\dimen0 by -\htdone% + \advance\dimen0 by 1.49\baselineskip% + \hangcount=\dimen0% + \divide\hangcount by \baselineskip% + \dimen0=\wd\figbox% + \advance\dimen0 by \figgutter% + \ifoddpages% + \global\hangafter=-\hangcount% placing right + \global\hangindent=-\dimen0% + \else% \ifleftsetting + \global\hangafter=-\hangcount% placing left + \global\hangindent=\dimen0% + \fi +} +\def\dohangt{% + \dimen0=\ht\tabbox% + \advance\dimen0 by -\htdone% + \advance\dimen0 by 1.49\baselineskip% + \hangcount=\dimen0% + \divide\hangcount by \baselineskip% + \dimen0=\wd\tabbox% + \advance\dimen0 by \tabgutter% + \ifoddpages% + \global\hangafter=-\hangcount% placing right + \global\hangindent=-\dimen0% + \else% \ifleftsetting + \global\hangafter=-\hangcount% placing left + \global\hangindent=\dimen0% + \fi +} +\newcommand{\fltitem}[2][0pt]{\setlength{\fltitemwidth}{\linewidth}% + \addtolength{\fltitemwidth}{-\floatfltwidth}% + \addtolength{\fltitemwidth}{-0.5em}% + \item \parbox[t]{\fltitemwidth}{#2}\\[#1]} +\newcommand{\fltditem}[3][0pt]{\setlength{\fltitemwidth}{\linewidth}% + \addtolength{\fltitemwidth}{-\floatfltwidth}% + \addtolength{\fltitemwidth}{-0.5em}% + \item[#2] \parbox[t]{\fltitemwidth}{#3}\\[#1]} +\endinput +%% +%% End of file `floatflt.sty'. diff --git a/img/TUKL_LOGO.pdf b/img/TUKL_LOGO.pdf new file mode 100644 index 0000000000000000000000000000000000000000..bbdbf269d262d3e9249f1a01b96eacd9a9f18bf2 GIT binary patch literal 7849 zcmcgxbySqw+a)BV8<848LM4V6LMf$0K)Q2)p)Er}RAuD2`FI2g*bv+0X9NNOAOLD+ zOCTl&;8lV+TDe*S1ksQ>0RRBtm9w#Tg}~5Pd$21+24W7ifDlMX5V*L)AYcaqkM!5k z4;``j@MV$dL4?n508MvY0!1Hbf%;g~1pD%Pcrz3g)4{mial$5d z{Ym6Sb_n>qJ4fz)lO)Jss=E{tn>F|3y8=s3Xb>94gR6SBbY1E>8y9?|1oR+)!SSV@q2m`Nlg);u&(`r0WMyU zSG776UbdYA<*L)zCu{OwA}0tANhU5lW?`k-8SXs4?!N!2W@~^|?uwWzHmLVtcm6aF(AfLGJg z2?F3%1zSOWMpgyGAdar+!GEurGQ`3L{0Qm+FhD~<03V+KkAMgWBr1%aK97iq06)O! z=Zn%%M_2TlE`X~Y@W*n?!=P}dzh&@8sGsQXq%_bIfPo!doUX!}d;W$M0Io3j&k0>+ zE{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rAkH-VFtgzy&V&mqBJI-C5xk-iuoq5t$p~cq_G-1-t zuHijlrwxHzU=Rh(V_y{Bb9!S94M!X_srH zllqPGiv;2rHK997?%FDN8N*p)VjB-IJ{CpAdRM{)q{o|G)SLCVerrorout_$ARGV[1]"); + +printf out_file ("The following table shows the addresses "); +printf out_file ("from the errors in the wideIO SDRAM.\n"); +printf out_file ("Addresses in binary \t\t\t Addresses in hexadecimal\n"); +printf out_file ("bank \t row \t\t column \t SDRAM address \t data value\n"); + +while() +{ + unless($_ =~ /\[.*\]/ || $_ =~ /$id/) + { + my $value = $_; + chop($value); + $value = substr( $value , 2); + my $result = sprintf("%0b", (hex($value) ^ $pattern)); + for(my $j = 0; $j < length($result); $j ++) + { + if(substr( $result, $j , 1 ) eq "1") + { + $errors++; + $addrb = $i-((ceil($i/11))*3); + $addr = $addrb + $addroffset; + $bank = ($addrb & $bankand) >> $bankshift; + $row = ($addrb & $rowand) >> $rowshift; + $column = ($addrb & $columnand); + printf out_file ("%02b\t %012b\t %09b\t %#8x\t $value\n", $bank, $row, $column, $addr); + } + } + } + $i++; +} + +close(out_file); +print "Errors = ".$errors."\n"; +close(IFH); +\end{perlcode} +\caption{Perl script to find errors for data pattern F, A or 5} +\label{lis:5af} +\end{listing} + +\pagebreak +Pagebreak and linebreak has to be done manually with pygmentize, this feature is +not yet implemented. Open the appendix.tex file and see the source code +afterwards how the pagebreak is done. For that the appendix.tex has to be +written with pagebreaks, so that the layout of the pages is done manually. + +Linebreaks are easier to do, just check that the lines are in the box of the pdf +file, otherwise make a linebreak yourself. +\pagebreak + +%\begin{listing}[H] +\begin{minted}[linenos, bgcolor=light-gray, fontsize=\scriptsize]{perl} +#!/usr/bin/perl + +use strict; +use warnings; +use POSIX; +use Chart::Gnuplot; + +# University of Kaiserslautern 2014 +# Matthias Jung +# Christian Weis +# Peter Ehses +# call programm: perl plotreffff_0xf.pl dfile1 dfile2 dfile3 + +my $i = 0; +my $line = 3; +my $addr = 0; # DRAM address in hex +my $bankb; # 2 bits for the bank +my $rowb; # 12 bits for the row +my $columnb; # 9 bits for the column +my $bank; # banknumber in decimal +my $row; # rownumber in decimal +my $column; # columnnumber in decimal +my $value; +my @ytics = [0, 25,50,75,100,125,150,175,200,225,250,275,300,325,350,375,400,425,450,475,500]; +my @xtics = [0,250,500,750,1000,1250,1500,1750,2000,2250,2500,2750,3000,3250,3500,3750,4000]; + +# set terminal to svg format +my $terminal = 'svg mouse jsdir '.'"http://gnuplot.sourceforge.net/demo_svg"'; +sub bin2dec {return unpack("N", pack("B32", substr("0" x 32 . shift, -33)));} + +my @row_array; +my @column_array; + +foreach my $argnum (0 .. $#ARGV) +{ + open(IFH, $ARGV[$argnum]); + $i = 0; + while() + { + chomp; + $i++; + if ($i > $line) + { + ($bankb, $rowb, $columnb, $addr, $value) = split("\t"); + $bank = (bin2dec($bankb)); + $row = (bin2dec($rowb)); + $column = (bin2dec($columnb)); + if ($argnum == 0) + { + push(@{$row_array[$bank]}, $row); + push(@{$column_array[$bank]}, $column); + } + if ($argnum == 1) + { + push(@{$row_array[$bank+4]}, $row); + push(@{$column_array[$bank+4]}, $column); + } + if ($argnum == 2) + { + push(@{$row_array[$bank+8]}, $row); + push(@{$column_array[$bank+8]}, $column); + } + } + } + close(IFH); +} +for (my $count = 1; $count < 5; $count++) +{ + $bank = $count -1; +\end{minted} + +%here is a pagebreak, and the next line of the code is starting with 70, has to be specified with minted like below. +\begin{listing}[H] +\begin{minted}[linenos, bgcolor=light-gray, fontsize=\scriptsize, firstnumber=70]{perl} + my $plot1 = Chart::Gnuplot->new( + terminal => $terminal, output => "plot_ref202ms_0xf_b_$count.svg", + title => "Errors channel 3 of SDRAM, bank $count, data pattern 0xffffffff and refresh 202 ms", + imagesize => '1024, 768', xlabel => "row address", ylabel => "column address", yrange=>[0, 511], + xrange=>[0, 4095], ytics => {labels => @ytics}, xtics => {labels => @xtics}, + legend => {position => "outside center bottom", order =>"horizontal reverse", + border => "on", align => "left"} + ); + my $dataSet1 = Chart::Gnuplot::DataSet->new( + xdata => \@{$row_array[$bank]}, ydata => \@{$column_array[$bank]}, + color => "blue", pointtype => 6, pointsize => 1.75, width => 2, + title => "95 degree C" + ); + my $dataSet2 = Chart::Gnuplot::DataSet->new( + xdata => \@{$row_array[$bank+4]}, ydata => \@{$column_array[$bank+4]}, + color => "red", pointtype => 8, pointsize => 1.25, width => 2, + title => "100 degree C" + ); + my $dataSet3 = Chart::Gnuplot::DataSet->new( + xdata => \@{$row_array[$bank+8]}, ydata => \@{$column_array[$bank+8]}, + color => "dark-green", pointtype => 10, pointsize => 1.25, width => 2, + title => "105 degree C" + ); + + if (@{$row_array[$bank]}){$plot1->plot2d($dataSet1, $dataSet2, $dataSet3);} + if (!@{$row_array[$bank]}){$plot1->plot2d($dataSet2, $dataSet3);} + if (!@{$row_array[$bank]} && !@{$row_array[$bank+4]}){$plot1->plot2d($dataSet3);} +} +\end{minted} +\caption{Perl script for scatter plot of different refresh periods} +\label{lis:plotref} +\end{listing} + diff --git a/minted.sty b/minted.sty new file mode 100644 index 0000000..1098519 --- /dev/null +++ b/minted.sty @@ -0,0 +1,227 @@ +%% +%% This is file `minted.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% minted.dtx (with options: `package') +%% Copyright 2010 Konrad Rudolph +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% Additionally, the project may be distributed under the terms of the new BSD +%% license. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Konrad Rudolph. +%% +%% This work consists of the files mints.dtx and mints.ins +%% and the derived file mints.sty. +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{minted}[2010/01/27 v1.6 Yet another Pygments shim for LaTeX] +\RequirePackage{keyval} +\RequirePackage{fancyvrb} +\RequirePackage{color} +\RequirePackage{float} +\RequirePackage{ifthen} +\RequirePackage{calc} +\RequirePackage{ifplatform} +\ifwindows + \providecommand\DeleteFile[1]{\immediate\write18{del #1}} +\else + \providecommand\DeleteFile[1]{\immediate\write18{rm #1}} +\fi +\newboolean{AppExists} +\providecommand\TestAppExists[1]{ + \ifwindows + \DeleteFile{\jobname.aex} + \immediate\write18{for \string^\@percentchar i in (#1.exe #1.bat #1.cmd) + do set >\jobname.aex >\jobname.aex} %$ + \newread\@appexistsfile + \immediate\openin\@appexistsfile\jobname.aex + \expandafter\def\expandafter\@tmp@cr\expandafter{\the\endlinechar} + \endlinechar=-1\relax + \readline\@appexistsfile to \@apppathifexists + \endlinechar=\@tmp@cr + \ifthenelse{\equal{\@apppathifexists}{}} + {\AppExistsfalse} + {\AppExiststrue} + \immediate\closein\@appexistsfile + \DeleteFile{\jobname.aex} +\immediate\typeout{file deleted} + \else + \immediate\write18{which -s #1 && touch \jobname.aex} + \IfFileExists{\jobname.aex} + {\AppExiststrue + \DeleteFile{\jobname.aex}} + {\AppExiststrue} + \fi} +\newcommand\minted@resetoptions{} +\newcommand\minted@defopt[1]{ + \expandafter\def\expandafter\minted@resetoptions\expandafter{% + \minted@resetoptions + \@namedef{minted@opt@#1}{}}} +\newcommand\minted@opt[1]{ + \expandafter\detokenize% + \expandafter\expandafter\expandafter{\csname minted@opt@#1\endcsname}} +\newcommand\minted@define@opt[3][]{ + \minted@defopt{#2} + \ifthenelse{\equal{#1}{}}{ + \define@key{minted@opt}{#2}{\@namedef{minted@opt@#2}{#3}}} + {\define@key{minted@opt}{#2}[#1]{\@namedef{minted@opt@#2}{#3}}}} +\newcommand\minted@define@switch[2]{ + \minted@defopt{#1} + \define@booleankey{minted@opt}{#1}{ + \@namedef{minted@opt@#1}{#2}} + {\@namedef{minted@opt@#1}{}}} +\minted@defopt{extra} +\newcommand\minted@define@extra[1]{ + \define@key{minted@opt}{#1}{ + \expandafter\def\expandafter\minted@opt@extra\expandafter{% + \minted@opt@extra,#1=##1}}} +\newcommand\minted@define@extra@switch[1]{ + \define@booleankey{minted@opt}{#1} + {\expandafter\def\expandafter\minted@opt@extra\expandafter{% + \minted@opt@extra,#1}} + {\expandafter\def\expandafter\minted@opt@extra\expandafter{% + \minted@opt@extra,#1=false}}} +\minted@define@switch{texcl}{-P texcomments} +\minted@define@switch{mathescape}{-P mathescape} +\minted@define@switch{linenos}{-P linenos} +\minted@define@opt{gobble}{-F gobble:n=#1} +\minted@define@opt{bgcolor}{#1} +\minted@define@extra{frame} +\minted@define@extra{framesep} +\minted@define@extra{framerule} +\minted@define@extra{rulecolor} +\minted@define@extra{numbersep} +\minted@define@extra{firstnumber} +\minted@define@extra{stepnumber} +\minted@define@extra{firstline} +\minted@define@extra{lastline} +\minted@define@extra{baselinestretch} +\minted@define@extra{xleftmargin} +\minted@define@extra{xrightmargin} +\minted@define@extra{fillcolor} +\minted@define@extra{tabsize} +\minted@define@extra{fontfamily} +\minted@define@extra{fontsize} +\minted@define@extra{fontshape} +\minted@define@extra{fontseries} +\minted@define@extra{formatcom} +\minted@define@extra@switch{numberblanklines} +\minted@define@extra@switch{showspaces} +\minted@define@extra@switch{resetmargins} +\minted@define@extra@switch{samepage} +\minted@define@extra@switch{showtabs} +\minted@define@extra@switch{obeytabs} +\newsavebox{\minted@bgbox} +\newenvironment{minted@colorbg}[1]{ + \def\minted@bgcol{#1} + \noindent + \begin{lrbox}{\minted@bgbox} + \begin{minipage}{\linewidth-2\fboxsep}} + {\end{minipage} + \end{lrbox}% + \colorbox{\minted@bgcol}{\usebox{\minted@bgbox}}} +\newwrite\minted@code +\newcommand\minted@savecode[1]{ + \immediate\openout\minted@code\jobname.pyg + \immediate\write\minted@code{#1} + \immediate\closeout\minted@code} +\newcommand\minted@pygmentize[2][\jobname.pyg]{ + \def\minted@cmd{pygmentize -l #2 -f latex -F tokenmerge + \minted@opt{gobble} \minted@opt{texcl} \minted@opt{mathescape} + \minted@opt{linenos} -P "verboptions=\minted@opt{extra}" + -o \jobname.out.pyg #1} + \immediate\write18{\minted@cmd} + \ifthenelse{\equal{\minted@opt@bgcolor}{}} + {} + {\begin{minted@colorbg}{\minted@opt@bgcolor}} + \input{\jobname.out.pyg} + \ifthenelse{\equal{\minted@opt@bgcolor}{}} + {} + {\end{minted@colorbg}} + \DeleteFile{\jobname.out.pyg}} +\newcommand\minted@usedefaultstyle{\usemintedstyle{default}} +\newcommand\usemintedstyle[1]{ + \renewcommand\minted@usedefaultstyle{} + \immediate\write18{pygmentize -S #1 -f latex > \jobname.pyg} + \input{\jobname.pyg}} +\newcommand\mint[3][]{ + \DefineShortVerb{#3} + \minted@resetoptions + \setkeys{minted@opt}{#1} + \SaveVerb[aftersave={ + \UndefineShortVerb{#3} + \minted@savecode{\FV@SV@minted@verb} + \minted@pygmentize{#2} + \DeleteFile{\jobname.pyg}}]{minted@verb}#3} +\newcommand\minted@proglang[1]{} +\newenvironment{minted}[2][] + {\VerbatimEnvironment + \renewcommand{\minted@proglang}[1]{#2} + \minted@resetoptions + \setkeys{minted@opt}{#1} + \begin{VerbatimOut}{\jobname.pyg}}% + {\end{VerbatimOut} + \minted@pygmentize{\minted@proglang{}} + \DeleteFile{\jobname.pyg}} +\newcommand\inputminted[3][]{ + \minted@resetoptions + \setkeys{minted@opt}{#1} + \minted@pygmentize[#3]{#2}} +\newcommand\newminted[3][]{ + \ifthenelse{\equal{#1}{}} + {\def\minted@envname{#2code}} + {\def\minted@envname{#1}} + \newenvironment{\minted@envname} + {\VerbatimEnvironment\begin{minted}[#3]{#2}} + {\end{minted}} + \newenvironment{\minted@envname *}[1] + {\VerbatimEnvironment\begin{minted}[#3,##1]{#2}} + {\end{minted}}} +\newcommand\newmint[3][]{ + \ifthenelse{\equal{#1}{}} + {\def\minted@shortname{#2}} + {\def\minted@shortname{#1}} + \expandafter\newcommand\csname\minted@shortname\endcsname[2][]{ + \mint[#3,##1]{#2}##2}} +\newcommand\newmintedfile[3][]{ + \ifthenelse{\equal{#1}{}} + {\def\minted@shortname{#2file}} + {\def\minted@shortname{#1}} + \expandafter\newcommand\csname\minted@shortname\endcsname[2][]{ + \inputminted[#3,##1]{#2}{##2}}} +\newfloat{listing}{h}{lol} +\newcommand\listingscaption{Listing} +\floatname{listing}{\listingscaption} +\newcommand\listoflistingscaption{List of listings} +\providecommand\listoflistings{\listof{listing}{\listoflistingscaption}} +\AtBeginDocument{ + \minted@usedefaultstyle} +\AtEndOfPackage{ + \ifeof18 + \PackageError{minted} + {You must invoke LaTeX with the + -shell-escape flag} + {Pass the -shell-escape flag to LaTeX. Refer to the minted.sty + documentation for more information.}\fi} + \TestAppExists{pygmentize} + \ifAppExists\else + \PackageError{minted} + {You must have `pygmentize' installed + to use this package} + {Refer to the installation instructions in the minted + documentation for more information.} + \fi +\endinput +%% +%% End of file `minted.sty'.