0

This is a general question in order to know if there is a simple way to have all the \exampleblock titles being on the same height in a beamer presentation ?

For instance, for 2 different templates, I have this displayed result :

enter image description here

With the 2 example block titles in different height.

Thank you for your help.

EDIT :

The command \documentclass[t]{beamer} seems to work well. Despite the fact, that in one frame it completely shifted a figure and I don't understand the reason of such a result...

\documentclass[t]{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}{Comparaison expérimentale}
\begin{exampleblock}{$Q = 5e^{-10} m^{3} \cdot s^{-1}$ et $d = 0.8 mm$}
\begin{columns}
\begin{column}{.35\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[blue,-latex,thick] (a) -- (b); 
\end{tikzpicture}
\end{column}
\begin{column}{.65\linewidth}
\begin{figure}
\subfloat{{\includegraphics[height= 0.65 \textheight,width=\linewidth]{example-image} }}%
\end{figure}
\end{column}
\end{columns}
\end{exampleblock}
\end{frame}

\end{document}

enter image description here

1 Answer 1

0

If your example blocks are the first element on the page, you can get them all at the same height by using top aligned frames:

\documentclass[t]{beamer}

(However I would not use example blocks for your "subtitles". You don't use any background colours for your blocks, so they aren't visible but make proper spacing much more difficult, e.g. they make the available text area narrower and then you use your \WWider hacks, which in turn hide your \items from the itemize environment and throw an error .... just a big rabbit hole)

\documentclass[t]{beamer}

\usepackage{tikz}

\begin{document}

\begin{frame}
  \frametitle{Comparaison expérimentale}
  \structure{$Q = 5e^{-10} m^{3} \cdot s^{-1}$ et $d = 0.8 mm$}
  \begin{columns}[T,onlytextwidth]
    \begin{column}{.35\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[blue,-latex,thick] (a) -- (b); 
      \end{tikzpicture}
    \end{column}
    \begin{column}{.6\linewidth}
      \includegraphics[height=0.65\textheight,width=\linewidth]{example-image-duck}
    \end{column}
  \end{columns}
\end{frame}

\end{document}

enter image description here

5
  • Thanks for the information : what would you suggest to use for implementing subtitles like these in general frames ?
    – Wiss
    Sep 23 at 9:32
  • Something like \structure{here goes your subtitle} or define a custom command. Sep 23 at 9:35
  • The command \documentclass[t]{beamer} seems to work very fine except for one slide where it shifted a figure downside for no reason... Could you please have a look to my edited post ? Thank you again for your helpful answers
    – Wiss
    Sep 23 at 9:41
  • @Wiss Your code is not compilable. We don't have your images. Please start using example-image or similar, which are includes in tex distributions for this purpose. You'll probably want to Top align your columns Sep 23 at 9:44
  • Sorry for this miss : I have modified it
    – Wiss
    Sep 23 at 9:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.