I'd like to recreate a calculation similar to:
I tried using a table with blind cells and \swarrow
, but the arrows are to steep. A second try was using xymatrix
, but the distances between the rows were to large.
Do you have a hint?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityI'd like to recreate a calculation similar to:
I tried using a table with blind cells and \swarrow
, but the arrows are to steep. A second try was using xymatrix
, but the distances between the rows were to large.
Do you have a hint?
Since you have not shown any code to help get started, my first thought was to use a TikZ matrix of math nodes
. Matrices are further discussed starting on page 654 of the v3.0.0 manual. With this construct, you can draw lines between the cells very easily. Hope the following can help you get started!
\documentclass[tikz]{standalone}
\usetikzlibrary{matrix}
\usepackage{mathtools}
\begin{document}
\begin{tikzpicture}
\matrix (diff) [matrix of math nodes]{
& & \text{1st} & \text{2nd} \\
x & F(x) & \text{difference} & \text{difference} \\
1 & 5 & & \\
& & 3 & \\
2 & 8 & & 2 \\
& & 5 & \\
3 & 13 & & 2 \\
& & 7 & \\
4 & 20 & & 2 \\
& & 9 & \\
5 & 29 & & 2 \\
& & 11 & \\
6 & 40 & \vdots & 2 \\
& \vdots & \vphantom{13}\vdots & \vdots \\
7 & \vdots & \vdots & \vdots \\
\vdots & \vdots & \vdots & \vdots \\
};
\draw[->] (diff-3-2.east) -- (diff-4-3.170);
\draw[->] (diff-5-2.east) -- (diff-4-3.190);
\end{tikzpicture}
\end{document}