Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass{article}
- usepackage[T1]{fontenc}
- usepackage{amsmath}
- usepackage[skip=10pt]{parskip}
- usepackage[table]{xcolor}
- usepackage{rotating}
- usepackage{array}
- usepackage{booktabs}
- usepackage{makecell}
- usepackage[column=Q]{cellspace} % changed to Q for simultaneous use of siunitx
- newcommand{tableComment}[2]{
- begin{tabular}{m{4.5cm}}
- #1\[5pt]#2
- end{tabular}}
- renewcommand{theadfont}{itshape}
- renewcommand{theadgape}{}
- renewcommand{theadalign}{cc}
- setcellgapes{1pt}
- renewcommand{cellrotangle}{90}
- newcommand{TopRule}{Xhline{1pt}}
- newcommand{MidRule}{Xhline{.5pt}}
- newcommand{BottomRule}{Xhline{1pt}}
- begin{document}
- tableComment{1: Standard Lines, Head with texttt{makecell}, no additional spacing}
- {
- rowcolors{1}{gray!20}{white}
- begin{tabular}{ll}hline
- rowcolor{gray!40}
- My Head & makecell{My second\ Head} \ hline
- some content & $dfrac{1}{2}$ \
- foo & bar \ hline
- end{tabular}
- }
- tableComment{2: Standard Lines, Head with texttt{makecell}, spacing with texttt{cellspace}}
- {
- rowcolors{1}{gray!20}{white}
- begin{tabular}{QlQl}hline
- rowcolor{gray!40}
- My Head & makecell{My second\ Head} \ hline
- some content & $dfrac{1}{2}$ \
- foo & bar \ hline
- end{tabular}
- }
- tableComment{3: Lines with texttt{Xhline}, Head with texttt{makecell}, spacing with texttt{cellspace}}
- {
- rowcolors{1}{gray!20}{white}
- begin{tabular}{QlQl}TopRule
- rowcolor{gray!40}
- My Head & makecell{My second\ Head} \ MidRule
- some content & $dfrac{1}{2}$ \
- foo & bar \ BottomRule
- end{tabular}
- }\
- tableComment{4: Lines with texttt{Xhline}, Head with texttt{thead}, spacing with texttt{makegapedcells}}
- {
- rowcolors{1}{gray!20}{white}
- makegapedcells
- begin{tabular}{ll}TopRule
- rowcolor{gray!40}
- thead{My Head} & thead{My second\ Head} \ MidRule
- some content & $dfrac{1}{2}$ \
- foo & bar \ BottomRule
- end{tabular}
- }
- tableComment{5: Lines with texttt{booktabs}, Head with texttt{makecell}, spacing with texttt{booktabs}}
- {
- rowcolors{1}{gray!20}{white}
- begin{tabular}{ll}toprule
- rowcolor{gray!40}
- My Head & makecell{My second\ Head} \ midrule
- some content & $dfrac{1}{2}$ \
- foo & bar \ bottomrule
- end{tabular}
- }
- tableComment{6: Lines with texttt{Xhline}, Head with texttt{thead}, spacing with texttt{cellspace}}
- {
- rowcolors{1}{gray!20}{white}
- begin{tabular}{QlQl}TopRule
- rowcolor{gray!40}
- thead{My Head} & thead{My second\ Head} \ MidRule
- some content & $dfrac{1}{2}$ \
- foo & bar \ BottomRule
- end{tabular}
- }
- settowidthrotheadsize{theadfont second}
- tableComment{7: Lines with texttt{Xhline}, Head with texttt{rothead}, spacing with texttt{callspace} }
- {
- rowcolors{1}{gray!20}{white}
- begin{tabular}{QlQl}TopRule
- rowcolor{gray!40}
- rothead{My\Head} & rothead{My\second\ Head} \ MidRule
- some content & $dfrac{1}{2}$ \
- foo & bar \ BottomRule
- end{tabular}
- }
- tableComment{8: Lines with texttt{booktabs}, Head with texttt{rothead}, spacing with texttt{booktabs}}
- {
- rowcolors{1}{gray!20}{white}
- begin{tabular}{ll}toprule
- rowcolor{gray!40}
- rothead{My\Head} & rothead{My\second\ Head} \midrule
- some content & $dfrac{1}{2}$ \
- foo & bar \ bottomrule
- end{tabular}
- }
- tableComment{9: Lines with texttt{Xhline}, Head with texttt{rothead}, spacing with texttt{makegapedcells}}
- {
- rowcolors{1}{gray!20}{white}
- makegapedcells
- begin{tabular}{ll}TopRule
- rowcolor{gray!40}
- rothead{My\Head} & rothead{My\second\ Head} \ MidRule
- some content & $dfrac{1}{2}$ \
- foo & bar \ BottomRule
- end{tabular}
- }
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement