Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \documentclass{article}
- \usepackage{array}
- \usepackage{booktabs}
- \usepackage{multirow}
- \newcount\delcnt
- \newcount\thistot
- \newcount\tottot
- \extrarowheight3pt
- \makeatletter
- \def\maketab#1{%
- \delcnt\z@
- \global\tottot\z@
- \begin{tabular}{c c p{20em} p{0.1cm} c c}
- \toprule
- & & & & Sum \\ \cmidrule{2-3}\cmidrule{5-5}
- \@maketab#1\relax
- & & \multicolumn{2}{r}{Totalt Antall Poeng \phantom{---}} &\the\tottot & \\
- \bottomrule
- \end{tabular}}
- \def\@maketab#1{%
- \ifx\relax#1%
- \expandafter\@gobble
- \else
- \global\thistot\z@
- \expandafter\@firstofone
- \fi
- {\global\advance\delcnt\@ne
- & \multirow{2}{*}{Del \the\delcnt}&% \
- \@maketb@#1\relax,;%
- & &
- \multirow{2}{*}{\global\advance\tottot\thistot
- \the\thistot}\\\cmidrule{2-3}\cmidrule{5-5}\@maketab}}
- \def\@maketb@#1,#2;{%
- \ifx\relax#1\else
- \global\advance\thistot#2\relax
- \parbox[t]{2em}{\centering
- \strut\ignorespaces#1\par\vskip2pt\hrule\vskip2pt
- \strut\ignorespaces#2}\hfil\penalty\z@\hfilneg
- \expandafter\@maketb@
- \fi}
- \makeatother
- \begin{document}
- \maketab{
- {1a1,1; 1a2,1;1a3,1;1b1,1;1b3,2;1c,2;1d1,2;1d2,2;1d3,0;1e1,2;1e2,2;1e3,2;1f,2;1g1,2;1g2,2;1g3,2;}
- {2a,2;2b,2;2c,2;2d,2;2e,2;2f,2;3a1,2;3a2,2;3b,3;4a,2;4b,2;4c,2;4d,2;5a,1;5b,2;5c,2;6a,2;6b,2;}}
- \end{document}
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement