用投影仪连接盒子

用投影仪连接盒子

我正在尝试使用 beamer 重现我的一个 PowerPoint 模板。

我想将方程式中的每个彩色框与另一个颜色相似的框链接起来。此外,我还尝试调整方程式后面的框的位置,使其与边距对齐。(就像在 PowerPoint 中一样)。

我之所以使用是tabular因为我想让每个小框都带有一种标题。我知道这tikz对于框定方程式来说是强烈推荐的,但如果可以在这种情况下使用它,我会很想知道。

PS:有什么方法可以让方框的边框变薄吗?因为它会干扰主方程的括号……

感谢您的热心帮助,

\documentclass[french]{beamer}

%%%%%% ENCODAGE %%%%%%%%%%%
\usepackage[utf8]{inputenc}

%%%%%% TIKZ %%%%%%%%%%%%%%%
\usepackage[beamer,customcolors,norndcorners]{hf-tikz}

%%%%%% OTHERS %%%%%%%%%%%%%
\usepackage{booktabs,calligra}
\usepackage{listings,stackengine}



\author{XXX}
\title{XXX}
\subtitle{XXX}
\institute [XXX] {XXX \\ XXX}
\date{\today}

%%%%%% DEFINITIONS %%%%%%%%%
\def\cmd#1{\texttt{\color{red}\footnotesize $\backslash$#1}}
\def\env#1{\texttt{\color{blue}\footnotesize #1}}
\definecolor{deepblue}{rgb}{0,0,0.5}
\definecolor{deepred}{rgb}{0.6,0,0}
\definecolor{deepgreen}{rgb}{0,0.5,0}
\definecolor{halfgray}{gray}{0.55}

\lstset{
    basicstyle=\ttfamily\small,
    keywordstyle=\bfseries\color{deepblue},
    emphstyle=\ttfamily\color{deepred},    % Custom highlighting style
    stringstyle=\color{deepgreen},
    numbers=left,
    numberstyle=\small\color{halfgray},
    rulesepcolor=\color{red!20!green!20!blue!20},
    frame=shadowbox,
}

%%%%%% VIDEO %%%%%%%%%%%%%%
\usepackage{multimedia}

%%%%%% BOX %%%%%%%%%%%%%%%%
\usepackage{fancybox}
\usepackage{varwidth}
\usepackage{subcaption}

\hfsetbordercolor{blue!50!black}

%%%%%% PGFPLOTS %%%%%%%%%%%%
\usepackage[export]{adjustbox}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}

\definecolor{mygreen}{RGB}{28,172,0} % color values Red, Green, Blue
\definecolor{mylilas}{RGB}{170,55,241}
\definecolor{BgYellow}{HTML}{FFF59C}
\definecolor{FrameYellow}{HTML}{F7A600}
\usepackage{pgf, tikz, adjustbox}
\usetikzlibrary{spy}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{patterns, matrix, positioning}
\usetikzlibrary{arrows.meta,
                patterns.meta
                }



\begin{document}



\begin{frame}{Equation des films minces générale}
        \begin{exampleblock}{Cas cylindrique} 
        \begin{equation*}
\frac{\partial h}{\partial t} = \frac{1}{12 \mu r}  \frac{\partial}{\partial r}  \left(r h^{3} \left(\tikzmarkin<1->[set fill color=red!20, set border color=red]{a1}(0.075,-0.4)(-0.045,0.65) \rho g \frac{\partial h}{\partial r} \tikzmarkend{a1}+ \tikzmarkin<1->[set fill color=blue!20, set border color=blue]{e}(0.05,-0.4)(-0.045,0.65) D \frac{\partial}{\partial r}(\Delta^2_r h)  \tikzmarkend{e}  \right) \right)
        \end{equation*}

     \begin{tabular}{ccc}
    Pesanteur &  & Elastique \\
    \fcolorbox{red}{white}{$
    \begin{aligned}
    R \propto t^{\frac{1}{2}}
    \end{aligned}
    $} &
    \fcolorbox{black}{white}{$
    \begin{aligned}
    \lambda_{E-G} = \left(\frac{Ed^3}{12 \rho g (1 - \nu)}  \right)^{\frac{1}{4}}
    \end{aligned}
    $} &
  \fcolorbox{blue}{white}{$
  \begin{aligned}
  R \propto t^{\frac{1}{3}}
  \end{aligned}
  $} \\
\end{tabular}
    \end{exampleblock}
    \end{frame}

\end{document} 

我有这个 :

在此处输入图片描述

我正在尝试重现这一点:

在此处输入图片描述

答案1

这里有一个可能的使用方法tcolorbox

\documentclass[french]{beamer}

%%%%%% ENCODAGE %%%%%%%%%%%
\usepackage[utf8]{inputenc}

%%%%%% TIKZ %%%%%%%%%%%%%%%
\usepackage[beamer,customcolors,norndcorners]{hf-tikz}

%%%%%% OTHERS %%%%%%%%%%%%%
\usepackage{booktabs,calligra}
\usepackage{listings,stackengine}



\author{XXX}
\title{XXX}
\subtitle{XXX}
\institute [XXX] {XXX \\ XXX}
\date{\today}

%%%%%% DEFINITIONS %%%%%%%%%
\def\cmd#1{\texttt{\color{red}\footnotesize $\backslash$#1}}
\def\env#1{\texttt{\color{blue}\footnotesize #1}}
\definecolor{deepblue}{rgb}{0,0,0.5}
\definecolor{deepred}{rgb}{0.6,0,0}
\definecolor{deepgreen}{rgb}{0,0.5,0}
\definecolor{halfgray}{gray}{0.55}

\lstset{
    basicstyle=\ttfamily\small,
    keywordstyle=\bfseries\color{deepblue},
    emphstyle=\ttfamily\color{deepred},    % Custom highlighting style
    stringstyle=\color{deepgreen},
    numbers=left,
    numberstyle=\small\color{halfgray},
    rulesepcolor=\color{red!20!green!20!blue!20},
    frame=shadowbox,
}

%%%%%% VIDEO %%%%%%%%%%%%%%
\usepackage{multimedia}

%%%%%% BOX %%%%%%%%%%%%%%%%
\usepackage{fancybox}
\usepackage{varwidth}
\usepackage{subcaption}

\hfsetbordercolor{blue!50!black}

%%%%%% PGFPLOTS %%%%%%%%%%%%
\usepackage[export]{adjustbox}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}

\definecolor{mygreen}{RGB}{28,172,0} % color values Red, Green, Blue
\definecolor{mylilas}{RGB}{170,55,241}
\definecolor{BgYellow}{HTML}{FFF59C}
\definecolor{FrameYellow}{HTML}{F7A600}
\usepackage{pgf, tikz, adjustbox}
\usetikzlibrary{spy}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{patterns, matrix, positioning}
\usetikzlibrary{arrows.meta,
                patterns.meta
                }


\usepackage[most]{tcolorbox}
\tcbset{highlight math style={enhanced,colframe=red,colback=red!10!white,boxsep=0pt,sharp corners,
equal height group=C,
minimum for equal height group=C:1.5cm,
valign=center,
}}


\begin{document}



\begin{frame}{Equation des films minces générale}
        \begin{exampleblock}{Cas cylindrique} 
        \begin{equation*}
          \frac{\partial h}{\partial t} = \frac{1}{12 \mu r}  \frac{\partial}{\partial r}  \left(r h^{3} \left(
          %
          \tcbhighmath[remember as=a,tcbox raise=-7mm]{
            \rho g \frac{\partial h}{\partial r}
          }
          + 
          \tcbhighmath[remember as=b,colback=blue!10,colframe=blue,tcbox raise=-7mm]{
           D \frac{\partial}{\partial r}(\Delta^2_r h) 
          } 
          \right) \right)
        \end{equation*}
        
        \vskip1.5cm

\begin{equation*}
    \tcbhighmath[
     tcbox raise=0mm,
      remember as=c,
      overlay={
        \node[anchor=north] at (frame.south) {Pesanteur};
        \draw[red,-latex,thick] (a.south) -- (frame.north);
      }
    ]{  
      \displaystyle R \propto t^{\frac{1}{2}} 
    } \qquad
   \tcbhighmath[
       tcbox raise=0mm,
       remember as=d,
       colback=black!10,
       colframe=black,
       overlay={
        \draw[black,-latex,thick] (c.east) -- (frame.west);
      }
     ]{  
    \lambda_{E-G} = \left(\frac{Ed^3}{12 \rho g (1 - \nu)}  \right)^{\frac{1}{4}}
    } \qquad
  \tcbhighmath[
         tcbox raise=0mm,
         remember as=e,
         colback=blue!10,
         colframe=blue,
         overlay={
          \draw[blue,latex-,thick] (d.east) -- (frame.west);
          \draw[blue,-latex,thick] (b.south) -- (frame.north);
          \node[anchor=north] at (frame.south) {Elastique};
        }
       ]{
    R \propto t^{\frac{1}{3}}
    }
    \end{equation*}
    \end{exampleblock}
    \end{frame}

\end{document} 

在此处输入图片描述

相关内容