4

I've got almost exactly what I want, but I can't figure out how to lower the j_1 so that it is in line with the equal symbol. What am I missing?

\documentclass[a4paper,12pt]{article}
\usepackage{tikz}
\usepackage{tabularx}
\usepackage{amsmath,amssymb}

\begin{document}
\usetikzlibrary[arrows,shapes]

\begin{table}[h]
    \begin{minipage}[b]{1 \linewidth}\centering
    \begin{tabular}{ p{3cm} l}
        Principal & $P=\$100$\\
        Nominal \newline anual \newline interest rate & $j_m=5\frac{1}{2}\%=5.5\%=0.005=\tikz[remember picture] \node[] (n2) {$j_1$};$ \\
        Compounding annually, & i.e. $m=1$\tikz[remember picture] \node[] (n1) {};\\
        Frequency \newline of term & $t=5\text{ years}$
    \end{tabular}
\end{minipage}
\end{table}
\begin{tikzpicture}[remember picture, overlay]
\draw[->,very thick] (n1) to [out=45, in=270] node[below] {so} (n2);
\end{tikzpicture}

\end{document}
5

Use the baseline of node n2 as baseline of the picture:

\tikz[remember picture,baseline=(n2.base)] \node[] (n2) {$j_1$};

enter image description here

Code:

\documentclass[a4paper,12pt]{article}
\usepackage{tikz}
\usetikzlibrary[arrows,shapes]% <- load the libraries in the preamble
\usepackage{tabularx}
\usepackage{amsmath,amssymb}

\begin{document}
\begin{table}[h]
    \begin{minipage}[b]{1 \linewidth}\centering
    \begin{tabular}{ p{3cm} l}
        Principal & $P=\$100$\\
        Nominal \newline anual \newline interest rate & $j_m=5\frac{1}{2}\%=5.5\%=0.005=
          \tikz[remember picture,baseline=(n2.base)] \node[] (n2) {$j_1$};$ \\
        Compounding annually, & i.e. $m=1$\tikz[remember picture] \node[] (n1) {};\\
        Frequency \newline of term & $t=5\text{ years}$
    \end{tabular}
\end{minipage}
\end{table}
\begin{tikzpicture}[remember picture, overlay]
\draw[->,very thick] (n1) to [out=45, in=270] node[below] {so} (n2);
\end{tikzpicture}
\end{document}
1
  • 1
    @Francesco: To see want's going on, you can change \node[] to \node[fill=yellow]. Then you'll see that without baseline=(n2.base) the base of the node is on the level of the baseline of the suroundig text, which was your problem. Tip: if you want to reduce the distance between the arrow and the node, you can change the inner sep (\node[inner sep=.2em] (n2)).
    – Mike
    Jun 23 '17 at 21:12
3

With use tikzmark library:

\documentclass[a4paper,12pt]{article}
\usepackage{tikz}
\usetikzlibrary{arrows, quotes, shapes, tikzmark}
\usepackage{tabularx}
\usepackage{amsmath,amssymb}

\begin{document}
\begin{table}[h]
%    \begin{minipage}[b]{1 \linewidth}% no needed
    \centering
    \begin{tabular}{ p{3cm} l}
Principal   & $P=\$100$\\
Nominal \newline anual \newline interest rate 
            & $j_m=5\frac{1}{2}\%=5.5\%=0.005=j_1\pgfmark{a}$     \\
Compounding annually, 
            & i.e. $m=1$\pgfmark{b}\\
Frequency \newline of term 
            & $t=5\text{ years}$
    \end{tabular}
%\end{minipage}
\end{table}
\begin{tikzpicture}[remember picture, overlay]
\path[draw=red, very thick, ->] 
    ([yshift=1em]pic cs:b) to [out=60, in=240, "so"] ([shift={(-1ex,-1ex)}] pic cs:a);
\end{tikzpicture}
\end{document}

![enter image description here

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.