0

Similar to this one in red enter image description here

In lines I know \underbracket{52-8}_{44} (with \usepackage{mathtools}) but.. is possible relating cols?

Or, even, with arrows similar to the top background image:

enter image description here

    \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
  • 1
    Could you please post a small complete code?
    – Bernard
    Commented Jan 24, 2021 at 17:21

3 Answers 3

1

Here is a way to obtain what you want with pstricks; I defined the relevant nodes, and connected them with \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} 

enter image description here

2
  • thank you. My problem with PsTricks is that PDFLaTeX don´t compile it. I like PSTricks.
    – Mika Ike
    Commented Jan 24, 2021 at 22:56
  • You can compile with xelatex --shell-escape without any problem (that's the way I obtained the pdf).
    – Bernard
    Commented Jan 24, 2021 at 23:27
3

I'm adapting my answer to "How to add arrows to equations and matrices?"; see there for explanations.

enter image description here

\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}
0

I´d like to separate a bit the rigth vertical final part of the arrow

enter image description here \documentclass{article} \usepackage{booktabs}% for nicer tables \usepackage{tikz} \usetikzlibrary{calc}% to calculate auxilary coordinates \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}
1
  • I have updated my answer to what you apparently want to achieve.
    – gernot
    Commented Jan 24, 2021 at 22:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .