我创建了以下“表格”作为更大文档的一部分:
\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}
\begin{tikzpicture}[node distance=0.5ex and 1em]
\node (d0) {\(u\)};
\node[right=of d0] (i0) {\(\D{v}\)};
\node[below=of d0] (d1) {\(\dd{u}{x}\)};
\node[right=of d1] (i1) {\(\int \D{v} \D{x}\)};
\node[below=of d1] (d2) {\(\dd[2]{u}{x}\)};
\node[right=of d2] (i2) {\(\int\left(\int\D{v}\D{x}\right)\D{x}\)};
\node[below=of d2] (d3) {\(\cdots\)};
\node[right=of d3] (i3) {\(\int\left(\int\left(\int\D{v}\D{x}\right)\D{x}%
\right)\D{x}\)};
\node[below=of i3] (i4) {\(\cdots\)};
\draw (d0.east) -- (i1.west) (d1.east) -- (i2.west) (d2.east) -- (i3.west);
\end{tikzpicture}
\end{document}
现在这样就好了(也许比那更糟糕一点)。我该如何改进这个设计?我原本以为,如果让所有线条都笔直,让第一列右对齐,第二列左对齐,这样会有所帮助,但我不知道该怎么做。有什么建议吗?
答案1
不确定您正在寻找什么,但这里有一个选项是使用语法to
并指定out=
和in=
角度。
代码:
\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}
\tikzset{My Line Style/.style={out=0, in=180, thick, blue, shorten <=-0.5ex, shorten >=-0.5ex, distance=1.0em, -stealth}}
\begin{document}
\begin{tikzpicture}[node distance=0.5ex and 1em]
\node (d0) {\(u\)};
\node[right=of d0] (i0) {\(\D{v}\)};
\node[below=of d0] (d1) {\(\dd{u}{x}\)};
\node[right=of d1] (i1) {\(\int \D{v} \D{x}\)};
\node[below=of d1] (d2) {\(\dd[2]{u}{x}\)};
\node[right=of d2] (i2) {\(\int\left(\int\D{v}\D{x}\right)\D{x}\)};
\node[below=of d2] (d3) {\(\cdots\)};
\node[right=of d3] (i3) {\(\int\left(\int\left(\int\D{v}\D{x}\right)\D{x}%
\right)\D{x}\)};
\node[below=of i3] (i4) {\(\cdots\)};
\draw[My Line Style] (d0.east) to (i1.west);
\draw[My Line Style] (d1.east) to (i2.west);
\draw[My Line Style] (d2.east) to (i3.west);
\end{tikzpicture}
\end{document}