我知道其中的道理,\underbracket{52-8}_{44} (with \usepackage{mathtools})
但是......有可能与 cols 相关吗?
或者,甚至使用与顶部背景图像类似的箭头:
\documentclass[12pt]{exam}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{mathtools}
\begin{document}
\begin{tabular}{ccccc}
\underline{Días} & & \underline{Coches} & & \underline{Mecánicos} \\
2 & & 5 & & 8 \\
8 & & 30 & & $x$ \\
\end{tabular}
\end{document}
答案1
以下是使用 获得所需内容的一种方法pstricks
;我定义了相关节点,并将它们连接起来\ncbar
:
\documentclass[12pt, svgnames]{article}
\usepackage[T1]{fontenc}
\usepackage[spanish]{babel}
\usepackage{booktabs}
\usepackage{pst-node}
\begin{document}
Some text. Some more text.
\begin{tabular}{ccccc}
\\[3ex]
\underline{Dí\rnode[t]{I}{a}s} & & \underline{Co\rnode[t]{D}{c}hes} & & \underline{Mec\pnode[0,1ex]{E}\rnode[t]{J}{án}icos} \\
2 & & 5 & & 8 \\
8 & & 30 & & $x$ \\
\psset{linewidth=2pt, linecolor=OrangeRed, linejoin=1, angle=90}
\ncbar[nodesep=2pt, arm=2mm]{D}{E}\nbput[labelsep=0pt]{\color{OrangeRed}\bfseries\sffamily \footnotesize D}
\ncbar[nodesepA=2pt, nodesepB=0pt, arm=4.5mm]{I}{J}\naput[labelsep=0pt]{\color{OrangeRed}\bfseries\sffamily \footnotesize I}
\end{tabular}
\end{document}
答案2
我正在适应我对“如何在方程和矩阵中添加箭头?”的回答;请参阅那里的解释。
\documentclass{article}
\usepackage{booktabs}% for nicer tables
\usepackage{tikz}
\usetikzlibrary{calc}
\newcommand\tikznode[3][]{%
\tikz[remember picture,baseline=(#2.base)]
\node[minimum size=0pt,inner sep=0pt,#1](#2){#3};%
}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{center}
\vspace{5ex}
\begin{tabular}{ccc}
\tikznode{dias}{Días} & \tikznode{coch}{Coches} & \tikznode{mec}{Mecánicos} \\
\midrule
2 & 5 & 8 \\
8 & 30 & $x$
\end{tabular}
\end{center}
\begin{tikzpicture}[remember picture,overlay,rounded corners,red,thick,shorten >=2pt,shorten <=2pt]
\draw[-stealth] (dias) -- ++(0,6ex) --
node[above,circle,draw,thin,inner sep=0.5pt]{\scriptsize $I$}
($(mec)+(0,6ex)$) -- (mec);
\draw (coch) -- ++(0,3ex) --
node[above,circle,draw,thin,inner sep=0.5pt]{\scriptsize $D$}
($(mec)+(0,3ex)$) -- (mec);
\end{tikzpicture}
\lipsum[2]
\end{document}
答案3
我想把箭头右侧垂直的最后部分分开一点
\documentclass{article} \usepackage{booktabs}% 用于更漂亮的表格 \usepackage{tikz} \usetikzlibrary{calc}% 用于计算辅助坐标 \newcommand\tikznode[3][]{% \tikz[remember picture,baseline=(#2.base)] \nodeminimum size=0pt,inner sep=0pt,#1{#3};% } \usepackage{lipsum}
\usetikzlibrary{shapes,snakes}
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{
\node[shape=circle,draw,inner sep=0pt] (char) {#1};}}
\newcommand*\circleds[1]{\tikz[baseline=(char.base)]{
\node[shape=circle,draw,inner sep=1pt] (char) {#1};}}
\newcommand*\circledss[1]{\tikz[baseline=(char.base)]{
\node[shape=circle,draw,inner sep=2pt] (char) {#1};}}
\begin{document}
%\lipsum[1]
\begin{center}
\vspace{5ex}
\begin{tabular}{ccc}
\tikznode{diasupp}{} & \tikznode{cochupp}{} & \tikznode{mecupp}{} \\
\tikznode{diasup}{} & \tikznode{cochup}{} & \tikznode{mecup}{} \\
\tikznode{dias}{Días} & \tikznode{coch}{Coches} & \tikznode{mec}{Mecánicos} \\
2 & 5 & 8 \\
8 & 30 & $x$
\end{tabular}
\end{center}
\tikzstyle{arrow} = [thick,->,>=stealth]
\begin{tikzpicture}[remember picture,overlay,red,thick]
\draw [arrow] (dias) -- (diasupp)--(mecupp)node[midway,sloped,left,rotate=0] {\raisebox{-.0\height}[46pt][50pt]{\circleds{I}}}--+(mec);
\draw [arrow] (coch) -- (cochup)--(mecup) node[midway,sloped,left,rotate=0] {\raisebox{-.0\height}[48pt][52pt]{\circled{D}}}--+(mec);
\end{tikzpicture}
%\lipsum[2]
\end{document}