2

I'm trying since some time now to get the following (see picture) done in LaTeX.

But I don't even have code that works so far, as all I've found by searching the internet wasn't helpful (I'm not even sure what to search for tbh).

I'd like the t's to be aligned with the v's and then draw the arrows like shown below. That t_1 \in T on the left side, isn't that important, as I'll just write that down below :)

I'm really stuck so any help would be appreciated!

enter image description here


EDIT: I've got the alignment although that isn't good practice I guess:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
        &cv_1 &&cv_2 &\ldots &&&cv_i &\ldots &&&&cv_j  &&\ldots &&&&&cv_k\\
        &t_1  &&t_2 &\ldots &&&t_i &\ldots &&&&t_j  &&\ldots &&&&&t_k
    \end{align*}
\end{document}
2
  • Why not try tikz?
    – Elad Den
    Jan 28 at 17:41
  • Tryed but couldn't do it...my tikz skills are too low i guess :P
    – Algebruh
    Jan 28 at 17:58
3

Here is a solution with a simple array environment andpstricks; the letters to be linked are defined as nodes in this array, and connected with \ncangle with the relevant parameters:

\documentclass{article}
\usepackage{amsmath}
\usepackage{array, makecell}
\usepackage{pst-node}

\begin{document}

    \[ \begin{array}{*{9}{r}}
     cv_1 &cv_2 &\ldots &cv_i &\ldots &cv_j &\ldots &cv_k\\
     t_1 & \rnode{T2}{t_2} &\ldots & \rnode{Ti}{t_i }&\ldots &\rnode{Tj}{t_j} &\ldots &t_k \\[0.5ex]
     & & & & & & & & \makecell{\rnode{Aj}{\varphi}\\\rnode{Ai}{\varphi}\\\rnode{A2}{\varphi}}
    \end{array}
    \psset{linewidth=0.6pt, linejoin=1, arrows=->, arrowinset=0.12, angleA=-90, angleB=180, nodesep=3pt}
    \foreach \s in {2,i, j}{\ncangle{T\s}{A\s}}
     \]%

\end{document} 

enter image description here

4
  • Seems like a nice solution! Thank you a lot! :) I get "undefined controll sequence" tho when using it, because "\ncangle" isn't known?
    – Algebruh
    Jan 28 at 14:38
  • It is documented. Maybe you compiled with pdflatex?
    – Bernard
    Jan 28 at 14:44
  • Ahm yes....ok so thats not working...gonna change it..thanks :) Edit: That solved it! Thanks so much!
    – Algebruh
    Jan 28 at 14:45
  • 1
    Use xelatex, it will be simpler.
    – Bernard
    Jan 28 at 14:47
2

I'm adapting my answer to "How to add arrow in equations and matrix?"; see there for some explanations on how to use Tikz to draw arrows between text elements.

  • First, typeset the text without arrows.
  • Wrap all elements, that will be the origin or target of an arrow, into a \tikznode command. This assigns a name to the text element and stores its size and position.
  • Add a tikzpicture environment with the options remember picture,overlay below. It contains the graphical elements, in this case the arrows. Here you will use the names assigned in the previous step.
  • Run LaTeX at least two times to propagate the information about the nodes and arrows everywhere.

enter image description here

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{arrows}% only needed for the arrow tip stealth'
\newcommand\tikznode[3][]{%
  \tikz[remember picture,baseline=(#2.base)]
    \node[minimum size=0pt,inner sep=0pt,#1](#2){#3};%
}
\begin{document}

    \[ \begin{array}{*{9}{r}}
     cv_1 &cv_2 &\ldots &cv_i &\ldots &cv_j &\ldots &cv_k\\
     t_1 & \tikznode{T2}{$t_2$} &\ldots & \tikznode{Ti}{$t_i$}&\ldots &\tikznode{Tj}{$t_j$} &\ldots &t_k \\[0.5ex]
         & & & & & & & & \tikznode{Aj}{$\varphi$} \\
         & & & & & & & & \tikznode{Ai}{$\varphi$} \\
         & & & & & & & & \tikznode{A2}{$\varphi$}
       \end{array}
     \]%
\begin{tikzpicture}[remember picture,overlay,> = stealth',shorten <=3pt,shorten >=3pt]
  \draw[->] (T2) |- (A2);
  \draw[->] (Ti) |- (Ai);
  \draw[->] (Tj) |- (Aj);
\end{tikzpicture}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.