2

I am trying to increase the font size of the text in this Latex table to make it easier to read, while also fitting it to the page using \resizebox. How do I proceed?

Here is what I have already tried:

\documentclass[english]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathptmx}
\usepackage{graphicx}
\usepackage{babel}
\usepackage[margin=.65in, includefoot]{geometry}
\usepackage{titlesec}
\usepackage{multirow}



\begin{document}

\begin{table}[ht]
\centering
\resizebox{\textwidth}{!}{\begin{tabular}{cccccccccc}
  \hline
TX DG Customers & March 2019 & March 2018 & \% Change & March 2019 YTD & March 2018 YTD & \% Change & March 2019 Cumulative & March 2018 Cumulative & \% Change\\
\hline
\multicolumn{1}{l}{Number of Applications}              & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\multicolumn{1}{l}{New Applications Capacity, kW}       & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\multicolumn{1}{l}{Installed Capacity, kW}              & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\multicolumn{1}{l}{Number of Meters Installed}          & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\hline
\end{tabular}}


\centering
\resizebox{\textwidth}{!}{\begin{tabular}{cccccccccc}
NM DG Customers & March 2019 & March 2018 & \% Change & March 2019 YTD & March 2018 YTD & \% Change & March 2019 Cumulative & March 2018 Cumulative & \% Change\\
\hline
\multicolumn{1}{l}{Number of Applications}              & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\multicolumn{1}{l}{New Applications Capacity, kW}       & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\multicolumn{1}{l}{Installed Capacity, kW}              & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\multicolumn{1}{l}{Number of Meters Installed}          & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\hline
\end{tabular}}

\centering
\resizebox{\textwidth}{!}{\begin{tabular}{cccccccccc}
TX \& NM DG Customers & March 2019 & March 2018 & \% Change & March 2019 YTD & March 2018 YTD & \% Change & March 2019 Cumulative & March 2018 Cumulative & \% Change\\
\hline
\multicolumn{1}{l}{Total Number of Applications}              & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\multicolumn{1}{l}{total New Applications Capacity, kW}       & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\multicolumn{1}{l}{Total Installed Capacity, kW}              & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\multicolumn{1}{l}{Total Number of Meters Installed}          & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\hline
\end{tabular}}

\end{table}

\end{document}
  • 2
    However you enlarge the font size, when you shrink the table to fit a width, the result will be the same. – egreg Apr 23 at 17:56
  • 1
    never apply \resizebox to tables. It will always produce incompatible font sizes. – David Carlisle Apr 23 at 18:45
1

You have too long headers, but it's easy to shorten them by grouping.

Instead of three separate tables, you should have one, with various sections having a title for which I suggest italics a bit indented to the left.

Since the table is large, it makes sense to use tabular* and let TeX compute the intercolumn widths.

\documentclass[english]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathptmx}
\usepackage{graphicx}
\usepackage{babel}
\usepackage[margin=.65in, includefoot]{geometry}
\usepackage{titlesec}
\usepackage{booktabs}



\begin{document}

\begin{table}[htp]
\centering

\setlength{\tabcolsep}{0pt} % let TeX compute the intercolumn space

\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}\quad}lccccccccc}
\toprule
& \multicolumn{3}{c}{March}
& \multicolumn{3}{c}{March, YTD}
& \multicolumn{3}{c}{March, Cumulative} \\
\cmidrule{2-4}\cmidrule{5-7}\cmidrule{8-10}
& 2019 & 2018 & \% Change & 2019 & 2018 & \% Change & 2019 & 2018 & \% Change \\
\midrule
\multicolumn{1}{l}{\itshape TX DG Customers} \\
Number of Applications              & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
New Applications Capacity, kW       & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
Installed Capacity, kW              & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
Number of Meters Installed          & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\midrule
\multicolumn{1}{l}{\itshape NM DG Customers} \\
Number of Applications              & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
New Applications Capacity, kW       & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
Installed Capacity, kW              & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
Number of Meters Installed          & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\midrule
\multicolumn{1}{l}{\itshape TX \& NM DG Customers} \\
Total Number of Applications        & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
Total New Applications Capacity, kW & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
Total Installed Capacity, kW        & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
Total Number of Meters Installed    & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\bottomrule
\end{tabular*}

\end{table}

\end{document}

enter image description here

1

Never apply \resizebox to tables, as you found it always produces font sizes that are inconsistent with the rest of the docuemnt.

Perhaps something like

enter image description here

\documentclass[english]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathptmx}
\usepackage{graphicx}
\usepackage{babel}
\usepackage[margin=.65in, includefoot]{geometry}
\usepackage{titlesec}
\usepackage{multirow}
\usepackage{booktabs}



\begin{document}

\begin{table}[ht]
\centering
\begin{tabular}{cccccccccc}
  \toprule
 & \multicolumn{3}{c}{March}& \multicolumn{3}{c}{March YTD}&\multicolumn{3}{c}{March Cumulative}\\
 & 2019 & 2018 & \% Change & 2019 & 2018 & \% Change & 2019  & 2018 & \% Change\\
\cmidrule(rl){2-4}\cmidrule(rl){5-7}\cmidrule(rl){8-10}
TX DG Customers\\
\midrule
\multicolumn{1}{l}{Number of Applications}              & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\multicolumn{1}{l}{New Applications Capacity, kW}       & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\multicolumn{1}{l}{Installed Capacity, kW}              & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\multicolumn{1}{l}{Number of Meters Installed}          & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\midrule
NM DG Customers\\
\midrule
\multicolumn{1}{l}{Number of Applications}              & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\multicolumn{1}{l}{New Applications Capacity, kW}       & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\multicolumn{1}{l}{Installed Capacity, kW}              & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\multicolumn{1}{l}{Number of Meters Installed}          & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\midrule
TX \& NM DG Customers \\
\midrule
\multicolumn{1}{l}{Total Number of Applications}              & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\multicolumn{1}{l}{Total New Applications Capacity, kW}       & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\multicolumn{1}{l}{Total Installed Capacity, kW}              & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\multicolumn{1}{l}{Total Number of Meters Installed}          & 6 & 4 & 0 & 2  & 6 & 4 & 0 & 2 & 2 \\
\bottomrule
\end{tabular}

\end{table}

\noindent X\dotfill page width\dotfill X

\end{document}
  • Nice table here! – NVaughan Apr 23 at 19:39
1

I propose this code, which will spare you resizing box. It is based on tabularx, makecell and booktabs and uses the small fontsize:

\documentclass[english]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathptmx}
\usepackage{graphicx}
\usepackage{babel}
\usepackage[margin=.65in, includefoot, showframe]{geometry}
\usepackage{titlesec}
\usepackage{multirow, makecell, tabularx, booktabs}

\begin{document}

\begin{table}[ht]
\centering
\small
\setlength{\tabcolsep}{3pt}
\renewcommand{\cellset}{\renewcommand\arraystretch{0.3}}
\renewcommand{\cellalign}{bc}
\setcellgapes{2pt}\makegapedcells
\begin{tabularx}{\linewidth}{@{}X*{9}{c}@{}}
  \toprule
\centering TX DG Customers & \makecell[b]{\\ March 2019} & \makecell{\\ March 2018} &\makecell{ \%\\ Change} & \makecell{March 2019\\ YTD} & \makecell{March 2018\\ YTD}& \makecell{\%\\ Change} & \makecell{March 2019\\ Cumulative} & \makecell{March 2018\\ Cumulative} & \makecell{\%\\ Change}\\
\midrule
Number of Applications & 6 & 4 & 0 & 2 & 6 & 4 & 0 & 2 & 2 \\
New Applications Capacity, kW & 6 & 4 & 0 & 2 & 6 & 4 & 0 & 2 & 2 \\
Installed Capacity, kW & 6 & 4 & 0 & 2 & 6 & 4 & 0 & 2 & 2 \\
Number of Meters Installed & 6 & 4 & 0 & 2 & 6 & 4 & 0 & 2 & 2 \\
\bottomrule\addlinespace[3ex]
\centering NM DG Customers & \makecell{\\ March 2019} & \makecell{\\ March 2018} &\makecell{ \%\\ Change} & \makecell{March 2019\\ YTD} & \makecell{March 2018\\ YTD}& \makecell{\%\\ Change} & \makecell{March 2019\\ Cumulative} & \makecell{March 2018\\ Cumulative} & \makecell{\%\\ Change}\\
\midrule
Number of Applications & 6 & 4 & 0 & 2 & 6 & 4 & 0 & 2 & 2 \\
New Applications Capacity, kW & 6 & 4 & 0 & 2 & 6 & 4 & 0 & 2 & 2 \\
Installed Capacity, kW & 6 & 4 & 0 & 2 & 6 & 4 & 0 & 2 & 2 \\
Number of Meters Installed & 6 & 4 & 0 & 2 & 6 & 4 & 0 & 2 & 2 \\
\bottomrule\addlinespace[3ex]
\centering TX \& NM DG Customers & \makecell{\\ March 2019} & \makecell{\\ March 2018} &\makecell{ \%\\ Change} & \makecell{March 2019\\ YTD} & \makecell{March 2018\\ YTD}& \makecell{\%\\ Change} & \makecell{March 2019\\ Cumulative} & \makecell{March 2018\\ Cumulative} & \makecell{\%\\ Change}\\
\midrule
Total Number of Applications & 6 & 4 & 0 & 2 & 6 & 4 & 0 & 2 & 2 \\
total New Applications Capacity, kW & 6 & 4 & 0 & 2 & 6 & 4 & 0 & 2 & 2 \\
Total Installed Capacity, kW & 6 & 4 & 0 & 2 & 6 & 4 & 0 & 2 & 2 \\
Total Number of Meters Installed & 6 & 4 & 0 & 2 & 6 & 4 & 0 & 2 & 2 \\
\bottomrule
\end{tabularx}

\end{table}

\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.