There is a similar question on this link: How to draw an arrow to a specified position in a frame and write some notes on the another end of arrow?, but I still have problems in applying it in my case.
What I want is to put color on part of the equation and then point out this part and indicate it to $\beta_0$
and $\beta_i$
, which should look like as
According to the solution of this link, I define a command \newcommand{\tikzmark}[1]{\tikz[remember picture] \node[coordinate] (#1) {#1};}
then put this syntax \tikzmark{t1}
at the end of the part that I want to be selected and point to $\beta_0$, then start a new
\begin{itemize}[<+-| alert@+>]
\item \tikzmark{n1} $\beta_0$
\end{itemize}
However, it does not work. It turns out to be, which is not what I want. I think my case is a little bit different with the question in the link, so I don't know how to successfully apply it to my case. Actually, I don't want to start with a new item, just add $\beta_0$ and $\beta_i$ at the end of the arrow. Could someone indicate me how realize it? Thank you.
\documentclass{beamer}
\usepackage{tabularx}
\usepackage[customcolors,norndcorners]{hf-tikz}
\usetheme{Madrid}
\newcommand{\tikzmark}[1]{\tikz[remember picture] \node[coordinate] (#1) {#1};}
\title{An empirical Bayes approach to predict
radiation-induced toxicity using large-scale
SNPs}
\author[C.e]{Ch \\ \vspace{5mm}}
\institute[University]{\textbf { University}}
\date{11 September 2017}
\subject{Theoretical Computer Science}
% Let's get started
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\section{Introduction}
\subsection{The general problem}
\begin{frame}{Modelling}
\begin{itemize}
\item {\textbf{SNP model}
\begin{equation}\label{bernoulli}
X_{ik}|Y \stackrel{iid}{\sim}
\begin{cases}
\mathrm{Bernoulli}($\mathrm{p}_{i+}$) & \text{when} \hspace{4mm} Y= +1, \\
\mathrm{Bernoulli}($\mathrm{p}_{i-}$) & \text{when} \hspace{4mm} Y =-1.
\end{cases}
\end{equation}
}
\item { \textbf{Prediction rule}
\scalebox{0.87}{
\hfsetfillcolor{green!10}
\hfsetbordercolor{green!10}
\begin{equation}\label{predictionrule}
\log \frac{\mathrm{P}(Y=+1|X)}{\mathrm{P}(Y=-1|X)}=\tikzmarkin{c}(0.05,-0.6)(-0.05,0.65) \log\frac{\mathrm{P}(Y=+1)}{\mathrm{P}(Y=-1)} + \sum_{i=1}^{N}\left(\log\frac{1-\mathrm{p}_{i+} }{1-\mathrm{p}_{i-} } \right) \tikzmarkend{c} \tikzmark{t1}
+ \tikzmarkin{a}(0.05,-0.6)(-0.05,0.65)\sum_{i=1}^{N}\left(\log\frac{\mathrm{p}_{i+} (1-\mathrm{p}_{i-}) }{\mathrm{p}_{i-} (1-\mathrm{p}_{i+} )}\right) \tikzmarkend{a} X_i.
\end{equation}\\
}}
\end{itemize}
\begin{itemize}[<+-| alert@+>]
\item \tikzmark{n1} $\beta_0$
\end{itemize}
\end{frame}
\end{document}
[1]: https://tex.stackexchange.com/questions/199218/how-to-draw-an-arrow-to-a-specified-position-in-a-frame-and-write-some-notes-on
[2]: https://i.stack.imgur.com/mAYTJ.jpg
Best Answer
You had some errors in your code, e.g the dollar signs inside the
cases
environment. Not sure if you like it, but I suggest a different way of typesetting that last equation, that doesn't involve a scalebox.There's no need to use a tikzmark for the betas as well, those can be added as part of the
tikzpicture
used to draw the arrows.