Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \documentclass{exam}
- \usepackage[
- a4paper,
- left = 10mm,
- right = 10mm,
- includehead,
- top = 10mm,
- headheight = 60mm,
- headsep = 0pt,
- includefoot,
- foot = 0mm,
- bottom = 25mm
- ]{geometry}
- \usepackage{xparse,xcolor,mdframed}
- \usepackage{blindtext}
- \ExplSyntaxOn
- \keys_define:nn { diaa / answers }
- {
- d .dim_set:N = \l__diaa_answers_distance_dim,
- t .dim_set:N = \l__diaa_answers_thickness_dim,
- c .tl_set:N = \l__diaa_answers_color_tl,
- d .initial:n = 10mm,
- t .initial:n = 0.2pt,
- c .initial:n = gray,
- }
- \NewDocumentCommand{\FillAnswerRules}{O{}}
- {
- \begin{mdframed}[linewidth = 1pt, nobreak = false]
- \group_begin:
- \keys_set:nn { diaa / answers } { #1 }
- \leaders \hbox:n
- {
- \makebox[\textwidth][s]{
- \color{\l__diaa_answers_color_tl}
- \vrule width 0pt height \l__diaa_answers_distance_dim % the distance
- \leaders\hrule height \l__diaa_answers_thickness_dim\hfill
- }
- }\vfill
- \clearpage
- \group_end:
- \end{mdframed}
- }
- \ExplSyntaxOff
- \begin{document}
- \begin{questions}
- \question short question\FillAnswerRules[d=2cm]
- \question \blindtext[3]\FillAnswerRules[t=1pt,c=red]
- \end{questions}
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement