I am wondering how to delete the empty space on the right side of the last column. Also, is there any way to align Panel A and B in beamer?
%\documentclass[handout,table,slidestop,compress,mathserif, 10pt]{beamer}
\documentclass[table,slidestop,compress,mathserif, 10pt]{beamer}
\usepackage{array}
\usepackage{verbatim}
\usepackage{subfigure}
\usepackage{amsmath}
\usepackage{tabularx}
\usepackage{booktabs,dcolumn}
\usetheme{Frankfurt}
%\usetheme{CambridgeUS}
\usecolortheme{seahorse}
\setbeamersize{text margin left=10mm, text margin right=7mm}
\usepackage{pstricks}
\usepackage{colortab}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{bbm}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\newcommand{\sumframe}[2]{\psframebox*[fillcolor=sumcolor,border=.5pt,bordercolor=black,shadow=true,shadowcolor=gray]{%
\parbox[c]{#1}{#2}}}%
\usepackage{xcolor}
\usepackage[orientation=landscape,size=custom,width=16,height=9,scale=0.5,debug]{beamerposter}
\newcommand{\indicator}[1]{\mathbbm{1}_{\left[ {#1} \right] }}
\usepackage{scalerel,stackengine}
\stackMath
\newcommand\reallywidehat[1]{%
\savestack{\tmpbox}{\stretchto{%
\scaleto{%
\scalerel*[\widthof{\ensuremath{#1}}]{\kern-.6pt\bigwedge\kern-.6pt}%
{\rule[-\textheight/2]{1ex}{\textheight}}%WIDTH-LIMITED BIG WEDGE
}{\textheight}%
}{0.5ex}}%
\stackon[1pt]{#1}{\tmpbox}%
}
\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}
\definecolor{dgreen}{rgb}{0.,0.6,0.}
\definecolor{dblue}{rgb}{0.,0.,0.6}
\definecolor{dred}{rgb}{0.6,0.,0.}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title[Title]
{
{\fontsize{16}{16}\selectfont Title} \\
}
\author[Name]
{%
\texorpdfstring{
\centering
Name\\
}
{Name}
}
\date[September 7, 2017]
{September 7, 2017}
% The main document
\begin{document}
\begin{frame}
\maketitle
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setcounter{subsection}{6}
\begin{frame}[label=Survivorship_Result2b]{Subsample test}
\vspace{-.53cm}
\begin{table}[htb]
\footnotesize
\begin{tabularx}{\linewidth}{l*{5}{Y}}
\toprule
\multicolumn{5}{l}{\textbf{Panel A: Group A}} \\
\midrule
& \textbf{(1)} & \textbf{(2)} & \textbf{(3)}& \textbf{(4)} & \textbf{(5)} \\\hline
\tikzmark{newcolr}{\textbf{A $\cdot$ B} &\ 0.006& 0.006 &0.006&0.006&0.005 \\
&\ [4.05]&[2.58]&[3.29]&[3.06]&[4.06]}\\
\textbf{A} &-0.004& -0.003 & -0.003&-0.003 &-0.003 \\
&[-6.81]&[-3.49] &[-4.10] &[-3.05]&[-3.35]\\
\textbf{B} & &&-0.002&-0.002 \\
&&& [-1.60]& [-1.55] \\\hline
\end{tabularx}
\begin{tabularx}{\linewidth}{l*{5}{Y}}
\toprule
\multicolumn{5}{l}{\textbf{Panel B: Group X}} \\
\midrule
& \textbf{(1)} & \textbf{(2)} & \textbf{(3)}& \textbf{(4)} & \textbf{(5)} \\\hline
\tikzmark{colorsa}{\textbf{X $\cdot$ Y} &\ 0.003& 0.002 &0.002&0.002&0.002 \\
&\ [1.44]&[1.28]&[1.40]&[1.32]&[1.24]}\\
\textbf{X} &-0.001& 0.000 & 0.000&0.000 &-0.001 \\
&[-1.67]&[0.04] &[0.04] &[0.04]&[-1.08]\\
\textbf{Y} & &&-0.001&-0.001 \\
&&& [-1.06]& [-1.00]\\
\textbf{Controls}& No& Yes & Yes & Yes & Yes \\
\textbf{Group FEs}& Yes& Yes & No & No & Yes \\
\textbf{Family FEs}& No& No & Yes & Yes & No \\
\textbf{Individual FEs}& No& No & No & Yes & No \\
\textbf{Family-Individual Clustering}& Yes& Yes & Yes & Yes& Yes \\
\textbf{Observations}&8,895&7,654&7,654& 7,654&4,538 \\
\textbf{R-squared} &0.48&0.53&0.40&0.41 &0.54 \\\hline
\bottomrule
\end{tabularx}
\end{table}
\tikz[overlay,remember picture]{\draw[draw=red,thick,single,fill opacity=0.2] ($(colorsa)+(-0.19,0.28)$) rectangle ($(colorsa)+(11.9,-0.55)$);}
\tikz[overlay,remember picture]{\draw[draw=blue,thick,single,fill opacity=0.2] ($(newcolr)+(-0.19,0.28)$) rectangle ($(newcolr)+(11.9,-0.55)$);}
\end{frame}
\end{document}
Best Answer
I would redesign your table as follows:
booktabs
\tikzmark
stuff (seems to be wrongly used)\rowcolor
colorab
,xcolor
; both are loaded bybeamer
using optiontable
...)Y
withS
defined in packagesiunitx
this effort resulted with:
After that result in case that the rectangles around now colored rows are required for some reason, i would investigate how to properly use
tikzmark
for drawing them.I guess that frames around rows should be as show next image. for it some changes to above mwe are done. indicated are with
% <---
:To obtain above image of table the mwe had to be compiled at least twice.