Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. documentclass{article}
  2. usepackage{amsmath}
  3. usepackage{totcount}
  4. newcounter{totalpoints}
  5. regtotcounter{totalpoints}
  6.  
  7. newcommand{shcpoint}[1]{%
  8. addtocounter{totalpoints}{#1}%
  9. ifnum#1<2
  10. (emph{#1 point})hphantom{em s}%
  11. else
  12. (emph{#1 points})%
  13. fiquad
  14. }
  15.  
  16. newcommand{totalpoints}{%
  17. parbox{linewidth}{%
  18. leavevmoderaisebox{-0.5ex}{llap{textbullet}}!hrulefill\[-0.825ex]%
  19. nullhfillbfseries Total Points: total{totalpoints}~~rlap{rule{0.4pt}{3ex}}%
  20. }
  21. }
  22. begin{document}
  23. This questionary has a total of total{totalpoints}~points.
  24. begin{enumerate}
  25. item shcpoint{1} Easy question
  26. item shcpoint{2} Some random question
  27. item shcpoint{3} Other question
  28. end{enumerate}
  29. %------------------------------------------------------------------------------------
  30. totalpoints
  31. %------------------------------------------------------------------------------------
  32. end{document}
  33.  
  34. newcommand{totalpoints}{%
  35. parbox{linewidth}{%
  36. leavevmoderaisebox{-0.5ex}{llap{textbullet}}!hrulefill\[-0.825ex]%
  37. nullhfillbfseries Total Points: total{totalpoints}~~rlap{rule{0.4pt}{3ex}}%
  38. }
  39. }
  40.  
  41. newcommand{totalpoints}{%
  42. parbox{linewidth}{%
  43. leavevmoderaisebox{-0.5ex}{llap{textbullet}}!hrulefill\[-0.825ex]%
  44. nullhfillbfseries Total Points: total{totalpoints}~~rlap{rule{0.4pt}{3ex}}%
  45. }%
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement