放大并突出显示表格的某些部分

放大并突出显示表格的某些部分

我想将回归结果添加到 beamer 演示文稿中,因为它是一个向量自回归模型,有很多系数。因此,我想显示整个表格,以便了解分析中使用的维度和滞后,但我想仅突出显示表格的某些部分,即某些系数。

可以使用framezoom,但这确实有缺点,它不仅放大框,还显示了幻灯片上的所有内容,这又使生成的高亮幻灯片变得混乱。我可以通过始终以与演示文稿相同的纵横比创建缩放区域来解决这个问题,但这并不令人满意。请参阅beamer framezoom:限制缩放帧到边框有关该问题的描述。

因此,我想知道是否有另一个像 tikz 和 spy 一样灵活的工具来突出显示表格的某个部分而不是图片的某个部分。 放大并突出显示图片的一部分

MWE 显示了 framezoom 的用法,应该用 tikz 替换。

% !TeX spellcheck = en_US
\documentclass[13pt
    ,aspectratio=43
%,handout
]{beamer}


\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amsfonts,amssymb}

\usepackage{gensymb}
\usepackage{color}
\usepackage{lmodern}
%\renewcommand{\rmdefault}{lmss}
\usepackage{hyperref}

%Remove indentation in footnotes
%\usepackage[hang,flushmargin]{footmisc} 
%Table Packages
\usepackage{tabularx}
\usepackage{longtable,booktabs,tabu}
\usepackage{makecell}
\usepackage[detect-all]{siunitx}
\sisetup{input-symbols = ()} % "(" and ")" are ordinary inputs
\usepackage{setspace}


\def\V#1,#2/#3/{\Entry[#3]{#1}{#2}}
\usepackage{siunitx} %align numbers by decimal point

\usepackage{csquotes}
% Options for captions
\usepackage[hypcap,format = plain, justification=raggedright, singlelinecheck=off]{caption}
\captionsetup[table]{belowskip=0em,aboveskip=2pt}
\captionsetup[figure]{belowskip=0em,aboveskip=2pt}


\usepackage{textcomp,ragged2e}
\usepackage{appendixnumberbeamer}

%Turn on and of the display of the notes by commenting out the following line
%\setbeameroption{show notes}
\setbeamertemplate{note page}[plain]

\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{positioning} 




% % % Theme
%\usetheme{Frankfurt}
\usetheme[titleformat = regular
        , sectionpage = progressbar
        , subsectionpage = none
        , numbering = counter %none,counter, fraction
        , progressbar = foot % none, head, frametitle, foot
        ]{metropolis}


\usepackage{standalone}
\usepackage{tikz}



% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % 

\begin{document}

\setstretch{1,5}

\begin{frame}[shrink = 0.2]
\frametitle{Distribution of Leverage prior to Price Decline in 2008 and 2014}

\framezoom<1><2>[border](2.5cm,1.5cm)(3cm,2cm)
\begin{table}[htb]
   \footnotesize
\begin{center}
\begin{tabularx}{\textwidth}{>{\centering}p{0.19\textwidth}
                                >{\centering}p{0.01em}
                                >{\centering}X
                                S[table-format=6.0
                                ,round-mode=places
                                ,round-precision=0
                                ,table-align-text-post = false
                                ]
                                S[table-format=6.0
                                ,round-mode=places
                                ,round-precision=0
                                ,table-align-text-post = false
                                ]
                                >{\centering}p{0.01em}
                                >{\centering}X
                                S[table-format=6.0
                                ,round-mode=places
                                ,round-precision=0
                                ,table-align-text-post = false
                                ]
                                S[table-format=6.0
                                ,round-mode=places
                                ,round-precision=0
                                ,table-align-text-post = false
                                ]
                                  }
    \toprule
    Leverage Percentile &  & \multicolumn{4}{c}{2008~Q2}  &  \multicolumn{3}{c}{2014~Q3}  \tabularnewline
    \cmidrule{3-5} \cmidrule{7-9}
                        &  & No.  & {Assets} & {Debt} & & No.  & {Assets} & {Debt}\tabularnewline
\cmidrule{1-1}      \cmidrule{3-5}  \cmidrule{7-9}
$1^{st} Quartile$   &  & 33 & 3094.25 & 493.08 & & 33 & 5871.65  & 948.29  \tabularnewline  %   $0    < P_{0.25} \leq 0.25$ 
$2^{nd} Quartile$   &  & 36 & 11868.81 & 2494.08 & & 36 & 12894.65 & 2749.38 \tabularnewline        % $0.25 < P_{0.50} \leq 0.50$   
$3^{rd} Quartile$   &  & 35 & 5018.03 & 1380.06 & & 36 & 4279.47 & 1328.07  \tabularnewline         % $0.50 < P_{0.75} \leq 0.75$ 
$4^{th} Quartile$       &  & 35 & 2844.71 & 1208.22 & & 36 & 2001.95 & 884.75 \tabularnewline   % $0.75 < P_{1} \leq 1$ 
Non-calculable Leverage &  & 5  & 1172.49 & 338.66 & &  7 & 1304.48  & 390.58 \tabularnewline
\bottomrule
\end{tabularx}
  \captionof{table}{Comparison of the number of companies for each leverage group prior to price declines in 2008~Q2 and 2014~Q3 and their average value of total assets and debt in million US-Dollar.}\label{t.Leverage.Groups}
\end{center}
\end{table}


\end{frame}


\end{document}

答案1

原理证明:使用 tikz 间谍库和@marmots 不错的答案https://tex.stackexchange.com/a/438238/36296

% !TeX spellcheck = en_US
\documentclass[13pt
   ,aspectratio=43
%,handout
]{beamer}


\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amsfonts,amssymb}

\usepackage{gensymb}
%\usepackage{color}
\usepackage{lmodern}
%\renewcommand{\rmdefault}{lmss}
%\usepackage{hyperref}

%Remove indentation in footnotes
%\usepackage[hang,flushmargin]{footmisc} 
%Table Packages
\usepackage{tabularx}
\usepackage{longtable,booktabs,tabu}
\usepackage{makecell}
\usepackage[detect-all]{siunitx}
\sisetup{input-symbols = ()} % "(" and ")" are ordinary inputs
\usepackage{setspace}


\def\V#1,#2/#3/{\Entry[#3]{#1}{#2}}
\usepackage{siunitx} %align numbers by decimal point

\usepackage{csquotes}
% Options for captions
\usepackage[hypcap,format = plain, justification=raggedright, singlelinecheck=off]{caption}
\captionsetup[table]{belowskip=0em,aboveskip=2pt}
\captionsetup[figure]{belowskip=0em,aboveskip=2pt}


\usepackage{textcomp,ragged2e}
\usepackage{appendixnumberbeamer}

%Turn on and of the display of the notes by commenting out the following line
%\setbeameroption{show notes}
\setbeamertemplate{note page}[plain]

\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{positioning} 
\usetikzlibrary{tikzmark}
\usetikzlibrary{spy}



% % % Theme
%\usetheme{Frankfurt}
\usetheme[sectionpage = progressbar
       , subsectionpage = none
       , progressbar = foot % none, head, frametitle, foot
       ]{moloch}% modern fork of the metropolis theme

\usetikzlibrary{matrix}
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % 


\tikzset{
   invisible/.style={opacity=0,text opacity=0},
   visible on/.style={alt={#1{}{invisible}}},
   connect on/.style={alt={#1{connect spies}{}}},
   alt/.code args={<#1>#2#3}{%
     \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}} 
   },
}

\begin{document}

\begin{frame}
\frametitle{Distribution of Leverage prior to Price Decline in 2008 and 2014}

\begin{table}
       \footnotesize
\begin{tikzpicture}[spy using outlines={rectangle, magnification=3, width=\textwidth, height=.8\textheight,
every spy in node/.style={fill=bg}
}
]
   \matrix[ampersand replacement=\&] {
       \node (species1) {
\begin{tabularx}{\textwidth}{>{\centering}p{0.19\textwidth}
                               >{\centering}p{0.01em}
                               >{\centering}X
                               S[table-format=6.0
                               ,round-mode=places
                               ,round-precision=0
                               ,table-align-text-post = false
                               ]
                               S[table-format=6.0
                               ,round-mode=places
                               ,round-precision=0
                               ,table-align-text-post = false
                               ]
                               >{\centering}p{0.01em}
                               >{\centering}X
                               S[table-format=6.0
                               ,round-mode=places
                               ,round-precision=0
                               ,table-align-text-post = false
                               ]
                               S[table-format=6.0
                               ,round-mode=places
                               ,round-precision=0
                               ,table-align-text-post = false
                               ]
                                 }
   \toprule
   Leverage Percentile &  & \multicolumn{4}{c}{2008~Q2}  &  \multicolumn{3}{c}{2014~Q3}  \tabularnewline
   \cmidrule{3-5} \cmidrule{7-9}
                       &  & No.  & {Assets} & {Debt} & & No.  & {Assets} & {Debt}\tabularnewline
\cmidrule{1-1}      \cmidrule{3-5}  \cmidrule{7-9}
$1^{st} Quartile$   &  & 33 & 3094.25 & 493.08 & & 33 & 5871.65  & 948.29  \tabularnewline  %   $0    < P_{0.25} \leq 0.25$ 
$2^{nd} Quartile$   &  & 36 & 11868.81 & 2494.08 & & 36 & 12894.65 & 2749.38 \tabularnewline        % $0.25 < P_{0.50} \leq 0.50$   
$3^{rd} Quartile$   &  & 35 & 5018.03 & 1380.06 & & 36 & 4279.47 & 1328.07  \tabularnewline         % $0.50 < P_{0.75} \leq 0.75$ 
$4^{th} Quartile$       &  & 35 & 2844.71 & 1208.22 & & 36 & 2001.95 & 884.75 \tabularnewline   % $0.75 < P_{1} \leq 1$ 
Non-calculable Leverage &  & 5  & 1172.49 & 338.66 & &  7 & 1304.48  & 390.58 \tabularnewline
\bottomrule
\end{tabularx}
       };\\
\node[text width=\textwidth] (species2) {\addtocounter{table}{1}\textbf{Table \thetable:} Comparison of the number of companies for each leverage group prior to price declines in 2008~Q2 and 2014~Q3 and their average value of total assets and debt in million US-Dollar.};\\
};
\spy on (-0.5,0.4) in node[visible on=<2->] at (0,0);
\end{tikzpicture}
\end{table}

\end{frame}

\end{document}

在此处输入图片描述


有关您的代码的一些其他评论:

  • 你不需要

      \usepackage{color}
      \usepackage{hyperref}
    

    带投影机

  • 请不要多次加载同一个包,特别是不要使用不同的选项,siunitx例如tikz

  • 您的意思\setstretch{1.5}是代替吗1,5

  • 使用\begin{frame}[shrink = 0.2]通常不是一个好主意,它会浪费右侧网站的空间。最好使用合适的字体大小

  • 使用浮点说明符(例如 \begin{table}[htb]在没有浮点数的文档类中)是没有意义的

  • 不要\begin{center}...\end{center}在表格环境中使用,这将增加额外的垂直空间,而且没有必要,因为在 beamer 中表格默认居中

  • 为什么\captionof{table}{...}如果你在表格环境中?只需使用\caption{...}

相关内容