I am trying to annotate a single entry in a table on a slide. My problem is that the word "tag" appears at a correct y location, but its x location is dead center of the slide. I tried xshift = ??? lots of values, but it simply wouldn't budge. I adapted the code for arrow from an answer by @Gonzalo Medina, but I have clearly made some fundamental errors in the integration, due to which I don't quite get what I want. To clarify again, I'd like more control on the word "tag", so that it positions nicely closer (in x axis) to the word "diverse", as that's what it's annotating. Additionally, I'd like it if I can enclose "tag" in a little tcolorbox. Thank you!
I want to add that I originally had a more minimal version of this code (with only the packages I need for this slide) that worked as desired; however, when integrated with the rest of my presentation (which has all the packages in the code below), I get this bug of wrong position. So it's some package interaction bug.
\documentclass{beamer}
\mode<presentation>
{
\usetheme{default} % or try Darmstadt, Madrid, Warsaw, ...
\usecolortheme{rose} % or try albatross, beaver, crane, ...
\usefonttheme{default} % or try serif, structurebold, ...
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{caption}[numbered]
}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
%\usepackage[TS1,T1]{fontenc}
\usepackage[T1]{fontenc}
\usepackage{verbatim}
%\usepackage[dvipsnames]{xcolor}
%% packages I am adding
%\usepackage{colortbl}
\usepackage[customcolors,beamer]{hf-tikz} %for beautiful inline highlighted math. Thanks Claudio!
\usepackage{tikz}
\usetikzlibrary{backgrounds}
\usetikzlibrary{arrows,shapes}
\usetikzlibrary{tikzmark, calc,decorations.pathmorphing,decorations.pathreplacing, patterns}
\usetikzlibrary{arrows.meta, positioning, quotes}
\usetikzlibrary{shapes.multipart}
\usetikzlibrary{matrix,overlay-beamer-styles}
\usepackage{amsmath}
\usetikzlibrary{fit,tikzmark}
\usepackage{skull}
\usepackage{nccmath} %for \medmath command to fit long eqns in tcolorbox
\usepackage[skins]{tcolorbox}
\tcbuselibrary{theorems}
\usepackage{makecell} %for the thead command to break up header
\usepackage{array, booktabs, longtable}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{mathtools}
%\tikzstyle{every picture}+=[remember picture, overlay]
\usetikzlibrary{overlay-beamer-styles}
\usepackage[absolute,overlay]{textpos}
\AtBeginSection[]{
\begin{frame}
\vfill
\centering
\begin{beamercolorbox}[sep=8pt,center,shadow=true,rounded=true]{title}
\usebeamerfont{title}\insertsectionhead\par%
\end{beamercolorbox}
\vfill
\end{frame}
}
\newcommand\fiteq[1]{%
\sbox{\mybox}{$\displaystyle#1$}%
\ifdim\wd\mybox>.85\textwidth\resizebox{.85\textwidth}{!}{\usebox{\mybox}}%
\else\usebox{\mybox}\fi%
}
%% start1
\begin{document}
\begin{frame}{Title}
\tikzset{rowhl/.style={
set fill color = white,
set border color = red,
above left offset={-0.01,0.37},
below right offset={0.1,-0.09},
},}
\begin{table}[htbp]
\centering
\resizebox{\linewidth}{!}{% Resize table to fit within \linewidth horizontally
\begin{tabular}{c c c c c c}
\toprule
\multicolumn{2}{c}{\textbf{Cost}} &
\multicolumn{1}{c}{\textbf{Team}} & \multicolumn{3}{c}{\textbf{Features}} \\
\cmidrule(lr){1-2}\cmidrule(lr){4-6}
\thead{\begin{tabular}{@{}c@{}}initial \\ cost \end{tabular}} & \thead{\begin{tabular}{@{}c@{}}secondary \\ cost \end{tabular}} & & \multicolumn{1}{c}{scale}
& \multicolumn{1}{c}{impact}
& \multicolumn{1}{c}{\thead{\begin{tabular}{@{}c@{}}diverse\tikzmark{B}\\ selection \end{tabular}}}\\
\midrule
$x1$ & $x2$ & name 1 + name 2 + name 3 & & \checkmark & \\
$y1$ & $y2$ & name 1 + name 2 & \checkmark & \checkmark & \checkmark\\
\tikzmarkin<2->[rowhl]{aa} $z1$ & $z2$ & name 1 + name 2 +name 3 + name 4 & \checkmark & \checkmark & \checkmark \tikzmarkend{aa} \\
$v1$ & $v2$ & name 5 + name 8 + name 9 & & \checkmark & \checkmark \\
$w1$ & $w2$ & name 1 + name 3 + name 5 & \checkmark & \checkmark & \\
$x1$ & $x2$ & name 1 + name 2 + name 3 & & \checkmark & \\
$x1$ & $x2$ & name 1 + name 2 + name 3 & & \checkmark & \\
$x1$ & $x2$ & name 1 + name 2 + name 3 & & \checkmark & \\
$x1$ & $x2$ & name 1 + name 2 + name 3 & & \checkmark & \\
\bottomrule
\end{tabular}}
\begin{tikzpicture}[remember picture,overlay]
\node [right=5cm,above=6cm,minimum width=0pt] at (pic cs:b) (B) {tag};
\draw [<-,out=5,in=180] ([xshift=140pt, yshift=115pt]{pic cs:b}) to (B);
\end{tikzpicture}
\caption{teams and costs}
\label{MyTable}
\vspace{-4mm}
\end{table}
%%%%%%%%
\end{frame}
\end{document}

resizeboxwithrememeber picture. Very simple fix, just changing the positioning of}! Is there a difference betweentikzmarkandtikzmarknode? – lazulikid May 30 '20 at 19:36\tikzmark{<id>}only sets a coordinate mark.\tikzmarknode{<id>}{<content>}makes<content>a node (with all sorts of nice checks which mode you are in), so you have access to all the anchors of the node (as opposed to coordinate). – May 30 '20 at 19:39convertas shown at the end of this answer. For this animation I was usingdensity 300anddelay 144. – May 30 '20 at 19:49\node [minimum width=0pt] (B) at ([xshift=1.5cm,yshift=2cm]b) {tag};If you change the value ofxshift, you can move the node to the left or right. – Jun 01 '20 at 06:47