Estoy intentando reproducir la siguiente tabla en látex:
Para esto, estoy usando el siguiente código:
\documentclass[12pt,oneside, brazil]{article}
\usepackage[utf8]{inputenc}
\usepackage{textcase}
\usepackage{amsmath,amsfonts}
\usepackage[colorlinks, linkcolor=blue, citecolor=purple]{hyperref}
\usepackage{geometry}
\geometry{
a4paper,
left=30mm,
top=30mm,
right=20mm,
bottom=20mm
}
\usepackage{array,multirow,graphicx}
\usepackage{makecell}
\usepackage{graphicx}
\usepackage{xcolor,colortbl}
\usepackage{float}
\begin{document}
\begin{table}[H]
\resizebox{0.99999\textwidth}{!}{\begin{tabular}{|l|l|l|l|l|l|l|l|l|l|l|l|l|l|}
\hline
\multicolumn{2}{|l|}{\multirow{2}{*}{}} & \multicolumn{8}{c|}{PRODUCERS AS CONSUMER} & \multicolumn{4}{l|}{FINAL DEMAND} \\ \cline{3-14}
\multicolumn{2}{|l|}{} & Agric. & Mining & Const. & Manuf. & Trade & Transp. & Services & Outher & \multicolumn{1}{c|}{\makecell{Personal\\ Consumption\\ Expenditures}} & \makecell{Gross Private\\ Domestic\\ Investiment} &\makecell{ Govt.\\ Purchases of\\ Goods $\&$ \\Services} & \makecell{Net Exports \\of Goods $\&$\\ Services}\\ \hline
\multirow{8}{*}{\rotatebox{90}{PRODUCERS}} & Agriculture & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & & & & \\ \cline{2-14}
& Mining & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & & & & \\ \cline{2-14}
& Construction & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & & & & \\ \cline{2-14}
& Manufacturing & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & & & & \\ \cline{2-14}
& Trade & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & & & & \\ \cline{2-14}
& Transportation & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & & & & \\ \cline{2-14}
& Services & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & & & & \\ \cline{2-14}
& Outher Industry & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & & & & \\ \hline
\parbox[t]{2mm}{\multirow{3}{*}{\rotatebox{90}{VALUE ADDED}}} & Employees & \multicolumn{8}{c|}{Employee compensation} & \multicolumn{4}{c|}{\multirow{3}{*}{GROSS DOMESTIC PRODUCT}} \\ \cline{2-10}
& \makecell{Business\\ Owners and\\ Capital }& \multicolumn{8}{c|}{Profit-type income and capital consuption allowances} & \multicolumn{4}{l|}{} \\ \cline{2-10}
& Government & \multicolumn{8}{c|}{Indirect business taxes} & \multicolumn{4}{l|}{} \\ \hline
\end{tabular}}
\end{table}
\end{document}
Pero el resultado final no está ni cerca. Por ejemplo, la fuente se ha vuelto muy pequeña, no pude ajustar el tamaño de la celda cuando giro una palabra, por ejemplo, la palabra VALOR AGREGADO no estaba dentro de la celda y las celdas grises no tienen el contorno, como se muestra en la cifra.
¿Alguien podría ayudarme? Por favor
Respuesta1
Aquí está mi sugerencia de usar una tabla en una página horizontal, \footnotesize
y una más pequeña \tabcolsep
para asegurar que la tabla encaje en la página, cellspace
para tener un poco más de espacio entre el texto y las líneas horizontales y hhline
para las líneas horizontales en el área de color gris:
(En la siguiente captura de pantalla parece que faltan algunas líneas. Esto se debe al visor de PDF. Compile el código y amplíelo más para ver todas las líneas).
\documentclass[12pt,oneside, brazil]{article}
\usepackage[utf8]{inputenc}
\usepackage{textcase}
\usepackage{amsmath,amsfonts}
\usepackage{geometry}
\geometry{
a4paper,
left=30mm,
top=30mm,
right=20mm,
bottom=20mm
}
\usepackage{array,multirow,graphicx}
\usepackage{makecell}
\usepackage{graphicx}
\usepackage{xcolor,colortbl}
\usepackage{float}
\usepackage{array}
\usepackage{pdflscape}
\usepackage{cellspace}
\setlength\cellspacetoplimit{\tabcolsep}
\setlength\cellspacebottomlimit{\cellspacetoplimit}
\usepackage{hhline}
\newcommand{\mycline}{\hhline{|~|-|-|-|-|-|-|-|-|-|-|-|-|-|}}
\usepackage[colorlinks, linkcolor=blue, citecolor=purple]{hyperref}
\begin{document}
\begin{landscape}
\begin{table}[H]
\footnotesize
\centering
\setlength{\tabcolsep}{5pt}
\begin{tabular}{|*{14}{Sl|}}
\hline
\multicolumn{2}{|Sl|}{\multirow{2}{*}{}} & \multicolumn{8}{c|}{PRODUCERS AS CONSUMER} & \multicolumn{4}{Sc|}{FINAL DEMAND} \\ \cline{3-14}
\multicolumn{2}{|l|}{} & Agric. & Mining & Const. & Manuf. & Trade & Transp. & Services & Outher & \multicolumn{1}{c|}{\makecell{Personal\\ Consumption\\ Expenditures}} & \makecell{Gross Private\\ Domestic\\ Investiment} &\makecell{ Govt.\\ Purchases of\\ Goods $\&$ \\Services} & \makecell{Net Exports \\of Goods $\&$\\ Services}\\ \hline
\multirow{13}{*}{\rotatebox{90}{PRODUCERS}} & Agriculture & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & & & & \\ \mycline
& Mining & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & & & & \\ \mycline
& Construction & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & & & & \\ \mycline
& Manufacturing & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & & & & \\ \mycline
& Trade & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & & & & \\ \mycline
& Transportation & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & & & & \\ \mycline
& Services & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & & & & \\ \mycline
& Outher Industry & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & \cellcolor{gray!25} & & & & \\ \hline
\parbox[t]{2mm}{\multirow{3}{*}{\rotatebox{90}{VALUE ADDED}}} & Employees & \multicolumn{8}{c|}{Employee compensation} & \multicolumn{4}{c|}{\multirow{7}{*}{GROSS DOMESTIC PRODUCT}} \\ \cline{2-10}
& \makecell[l]{Business\\ Owners and\\ Capital }& \multicolumn{8}{c|}{Profit-type income and capital consuption allowances} & \multicolumn{4}{l|}{} \\ \cline{2-10}
& Government & \multicolumn{8}{c|}{Indirect business taxes} & \multicolumn{4}{l|}{} \\ \hline
\end{tabular}
\end{table}
\end{landscape}
\end{document}