我的箭头从“3”的直角伸出,但它几乎立即越过其他文本?我在“simple”中的“s”处添加了一个节点,但不确定如何让线条通过其左下角避开该节点。这可能吗?右列“nominal”中的“n”的情况类似。
\documentclass[a4paper,12pt]{article}
\usepackage{tikz}
\usepackage{tabularx}
\usepackage{amsmath,amssymb}
\usepackage{array}
%\setlength\extrarowheight{3pt}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\begin{document}
\usetikzlibrary[arrows,shapes]
\begin{table}[h]
\begin{minipage}[b]{1 \linewidth}\centering
\begin{tabular}{ L{5cm} C{1cm} L{5cm} }
\hspace{7pt}\hspace{2cm}Outstanding\newline\hspace{7pt}\hspace{2cm}balance at\newline\hspace{7pt}\hspace{2cm}the end of\newline\hspace{7pt}\hspace{2cm}\tikz[remember picture,baseline=(n1.base),inner sep=0pt] \node[] (n1) {3}; years at\newline\hspace{7pt}\hspace{2cm}\tikz[remember picture,baseline=(j.base),inner sep=0pt] \node[] (j) {s};imple rate \tikz[remember picture,baseline=(n2.base),inner sep=0pt] \node[] (n2) {$r$}; & = & Outstanding\newline balance at\newline the end of\newline\tikz[remember picture,baseline=(n3.base),inner sep=0pt] \node[] (n3) {3}; years at\newline nominal rate $j_{365}=8\%$ \\
\hspace{20pt}\hspace{2cm}$P\left(1+\tikz[remember picture,baseline=(n4.base),inner sep=0pt] \node[anchor=north] (n4) {$r$};\cdot\tikz[remember picture,baseline=(n5.base),inner sep=0pt] \node[anchor=south west] (n5) {3};\right)$ & = & \hspace{-11pt}$P\left(1+\frac{j_{365}}{365}\right)^{365\cdot \tikz[remember picture,baseline=(n6.base),inner sep=0pt] \node[] (n6) {\scriptsize3};}$ \\
So\hspace{23pt}\hspace{2cm}$1+3r$ & = & $\left(1+\frac{8\%}{365}\right)^{365\cdot3}$ \\
Thus,\hspace{26pt}\hspace{2cm}$3r$ & = & $\left(1+\frac{0.08}{365}\right)^{365\cdot3}-1$\\
Hence, \hspace{79pt}$r$& = & $\frac{1}{3}\left[\left(1+\frac{0.08}{365}\right)^{365\cdot3}-1\right]$\\
& $\cong$ & 0.0904\\
& = & 9.04\%
\end{tabular}
\end{minipage}
\end{table}
\begin{tikzpicture}[remember picture, overlay]
\draw[->] (n1) to [out=225, in=145,looseness=1.5] node[] {} (n5); % Here we connect the nodes
\draw[->] (n2) to [out=285, in=85,looseness=1] node[] {} (n4); % Here we connect the nodes
\draw[->] (n3) to [out=225, in=90,looseness=1] node[] {} (n6); % Here we connect the nodes
\end{tikzpicture}\end{document}
答案1
在您的情况下,一个便宜的解决方案是调整出口和入口角度,并添加松散参数:
\draw[->] (n1) to [out=225, in=145, looseness=1.5] node[] {} (n5);
在更一般的情况下,您可以指定其他控制点。例如,请参见以下问题: tikz - 在曲线上指定更多控制
编辑:为了更精确的控制,请尝试贝塞尔控制点:
\draw[->] (n1) .. controls ++(220:2) and ++(120:1) .. (n5);
\draw[->,blue] (n3) .. controls ++(225:2) and ++(105:1.35) .. (n6);
两个控制点分别以相对于原点和到达点的极坐标表示。尝试调整角度和半径以掌握窍门。