Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. newcommand{reqV}[7]
  2. {
  3. multirow{5}{*}{#1} & subReq{#1.1}{#3} & multirow{5}{*}{#2} \
  4. cline{2-3}
  5. & subReq{#1.2}{#4} & \
  6. cline{2-3}
  7. & subReq{#1.3}{#5} & \
  8. cline{2-3}
  9. & subReq{#1.4}{#6} & \
  10. cline{2-3}
  11. & subReq{#1.5}{#7} & \
  12. }
  13.  
  14. documentclass{article}
  15.  
  16. usepackage{tabularx}
  17. renewcommand{tabularxcolumn}[1]{ m{#1} }
  18. newcolumntype{M}[1]{ >{centeringarraybackslash} m{#1} }
  19.  
  20. newcounter{req}
  21. newcommand{req}[3]{%
  22. setcounter{req}{1}%
  23. parnoindent
  24. begin{tabularx}{linewidth}{ | M{5em} X M{7em} | }
  25. hline
  26. #1 &
  27. {letoldbackslash\
  28. renewcommand{tabularxcolumn}[1]{ p{##1} }%
  29. begin{tabularx}{linewidth}{ | @{hspace{tabcolsep}#1.thereqhspace{tabcolsep}} | X | }
  30. globaldef\{stepcounter{req}oldbackslash hline}
  31. #2
  32. end{tabularx}%
  33. globallet\oldbackslash} &
  34. #3 \
  35. hline
  36. end{tabularx}
  37. par
  38. }
  39.  
  40. begin{document}
  41.  
  42. req{IR5}{A \ B \ C \ D}{Mandatory}
  43.  
  44. req{IR6}{%
  45. Lorem ipsum dolor sit amet, consectetur adipiscing elit. \
  46. Pellentesque eget nisi non tortor tincidunt porttitor. \
  47. Aliquam eget sem arcu. \
  48. Suspendisse potenti. \
  49. Nullam pellentesque sapien vel leo consequat facilisis. \
  50. Aliquam pretium convallis arcu, ut volutpat massa pellentesque quis. \
  51. Praesent dignissim facilisis risus ac dignissim. \
  52. Interdum et malesuada fames ac ante ipsum primis in faucibus.}{Optional}
  53.  
  54. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement