LabProtocol.sty 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. %
  3. % packages
  4. %
  5. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  6. \usepackage{fancyhdr}
  7. \usepackage{graphicx}
  8. \usepackage[latin1]{inputenc}
  9. \usepackage{listings}
  10. \usepackage{titlesec}
  11. \usepackage{placeins}
  12. \usepackage{booktabs}
  13. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  14. %
  15. % some size definitions and counter settings
  16. %
  17. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  18. \oddsidemargin 0.5cm
  19. \evensidemargin 0.5cm
  20. \topmargin 0pt
  21. \headsep 10pt
  22. \textheight 22.5cm
  23. \textwidth 15.1cm
  24. \renewcommand{\floatpagefraction}{0.9}
  25. \renewcommand{\textfraction}{0.05}
  26. \renewcommand{\topfraction}{1.0}
  27. \renewcommand{\bottomfraction}{1.0}
  28. \setcounter{totalnumber}{3}
  29. \setcounter{bottomnumber}{3}
  30. \setcounter{topnumber}{3}
  31. \setlength{\unitlength}{1mm}
  32. \setlength{\parindent}{6mm}
  33. \setlength{\parskip}{12pt plus2pt minus2pt}
  34. \newenvironment{qa}{
  35. \begin{list}{}{\leftmargin=0em}
  36. }{
  37. \end{list}
  38. }
  39. \newcommand\question[1]{\item{{\bf Question:} #1}}
  40. \newcommand\answer[1]{\item{{\bf Answer:} #1}}
  41. \lstnewenvironment{icode}[1][]
  42. {
  43. \vskip 3mm
  44. \lstset{#1,captionpos=b,basicstyle=\scriptsize,numbers=left,numberstyle=\tiny,stepnumber=1,
  45. framexleftmargin=8mm,xleftmargin=8mm,frame=tb}}
  46. {}
  47. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  48. %
  49. % define variables used on titlepage
  50. %
  51. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  52. \setcounter{footnote}{0}
  53. % initialize variables
  54. \newcommand{\varHeadline}{Digital Design and Computer Architecture LU}
  55. \newcommand{\varSubtitle}{Lab Protocol}
  56. \newcommand{\varExercise}{}
  57. \newcommand{\varAuthors}{}
  58. \newcommand{\varGroupno}{0}
  59. \newcommand{\headline}[1]{\renewcommand{\varHeadline}{#1}}
  60. \newcommand{\subtitle}[1]{\renewcommand{\varSubtitle}{#1}}
  61. \newcommand{\exercise}[1]{\renewcommand{\varExercise}{#1}}
  62. \newcommand{\authors}[1]{\renewcommand{\varAuthors}{#1}}
  63. \newcommand{\groupno}[1]{\renewcommand{\varGroupno}{#1}}
  64. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  65. %
  66. % titlepage
  67. %
  68. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  69. \def\maketitle{
  70. \begin{titlepage}
  71. % enlarge page
  72. \setlength{\topmargin}{0pt}
  73. \setlength{\headheight}{0pt}
  74. \setlength{\headsep}{0pt}
  75. \setlength{\footskip}{0pt}
  76. \let\footnotesize\small \let\footnoterule\relax \setcounter{page}{1}
  77. \null
  78. \vfill
  79. \large
  80. \vskip -4 cm
  81. \begin{center}
  82. % heading
  83. {\LARGE\bf \varHeadline \par} \vskip 2cm
  84. \vskip 1cm
  85. % title
  86. {\Huge\bf \varSubtitle \par}
  87. \vskip 1cm
  88. {\Huge\bf \varExercise \par}
  89. %{\Large \bf \@aufgabe \par}
  90. \vskip 4cm
  91. \begin{flushright}
  92. Group \varGroupno \par
  93. % authors
  94. \varAuthors
  95. \vskip 1cm
  96. Vienna, \today{}
  97. \end{flushright}
  98. \end{center} \par
  99. \vskip 1.5cm
  100. \end{titlepage}
  101. \setcounter{footnote}{0}
  102. \let\thanks\relax
  103. } % \def\maketitle
  104. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  105. \newcommand{\dummyimage}{\framebox[\linewidth]{\rotatebox{30}{Insert your screen-shot here.}}}
  106. \newcommand{\Task}[1]{\FloatBarrier\section{#1}}
  107. \titleformat{\section}{\normalfont\Large\bfseries}{Task~\thesection:}{1em}{}