LabProtocol.sty 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. %
  3. % packages
  4. %
  5. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  6. \usepackage{fancyhdr}
  7. \usepackage{graphicx}
  8. \usepackage[utf8]{inputenc}
  9. \usepackage{listings}
  10. \usepackage{titlesec}
  11. \usepackage{placeins}
  12. \usepackage{longtable}
  13. \usepackage{setspace}
  14. \usepackage{geometry}
  15. \geometry{
  16. a4paper,
  17. total={165mm,240mm},
  18. left=20mm,
  19. top=30mm,
  20. }
  21. \renewcommand{\floatpagefraction}{0.9}
  22. \renewcommand{\textfraction}{0.05}
  23. \renewcommand{\topfraction}{1.0}
  24. \renewcommand{\bottomfraction}{1.0}
  25. \setcounter{totalnumber}{3}
  26. \setcounter{bottomnumber}{3}
  27. \setcounter{topnumber}{3}
  28. \setlength{\unitlength}{1mm}
  29. \setlength{\parindent}{6mm}
  30. %\setlength{\parskip}{12pt plus2pt minus2pt}
  31. \newcounter{questioncounter}
  32. \newcommand*\ruleline[1]{\par\noindent\raisebox{.8ex}{\makebox[\linewidth]{\hrulefill\hspace{1ex}\raisebox{-.8ex}{#1}\hspace{1ex}\hrulefill}}}
  33. \newenvironment{qa}[1]{
  34. \stepcounter{questioncounter}
  35. \noindent
  36. \begin{center}
  37. \noindent\ruleline{\textbf{Subtask \arabic{questioncounter}}}
  38. \end{center}
  39. #1
  40. \smallskip
  41. \begin{spacing}{0.05}
  42. \noindent
  43. \rule{\linewidth}{0.25mm}\\
  44. \rule{\linewidth}{0.25mm}\\
  45. \end{spacing}
  46. \bigskip
  47. }{
  48. \vspace{0.5em}
  49. \FloatBarrier
  50. \noindent\ruleline{END Subtask \arabic{questioncounter}}
  51. }
  52. \lstnewenvironment{icode}[1][]
  53. {
  54. \vskip 3mm
  55. \lstset{#1,captionpos=b,basicstyle=\scriptsize,numbers=left,numberstyle=\tiny,stepnumber=1,
  56. framexleftmargin=8mm,xleftmargin=8mm,frame=tb}}
  57. {}
  58. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  59. %
  60. % define variables used on titlepage
  61. %
  62. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  63. \setcounter{footnote}{0}
  64. % initialize variables
  65. \newcommand{\varHeadline}{Digital Design and Computer Architecture LU}
  66. \newcommand{\varSubtitle}{Lab Protocol}
  67. \newcommand{\varExercise}{}
  68. \newcommand{\varAuthors}{}
  69. \newcommand{\headline}[1]{\renewcommand{\varHeadline}{#1}}
  70. \newcommand{\subtitle}[1]{\renewcommand{\varSubtitle}{#1}}
  71. \newcommand{\exercise}[1]{\renewcommand{\varExercise}{#1}}
  72. \newcommand{\authors}[1]{\renewcommand{\varAuthors}{#1}}
  73. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  74. %
  75. % titlepage
  76. %
  77. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  78. \def\maketitle{
  79. \begin{titlepage}
  80. % enlarge page
  81. \setlength{\topmargin}{0pt}
  82. \setlength{\headheight}{0pt}
  83. \setlength{\headsep}{0pt}
  84. \setlength{\footskip}{0pt}
  85. \let\footnotesize\small \let\footnoterule\relax \setcounter{page}{1}
  86. \null
  87. \vfill
  88. \large
  89. \vskip -4 cm
  90. \begin{center}
  91. % heading
  92. {\LARGE\bf \varHeadline \par} \vskip 2cm
  93. \vskip 1cm
  94. % title
  95. {\Huge\bf \varSubtitle \par}
  96. \vskip 1cm
  97. {\Huge\bf \varExercise \par}
  98. %{\Large \bf \@aufgabe \par}
  99. \vskip 4cm
  100. \begin{flushright}
  101. % authors
  102. \varAuthors
  103. \vskip 1cm
  104. Vienna, \today{}
  105. \end{flushright}
  106. \end{center} \par
  107. \vskip 1.5cm
  108. \end{titlepage}
  109. \setcounter{footnote}{0}
  110. \let\thanks\relax
  111. } % \def\maketitle
  112. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  113. \newcommand{\dummyimage}{\framebox[\linewidth]{\rotatebox{30}{Insert your screenshot here.}}}
  114. \newcommand{\Task}[1]{\FloatBarrier\section{#1}}
  115. \titleformat{\section}{\normalfont\Large\bfseries}{Task~\thesection:}{1em}{}