Table with different column numbers - full width
up vote
3
down vote
favorite
I'm trying to generate a table in beamer like the one in the picture below
The problem is that In the last part of the table, there are lesser columns.
I tried to overcome this issue with a combination of multicolumn and tabular.
However, so far I only managed to get misaligned columns standing at the center of the table.
Is there a way to get the last columns to fill the whole table width, like the ones in the picture?
Thank you very much for your support.
Best regards
%%%%%% Preamble %%%%%%
documentclass[xcolor={dvipsnames}]{beamer}
usepackage{bm}
usepackage{amsmath}
usepackage{enumerate}
usepackage[english]{babel}
usepackage[latin1]{inputenc}
usepackage{times}
usepackage{tikz}
usetikzlibrary{fit,shapes.geometric}
usetikzlibrary{arrows}
usetikzlibrary{tikzmark,calc}
tikzstyle{block}=[draw opacity=0.7,line width=1.4cm]
newcounter{nodemarkers}
usepackage[T1]{fontenc}
usepackage{multirow}
usepackage{mathtools}
usepackage{array}
usepackage{graphicx}
usepackage{hyperref}
usepackage{booktabs}
usepackage[justification=centering]{caption}
usetheme{}
setbeamertemplate{caption}[numbered]
captionsetup[table]{font=scriptsize}
usefonttheme[onlylarge]{structurebold}
setbeamerfont*{frametitle}{size=normalsize,series=bfseries}
setbeamercolor{bibliography item}{fg=black}
setbeamercolor{frame number}{fg=black}
%%%%%% Beamer %%%%
begin{document}
begin{frame}{Results}
begin{table}
caption{ Estimation results of $RI-RF=alpha + beta(RM-RF)+epsilon_i$.}
centering
scalebox{0.52}[0.62]{
begin{tabular}{lrrrrrrrrrr}
addlinespace
toprule
midrule
multirow{2}{1pt}{Size quintile} & multicolumn{10}{c}{Book-to-market equity (BE/ME) quintiles}\
cmidrule(lr){2-11}
& Low & 2 & 3 & 4 & 5 & Low & 2 & 3 & 4 & 5 \
cmidrule(lr){1-11}
& multicolumn{5}{c}{boldsymbol{$beta$}} & multicolumn{5}{c}{ textbf{t(boldmath$beta$)}} \
cmidrule(lr){2-6} cmidrule(lr){7-11}
Small & 20.6 & 20.8 & 20.2 & 19.4 & 15.1 & 0.30 & 0.62 & 0.84 & 1.09 & 1.80 \
2 & 89.7 & 89.3 & 89.3 & 89.9 & 88.5 & 0.31 & 0.60 & 0.83 & 1.09 & 1.71 \
3 & 209.3 & 211.9 & 210.8 & 214.8 & 210.7 & 0.31 & 0.60 & 0.84 & 1.08 & 1.66 \
4 & 535.1 & 537.4 & 545.4 & 551.6 & 538.7 & 0.31 & 0.61 & 0.84 & 1.09 & 1.67 \
Big & 3583.7 & 2885.8 & 2819.5 & 2700.5 & 2337.9 & 0.29 & 0.59 & 0.83 & 1.08 & 1.56 \
cmidrule(lr){2-11}
& multicolumn{5}{c}{textbf{$R^2$}} & multicolumn{5}{c}{textbf{s(boldsymbol{$epsilon$})}} \
cmidrule(lr){2-6} cmidrule(lr){7-11}
Small & 0.69 & 0.49 & 0.46 & 0.48 & 0.64 & 428.0 & 276.6 & 263.8 & 291.5 & 512.7 \
2 & 0.92 & 0.71 & 0.65 & 0.61 & 0.55 & 121.6 & 94.0 & 86.7 & 79.8 & 71.3 \
3 & 1.78 & 1.36 & 1.26 & 1.14 & 0.82 & 102.7 & 78.3 & 73.0 & 64.5 & 45.9 \
4 & 3.95 & 3.01 & 2.71 & 2.41 & 1.50 & 90.1 & 68.9 & 60.7 & 53.1 & 33.4 \
Big & 30.13 & 15.87 & 12.85 & 10.44 & 4.61 & 93.6 & 63.7 & 52.7 & 44.0 & 23.6 \
cmidrule(lr){1-11}
& multicolumn{10}{c}{Excess returns on government and corporate bonds} \
& multicolumn{10}{c}{begin{tabular}{rrrrrrr} 1-5G & 6-10G & AAA & AA & A & BAA & LG end{tabular}} \
cmidrule(lr){1-11}\
boldmath $beta$ & multicolumn{10}{c}{begin{tabular}{rrrrrrr} 0.08 & 0.13 & 0.19 & 0.20 & 0.21 & 0.22 & 0.30 end{tabular}} \
textbf{t(boldmath $beta$)} & multicolumn{10}{c}{begin{tabular}{rrrrrrr} 0.08 & 0.13 & 0.19 & 0.20 & 0.21 & 0.22 & 0.30 end{tabular}} \
boldmath$R^2$ & multicolumn{10}{c}{begin{tabular}{rrrrrrr} 0.07 & 0.08 & 0.14 & 0.16 & 0.17 & 0.18 & 0.29 end{tabular}} \
textbf{s(boldsymbol{$epsilon$})} & multicolumn{10}{c}{begin{tabular}{rrrrrrr} 1.21 & 1.95 & 2.17 & 2.05 & 2.05 & 2.12 & 2.12 end{tabular}} \
midrule
bottomrule
end{tabular}%
}
end{table}%
end{frame}
end{document}
Following comments I tried this:
%%%%%% Preamble %%%%%%
documentclass[xcolor={dvipsnames}]{beamer}
usepackage{bm}
usepackage{amsmath}
usepackage{enumerate}
usepackage[english]{babel}
usepackage[latin1]{inputenc}
usepackage{times}
usepackage{tikz}
usetikzlibrary{fit,shapes.geometric}
usetikzlibrary{arrows}
usetikzlibrary{tikzmark,calc}
tikzstyle{block}=[draw opacity=0.7,line width=1.4cm]
newcounter{nodemarkers}
usepackage[T1]{fontenc}
usepackage{multirow}
usepackage{mathtools}
usepackage{array}
usepackage{graphicx}
usepackage{hyperref}
usepackage{booktabs}
usepackage[justification=centering]{caption}
usetheme{}
setbeamertemplate{caption}[numbered]
captionsetup[table]{font=scriptsize}
usefonttheme[onlylarge]{structurebold}
setbeamerfont*{frametitle}{size=normalsize,series=bfseries}
setbeamercolor{bibliography item}{fg=black}
setbeamercolor{frame number}{fg=black}
%%%%%% Beamer %%%%
begin{document}
begin{frame}{Results}
begin{table}[!h]
tiny
begin{center}
caption{ Estimation results of $RI-RF=alpha + beta(RM-RF)+epsilon_i$.}
begin{tabular}{lrrrrrrrrrr}
toprule
midrule
multirow{2}{1pt}{Size quintile} & multicolumn{10}{c}{Book-to-market equity (BE/ME) quintiles}\
cmidrule(lr){2-11}
& Low & 2 & 3 & 4 & 5 & Low & 2 & 3 & 4 & 5 \
cmidrule(lr){1-11}
& multicolumn{5}{c}{boldsymbol{$beta$}} & multicolumn{5}{c}{ textbf{t(boldmath$beta$)}} \
cmidrule(lr){2-6} cmidrule(lr){7-11}
Small & 20.6 & 20.8 & 20.2 & 19.4 & 15.1 & 0.30 & 0.62 & 0.84 & 1.09 & 1.80 \
2 & 89.7 & 89.3 & 89.3 & 89.9 & 88.5 & 0.31 & 0.60 & 0.83 & 1.09 & 1.71 \
3 & 209.3 & 211.9 & 210.8 & 214.8 & 210.7 & 0.31 & 0.60 & 0.84 & 1.08 & 1.66 \
4 & 535.1 & 537.4 & 545.4 & 551.6 & 538.7 & 0.31 & 0.61 & 0.84 & 1.09 & 1.67 \
Big & 3583.7 & 2885.8 & 2819.5 & 2700.5 & 2337.9 & 0.29 & 0.59 & 0.83 & 1.08 & 1.56 \
cmidrule(lr){2-11}
& multicolumn{5}{c}{textbf{$R^2$}} & multicolumn{5}{c}{textbf{s(boldsymbol{$epsilon$})}} \
cmidrule(lr){2-6} cmidrule(lr){7-11}
Small & 0.69 & 0.49 & 0.46 & 0.48 & 0.64 & 428.0 & 276.6 & 263.8 & 291.5 & 512.7 \
2 & 0.92 & 0.71 & 0.65 & 0.61 & 0.55 & 121.6 & 94.0 & 86.7 & 79.8 & 71.3 \
3 & 1.78 & 1.36 & 1.26 & 1.14 & 0.82 & 102.7 & 78.3 & 73.0 & 64.5 & 45.9 \
4 & 3.95 & 3.01 & 2.71 & 2.41 & 1.50 & 90.1 & 68.9 & 60.7 & 53.1 & 33.4 \
Big & 30.13 & 15.87 & 12.85 & 10.44 & 4.61 & 93.6 & 63.7 & 52.7 & 44.0 & 23.6 \
cmidrule(lr){1-11}
&
end{tabular}
begin{tabular}{rrrrrrr}
multicolumn{7}{c}{Excess returns on government and corporate bonds} \
1-5G & 6-10G & AAA & AA & A & BAA & LG\
0.10 & 0.13 & 0.18 & 0.23 & 0.25 & 0.28 & 0.36\
midrule
bottomrule
end{tabular}
end{center}
end{table}%
end{frame}
end{document}
But this is far from the table in the picture.
The second tabular doesn't have the same width as the first one and also the two tabulars seem to be apart from each other, despite belonging to the same table.
This is the result:
tables beamer multicolumn
add a comment |
up vote
3
down vote
favorite
I'm trying to generate a table in beamer like the one in the picture below
The problem is that In the last part of the table, there are lesser columns.
I tried to overcome this issue with a combination of multicolumn and tabular.
However, so far I only managed to get misaligned columns standing at the center of the table.
Is there a way to get the last columns to fill the whole table width, like the ones in the picture?
Thank you very much for your support.
Best regards
%%%%%% Preamble %%%%%%
documentclass[xcolor={dvipsnames}]{beamer}
usepackage{bm}
usepackage{amsmath}
usepackage{enumerate}
usepackage[english]{babel}
usepackage[latin1]{inputenc}
usepackage{times}
usepackage{tikz}
usetikzlibrary{fit,shapes.geometric}
usetikzlibrary{arrows}
usetikzlibrary{tikzmark,calc}
tikzstyle{block}=[draw opacity=0.7,line width=1.4cm]
newcounter{nodemarkers}
usepackage[T1]{fontenc}
usepackage{multirow}
usepackage{mathtools}
usepackage{array}
usepackage{graphicx}
usepackage{hyperref}
usepackage{booktabs}
usepackage[justification=centering]{caption}
usetheme{}
setbeamertemplate{caption}[numbered]
captionsetup[table]{font=scriptsize}
usefonttheme[onlylarge]{structurebold}
setbeamerfont*{frametitle}{size=normalsize,series=bfseries}
setbeamercolor{bibliography item}{fg=black}
setbeamercolor{frame number}{fg=black}
%%%%%% Beamer %%%%
begin{document}
begin{frame}{Results}
begin{table}
caption{ Estimation results of $RI-RF=alpha + beta(RM-RF)+epsilon_i$.}
centering
scalebox{0.52}[0.62]{
begin{tabular}{lrrrrrrrrrr}
addlinespace
toprule
midrule
multirow{2}{1pt}{Size quintile} & multicolumn{10}{c}{Book-to-market equity (BE/ME) quintiles}\
cmidrule(lr){2-11}
& Low & 2 & 3 & 4 & 5 & Low & 2 & 3 & 4 & 5 \
cmidrule(lr){1-11}
& multicolumn{5}{c}{boldsymbol{$beta$}} & multicolumn{5}{c}{ textbf{t(boldmath$beta$)}} \
cmidrule(lr){2-6} cmidrule(lr){7-11}
Small & 20.6 & 20.8 & 20.2 & 19.4 & 15.1 & 0.30 & 0.62 & 0.84 & 1.09 & 1.80 \
2 & 89.7 & 89.3 & 89.3 & 89.9 & 88.5 & 0.31 & 0.60 & 0.83 & 1.09 & 1.71 \
3 & 209.3 & 211.9 & 210.8 & 214.8 & 210.7 & 0.31 & 0.60 & 0.84 & 1.08 & 1.66 \
4 & 535.1 & 537.4 & 545.4 & 551.6 & 538.7 & 0.31 & 0.61 & 0.84 & 1.09 & 1.67 \
Big & 3583.7 & 2885.8 & 2819.5 & 2700.5 & 2337.9 & 0.29 & 0.59 & 0.83 & 1.08 & 1.56 \
cmidrule(lr){2-11}
& multicolumn{5}{c}{textbf{$R^2$}} & multicolumn{5}{c}{textbf{s(boldsymbol{$epsilon$})}} \
cmidrule(lr){2-6} cmidrule(lr){7-11}
Small & 0.69 & 0.49 & 0.46 & 0.48 & 0.64 & 428.0 & 276.6 & 263.8 & 291.5 & 512.7 \
2 & 0.92 & 0.71 & 0.65 & 0.61 & 0.55 & 121.6 & 94.0 & 86.7 & 79.8 & 71.3 \
3 & 1.78 & 1.36 & 1.26 & 1.14 & 0.82 & 102.7 & 78.3 & 73.0 & 64.5 & 45.9 \
4 & 3.95 & 3.01 & 2.71 & 2.41 & 1.50 & 90.1 & 68.9 & 60.7 & 53.1 & 33.4 \
Big & 30.13 & 15.87 & 12.85 & 10.44 & 4.61 & 93.6 & 63.7 & 52.7 & 44.0 & 23.6 \
cmidrule(lr){1-11}
& multicolumn{10}{c}{Excess returns on government and corporate bonds} \
& multicolumn{10}{c}{begin{tabular}{rrrrrrr} 1-5G & 6-10G & AAA & AA & A & BAA & LG end{tabular}} \
cmidrule(lr){1-11}\
boldmath $beta$ & multicolumn{10}{c}{begin{tabular}{rrrrrrr} 0.08 & 0.13 & 0.19 & 0.20 & 0.21 & 0.22 & 0.30 end{tabular}} \
textbf{t(boldmath $beta$)} & multicolumn{10}{c}{begin{tabular}{rrrrrrr} 0.08 & 0.13 & 0.19 & 0.20 & 0.21 & 0.22 & 0.30 end{tabular}} \
boldmath$R^2$ & multicolumn{10}{c}{begin{tabular}{rrrrrrr} 0.07 & 0.08 & 0.14 & 0.16 & 0.17 & 0.18 & 0.29 end{tabular}} \
textbf{s(boldsymbol{$epsilon$})} & multicolumn{10}{c}{begin{tabular}{rrrrrrr} 1.21 & 1.95 & 2.17 & 2.05 & 2.05 & 2.12 & 2.12 end{tabular}} \
midrule
bottomrule
end{tabular}%
}
end{table}%
end{frame}
end{document}
Following comments I tried this:
%%%%%% Preamble %%%%%%
documentclass[xcolor={dvipsnames}]{beamer}
usepackage{bm}
usepackage{amsmath}
usepackage{enumerate}
usepackage[english]{babel}
usepackage[latin1]{inputenc}
usepackage{times}
usepackage{tikz}
usetikzlibrary{fit,shapes.geometric}
usetikzlibrary{arrows}
usetikzlibrary{tikzmark,calc}
tikzstyle{block}=[draw opacity=0.7,line width=1.4cm]
newcounter{nodemarkers}
usepackage[T1]{fontenc}
usepackage{multirow}
usepackage{mathtools}
usepackage{array}
usepackage{graphicx}
usepackage{hyperref}
usepackage{booktabs}
usepackage[justification=centering]{caption}
usetheme{}
setbeamertemplate{caption}[numbered]
captionsetup[table]{font=scriptsize}
usefonttheme[onlylarge]{structurebold}
setbeamerfont*{frametitle}{size=normalsize,series=bfseries}
setbeamercolor{bibliography item}{fg=black}
setbeamercolor{frame number}{fg=black}
%%%%%% Beamer %%%%
begin{document}
begin{frame}{Results}
begin{table}[!h]
tiny
begin{center}
caption{ Estimation results of $RI-RF=alpha + beta(RM-RF)+epsilon_i$.}
begin{tabular}{lrrrrrrrrrr}
toprule
midrule
multirow{2}{1pt}{Size quintile} & multicolumn{10}{c}{Book-to-market equity (BE/ME) quintiles}\
cmidrule(lr){2-11}
& Low & 2 & 3 & 4 & 5 & Low & 2 & 3 & 4 & 5 \
cmidrule(lr){1-11}
& multicolumn{5}{c}{boldsymbol{$beta$}} & multicolumn{5}{c}{ textbf{t(boldmath$beta$)}} \
cmidrule(lr){2-6} cmidrule(lr){7-11}
Small & 20.6 & 20.8 & 20.2 & 19.4 & 15.1 & 0.30 & 0.62 & 0.84 & 1.09 & 1.80 \
2 & 89.7 & 89.3 & 89.3 & 89.9 & 88.5 & 0.31 & 0.60 & 0.83 & 1.09 & 1.71 \
3 & 209.3 & 211.9 & 210.8 & 214.8 & 210.7 & 0.31 & 0.60 & 0.84 & 1.08 & 1.66 \
4 & 535.1 & 537.4 & 545.4 & 551.6 & 538.7 & 0.31 & 0.61 & 0.84 & 1.09 & 1.67 \
Big & 3583.7 & 2885.8 & 2819.5 & 2700.5 & 2337.9 & 0.29 & 0.59 & 0.83 & 1.08 & 1.56 \
cmidrule(lr){2-11}
& multicolumn{5}{c}{textbf{$R^2$}} & multicolumn{5}{c}{textbf{s(boldsymbol{$epsilon$})}} \
cmidrule(lr){2-6} cmidrule(lr){7-11}
Small & 0.69 & 0.49 & 0.46 & 0.48 & 0.64 & 428.0 & 276.6 & 263.8 & 291.5 & 512.7 \
2 & 0.92 & 0.71 & 0.65 & 0.61 & 0.55 & 121.6 & 94.0 & 86.7 & 79.8 & 71.3 \
3 & 1.78 & 1.36 & 1.26 & 1.14 & 0.82 & 102.7 & 78.3 & 73.0 & 64.5 & 45.9 \
4 & 3.95 & 3.01 & 2.71 & 2.41 & 1.50 & 90.1 & 68.9 & 60.7 & 53.1 & 33.4 \
Big & 30.13 & 15.87 & 12.85 & 10.44 & 4.61 & 93.6 & 63.7 & 52.7 & 44.0 & 23.6 \
cmidrule(lr){1-11}
&
end{tabular}
begin{tabular}{rrrrrrr}
multicolumn{7}{c}{Excess returns on government and corporate bonds} \
1-5G & 6-10G & AAA & AA & A & BAA & LG\
0.10 & 0.13 & 0.18 & 0.23 & 0.25 & 0.28 & 0.36\
midrule
bottomrule
end{tabular}
end{center}
end{table}%
end{frame}
end{document}
But this is far from the table in the picture.
The second tabular doesn't have the same width as the first one and also the two tabulars seem to be apart from each other, despite belonging to the same table.
This is the result:
tables beamer multicolumn
3
Why don't you do two tabulars one under the other?
– CarLaTeX
Dec 6 at 13:50
1
I agree with @CarLaTeX, make twotabular
s. If you place them in the sametable
environment, they will share one caption etc.
– samcarter
Dec 6 at 22:31
Please have a look at tex.stackexchange.com/questions/425453/… Instead of scaling your table, I suggest to use a smaller font size
– samcarter
Dec 6 at 22:33
Off-topic: You don't needusepackage{graphicx} usepackage{hyperref}
with beamer
– samcarter
Dec 6 at 22:33
Thank you very much for your replies. I used the two tabular strategy you suggested, but I still couldn't replicate the structure of the table in the first picture. The second tabular doesn't have the same width and it seems apart from the first one. Nevertheless I believe we are getting closer. Thank you. I edited my post with the solution I tried
– Luis Martins
Dec 7 at 8:27
add a comment |
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I'm trying to generate a table in beamer like the one in the picture below
The problem is that In the last part of the table, there are lesser columns.
I tried to overcome this issue with a combination of multicolumn and tabular.
However, so far I only managed to get misaligned columns standing at the center of the table.
Is there a way to get the last columns to fill the whole table width, like the ones in the picture?
Thank you very much for your support.
Best regards
%%%%%% Preamble %%%%%%
documentclass[xcolor={dvipsnames}]{beamer}
usepackage{bm}
usepackage{amsmath}
usepackage{enumerate}
usepackage[english]{babel}
usepackage[latin1]{inputenc}
usepackage{times}
usepackage{tikz}
usetikzlibrary{fit,shapes.geometric}
usetikzlibrary{arrows}
usetikzlibrary{tikzmark,calc}
tikzstyle{block}=[draw opacity=0.7,line width=1.4cm]
newcounter{nodemarkers}
usepackage[T1]{fontenc}
usepackage{multirow}
usepackage{mathtools}
usepackage{array}
usepackage{graphicx}
usepackage{hyperref}
usepackage{booktabs}
usepackage[justification=centering]{caption}
usetheme{}
setbeamertemplate{caption}[numbered]
captionsetup[table]{font=scriptsize}
usefonttheme[onlylarge]{structurebold}
setbeamerfont*{frametitle}{size=normalsize,series=bfseries}
setbeamercolor{bibliography item}{fg=black}
setbeamercolor{frame number}{fg=black}
%%%%%% Beamer %%%%
begin{document}
begin{frame}{Results}
begin{table}
caption{ Estimation results of $RI-RF=alpha + beta(RM-RF)+epsilon_i$.}
centering
scalebox{0.52}[0.62]{
begin{tabular}{lrrrrrrrrrr}
addlinespace
toprule
midrule
multirow{2}{1pt}{Size quintile} & multicolumn{10}{c}{Book-to-market equity (BE/ME) quintiles}\
cmidrule(lr){2-11}
& Low & 2 & 3 & 4 & 5 & Low & 2 & 3 & 4 & 5 \
cmidrule(lr){1-11}
& multicolumn{5}{c}{boldsymbol{$beta$}} & multicolumn{5}{c}{ textbf{t(boldmath$beta$)}} \
cmidrule(lr){2-6} cmidrule(lr){7-11}
Small & 20.6 & 20.8 & 20.2 & 19.4 & 15.1 & 0.30 & 0.62 & 0.84 & 1.09 & 1.80 \
2 & 89.7 & 89.3 & 89.3 & 89.9 & 88.5 & 0.31 & 0.60 & 0.83 & 1.09 & 1.71 \
3 & 209.3 & 211.9 & 210.8 & 214.8 & 210.7 & 0.31 & 0.60 & 0.84 & 1.08 & 1.66 \
4 & 535.1 & 537.4 & 545.4 & 551.6 & 538.7 & 0.31 & 0.61 & 0.84 & 1.09 & 1.67 \
Big & 3583.7 & 2885.8 & 2819.5 & 2700.5 & 2337.9 & 0.29 & 0.59 & 0.83 & 1.08 & 1.56 \
cmidrule(lr){2-11}
& multicolumn{5}{c}{textbf{$R^2$}} & multicolumn{5}{c}{textbf{s(boldsymbol{$epsilon$})}} \
cmidrule(lr){2-6} cmidrule(lr){7-11}
Small & 0.69 & 0.49 & 0.46 & 0.48 & 0.64 & 428.0 & 276.6 & 263.8 & 291.5 & 512.7 \
2 & 0.92 & 0.71 & 0.65 & 0.61 & 0.55 & 121.6 & 94.0 & 86.7 & 79.8 & 71.3 \
3 & 1.78 & 1.36 & 1.26 & 1.14 & 0.82 & 102.7 & 78.3 & 73.0 & 64.5 & 45.9 \
4 & 3.95 & 3.01 & 2.71 & 2.41 & 1.50 & 90.1 & 68.9 & 60.7 & 53.1 & 33.4 \
Big & 30.13 & 15.87 & 12.85 & 10.44 & 4.61 & 93.6 & 63.7 & 52.7 & 44.0 & 23.6 \
cmidrule(lr){1-11}
& multicolumn{10}{c}{Excess returns on government and corporate bonds} \
& multicolumn{10}{c}{begin{tabular}{rrrrrrr} 1-5G & 6-10G & AAA & AA & A & BAA & LG end{tabular}} \
cmidrule(lr){1-11}\
boldmath $beta$ & multicolumn{10}{c}{begin{tabular}{rrrrrrr} 0.08 & 0.13 & 0.19 & 0.20 & 0.21 & 0.22 & 0.30 end{tabular}} \
textbf{t(boldmath $beta$)} & multicolumn{10}{c}{begin{tabular}{rrrrrrr} 0.08 & 0.13 & 0.19 & 0.20 & 0.21 & 0.22 & 0.30 end{tabular}} \
boldmath$R^2$ & multicolumn{10}{c}{begin{tabular}{rrrrrrr} 0.07 & 0.08 & 0.14 & 0.16 & 0.17 & 0.18 & 0.29 end{tabular}} \
textbf{s(boldsymbol{$epsilon$})} & multicolumn{10}{c}{begin{tabular}{rrrrrrr} 1.21 & 1.95 & 2.17 & 2.05 & 2.05 & 2.12 & 2.12 end{tabular}} \
midrule
bottomrule
end{tabular}%
}
end{table}%
end{frame}
end{document}
Following comments I tried this:
%%%%%% Preamble %%%%%%
documentclass[xcolor={dvipsnames}]{beamer}
usepackage{bm}
usepackage{amsmath}
usepackage{enumerate}
usepackage[english]{babel}
usepackage[latin1]{inputenc}
usepackage{times}
usepackage{tikz}
usetikzlibrary{fit,shapes.geometric}
usetikzlibrary{arrows}
usetikzlibrary{tikzmark,calc}
tikzstyle{block}=[draw opacity=0.7,line width=1.4cm]
newcounter{nodemarkers}
usepackage[T1]{fontenc}
usepackage{multirow}
usepackage{mathtools}
usepackage{array}
usepackage{graphicx}
usepackage{hyperref}
usepackage{booktabs}
usepackage[justification=centering]{caption}
usetheme{}
setbeamertemplate{caption}[numbered]
captionsetup[table]{font=scriptsize}
usefonttheme[onlylarge]{structurebold}
setbeamerfont*{frametitle}{size=normalsize,series=bfseries}
setbeamercolor{bibliography item}{fg=black}
setbeamercolor{frame number}{fg=black}
%%%%%% Beamer %%%%
begin{document}
begin{frame}{Results}
begin{table}[!h]
tiny
begin{center}
caption{ Estimation results of $RI-RF=alpha + beta(RM-RF)+epsilon_i$.}
begin{tabular}{lrrrrrrrrrr}
toprule
midrule
multirow{2}{1pt}{Size quintile} & multicolumn{10}{c}{Book-to-market equity (BE/ME) quintiles}\
cmidrule(lr){2-11}
& Low & 2 & 3 & 4 & 5 & Low & 2 & 3 & 4 & 5 \
cmidrule(lr){1-11}
& multicolumn{5}{c}{boldsymbol{$beta$}} & multicolumn{5}{c}{ textbf{t(boldmath$beta$)}} \
cmidrule(lr){2-6} cmidrule(lr){7-11}
Small & 20.6 & 20.8 & 20.2 & 19.4 & 15.1 & 0.30 & 0.62 & 0.84 & 1.09 & 1.80 \
2 & 89.7 & 89.3 & 89.3 & 89.9 & 88.5 & 0.31 & 0.60 & 0.83 & 1.09 & 1.71 \
3 & 209.3 & 211.9 & 210.8 & 214.8 & 210.7 & 0.31 & 0.60 & 0.84 & 1.08 & 1.66 \
4 & 535.1 & 537.4 & 545.4 & 551.6 & 538.7 & 0.31 & 0.61 & 0.84 & 1.09 & 1.67 \
Big & 3583.7 & 2885.8 & 2819.5 & 2700.5 & 2337.9 & 0.29 & 0.59 & 0.83 & 1.08 & 1.56 \
cmidrule(lr){2-11}
& multicolumn{5}{c}{textbf{$R^2$}} & multicolumn{5}{c}{textbf{s(boldsymbol{$epsilon$})}} \
cmidrule(lr){2-6} cmidrule(lr){7-11}
Small & 0.69 & 0.49 & 0.46 & 0.48 & 0.64 & 428.0 & 276.6 & 263.8 & 291.5 & 512.7 \
2 & 0.92 & 0.71 & 0.65 & 0.61 & 0.55 & 121.6 & 94.0 & 86.7 & 79.8 & 71.3 \
3 & 1.78 & 1.36 & 1.26 & 1.14 & 0.82 & 102.7 & 78.3 & 73.0 & 64.5 & 45.9 \
4 & 3.95 & 3.01 & 2.71 & 2.41 & 1.50 & 90.1 & 68.9 & 60.7 & 53.1 & 33.4 \
Big & 30.13 & 15.87 & 12.85 & 10.44 & 4.61 & 93.6 & 63.7 & 52.7 & 44.0 & 23.6 \
cmidrule(lr){1-11}
&
end{tabular}
begin{tabular}{rrrrrrr}
multicolumn{7}{c}{Excess returns on government and corporate bonds} \
1-5G & 6-10G & AAA & AA & A & BAA & LG\
0.10 & 0.13 & 0.18 & 0.23 & 0.25 & 0.28 & 0.36\
midrule
bottomrule
end{tabular}
end{center}
end{table}%
end{frame}
end{document}
But this is far from the table in the picture.
The second tabular doesn't have the same width as the first one and also the two tabulars seem to be apart from each other, despite belonging to the same table.
This is the result:
tables beamer multicolumn
I'm trying to generate a table in beamer like the one in the picture below
The problem is that In the last part of the table, there are lesser columns.
I tried to overcome this issue with a combination of multicolumn and tabular.
However, so far I only managed to get misaligned columns standing at the center of the table.
Is there a way to get the last columns to fill the whole table width, like the ones in the picture?
Thank you very much for your support.
Best regards
%%%%%% Preamble %%%%%%
documentclass[xcolor={dvipsnames}]{beamer}
usepackage{bm}
usepackage{amsmath}
usepackage{enumerate}
usepackage[english]{babel}
usepackage[latin1]{inputenc}
usepackage{times}
usepackage{tikz}
usetikzlibrary{fit,shapes.geometric}
usetikzlibrary{arrows}
usetikzlibrary{tikzmark,calc}
tikzstyle{block}=[draw opacity=0.7,line width=1.4cm]
newcounter{nodemarkers}
usepackage[T1]{fontenc}
usepackage{multirow}
usepackage{mathtools}
usepackage{array}
usepackage{graphicx}
usepackage{hyperref}
usepackage{booktabs}
usepackage[justification=centering]{caption}
usetheme{}
setbeamertemplate{caption}[numbered]
captionsetup[table]{font=scriptsize}
usefonttheme[onlylarge]{structurebold}
setbeamerfont*{frametitle}{size=normalsize,series=bfseries}
setbeamercolor{bibliography item}{fg=black}
setbeamercolor{frame number}{fg=black}
%%%%%% Beamer %%%%
begin{document}
begin{frame}{Results}
begin{table}
caption{ Estimation results of $RI-RF=alpha + beta(RM-RF)+epsilon_i$.}
centering
scalebox{0.52}[0.62]{
begin{tabular}{lrrrrrrrrrr}
addlinespace
toprule
midrule
multirow{2}{1pt}{Size quintile} & multicolumn{10}{c}{Book-to-market equity (BE/ME) quintiles}\
cmidrule(lr){2-11}
& Low & 2 & 3 & 4 & 5 & Low & 2 & 3 & 4 & 5 \
cmidrule(lr){1-11}
& multicolumn{5}{c}{boldsymbol{$beta$}} & multicolumn{5}{c}{ textbf{t(boldmath$beta$)}} \
cmidrule(lr){2-6} cmidrule(lr){7-11}
Small & 20.6 & 20.8 & 20.2 & 19.4 & 15.1 & 0.30 & 0.62 & 0.84 & 1.09 & 1.80 \
2 & 89.7 & 89.3 & 89.3 & 89.9 & 88.5 & 0.31 & 0.60 & 0.83 & 1.09 & 1.71 \
3 & 209.3 & 211.9 & 210.8 & 214.8 & 210.7 & 0.31 & 0.60 & 0.84 & 1.08 & 1.66 \
4 & 535.1 & 537.4 & 545.4 & 551.6 & 538.7 & 0.31 & 0.61 & 0.84 & 1.09 & 1.67 \
Big & 3583.7 & 2885.8 & 2819.5 & 2700.5 & 2337.9 & 0.29 & 0.59 & 0.83 & 1.08 & 1.56 \
cmidrule(lr){2-11}
& multicolumn{5}{c}{textbf{$R^2$}} & multicolumn{5}{c}{textbf{s(boldsymbol{$epsilon$})}} \
cmidrule(lr){2-6} cmidrule(lr){7-11}
Small & 0.69 & 0.49 & 0.46 & 0.48 & 0.64 & 428.0 & 276.6 & 263.8 & 291.5 & 512.7 \
2 & 0.92 & 0.71 & 0.65 & 0.61 & 0.55 & 121.6 & 94.0 & 86.7 & 79.8 & 71.3 \
3 & 1.78 & 1.36 & 1.26 & 1.14 & 0.82 & 102.7 & 78.3 & 73.0 & 64.5 & 45.9 \
4 & 3.95 & 3.01 & 2.71 & 2.41 & 1.50 & 90.1 & 68.9 & 60.7 & 53.1 & 33.4 \
Big & 30.13 & 15.87 & 12.85 & 10.44 & 4.61 & 93.6 & 63.7 & 52.7 & 44.0 & 23.6 \
cmidrule(lr){1-11}
& multicolumn{10}{c}{Excess returns on government and corporate bonds} \
& multicolumn{10}{c}{begin{tabular}{rrrrrrr} 1-5G & 6-10G & AAA & AA & A & BAA & LG end{tabular}} \
cmidrule(lr){1-11}\
boldmath $beta$ & multicolumn{10}{c}{begin{tabular}{rrrrrrr} 0.08 & 0.13 & 0.19 & 0.20 & 0.21 & 0.22 & 0.30 end{tabular}} \
textbf{t(boldmath $beta$)} & multicolumn{10}{c}{begin{tabular}{rrrrrrr} 0.08 & 0.13 & 0.19 & 0.20 & 0.21 & 0.22 & 0.30 end{tabular}} \
boldmath$R^2$ & multicolumn{10}{c}{begin{tabular}{rrrrrrr} 0.07 & 0.08 & 0.14 & 0.16 & 0.17 & 0.18 & 0.29 end{tabular}} \
textbf{s(boldsymbol{$epsilon$})} & multicolumn{10}{c}{begin{tabular}{rrrrrrr} 1.21 & 1.95 & 2.17 & 2.05 & 2.05 & 2.12 & 2.12 end{tabular}} \
midrule
bottomrule
end{tabular}%
}
end{table}%
end{frame}
end{document}
Following comments I tried this:
%%%%%% Preamble %%%%%%
documentclass[xcolor={dvipsnames}]{beamer}
usepackage{bm}
usepackage{amsmath}
usepackage{enumerate}
usepackage[english]{babel}
usepackage[latin1]{inputenc}
usepackage{times}
usepackage{tikz}
usetikzlibrary{fit,shapes.geometric}
usetikzlibrary{arrows}
usetikzlibrary{tikzmark,calc}
tikzstyle{block}=[draw opacity=0.7,line width=1.4cm]
newcounter{nodemarkers}
usepackage[T1]{fontenc}
usepackage{multirow}
usepackage{mathtools}
usepackage{array}
usepackage{graphicx}
usepackage{hyperref}
usepackage{booktabs}
usepackage[justification=centering]{caption}
usetheme{}
setbeamertemplate{caption}[numbered]
captionsetup[table]{font=scriptsize}
usefonttheme[onlylarge]{structurebold}
setbeamerfont*{frametitle}{size=normalsize,series=bfseries}
setbeamercolor{bibliography item}{fg=black}
setbeamercolor{frame number}{fg=black}
%%%%%% Beamer %%%%
begin{document}
begin{frame}{Results}
begin{table}[!h]
tiny
begin{center}
caption{ Estimation results of $RI-RF=alpha + beta(RM-RF)+epsilon_i$.}
begin{tabular}{lrrrrrrrrrr}
toprule
midrule
multirow{2}{1pt}{Size quintile} & multicolumn{10}{c}{Book-to-market equity (BE/ME) quintiles}\
cmidrule(lr){2-11}
& Low & 2 & 3 & 4 & 5 & Low & 2 & 3 & 4 & 5 \
cmidrule(lr){1-11}
& multicolumn{5}{c}{boldsymbol{$beta$}} & multicolumn{5}{c}{ textbf{t(boldmath$beta$)}} \
cmidrule(lr){2-6} cmidrule(lr){7-11}
Small & 20.6 & 20.8 & 20.2 & 19.4 & 15.1 & 0.30 & 0.62 & 0.84 & 1.09 & 1.80 \
2 & 89.7 & 89.3 & 89.3 & 89.9 & 88.5 & 0.31 & 0.60 & 0.83 & 1.09 & 1.71 \
3 & 209.3 & 211.9 & 210.8 & 214.8 & 210.7 & 0.31 & 0.60 & 0.84 & 1.08 & 1.66 \
4 & 535.1 & 537.4 & 545.4 & 551.6 & 538.7 & 0.31 & 0.61 & 0.84 & 1.09 & 1.67 \
Big & 3583.7 & 2885.8 & 2819.5 & 2700.5 & 2337.9 & 0.29 & 0.59 & 0.83 & 1.08 & 1.56 \
cmidrule(lr){2-11}
& multicolumn{5}{c}{textbf{$R^2$}} & multicolumn{5}{c}{textbf{s(boldsymbol{$epsilon$})}} \
cmidrule(lr){2-6} cmidrule(lr){7-11}
Small & 0.69 & 0.49 & 0.46 & 0.48 & 0.64 & 428.0 & 276.6 & 263.8 & 291.5 & 512.7 \
2 & 0.92 & 0.71 & 0.65 & 0.61 & 0.55 & 121.6 & 94.0 & 86.7 & 79.8 & 71.3 \
3 & 1.78 & 1.36 & 1.26 & 1.14 & 0.82 & 102.7 & 78.3 & 73.0 & 64.5 & 45.9 \
4 & 3.95 & 3.01 & 2.71 & 2.41 & 1.50 & 90.1 & 68.9 & 60.7 & 53.1 & 33.4 \
Big & 30.13 & 15.87 & 12.85 & 10.44 & 4.61 & 93.6 & 63.7 & 52.7 & 44.0 & 23.6 \
cmidrule(lr){1-11}
&
end{tabular}
begin{tabular}{rrrrrrr}
multicolumn{7}{c}{Excess returns on government and corporate bonds} \
1-5G & 6-10G & AAA & AA & A & BAA & LG\
0.10 & 0.13 & 0.18 & 0.23 & 0.25 & 0.28 & 0.36\
midrule
bottomrule
end{tabular}
end{center}
end{table}%
end{frame}
end{document}
But this is far from the table in the picture.
The second tabular doesn't have the same width as the first one and also the two tabulars seem to be apart from each other, despite belonging to the same table.
This is the result:
tables beamer multicolumn
tables beamer multicolumn
edited Dec 7 at 8:25
asked Dec 6 at 10:58
Luis Martins
184
184
3
Why don't you do two tabulars one under the other?
– CarLaTeX
Dec 6 at 13:50
1
I agree with @CarLaTeX, make twotabular
s. If you place them in the sametable
environment, they will share one caption etc.
– samcarter
Dec 6 at 22:31
Please have a look at tex.stackexchange.com/questions/425453/… Instead of scaling your table, I suggest to use a smaller font size
– samcarter
Dec 6 at 22:33
Off-topic: You don't needusepackage{graphicx} usepackage{hyperref}
with beamer
– samcarter
Dec 6 at 22:33
Thank you very much for your replies. I used the two tabular strategy you suggested, but I still couldn't replicate the structure of the table in the first picture. The second tabular doesn't have the same width and it seems apart from the first one. Nevertheless I believe we are getting closer. Thank you. I edited my post with the solution I tried
– Luis Martins
Dec 7 at 8:27
add a comment |
3
Why don't you do two tabulars one under the other?
– CarLaTeX
Dec 6 at 13:50
1
I agree with @CarLaTeX, make twotabular
s. If you place them in the sametable
environment, they will share one caption etc.
– samcarter
Dec 6 at 22:31
Please have a look at tex.stackexchange.com/questions/425453/… Instead of scaling your table, I suggest to use a smaller font size
– samcarter
Dec 6 at 22:33
Off-topic: You don't needusepackage{graphicx} usepackage{hyperref}
with beamer
– samcarter
Dec 6 at 22:33
Thank you very much for your replies. I used the two tabular strategy you suggested, but I still couldn't replicate the structure of the table in the first picture. The second tabular doesn't have the same width and it seems apart from the first one. Nevertheless I believe we are getting closer. Thank you. I edited my post with the solution I tried
– Luis Martins
Dec 7 at 8:27
3
3
Why don't you do two tabulars one under the other?
– CarLaTeX
Dec 6 at 13:50
Why don't you do two tabulars one under the other?
– CarLaTeX
Dec 6 at 13:50
1
1
I agree with @CarLaTeX, make two
tabular
s. If you place them in the same table
environment, they will share one caption etc.– samcarter
Dec 6 at 22:31
I agree with @CarLaTeX, make two
tabular
s. If you place them in the same table
environment, they will share one caption etc.– samcarter
Dec 6 at 22:31
Please have a look at tex.stackexchange.com/questions/425453/… Instead of scaling your table, I suggest to use a smaller font size
– samcarter
Dec 6 at 22:33
Please have a look at tex.stackexchange.com/questions/425453/… Instead of scaling your table, I suggest to use a smaller font size
– samcarter
Dec 6 at 22:33
Off-topic: You don't need
usepackage{graphicx} usepackage{hyperref}
with beamer– samcarter
Dec 6 at 22:33
Off-topic: You don't need
usepackage{graphicx} usepackage{hyperref}
with beamer– samcarter
Dec 6 at 22:33
Thank you very much for your replies. I used the two tabular strategy you suggested, but I still couldn't replicate the structure of the table in the first picture. The second tabular doesn't have the same width and it seems apart from the first one. Nevertheless I believe we are getting closer. Thank you. I edited my post with the solution I tried
– Luis Martins
Dec 7 at 8:27
Thank you very much for your replies. I used the two tabular strategy you suggested, but I still couldn't replicate the structure of the table in the first picture. The second tabular doesn't have the same width and it seems apart from the first one. Nevertheless I believe we are getting closer. Thank you. I edited my post with the solution I tried
– Luis Martins
Dec 7 at 8:27
add a comment |
1 Answer
1
active
oldest
votes
up vote
5
down vote
accepted
I would use a tabular*
environment for the upper table; that way, you can ensure that it fits inside the text block. Conversely, I would not use a table
environment at all; instead, stick the caption into the argument of frametitle
. I would also use bold-facing much more sparingly; actually, I wouldn't use it at all for this table.
documentclass[xcolor={dvipsnames}]{beamer}
usepackage{bm}
%%usepackage{amsmath}
usepackage{enumerate}
usepackage[english]{babel}
%usepackage[latin1]{inputenc}
%usepackage{times}
usepackage{tikz}
usetikzlibrary{fit,shapes.geometric}
usetikzlibrary{arrows}
usetikzlibrary{tikzmark,calc}
tikzstyle{block}=[draw opacity=0.7,line width=1.4cm]
newcounter{nodemarkers}
usepackage[T1]{fontenc}
usepackage{multirow}
usepackage{mathtools}
usepackage{array}
usepackage{graphicx}
usepackage{siunitx} % <-- new
%usepackage{hyperref}
usepackage{booktabs}
usepackage[justification=centering]{caption}
usetheme{}
setbeamertemplate{caption}[numbered]
captionsetup[table]{font=scriptsize}
usefonttheme[onlylarge]{structurebold}
setbeamerfont*{frametitle}{size=normalsize,series=bfseries}
setbeamercolor{bibliography item}{fg=black}
setbeamercolor{frame number}{fg=black}
%%%%%% Beamer %%%%
begin{document}
begin{frame}{Estimation results of
$RI-RF = alpha + beta(RM-RF) + epsilon_i$}
scriptsize
begingroup
setlengthtabcolsep{0pt}
begin{tabular*}{textwidth}{@{extracolsep{fill}}
l*{10}{r}}
toprule
multirow{2}{1pt}{Size quintile} & multicolumn{10}{c}{Book-to-market equity (BE/ME) quintiles}\
cmidrule(l){2-11}
& Low & 2 & 3 & 4 & 5
& Low & 2 & 3 & 4 & 5 \
cmidrule{2-11}addlinespace
& multicolumn{5}{c}{$beta$}
& multicolumn{5}{c}{$t(beta)$} \
cmidrule{2-6} cmidrule{7-11}
Small & 20.6 & 20.8 & 20.2 & 19.4 & 15.1 & 0.30 & 0.62 & 0.84 & 1.09 & 1.80 \
2 & 89.7 & 89.3 & 89.3 & 89.9 & 88.5 & 0.31 & 0.60 & 0.83 & 1.09 & 1.71 \
3 & 209.3 & 211.9 & 210.8 & 214.8 & 210.7 & 0.31 & 0.60 & 0.84 & 1.08 & 1.66 \
4 & 535.1 & 537.4 & 545.4 & 551.6 & 538.7 & 0.31 & 0.61 & 0.84 & 1.09 & 1.67 \
Big & 3583.7 & 2885.8 & 2819.5 & 2700.5 & 2337.9 & 0.29 & 0.59 & 0.83 & 1.08 & 1.56 \
cmidrule{2-11}addlinespace
& multicolumn{5}{c}{$R^2$}
& multicolumn{5}{c}{$s(epsilon)$} \
cmidrule{2-6} cmidrule{7-11}
Small & 0.69 & 0.49 & 0.46 & 0.48 & 0.64 & 428.0 & 276.6 & 263.8 & 291.5 & 512.7 \
2 & 0.92 & 0.71 & 0.65 & 0.61 & 0.55 & 121.6 & 94.0 & 86.7 & 79.8 & 71.3 \
3 & 1.78 & 1.36 & 1.26 & 1.14 & 0.82 & 102.7 & 78.3 & 73.0 & 64.5 & 45.9 \
4 & 3.95 & 3.01 & 2.71 & 2.41 & 1.50 & 90.1 & 68.9 & 60.7 & 53.1 & 33.4 \
Big & 30.13 & 15.87 & 12.85 & 10.44 & 4.61 & 93.6 & 63.7 & 52.7 & 44.0 & 23.6 \
bottomrule
end{tabular*}
endgroup
bigskip
centering
begin{tabular}{@{}*{7}{c}@{}}
multicolumn{7}{c}{Excess returns on government and corporate bonds} \[0.5ex]
toprule
1--5G & 6--10G & AAA & AA & A & BAA & LG\
midrule
0.10 & 0.13 & 0.18 & 0.23 & 0.25 & 0.28 & 0.36\
bottomrule
end{tabular}
end{frame}
end{document}
1
Very nice layout!
– samcarter
Dec 7 at 9:50
@samcarter - Many thanks for the compliment!
– Mico
Dec 7 at 10:04
I noticed that you eliminatedhyperref
- could you do the same withusepackage{graphicx}
?
– samcarter
Dec 7 at 10:05
2
This is a very nice layout indeed and I think I'll use it instead of trying to mimic the table in the picture. Thank you very much for your reply.
– Luis Martins
Dec 7 at 10:29
2
@Mico That's easy: basically all, one just has to remember the few packages which are not loaded :)
– samcarter
Dec 7 at 10:30
|
show 2 more comments
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f463496%2ftable-with-different-column-numbers-full-width%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
I would use a tabular*
environment for the upper table; that way, you can ensure that it fits inside the text block. Conversely, I would not use a table
environment at all; instead, stick the caption into the argument of frametitle
. I would also use bold-facing much more sparingly; actually, I wouldn't use it at all for this table.
documentclass[xcolor={dvipsnames}]{beamer}
usepackage{bm}
%%usepackage{amsmath}
usepackage{enumerate}
usepackage[english]{babel}
%usepackage[latin1]{inputenc}
%usepackage{times}
usepackage{tikz}
usetikzlibrary{fit,shapes.geometric}
usetikzlibrary{arrows}
usetikzlibrary{tikzmark,calc}
tikzstyle{block}=[draw opacity=0.7,line width=1.4cm]
newcounter{nodemarkers}
usepackage[T1]{fontenc}
usepackage{multirow}
usepackage{mathtools}
usepackage{array}
usepackage{graphicx}
usepackage{siunitx} % <-- new
%usepackage{hyperref}
usepackage{booktabs}
usepackage[justification=centering]{caption}
usetheme{}
setbeamertemplate{caption}[numbered]
captionsetup[table]{font=scriptsize}
usefonttheme[onlylarge]{structurebold}
setbeamerfont*{frametitle}{size=normalsize,series=bfseries}
setbeamercolor{bibliography item}{fg=black}
setbeamercolor{frame number}{fg=black}
%%%%%% Beamer %%%%
begin{document}
begin{frame}{Estimation results of
$RI-RF = alpha + beta(RM-RF) + epsilon_i$}
scriptsize
begingroup
setlengthtabcolsep{0pt}
begin{tabular*}{textwidth}{@{extracolsep{fill}}
l*{10}{r}}
toprule
multirow{2}{1pt}{Size quintile} & multicolumn{10}{c}{Book-to-market equity (BE/ME) quintiles}\
cmidrule(l){2-11}
& Low & 2 & 3 & 4 & 5
& Low & 2 & 3 & 4 & 5 \
cmidrule{2-11}addlinespace
& multicolumn{5}{c}{$beta$}
& multicolumn{5}{c}{$t(beta)$} \
cmidrule{2-6} cmidrule{7-11}
Small & 20.6 & 20.8 & 20.2 & 19.4 & 15.1 & 0.30 & 0.62 & 0.84 & 1.09 & 1.80 \
2 & 89.7 & 89.3 & 89.3 & 89.9 & 88.5 & 0.31 & 0.60 & 0.83 & 1.09 & 1.71 \
3 & 209.3 & 211.9 & 210.8 & 214.8 & 210.7 & 0.31 & 0.60 & 0.84 & 1.08 & 1.66 \
4 & 535.1 & 537.4 & 545.4 & 551.6 & 538.7 & 0.31 & 0.61 & 0.84 & 1.09 & 1.67 \
Big & 3583.7 & 2885.8 & 2819.5 & 2700.5 & 2337.9 & 0.29 & 0.59 & 0.83 & 1.08 & 1.56 \
cmidrule{2-11}addlinespace
& multicolumn{5}{c}{$R^2$}
& multicolumn{5}{c}{$s(epsilon)$} \
cmidrule{2-6} cmidrule{7-11}
Small & 0.69 & 0.49 & 0.46 & 0.48 & 0.64 & 428.0 & 276.6 & 263.8 & 291.5 & 512.7 \
2 & 0.92 & 0.71 & 0.65 & 0.61 & 0.55 & 121.6 & 94.0 & 86.7 & 79.8 & 71.3 \
3 & 1.78 & 1.36 & 1.26 & 1.14 & 0.82 & 102.7 & 78.3 & 73.0 & 64.5 & 45.9 \
4 & 3.95 & 3.01 & 2.71 & 2.41 & 1.50 & 90.1 & 68.9 & 60.7 & 53.1 & 33.4 \
Big & 30.13 & 15.87 & 12.85 & 10.44 & 4.61 & 93.6 & 63.7 & 52.7 & 44.0 & 23.6 \
bottomrule
end{tabular*}
endgroup
bigskip
centering
begin{tabular}{@{}*{7}{c}@{}}
multicolumn{7}{c}{Excess returns on government and corporate bonds} \[0.5ex]
toprule
1--5G & 6--10G & AAA & AA & A & BAA & LG\
midrule
0.10 & 0.13 & 0.18 & 0.23 & 0.25 & 0.28 & 0.36\
bottomrule
end{tabular}
end{frame}
end{document}
1
Very nice layout!
– samcarter
Dec 7 at 9:50
@samcarter - Many thanks for the compliment!
– Mico
Dec 7 at 10:04
I noticed that you eliminatedhyperref
- could you do the same withusepackage{graphicx}
?
– samcarter
Dec 7 at 10:05
2
This is a very nice layout indeed and I think I'll use it instead of trying to mimic the table in the picture. Thank you very much for your reply.
– Luis Martins
Dec 7 at 10:29
2
@Mico That's easy: basically all, one just has to remember the few packages which are not loaded :)
– samcarter
Dec 7 at 10:30
|
show 2 more comments
up vote
5
down vote
accepted
I would use a tabular*
environment for the upper table; that way, you can ensure that it fits inside the text block. Conversely, I would not use a table
environment at all; instead, stick the caption into the argument of frametitle
. I would also use bold-facing much more sparingly; actually, I wouldn't use it at all for this table.
documentclass[xcolor={dvipsnames}]{beamer}
usepackage{bm}
%%usepackage{amsmath}
usepackage{enumerate}
usepackage[english]{babel}
%usepackage[latin1]{inputenc}
%usepackage{times}
usepackage{tikz}
usetikzlibrary{fit,shapes.geometric}
usetikzlibrary{arrows}
usetikzlibrary{tikzmark,calc}
tikzstyle{block}=[draw opacity=0.7,line width=1.4cm]
newcounter{nodemarkers}
usepackage[T1]{fontenc}
usepackage{multirow}
usepackage{mathtools}
usepackage{array}
usepackage{graphicx}
usepackage{siunitx} % <-- new
%usepackage{hyperref}
usepackage{booktabs}
usepackage[justification=centering]{caption}
usetheme{}
setbeamertemplate{caption}[numbered]
captionsetup[table]{font=scriptsize}
usefonttheme[onlylarge]{structurebold}
setbeamerfont*{frametitle}{size=normalsize,series=bfseries}
setbeamercolor{bibliography item}{fg=black}
setbeamercolor{frame number}{fg=black}
%%%%%% Beamer %%%%
begin{document}
begin{frame}{Estimation results of
$RI-RF = alpha + beta(RM-RF) + epsilon_i$}
scriptsize
begingroup
setlengthtabcolsep{0pt}
begin{tabular*}{textwidth}{@{extracolsep{fill}}
l*{10}{r}}
toprule
multirow{2}{1pt}{Size quintile} & multicolumn{10}{c}{Book-to-market equity (BE/ME) quintiles}\
cmidrule(l){2-11}
& Low & 2 & 3 & 4 & 5
& Low & 2 & 3 & 4 & 5 \
cmidrule{2-11}addlinespace
& multicolumn{5}{c}{$beta$}
& multicolumn{5}{c}{$t(beta)$} \
cmidrule{2-6} cmidrule{7-11}
Small & 20.6 & 20.8 & 20.2 & 19.4 & 15.1 & 0.30 & 0.62 & 0.84 & 1.09 & 1.80 \
2 & 89.7 & 89.3 & 89.3 & 89.9 & 88.5 & 0.31 & 0.60 & 0.83 & 1.09 & 1.71 \
3 & 209.3 & 211.9 & 210.8 & 214.8 & 210.7 & 0.31 & 0.60 & 0.84 & 1.08 & 1.66 \
4 & 535.1 & 537.4 & 545.4 & 551.6 & 538.7 & 0.31 & 0.61 & 0.84 & 1.09 & 1.67 \
Big & 3583.7 & 2885.8 & 2819.5 & 2700.5 & 2337.9 & 0.29 & 0.59 & 0.83 & 1.08 & 1.56 \
cmidrule{2-11}addlinespace
& multicolumn{5}{c}{$R^2$}
& multicolumn{5}{c}{$s(epsilon)$} \
cmidrule{2-6} cmidrule{7-11}
Small & 0.69 & 0.49 & 0.46 & 0.48 & 0.64 & 428.0 & 276.6 & 263.8 & 291.5 & 512.7 \
2 & 0.92 & 0.71 & 0.65 & 0.61 & 0.55 & 121.6 & 94.0 & 86.7 & 79.8 & 71.3 \
3 & 1.78 & 1.36 & 1.26 & 1.14 & 0.82 & 102.7 & 78.3 & 73.0 & 64.5 & 45.9 \
4 & 3.95 & 3.01 & 2.71 & 2.41 & 1.50 & 90.1 & 68.9 & 60.7 & 53.1 & 33.4 \
Big & 30.13 & 15.87 & 12.85 & 10.44 & 4.61 & 93.6 & 63.7 & 52.7 & 44.0 & 23.6 \
bottomrule
end{tabular*}
endgroup
bigskip
centering
begin{tabular}{@{}*{7}{c}@{}}
multicolumn{7}{c}{Excess returns on government and corporate bonds} \[0.5ex]
toprule
1--5G & 6--10G & AAA & AA & A & BAA & LG\
midrule
0.10 & 0.13 & 0.18 & 0.23 & 0.25 & 0.28 & 0.36\
bottomrule
end{tabular}
end{frame}
end{document}
1
Very nice layout!
– samcarter
Dec 7 at 9:50
@samcarter - Many thanks for the compliment!
– Mico
Dec 7 at 10:04
I noticed that you eliminatedhyperref
- could you do the same withusepackage{graphicx}
?
– samcarter
Dec 7 at 10:05
2
This is a very nice layout indeed and I think I'll use it instead of trying to mimic the table in the picture. Thank you very much for your reply.
– Luis Martins
Dec 7 at 10:29
2
@Mico That's easy: basically all, one just has to remember the few packages which are not loaded :)
– samcarter
Dec 7 at 10:30
|
show 2 more comments
up vote
5
down vote
accepted
up vote
5
down vote
accepted
I would use a tabular*
environment for the upper table; that way, you can ensure that it fits inside the text block. Conversely, I would not use a table
environment at all; instead, stick the caption into the argument of frametitle
. I would also use bold-facing much more sparingly; actually, I wouldn't use it at all for this table.
documentclass[xcolor={dvipsnames}]{beamer}
usepackage{bm}
%%usepackage{amsmath}
usepackage{enumerate}
usepackage[english]{babel}
%usepackage[latin1]{inputenc}
%usepackage{times}
usepackage{tikz}
usetikzlibrary{fit,shapes.geometric}
usetikzlibrary{arrows}
usetikzlibrary{tikzmark,calc}
tikzstyle{block}=[draw opacity=0.7,line width=1.4cm]
newcounter{nodemarkers}
usepackage[T1]{fontenc}
usepackage{multirow}
usepackage{mathtools}
usepackage{array}
usepackage{graphicx}
usepackage{siunitx} % <-- new
%usepackage{hyperref}
usepackage{booktabs}
usepackage[justification=centering]{caption}
usetheme{}
setbeamertemplate{caption}[numbered]
captionsetup[table]{font=scriptsize}
usefonttheme[onlylarge]{structurebold}
setbeamerfont*{frametitle}{size=normalsize,series=bfseries}
setbeamercolor{bibliography item}{fg=black}
setbeamercolor{frame number}{fg=black}
%%%%%% Beamer %%%%
begin{document}
begin{frame}{Estimation results of
$RI-RF = alpha + beta(RM-RF) + epsilon_i$}
scriptsize
begingroup
setlengthtabcolsep{0pt}
begin{tabular*}{textwidth}{@{extracolsep{fill}}
l*{10}{r}}
toprule
multirow{2}{1pt}{Size quintile} & multicolumn{10}{c}{Book-to-market equity (BE/ME) quintiles}\
cmidrule(l){2-11}
& Low & 2 & 3 & 4 & 5
& Low & 2 & 3 & 4 & 5 \
cmidrule{2-11}addlinespace
& multicolumn{5}{c}{$beta$}
& multicolumn{5}{c}{$t(beta)$} \
cmidrule{2-6} cmidrule{7-11}
Small & 20.6 & 20.8 & 20.2 & 19.4 & 15.1 & 0.30 & 0.62 & 0.84 & 1.09 & 1.80 \
2 & 89.7 & 89.3 & 89.3 & 89.9 & 88.5 & 0.31 & 0.60 & 0.83 & 1.09 & 1.71 \
3 & 209.3 & 211.9 & 210.8 & 214.8 & 210.7 & 0.31 & 0.60 & 0.84 & 1.08 & 1.66 \
4 & 535.1 & 537.4 & 545.4 & 551.6 & 538.7 & 0.31 & 0.61 & 0.84 & 1.09 & 1.67 \
Big & 3583.7 & 2885.8 & 2819.5 & 2700.5 & 2337.9 & 0.29 & 0.59 & 0.83 & 1.08 & 1.56 \
cmidrule{2-11}addlinespace
& multicolumn{5}{c}{$R^2$}
& multicolumn{5}{c}{$s(epsilon)$} \
cmidrule{2-6} cmidrule{7-11}
Small & 0.69 & 0.49 & 0.46 & 0.48 & 0.64 & 428.0 & 276.6 & 263.8 & 291.5 & 512.7 \
2 & 0.92 & 0.71 & 0.65 & 0.61 & 0.55 & 121.6 & 94.0 & 86.7 & 79.8 & 71.3 \
3 & 1.78 & 1.36 & 1.26 & 1.14 & 0.82 & 102.7 & 78.3 & 73.0 & 64.5 & 45.9 \
4 & 3.95 & 3.01 & 2.71 & 2.41 & 1.50 & 90.1 & 68.9 & 60.7 & 53.1 & 33.4 \
Big & 30.13 & 15.87 & 12.85 & 10.44 & 4.61 & 93.6 & 63.7 & 52.7 & 44.0 & 23.6 \
bottomrule
end{tabular*}
endgroup
bigskip
centering
begin{tabular}{@{}*{7}{c}@{}}
multicolumn{7}{c}{Excess returns on government and corporate bonds} \[0.5ex]
toprule
1--5G & 6--10G & AAA & AA & A & BAA & LG\
midrule
0.10 & 0.13 & 0.18 & 0.23 & 0.25 & 0.28 & 0.36\
bottomrule
end{tabular}
end{frame}
end{document}
I would use a tabular*
environment for the upper table; that way, you can ensure that it fits inside the text block. Conversely, I would not use a table
environment at all; instead, stick the caption into the argument of frametitle
. I would also use bold-facing much more sparingly; actually, I wouldn't use it at all for this table.
documentclass[xcolor={dvipsnames}]{beamer}
usepackage{bm}
%%usepackage{amsmath}
usepackage{enumerate}
usepackage[english]{babel}
%usepackage[latin1]{inputenc}
%usepackage{times}
usepackage{tikz}
usetikzlibrary{fit,shapes.geometric}
usetikzlibrary{arrows}
usetikzlibrary{tikzmark,calc}
tikzstyle{block}=[draw opacity=0.7,line width=1.4cm]
newcounter{nodemarkers}
usepackage[T1]{fontenc}
usepackage{multirow}
usepackage{mathtools}
usepackage{array}
usepackage{graphicx}
usepackage{siunitx} % <-- new
%usepackage{hyperref}
usepackage{booktabs}
usepackage[justification=centering]{caption}
usetheme{}
setbeamertemplate{caption}[numbered]
captionsetup[table]{font=scriptsize}
usefonttheme[onlylarge]{structurebold}
setbeamerfont*{frametitle}{size=normalsize,series=bfseries}
setbeamercolor{bibliography item}{fg=black}
setbeamercolor{frame number}{fg=black}
%%%%%% Beamer %%%%
begin{document}
begin{frame}{Estimation results of
$RI-RF = alpha + beta(RM-RF) + epsilon_i$}
scriptsize
begingroup
setlengthtabcolsep{0pt}
begin{tabular*}{textwidth}{@{extracolsep{fill}}
l*{10}{r}}
toprule
multirow{2}{1pt}{Size quintile} & multicolumn{10}{c}{Book-to-market equity (BE/ME) quintiles}\
cmidrule(l){2-11}
& Low & 2 & 3 & 4 & 5
& Low & 2 & 3 & 4 & 5 \
cmidrule{2-11}addlinespace
& multicolumn{5}{c}{$beta$}
& multicolumn{5}{c}{$t(beta)$} \
cmidrule{2-6} cmidrule{7-11}
Small & 20.6 & 20.8 & 20.2 & 19.4 & 15.1 & 0.30 & 0.62 & 0.84 & 1.09 & 1.80 \
2 & 89.7 & 89.3 & 89.3 & 89.9 & 88.5 & 0.31 & 0.60 & 0.83 & 1.09 & 1.71 \
3 & 209.3 & 211.9 & 210.8 & 214.8 & 210.7 & 0.31 & 0.60 & 0.84 & 1.08 & 1.66 \
4 & 535.1 & 537.4 & 545.4 & 551.6 & 538.7 & 0.31 & 0.61 & 0.84 & 1.09 & 1.67 \
Big & 3583.7 & 2885.8 & 2819.5 & 2700.5 & 2337.9 & 0.29 & 0.59 & 0.83 & 1.08 & 1.56 \
cmidrule{2-11}addlinespace
& multicolumn{5}{c}{$R^2$}
& multicolumn{5}{c}{$s(epsilon)$} \
cmidrule{2-6} cmidrule{7-11}
Small & 0.69 & 0.49 & 0.46 & 0.48 & 0.64 & 428.0 & 276.6 & 263.8 & 291.5 & 512.7 \
2 & 0.92 & 0.71 & 0.65 & 0.61 & 0.55 & 121.6 & 94.0 & 86.7 & 79.8 & 71.3 \
3 & 1.78 & 1.36 & 1.26 & 1.14 & 0.82 & 102.7 & 78.3 & 73.0 & 64.5 & 45.9 \
4 & 3.95 & 3.01 & 2.71 & 2.41 & 1.50 & 90.1 & 68.9 & 60.7 & 53.1 & 33.4 \
Big & 30.13 & 15.87 & 12.85 & 10.44 & 4.61 & 93.6 & 63.7 & 52.7 & 44.0 & 23.6 \
bottomrule
end{tabular*}
endgroup
bigskip
centering
begin{tabular}{@{}*{7}{c}@{}}
multicolumn{7}{c}{Excess returns on government and corporate bonds} \[0.5ex]
toprule
1--5G & 6--10G & AAA & AA & A & BAA & LG\
midrule
0.10 & 0.13 & 0.18 & 0.23 & 0.25 & 0.28 & 0.36\
bottomrule
end{tabular}
end{frame}
end{document}
edited Dec 7 at 9:33
answered Dec 7 at 9:23
Mico
272k30369756
272k30369756
1
Very nice layout!
– samcarter
Dec 7 at 9:50
@samcarter - Many thanks for the compliment!
– Mico
Dec 7 at 10:04
I noticed that you eliminatedhyperref
- could you do the same withusepackage{graphicx}
?
– samcarter
Dec 7 at 10:05
2
This is a very nice layout indeed and I think I'll use it instead of trying to mimic the table in the picture. Thank you very much for your reply.
– Luis Martins
Dec 7 at 10:29
2
@Mico That's easy: basically all, one just has to remember the few packages which are not loaded :)
– samcarter
Dec 7 at 10:30
|
show 2 more comments
1
Very nice layout!
– samcarter
Dec 7 at 9:50
@samcarter - Many thanks for the compliment!
– Mico
Dec 7 at 10:04
I noticed that you eliminatedhyperref
- could you do the same withusepackage{graphicx}
?
– samcarter
Dec 7 at 10:05
2
This is a very nice layout indeed and I think I'll use it instead of trying to mimic the table in the picture. Thank you very much for your reply.
– Luis Martins
Dec 7 at 10:29
2
@Mico That's easy: basically all, one just has to remember the few packages which are not loaded :)
– samcarter
Dec 7 at 10:30
1
1
Very nice layout!
– samcarter
Dec 7 at 9:50
Very nice layout!
– samcarter
Dec 7 at 9:50
@samcarter - Many thanks for the compliment!
– Mico
Dec 7 at 10:04
@samcarter - Many thanks for the compliment!
– Mico
Dec 7 at 10:04
I noticed that you eliminated
hyperref
- could you do the same with usepackage{graphicx}
?– samcarter
Dec 7 at 10:05
I noticed that you eliminated
hyperref
- could you do the same with usepackage{graphicx}
?– samcarter
Dec 7 at 10:05
2
2
This is a very nice layout indeed and I think I'll use it instead of trying to mimic the table in the picture. Thank you very much for your reply.
– Luis Martins
Dec 7 at 10:29
This is a very nice layout indeed and I think I'll use it instead of trying to mimic the table in the picture. Thank you very much for your reply.
– Luis Martins
Dec 7 at 10:29
2
2
@Mico That's easy: basically all, one just has to remember the few packages which are not loaded :)
– samcarter
Dec 7 at 10:30
@Mico That's easy: basically all, one just has to remember the few packages which are not loaded :)
– samcarter
Dec 7 at 10:30
|
show 2 more comments
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f463496%2ftable-with-different-column-numbers-full-width%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
3
Why don't you do two tabulars one under the other?
– CarLaTeX
Dec 6 at 13:50
1
I agree with @CarLaTeX, make two
tabular
s. If you place them in the sametable
environment, they will share one caption etc.– samcarter
Dec 6 at 22:31
Please have a look at tex.stackexchange.com/questions/425453/… Instead of scaling your table, I suggest to use a smaller font size
– samcarter
Dec 6 at 22:33
Off-topic: You don't need
usepackage{graphicx} usepackage{hyperref}
with beamer– samcarter
Dec 6 at 22:33
Thank you very much for your replies. I used the two tabular strategy you suggested, but I still couldn't replicate the structure of the table in the first picture. The second tabular doesn't have the same width and it seems apart from the first one. Nevertheless I believe we are getting closer. Thank you. I edited my post with the solution I tried
– Luis Martins
Dec 7 at 8:27