0

I have a document that is written in 12pt, but I wish to have one of the sections that has all my tables to be in 10pt. I have tried using \fontsize{10}{12}\helvet but it doesn't seem to work for one of the tables.

\documentclass[12pt]{article}
\addtolength{\parskip}{\baselineskip}
\usepackage[margin=1in,includefoot]{geometry}
\usepackage[fleqn]{amsmath}
\usepackage{mathtools}
\usepackage{siunitx}

%Tables preamble
\usepackage[none]{hyphenat}
\usepackage{array}
\usepackage[thinlines]{easytable}
\usepackage{longtable}
\usepackage{array, booktabs, makecell, multirow}

\renewcommand\theadfont{\bfseries\small}
\newcommand\mceight[1]{\multicolumn{8}{l}{#1}}
\newcommand\mctwelve[1]{\multicolumn{12}{c}{#1}}

\usepackage{arydshln}
\setlength\dashlinedash{0.2pt}
\setlength\dashlinegap{1.5pt}
\setlength\arrayrulewidth{0.3pt}
\usepackage{pdflscape}
\usepackage{afterpage}

\widowpenalty500
\clubpenalty500
\clubpenalty=9996
\exhyphenpenalty=50 %for line-breaking at an explicit hyphen
\brokenpenalty=4991
\predisplaypenalty=10000
\postdisplaypenalty=1549
\displaywidowpenalty=1602
\floatingpenalty = 20000

% Header and footer
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\fancyfoot[R]{ \thepage\ }
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{1pt}

\usepackage{booktabs}
\usepackage{dcolumn} 


\begin{document}

\subsection{Appendix of Tables}

\newgeometry{margin=0.5in} 

\begin{table*}[ht] \centering
\fontsize{10}{12}\helvet
\caption{Summary statistics 1}
\begin{tabular}{l*{6}{S[table-format=2.2]}} \toprule
& & & \multicolumn{3}{c}{Quantiles} \\ \cmidrule(lr){4-6}
\textbf{Variable} & \textbf{Mean} & \textbf{Minimum} & \textbf{25th percentile} & \textbf{Median} & \textbf{75th percentile} & \textbf{Maximum} \\ \midrule
\textbf{Panel A: Female labour force} \\ \midrule
\textbf{2004-05} \\ \hdashline
{Hourly wage}  & 17.17 & 0 & 3.75 & 5.48 & 12.5 & 250\ \\ \hdashline
{Age (in years)}& 9.98 & 15 & 22 & 29 & 38 & 60\ \\ \hdashline
{Years of experience} & 10.61 & 0 & 8 & 15 & 25 & 40\ \\ \hdashline
{Years of education} & 7.13 & 0 & 0 & 8 & 12 & 16\ \\ \hdashline
\\ \bottomrule
\end{tabular}
\end{table*}

\begin{longtable}{ l*{7}{S[table-format=2.2]} }
\fontsize{10}{12}\helvet
\caption{Summary statistics 2}
\label{tab:...} \\
\toprule
\multirow[b]{2}{*}{\thead{Dependent\\ Variables}}
    &   \multicolumn{3}{c}{\thead[b]{Share(\%)}}
        & \multicolumn{3}{c}{\thead[b]{Avg hourly wage}}
            & {\multirow[b]{2}{*}{\thead{Avg\\ differential}}}              \\
    \cmidrule(lr){2-4}\cmidrule(lr){5-7}
    & \textbf{Men} & \textbf{Women} & \textbf{Pooled}
    & \textbf{Men} & \textbf{Women} & \textbf{Pooled}                       \\
   \hdashline                                                               \\
\endfirsthead
%%%%
\caption{Summary statistics 2 (cont.)} \\ \toprule                                    
\multirow[b]{2}{*}{\thead{Dependent\\ Variables}}
    &   \multicolumn{3}{c}{\thead[b]{Share(\%)}}
        & \multicolumn{3}{c}{\thead[b]{Avg hourly wage}}
            & {\multirow[b]{2}{*}{\thead{Avg\\ differential}}} \\ 
\cmidrule(lr){2-4} \cmidrule(lr){5-7} 
& \textbf{Men} & \textbf{Women} & \textbf{Pooled} & \textbf{Men} & 
\textbf{Women} & \textbf{Pooled} \\ \midrule \\ \endhead \midrule
\multicolumn{8}{r}{\footnotesize\textit{Continue on the next page}}
\endfoot\endlastfoot
\mceight{\textbf{PANEL A: 2011-2012}} \\ \midrule
\\
\mceight{\textbf{Panel A.1: Sector (Urban or Rural)}} \\ \midrule
Rural  & 51.5 & 54 & 52 & 28.54 & 18.83 & 26.92 & 51.5 \\ \hdashline
Urban  & 48.4 & 46 & 48 & 45.19 & 41.86 & 45    & 7.8 \\ \hdashline
\bottomrule
\end{longtable}
\end{document}
  • See Changing the font size in a table(by lockstep) and use floatrow. – Bobyandbob Sep 6 '17 at 13:36
  • @Bobyandbob I have tried using \usepackage{floatrow} \floatsetup[table]{style=BOXED,captionskip=25pt} \DeclareFloatFont{small}{\small} \floatsetup[table]{font=small} it does align the table, but doesn't help the font size. – Kusha Verma Sep 6 '17 at 13:51
  • 1
    @KushaVerma: The placement of the \fontsize command inside the longtable environment is wrong; that way it's limited in scope (to the cell that it's called in). You need to call \fontsize outside the longtable environment (and additionally use \begingroup...\endgroup to limit the scope). – Werner Sep 6 '17 at 16:49
  • We don't even know how you've defined \helvet... – Mico Sep 6 '17 at 18:24

Your Answer

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

Browse other questions tagged or ask your own question.