2

I want to draw straight down arrows from different elements of a vector. I modified the code for Arrows pointing to equation.

Can someone let me know why the rightmost arrow is not placed at the middle underprice. Secondly I would appreciate if the overall look can be improved. Also '$\bm{v}$' does not appear bold italic as seen below.

enter image description here

here is code

\documentclass{beamer}
\usetheme{default}
\usecolortheme{default}
\usepackage[english]{babel}
\usepackage{amsmath,amsfonts,amssymb,amsthm}
\usepackage{mathptmx}
\usepackage{calc}
\usepackage{tikz}
\usepackage{mathtools,mathdots,bm,fixltx2e}
\usetikzlibrary{tikzmark,calc,,arrows,shapes,decorations.pathreplacing}
\tikzset{every picture/.style={remember picture}}
\usepackage{accents}

\newcommand\myubar[1]{%
\underaccent{\bar}{#1}}

\begin{document}

\begin{equation*}
\tikz[baseline]{\node(a) {$\bm{v}$}} = [\quad \tikz[baseline]{\node(b){$I_{E(x_3)}$}} , \tikz[baseline]{\node(c) {$c$}},\tikz[baseline]{\node(d){$\underbrace{I_{E(x_1)},\cdots,I_{E(x_2)}}$}} , \tikz[baseline]{\node(e){$\underbrace{I_{E(y_2)},\cdots,I_{E(y_3)}}\quad$}}]
\end{equation*}

\begin{tikzpicture}[remember picture,overlay]
\draw[blue,thick,->] (b) to [in=90,out=270] + (270:4cm) node[anchor=north,text = black,text width=3cm,align=center] {ABC\\DEF};
\draw[blue,thick,->] (c) to [in=90,out=270] +(270:2cm) node[anchor=north,text = black,text width=3cm,align=center] {GHI\\JKL};
\draw[blue,thick,->] (d) to [in=90,out=270] +(270:3cm) node[anchor=north,text = black,text width=3cm,align=center]{MNO\\ PQR \\ (xxx)};
\draw[blue,thick,->] (e) to [in=90,out=270] +(270:2cm) node[anchor=north,text = black,text width=3cm,align=center]{STU\\ VWY \\ (yyy)};
\end{tikzpicture}

\end{document}

Output:

enter image description here

NAASI
  • 2,809
  • 3
    You've included \quad in your last node (e), that's why your arrow is not centered. Plus v seems bold slanted to me. – Christoph Frings Jun 29 '16 at 22:58
  • Thanks for pointing that out. I have included the image for my equation to point out the difference when I use \bm{v} in equation environment. – NAASI Jun 29 '16 at 23:06
  • 2
    The first image isn't from Beamer, though, is it? And you need a frame if you're in Beamer. Beamer changes the fonts. If you don't want it to, you need to load the so-called professional font theme, for example, and/or block the use of sans etc. See the manual. – cfr Jun 29 '16 at 23:35
  • First image is from beamer. I took a snapshot of beamer slide. – NAASI Jun 29 '16 at 23:37
  • 1
    A somewhat unrelated note: You should use \dots instead of \cdots. – Svend Tveskæg Jul 05 '16 at 09:35

1 Answers1

1

As stated in the comments the font is typical beamer font and the misplacement of the arrow is due to \quad. To improve the overall look I would suggest to not put everything on a baseline. I would also like all the arrows to start at the same level.

\begin{frame}
  \begin{displaymath}
    \bm{v} 
    = \Bigl[%
    \tikz[remember picture,inner sep=0pt]\node (b1) {\smash{$\displaystyle I_{E(x_3)}$}};,
    \tikz[remember picture,inner sep=0pt]\node (c1) {\smash{$\displaystyle c$}};, 
    \underbrace{I_{E(x_1)},\cdots,I_{E(x_2)}}_{\tikz[remember picture]\coordinate (d1) at (0,0);}, 
    \underbrace{I_{E(y_2)},\cdots,I_{E(y_3)}}_{\tikz[remember picture]\coordinate (e1) at (0,0);}\Bigr]
  \end{displaymath}
  \begin{tikzpicture}[remember picture,overlay]
    \draw[blue,thick,->] (b1|-d1) to [in=90,out=270] + (270:2.5cm) node[anchor=north,text = black,text width=3cm,align=center] {ABC\\DEF};
    \draw[blue,thick,->] (c1|-d1) to [in=90,out=270] +(270:1cm) node[anchor=north,text = black,text width=3cm,align=center] {GHI\\JKL};
    \draw[blue,thick,->] (d1) to [in=90,out=270] +(270:2cm) node[anchor=north,text = black,text width=3cm,align=center]{MNO\\ PQR \\ (xxx)};
    \draw[blue,thick,->] (e1) to [in=90,out=270] +(270:1cm) node[anchor=north,text = black,text width=3cm,align=center]{STU\\ VWY \\ (yyy)};
  \end{tikzpicture}
\end{frame}

enter image description here

StefanH
  • 13,823