两个盒子用 \columns 排列

两个盒子用 \columns 排列

我想显示 2 个框:一个在另一个旁边,在模板上的图形旁边。我使用环境,\column因为它似乎最合适。对于框的创建,我使用\tikzmarkin。我还想显示一个从上框指向下框的箭头。

我的编码给出了这样的结果:

在此处输入图片描述

这不是我想要的,因为两个框的尺寸不一样,并且框之间没有垂直间距。另外,我尝试\draw在两者之间添加一个箭头\tikzmarkin,但也没有用...

\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,
}

%%%%%% 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}{Les précèdents travaux}
\begin{columns}
\begin{column}{.5\linewidth}
$\displaystyle\tikzmarkin<1->[set fill color=white, set border color=blue!50!black]{a}
\text{Plusieurs décades observées}
\tikzmarkend{a}
$
$\displaystyle\tikzmarkin<1->[set fill color=white, set border color=blue!50!black]{b}
\text{Confirmation de la loi d'échelle}
\tikzmarkend{b}
$  
\end{column}
\begin{column}{.5\linewidth}
\begin{figure}
\phantomsubcaption
\subfloat{{\includegraphics[height= 0.55 \textheight,width=\linewidth]{example-image} }}%
\end{figure}
\end{column}
\end{columns}
\end{frame}

\end{document}

请问最有效的方法是什么?谢谢。

编辑 :

为什么这种替代方法\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}

%\usepackage{YTU}

%%%%%% 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}{Les précèdents travaux}
\begin{columns}
\begin{column}{.5\linewidth}
  \tcbhighmath[
         tcbox raise=0mm,
         remember as=a,
         colback=blue!10,
         colframe=blue
       ]{
    \text{Plusieurs décades observées}
    }
  \tcbhighmath[
         tcbox raise=0mm,
         remember as=b,
         colback=blue!10,
         colframe=blue,
         overlay={
          \draw[blue,-latex,thick] (a.south) -- (frame.north);
        }
       ]{
    \text{Confirmation de la loi d'échelle}
    }
\end{column}
\begin{column}{.5\linewidth}
\begin{figure}
\phantomsubcaption
\subfloat{{\includegraphics[height= 0.55 \textheight,width=\linewidth]{pic/ComparaisonBerhanu.eps} }}%
\end{figure}
\end{column}
\end{columns}
\end{frame}

\end{document}

再次感谢你

答案1

这里有一个版本tikz

\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,
}

%%%%%% 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,
}}


\usepackage{tikz}

\begin{document}


\begin{frame}{Les précèdents travaux}
\begin{columns}
\begin{column}{.5\linewidth}
\begin{tikzpicture}
\node[draw=blue,text width=.95\linewidth,align=center] (a) at (0,0) {Plusieurs décades observées};
\node[draw=blue,text width=.95\linewidth,align=center] (b) at (0,-3) {Confirmation de la loi d'échelle};
\draw[->] (a) -- (b); 
\end{tikzpicture}
\end{column}
\begin{column}{.5\linewidth}
\begin{figure}
\subfloat{{\includegraphics[height= 0.55 \textheight,width=\linewidth]{example-image} }}%
\end{figure}
\end{column}
\end{columns}
\end{frame}

\end{document}

在此处输入图片描述

相关内容