2

I have tried to include a pdf document and I would like to add bubbles / comments frame in the middle here is a part of my code( since the project is too long) (am using beamer): Basically It works fine but not when I want to see them I would like to put them in the middle of each pdf I joined a figure so that it would be easy to see the problem. figure edited link for the whole project

\PassOptionsToPackage{many}{tcolorbox}
\documentclass{bredelebeamer}
\setbeamertemplate{caption}[numbered]{}
 \usepackage[absolute,overlay]{textpos}
  %%%%%%%%%%%%%%%%
  \usepackage{array,colortbl,xcolor}
  \usepackage{array}
  \usepackage{booktabs}
  %\setbeamertemplate{caption}[numbered]
  \numberwithin{figure}{section}
  \usepackage[export]{adjustbox}
  \setbeamercovered{dynamic}
  \usepackage{pgfplots}
  \usetikzlibrary{positioning}
  \usetikzlibrary{fit}
  \usetikzlibrary{backgrounds}
  \usetikzlibrary{calc}
  \usetikzlibrary{shapes}
  \usetikzlibrary{mindmap}
  \usetikzlibrary{decorations.text}
  % tikzmark command, for shading over items
  %\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}


  \usepackage{lmodern}

  \usepackage{tikz}
   \usetikzlibrary{shapes.callouts}

  \usepackage{xparse}

   \tikzset{
   invisible/.style={opacity=0,text opacity=0},
    visible on/.style={alt=#1{}{invisible}},
    alt/.code args={<#1>#2#3}{%
     \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}} % \pgfkeysalso doesn't 
    change the path
      },
    }

   \NewDocumentCommand{\mycallout}{r<> O{opacity=0.8,text opacity=1} m m}{%
   \tikz[remember picture, overlay]\node[align=center, fill=cyan!20, text 
    width=2cm,
    #2,visible on=<#1>, rounded corners,
    draw,rectangle callout,anchor=pointer,callout relative pointer=
    {(230:1cm)}]
    at (#3) {#4};
    }

    \newcommand{\tikzmark}[1]{\tikz[overlay,remember 
    picture,baseline=-0.5ex] \node (#1) {};}
     % standard enumeration
    \setbeamertemplate{enumerate items}{(\arabic{enumi})}

    % default itemize
    \setbeamertemplate{itemize items}[circle]

     % transparency
     \setbeamercovered{transparent=15}

      % for resuming lists across frames
      \newcounter{savedenum}
      \newcommand*{\saveenum}{\setcounter{savedenum}{\theenumi}}
       \newcommand*{\resume}{\setcounter{enumi}{\thesavedenum}}

     \tikzset{
     invisible/.style={opacity=0},
      visible on/.style={alt=#1{}{invisible}},
     alt/.code args={<#1>#2#3}{%
     \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}} % \pgfkeysalso doesn't 
     change the path
     },
     }
     \title[]{efijrj iejijdfikj ldlckd,dkf}
     % Titre du diaporama

     \subtitle{}
     % Sous-titre optionnel

     \author{Majikdid Mkks}
     % La commande \inst{...} Permet d'afficher l' affiliation de 
      l'intervenant.
     % Si il y a plusieurs intervenants: Marcel Dupont\inst{1}, Roger 
     Durand\inst{2}
    % Il suffit alors d'ajouter un autre institut sur le modèle ci-dessous.

    \institute[]
     {
     MASTER RECHERCHE\\
     Gestion \\

     }

    \date{\today}
    %\date{18 Brumaire 2015}
    % Optionnel. La date, généralement celle du jour de la conférence

   \subject{Sujet de votre diaporama}
    % C'est utilisé dans les métadonnes du PDF

   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   \begin{document}
   \section{IAL \& feature ordering}
   \begin{frame}{Danhjhuiiu hhyhuui yhgyygtyt (1/2)}
   \includegraphics[page=1,height=0.80\textheight,scale=0.90]
   {images/file.pdf} \tikzmark{mf1}
   \mycallout<1>[opacity=1,yshift=1cm]{mf1}{gvhh hhj: 2.929}
    \includegraphics[page=1,height=0.90\textheight,scale=0.90]
    {images/file1.pdf}\tikzmark{mf2}
    \mycallout<1>[opacity=1]{mf2}{ddfb jjhg: 5}
    \end{frame}

    \begin{frame}{Danhjhuiiu hhyhuui yhgyygtyt(2/2)}
    \includegraphics[page=1,height=0.90\textheight,scale=0.90]
    {images/file3.pdf}\tikzmark{mf1}
    \mycallout<1>[opacity=1]{mf1}{tftgt jjjb: 0.31}
    \includegraphics[page=1,height=0.90\textheight,scale=0.90]
     {images/file2.pdf}\tikzmark{mf2}
     \mycallout<1>[opacity=1]{mf2} {fgh nhhjj: 1.457}
    \end{frame}


   \end{document}
  • Please don't just post code fragments but compilable MWE! – user36296 Jul 4 '17 at 14:54
6

If you include the image inside a TikZ node you could use it as reference (with remember picture and overlay options) for the callouts nodes.

\documentclass{beamer} 
\usepackage{tikz}
\usetikzlibrary{shapes.callouts, calc}

\begin{document}
\begin{frame}
\centering
\begin{tikzpicture}[remember picture, overlay]
\node (a) {\includegraphics[width=.75\linewidth]{example-image-a}};
\node<2->[ellipse callout, draw=blue, fill=blue!30] at ($(a.center)!.5!(a.north east)$) (b)  {Hello!};
\end{tikzpicture}
\end{frame}
\end{document}

enter image description here

Update: Answer to mirette comment.

Your code is correct and the result is the expected one. tikzmark creates a reference to its position which in your case is after the includegraphics command and mycallout is placed according this reference which is, in this case, below the lower left corner of the included figure.

The proposed solution replaces tikzmark by a node which encompasses the whole page, then you can use any position on the page to place the callout.

As mycallout command is already defined inside a tikzpicture environment it's better to use it outside the tikzpicture defined for included pages.

Following code shows an example with two figures on one frame. Both figures has been distributed using beamer columns environment.

\documentclass{beamer} 
\usepackage{tikz}
\usetikzlibrary{shapes.callouts, calc}
\usepackage[most]{tcolorbox}

\tikzset{
   invisible/.style={opacity=0,text opacity=0},
    visible on/.style={alt=#1{}{invisible}},
    alt/.code args={<#1>#2#3}{%
     \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}} % \pgfkeysalso doesn't 
    change the path
      },
    }

\NewDocumentCommand{\mycallout}{r<> O{opacity=0.8,text opacity=1} m m}{%
   \tikz[remember picture, overlay]\node[align=center, fill=cyan!20, text 
    width=2cm,
    #2,visible on=<#1>, rounded corners,
    draw,rectangle callout,anchor=pointer,callout relative pointer=
    {(230:1cm)}]
    at (#3) {#4};
    }

\begin{document}
\begin{frame}{Test callouts}

\begin{columns}[onlytextwidth]
\column{.5\linewidth}
\centering
\begin{tikzpicture}[remember picture, overlay]
\node (a) {\includegraphics[width=.85\linewidth, height=.7\textheight]{example-image-a}};
\end{tikzpicture}
\mycallout<1>[opacity=1,yshift=1cm]{a}{gvhh hhj: 2.929}
\column{.5\linewidth}
\centering
\begin{tikzpicture}[remember picture, overlay]
\node (b) {\includegraphics[width=.85\linewidth, height=.7\textheight]{example-image-b}};
\end{tikzpicture}
\mycallout<1>[opacity=1,yshift=1cm]{[shift={(-1cm,-2cm)}]b.center}{gvhh hhj: 2.929}
\end{columns}
\end{frame}
\end{document}

enter image description here

  • 1
    @tex.stackexchange.com/users/1952/ignasi, the code works well but when s I want to make two figure (or pdf) on one page like in the question I could not , I have added my code (see please the question part, and the link to my project please can you tell me how just to put the bubbles on the middle – mirette Jul 5 '17 at 11:28
  • 2
    @mirette I've updated the answer trying to solve your new question. – Ignasi Jul 5 '17 at 12:29
  • 1
    Thank you @Ignasi :) I am definetly gratefull :) I am gonna try the latest code thank you ^^ :) – mirette Jul 5 '17 at 13:13

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.