Skip to main content
deleted 13 characters in body
Source Link
Simon Dispa
  • 42.8k
  • 2
  • 19
  • 42

While it may not be in the accepted ascetic style of technical publications, it will fit very well in a financial or corporate report. Not only alternate color columns, but number grouping and underlining are widely used in those environments as well. Just for fun I added bold.

The S column allows grouping, but then it is necessary to robustifyrobustify the bold and underlined commands. The underline length has to be extended to account for the extra space introduced by the number grouping. 

Even if there is currently no package that takes care of hline colors matching alternate columns, the code can be used as a template and it is easily modified.

While it may not be in the accepted ascetic style of technical publications, it will fit very well in a financial or corporate report. Not only alternate color columns, but grouping and underlining are widely used in those environments as well. Just for fun I added bold.

The S column allows grouping, but then it is necessary to robustify the bold and underlined commands. Even if there is currently no package that takes care of hline colors matching alternate columns, the code can be used as a template and it is easily modified.

While it may not be in the accepted ascetic style of technical publications, it will fit very well in a financial or corporate report. Not only alternate color columns, but number grouping and underlining are widely used in those environments as well. Just for fun I added bold.

The S column allows grouping, but then it is necessary to robustify the bold and underlined commands. The underline length has to be extended to account for the extra space introduced by the number grouping. 

Even if there is currently no package that takes care of hline colors matching alternate columns, the code can be used as a template and it is easily modified.

deleted 13 characters in body
Source Link
Simon Dispa
  • 42.8k
  • 2
  • 19
  • 42

The S column allows grouping, but then it is necessary to robustify the bold and underlined commands. Even if there is currently no package that takes care of hline colors matching alternate columns, the code can be used as a template and can beit is easily modified.

The S column allows grouping, but then it is necessary to robustify the bold and underlined commands. Even if there is currently no package that takes care of hline colors matching alternate columns, the code can be used as a template and can be easily modified.

The S column allows grouping, but then it is necessary to robustify the bold and underlined commands. Even if there is currently no package that takes care of hline colors matching alternate columns, the code can be used as a template and it is easily modified.

deleted 13 characters in body
Source Link
Simon Dispa
  • 42.8k
  • 2
  • 19
  • 42

The S column allows grouping, but then it is necessary to robustifyrobustify the bold and underlined commands. Even Even if there is currently no package that takes care of hline colors matching alternate columns, the code can be used as a template and can be easily modified.

\documentclass[12pt,a4paper]{book} \usepackage[table]{xcolor} \usepackage{latexcolors} \usepackage{colortbl} %%color definitions for alternate colors \colorlet{rbacki}{white} %background column type 1 white original style \colorlet{rbackii}{gainsboro} %background column type 2 gray original style %\colorlet{rbacki}{whitesmoke} %background column type 1 whitesmoke new style %\colorlet{rbackii}{palecornflowerblue} %background column type 2 palecornflowerblue new style %%%%%%%% only first and second row \colorlet{rbackiii}{copperrose} %background second row \colorlet{rbackiv}{mediumturquoise} %background first row \colorlet{vrulei}{rbacki} %vertical rule = background column type 1   % alternating colors in columns and rules \colorlet{crulei}{rbackiv} %gray column type 2 \colorlet{hrulei}{rbacki} %border gray row type 2 \colorlet{hruleii}{rbackiv} %border white row type 1 \colorlet{cruleii}{rbacki} % column type 1 \usepackage{siunitx} % grouping, align, etc \usepackage{hhline} % \hhline \usepackage{array}   %https://alexwlchan.net/2017/10/latex-underlines/ \usepackage[normalem]{ulem} \renewcommand{\ULdepth}{2.7pt} %%https://tex.stackexchange.com/questions/469559/bold-entries-in-table-with-s-column-type \usepackage{etoolbox} % provides robustify \robustify\bfseries % make it robust %https://tex.stackexchange.com/questions/161032/problem-with-uline-and-table-format-in-siunitx-table \robustify\uline % make it robust \def\Uline#1{#1\llap{\uline{\phantom{#1i}}}} % +i for added space of grouping \robustify\uuline% make it robust \def\UUline#1{#1\llap{\uuline{\phantom{#1i}}}} % +i for added space of grouping \renewcommand{\familydefault}{\sfdefault} \begin{document} \setlength\arrayrulewidth{1pt} % horizontal and also vertical lines % to simplify the table code \newcommand{\rci}{{\cellcolor{rbacki}}} \newcommand{\rcii}{{\cellcolor{rbackii}}} \newcommand{\rciii}{{\cellcolor{rbackiii}}} \newcommand{\rciv}{{\cellcolor{rbackiv}}} \newcommand{\tci}{\textcolor{rbacki}} \newcommand{\vrluei\vrulei}{\color{vrulei}\vrule width \arrayrulewidth} \newcommand{\althhline}{% \hhline{% >{\arrayrulecolor{rbackii}}- >{\arrayrulecolor{rbacki}}- >{\arrayrulecolor{rbackii}}- >{\arrayrulecolor{rbacki}}- >{\arrayrulecolor{rbackii}}- } } \newcolumntype{?}{!{\vrluei\vrulei}} \renewcommand{\arraystretch}{1.3} \setlength\belowcaptionskip{8pt} \begin{table}[htbp] \sisetup{% group-minimum-digits = 4, table-format=6.0, detect-weight=true } \centering \caption{With features matching the desired result.} \begin{tabular}{% >{\rci}p{170pt}? >{\rcii}c >{\rci}S >{\rcii}S >{\rci}S } \rciv &\multicolumn{1}{r}{\tci{NOTES}\rciv} & \multicolumn{2}{?c?}{\tci{20X4}\rciv} & \multicolumn{1}{r}{\tci{20X3}\rciv} \\ \rciii & \rciii & \multicolumn{1}{?r?}{\tci{\$000}\rciii} & \multicolumn{1}{r?}{\tci{\$000}\rciii} & \multicolumn{1}{r}{\tci{\$000}\rciii} \\ \textit{Non-current liabilities} & & & & \\ \althhline \textbf{Total liabilities} & & & 8200 & 5500 \\ \althhline Net assets & & & \UUline{96300}& \UUline{\bfseries 74500} \\ \althhline \textbf{Capital and reserves} & & & & \\ \althhline Share capital & 8 & \bfseries 70000 & & 64000 \\ \althhline Retained profits & 9 & 5300 & & 4500 \\ \althhline Reserves & 10&\Uline{21000} & & \Uline{6000} \\ \althhline \textbf{Total capital and reserves} & & & \UUline{96300}& \UUline{\bfseries 74500} \\ \end{tabular}% \label{tab:addlabel}% \end{table}% \end{document} 

enter image description hereClose to the example

The S column allows grouping, but then it is necessary to robustify the bold and underlined commands. Even if there is currently no package that takes care of hline colors matching alternate columns, the code can be used as a template and can be easily modified.

\documentclass[12pt,a4paper]{book} \usepackage[table]{xcolor} \usepackage{latexcolors} \usepackage{colortbl} %%color definitions for alternate colors \colorlet{rbacki}{white} %background column type 1 white original style \colorlet{rbackii}{gainsboro} %background column type 2 gray original style %\colorlet{rbacki}{whitesmoke} %background column type 1 whitesmoke new style %\colorlet{rbackii}{palecornflowerblue} %background column type 2 palecornflowerblue new style %%%%%%%% only first and second row \colorlet{rbackiii}{copperrose} %background second row \colorlet{rbackiv}{mediumturquoise} %background first row \colorlet{vrulei}{rbacki} %vertical rule = background column type 1   % alternating colors in columns and rules \colorlet{crulei}{rbackiv} %gray column type 2 \colorlet{hrulei}{rbacki} %border gray row type 2 \colorlet{hruleii}{rbackiv} %border white row type 1 \colorlet{cruleii}{rbacki} % column type 1 \usepackage{siunitx} % grouping, align, etc \usepackage{hhline} % \hhline \usepackage{array}   %https://alexwlchan.net/2017/10/latex-underlines/ \usepackage[normalem]{ulem} \renewcommand{\ULdepth}{2.7pt} %%https://tex.stackexchange.com/questions/469559/bold-entries-in-table-with-s-column-type \usepackage{etoolbox} % provides robustify \robustify\bfseries % make it robust %https://tex.stackexchange.com/questions/161032/problem-with-uline-and-table-format-in-siunitx-table \robustify\uline % make it robust \def\Uline#1{#1\llap{\uline{\phantom{#1i}}}} % +i for added space of grouping \robustify\uuline% make it robust \def\UUline#1{#1\llap{\uuline{\phantom{#1i}}}} % +i for added space of grouping \renewcommand{\familydefault}{\sfdefault} \begin{document} \setlength\arrayrulewidth{1pt} % horizontal and also vertical lines % to simplify the table code \newcommand{\rci}{{\cellcolor{rbacki}}} \newcommand{\rcii}{{\cellcolor{rbackii}}} \newcommand{\rciii}{{\cellcolor{rbackiii}}} \newcommand{\rciv}{{\cellcolor{rbackiv}}} \newcommand{\tci}{\textcolor{rbacki}} \newcommand{\vrluei}{\color{vrulei}\vrule width \arrayrulewidth} \newcommand{\althhline}{% \hhline{% >{\arrayrulecolor{rbackii}}- >{\arrayrulecolor{rbacki}}- >{\arrayrulecolor{rbackii}}- >{\arrayrulecolor{rbacki}}- >{\arrayrulecolor{rbackii}}- } } \newcolumntype{?}{!{\vrluei}} \renewcommand{\arraystretch}{1.3} \setlength\belowcaptionskip{8pt} \begin{table}[htbp] \sisetup{% group-minimum-digits = 4, table-format=6.0, detect-weight=true } \centering \caption{With features matching the desired result.} \begin{tabular}{% >{\rci}p{170pt}? >{\rcii}c >{\rci}S >{\rcii}S >{\rci}S } \rciv &\multicolumn{1}{r}{\tci{NOTES}\rciv} & \multicolumn{2}{?c?}{\tci{20X4}\rciv} & \multicolumn{1}{r}{\tci{20X3}\rciv} \\ \rciii & \rciii & \multicolumn{1}{?r?}{\tci{\$000}\rciii} & \multicolumn{1}{r?}{\tci{\$000}\rciii} & \multicolumn{1}{r}{\tci{\$000}\rciii} \\ \textit{Non-current liabilities} & & & & \\ \althhline \textbf{Total liabilities} & & & 8200 & 5500 \\ \althhline Net assets & & & \UUline{96300}& \UUline{\bfseries 74500} \\ \althhline \textbf{Capital and reserves} & & & & \\ \althhline Share capital & 8 & \bfseries 70000 & & 64000 \\ \althhline Retained profits & 9 & 5300 & & 4500 \\ \althhline Reserves & 10&\Uline{21000} & & \Uline{6000} \\ \althhline \textbf{Total capital and reserves} & & & \UUline{96300}& \UUline{\bfseries 74500} \\ \end{tabular}% \label{tab:addlabel}% \end{table}% \end{document} 

enter image description here

The S column allows grouping, but then it is necessary to robustify the bold and underlined commands. Even if there is currently no package that takes care of hline colors matching alternate columns, the code can be used as a template and can be easily modified.

\documentclass[12pt,a4paper]{book} \usepackage[table]{xcolor} \usepackage{latexcolors} \usepackage{colortbl} %%color definitions for alternate colors \colorlet{rbacki}{white} %background column type 1 white original style \colorlet{rbackii}{gainsboro} %background column type 2 gray original style %\colorlet{rbacki}{whitesmoke} %background column type 1 whitesmoke new style %\colorlet{rbackii}{palecornflowerblue} %background column type 2 palecornflowerblue new style %%%%%%%% only first and second row \colorlet{rbackiii}{copperrose} %background second row \colorlet{rbackiv}{mediumturquoise} %background first row \colorlet{vrulei}{rbacki} %vertical rule = background column type 1 \usepackage{siunitx} % grouping, align, etc \usepackage{hhline} % \hhline \usepackage{array} %https://alexwlchan.net/2017/10/latex-underlines/ \usepackage[normalem]{ulem} \renewcommand{\ULdepth}{2.7pt} %%https://tex.stackexchange.com/questions/469559/bold-entries-in-table-with-s-column-type \usepackage{etoolbox} % provides robustify \robustify\bfseries % make it robust %https://tex.stackexchange.com/questions/161032/problem-with-uline-and-table-format-in-siunitx-table \robustify\uline % make it robust \def\Uline#1{#1\llap{\uline{\phantom{#1i}}}} % +i for added space of grouping \robustify\uuline% make it robust \def\UUline#1{#1\llap{\uuline{\phantom{#1i}}}} % +i for added space of grouping \renewcommand{\familydefault}{\sfdefault} \begin{document} \setlength\arrayrulewidth{1pt} % horizontal and also vertical lines % to simplify the table code \newcommand{\rci}{{\cellcolor{rbacki}}} \newcommand{\rcii}{{\cellcolor{rbackii}}} \newcommand{\rciii}{{\cellcolor{rbackiii}}} \newcommand{\rciv}{{\cellcolor{rbackiv}}} \newcommand{\tci}{\textcolor{rbacki}} \newcommand{\vrulei}{\color{vrulei}\vrule width \arrayrulewidth} \newcommand{\althhline}{% \hhline{% >{\arrayrulecolor{rbackii}}- >{\arrayrulecolor{rbacki}}- >{\arrayrulecolor{rbackii}}- >{\arrayrulecolor{rbacki}}- >{\arrayrulecolor{rbackii}}- } } \newcolumntype{?}{!{\vrulei}} \renewcommand{\arraystretch}{1.3} \setlength\belowcaptionskip{8pt} \begin{table}[htbp] \sisetup{% group-minimum-digits = 4, table-format=6.0, detect-weight=true } \centering \caption{With features matching the desired result.} \begin{tabular}{% >{\rci}p{170pt}? >{\rcii}c >{\rci}S >{\rcii}S >{\rci}S } \rciv &\multicolumn{1}{r}{\tci{NOTES}\rciv} & \multicolumn{2}{?c?}{\tci{20X4}\rciv} & \multicolumn{1}{r}{\tci{20X3}\rciv} \\ \rciii & \rciii & \multicolumn{1}{?r?}{\tci{\$000}\rciii} & \multicolumn{1}{r?}{\tci{\$000}\rciii} & \multicolumn{1}{r}{\tci{\$000}\rciii} \\ \textit{Non-current liabilities} & & & & \\ \althhline \textbf{Total liabilities} & & & 8200 & 5500 \\ \althhline Net assets & & & \UUline{96300}& \UUline{\bfseries 74500} \\ \althhline \textbf{Capital and reserves} & & & & \\ \althhline Share capital & 8 & \bfseries 70000 & & 64000 \\ \althhline Retained profits & 9 & 5300 & & 4500 \\ \althhline Reserves & 10&\Uline{21000} & & \Uline{6000} \\ \althhline \textbf{Total capital and reserves} & & & \UUline{96300}& \UUline{\bfseries 74500} \\ \end{tabular}% \label{tab:addlabel}% \end{table}% \end{document} 

Close to the example

Source Link
Simon Dispa
  • 42.8k
  • 2
  • 19
  • 42
Loading