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