Advertisement
Guest User

Untitled

a guest
Jun 1st, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.69 KB | None | 0 0
  1. documentclass[12pt]{article}
  2. usepackage{hyperref}
  3. usepackage{enumitem}
  4. usepackage{amsmath}
  5. usepackage{graphicx}
  6.  
  7. usepackage{spverbatim}
  8. %lstset{breaklines=true}
  9.  
  10. usepackage{lastpage} %page number
  11. usepackage{fancyhdr}%header and footer
  12. usepackage{calc}
  13. usepackage{enumitem}
  14.  
  15. usepackage{totcount}
  16. usepackage{etoolbox}
  17.  
  18. makeatletter
  19.  
  20. newcommand{LectureCode}[1]{def@LectureCode{#1}}
  21. newcommand{LectureName}[1]{def@LectureName{#1}}
  22. newcommand{ExamType}[1]{def@ExamType{#1}}
  23. newcommand{ExamDate}[1]{def@ExamDate{#1}}
  24. newcommand{ExamStart}[1]{def@ExamStart{#1}}
  25. newcommand{ExamDuration}[1]{def@ExamDuration{#1}}
  26.  
  27. LectureCode{XYZ 550}
  28. LectureName{Advanced Technology}
  29. ExamType{Final}
  30. ExamDate{25/6/2016}
  31. ExamDate{9am}
  32. ExamDuration{90 minutes}
  33.  
  34. makeatother
  35.  
  36.  
  37. textwidth=7in
  38. textheight=9.8in
  39. topmargin=-1in
  40. headheight=0in
  41. headsep=.5in
  42. hoffset=-.85in
  43.  
  44. pagestyle{fancy}
  45. fancyhf{}
  46. renewcommand{headrulewidth}{0pt}
  47. fancyfoot[R] {Page thepage ~ of ~pageref{LastPage}}
  48.  
  49. newcounter{cnt}
  50. newtotcounter{Toplam}
  51.  
  52. newcommandtextlist{}
  53.  
  54. newcommandsettext[2]{%
  55. csdef{text#1}{#2}
  56. }
  57. newcommandaddtext[1]{%
  58. stepcounter{cnt}%
  59. csdef{textthecnt}{#1}
  60. addtocounter{Toplam}{#1}
  61. }
  62. newcommandgettext[1]{%
  63. csuse{text#1}
  64. }
  65.  
  66. newcommand{question}[2]
  67. {noindenttextbf{refstepcounter{cnt}thecnt . Question ( {#1} pts ) :}
  68. csdef{textthecnt}{#1} addtocounter{Toplam}{#1}{#2} vspace{0.4em}
  69. }
  70.  
  71. newcommand{answer}[1]{ vspace{1em}textbf{Answer : } {#1} vspace{1em}}
  72.  
  73. makeatletter
  74. defvhrulefill#1{leavevmodeleadershrule@height#1hfill kernz@}
  75. defVhrulefill#1{leavevmodeleadershrule@height#1 height 0.7ex depth dimexpr0.4pt-0.7exhfillkern0pt}
  76. makeatother
  77.  
  78. begin{document}
  79.  
  80. makeatletter
  81. {bfcentering @LectureCode hfill @LectureNamembox{ - }@ExamType hfill @ExamDate \
  82. hfill Duration : @ExamDuration hfill
  83. }
  84. makeatother
  85.  
  86. setlength{unitlength}{1in}
  87.  
  88. noindentVhrulefill{1pt}
  89.  
  90. vspace{1em}
  91. makeatletter
  92. begin{minipage}{7cm}
  93.  
  94. textbf{Name : }
  95. vspace{1em}
  96.  
  97. textbf{ID : }
  98. vspace{1em}
  99.  
  100. textbf{Sign : }
  101. vspace{1em}
  102. end{minipage}hskip1pc
  103. begin{minipage}{5cm}
  104. begingroup
  105. fontsize{14pt}{16pt}selectfont
  106. begin{tabular}{|c|c@{} *{thecnt}{c|}c|} % the first row is hidden
  107. hline
  108. newcounter{colnum}%
  109. setcounter{colnum}{0}
  110. Question &
  111. whileboolexpr{test{ifnumcomp{value{colnum}}{<}{thecnt}}}%
  112. {& stepcounter{colnum}arabic{colnum}}
  113. & Total \ hline
  114. Point &
  115. setcounter{colnum}{0}
  116. whileboolexpr{test{ifnumcomp{value{colnum}}{<}{thecnt}}}%
  117. {&stepcounter{colnum}gettext{thecolnum}}
  118. & total{Toplam} \ hline
  119. Grade &
  120. setcounter{colnum}{0}
  121. whileboolexpr{test{ifnumcomp{value{colnum}}{<}{thecnt}}}%
  122. {&stepcounter{colnum}} & \ hline
  123. end{tabular}
  124. endgroup
  125. end{minipage}
  126. makeatother
  127.  
  128. noindentVhrulefill{1pt}mbox{ bf Questions }Vhrulefill{1pt}
  129. vspace{1em}
  130.  
  131. question{10}{It has known that It has known that It has known that It has known that It has known that It has known that It has known that It has known that It has known that It has known that It has known that It has known that It has known that It has known that It has known that It has known that It has known that It has known that ...
  132.  
  133. }
  134.  
  135. question{15}{It has known that It has known that It has known that It has known that It has known that It has known that It has known that It has known that It has known that It has known that It has known that It has known that It has known that It has known that It has known that It has known that It has known that It has known that It has known that It has known that ...
  136. }
  137.  
  138. question{15}{Analyze the provided Analyze the provided Analyze the provided Analyze the provided Analyze the provided Analyze the provided Analyze the provided Analyze the provided Analyze the provided Analyze the provided Analyze the provided Analyze the provided Analyze the provided Analyze the provided Analyze the provided Analyze the provided Analyze the provided Analyze the provided Analyze the provided Analyze the provided Analyze the provided Analyze the provided Analyze the provided Analyze the provided Analyze the provided ...
  139. }
  140.  
  141. question{30}{ Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow ...
  142. }
  143.  
  144. question{15}{In order to In order to In order to In order to In order to In order to In order to In order to In order to In order to In order to In order to In order to In order to In order to In order to In order to In order to In order to In order to In order to ...
  145. }
  146.  
  147. question{15}{Finally,...
  148. }
  149.  
  150. noindentVhrulefill{1pt}mbox{ bf End of Questions }Vhrulefill{1pt}
  151.  
  152. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement