Advertisement
diaaa

Untitled

Feb 19th, 2020
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. \documentclass{exam}
  2. \usepackage[
  3. a4paper,
  4. left = 10mm,
  5. right = 10mm,
  6. includehead,
  7. top = 10mm,
  8. headheight = 60mm,
  9. headsep = 0pt,
  10. includefoot,
  11. foot = 0mm,
  12. bottom = 25mm
  13. ]{geometry}
  14. \usepackage{xparse,xcolor,mdframed}
  15.  
  16. \usepackage{blindtext}
  17.  
  18.  
  19. \ExplSyntaxOn
  20. \keys_define:nn { diaa / answers }
  21. {
  22. d .dim_set:N = \l__diaa_answers_distance_dim,
  23. t .dim_set:N = \l__diaa_answers_thickness_dim,
  24. c .tl_set:N = \l__diaa_answers_color_tl,
  25. d .initial:n = 10mm,
  26. t .initial:n = 0.2pt,
  27. c .initial:n = gray,
  28. }
  29.  
  30. \NewDocumentCommand{\FillAnswerRules}{O{}}
  31. {
  32. \begin{mdframed}[linewidth = 1pt, nobreak = false]
  33. \group_begin:
  34. \keys_set:nn { diaa / answers } { #1 }
  35. \leaders \hbox:n
  36. {
  37. \makebox[\textwidth][s]{
  38. \color{\l__diaa_answers_color_tl}
  39. \vrule width 0pt height \l__diaa_answers_distance_dim % the distance
  40. \leaders\hrule height \l__diaa_answers_thickness_dim\hfill
  41. }
  42. }\vfill
  43. \clearpage
  44. \group_end:
  45. \end{mdframed}
  46. }
  47.  
  48. \ExplSyntaxOff
  49.  
  50. \begin{document}
  51.  
  52. \begin{questions}
  53. \question short question\FillAnswerRules[d=2cm]
  54.  
  55. \question \blindtext[3]\FillAnswerRules[t=1pt,c=red]
  56.  
  57. \end{questions}
  58.  
  59. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement