0

Based on a previous question I asked, I have created the following:

\documentclass{standalone}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[fleqn]{mathtools}
\usepackage{tikz}
\usetikzlibrary{positioning}

\newcommand*{\dd}[3][]{\tfrac{\mathrm{d}^{#1}#2}{\mathrm{d}#3^{#1}}}
\newcommand*{\D}[1]{\mathop{}\!\mathrm{d} #1}

\begin{document}
{\renewcommand{\arraystretch}{1.5}\begin{tabular}{r@{\qquad}l}
  \(u\)\tikzmark{d0} & \(\D{v}\)\\
  \(\dd{u}{x}\)\tikzmark{d1} & \tikzmark{i1}\(\int \D{v} \D{x}\)\\
  \(\dd[2]{u}{x}\)\tikzmark{d2} & \tikzmark{i2}\(\int\left(%
    \int\D{v}\D{x}\right)\D{x}\)\\
  \(\dd[3]{u}{x}\)\tikzmark{d3} & \tikzmark{i3}\(\int\left(\int\left(%
    \int\D{v}\D{x}\right)\D{x}\right)\D{x}\)\\
  \(\cdots\)\tikzmark{d4} & \tikzmark{i4}\(\cdots\)\\
  0 & \tikzmark{i5}\(\cdots\)
\end{tabular}}
\tikz[remember picture]{\foreach \d/\i in {d0/i1,d1/i2,d2/i3,d3/i4,d4/i5}{
  \draw[overlay] (pic cs:\d) to[out=0,in=180] (pic cs:\i);
}}
\end{document}

This works quite well; however, the lines appear to be coming from the baseline, whereas I believe it would look better if they came from the center of line line (lined up with the fraction bar). I could do this using a yshift of about 0.6ex, but is there a better way?

1 Answers1

2

A matrix approch :

\documentclass{standalone}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[fleqn]{mathtools}
\usepackage{array}
\usepackage{tikz}
\usetikzlibrary{positioning, matrix}

\newcommand*{\dd}[3][]{\tfrac{\mathrm{d}^{#1}#2}{\mathrm{d}#3^{#1}}}
\newcommand*{\D}[1]{\mathop{}\!\mathrm{d} #1}

\begin{document}
\begin{tikzpicture}
  \matrix [matrix of nodes, nodes={anchor=west,minimum width=5mm, minimum height=1cm,
  inner sep=0pt},
    row sep=0cm, column sep=10mm]
  {
    |(d0)| \(u\)            & \(\D{v}\)                                                            \\
    |(d1)| \(\dd{u}{x}\)    & |(i1)| \(\int \D{v} \D{x}\)                                          \\
    |(d2)| \(\dd[2]{u}{x}\) & |(i2)| \(\int\left(\int\D{v}\D{x}\right)\D{x}\)                      \\
    |(d3)| \(\dd[3]{u}{x}\) & |(i3)| \(\int\left(\int\left(\int\D{v}\D{x}\right)\D{x}\right)\D{x}\) \\
    |(d4)| \(\cdots\)       & |(i4)| \(\cdots\)                                                    \\
    0                       & |(i5)| \(\cdots\)                                                    \\
  };
  \foreach \d/\i in {d0/i1,d1/i2,d2/i3,d3/i4,d4/i5}{
      \draw[overlay] (\d) to[out=0,in=180] (\i);
    }
\end{tikzpicture}

\end{document}

enter image description here

flav
  • 4,714