4

I created some Latex Matrix equations. I want to create a matrix dimensions workflow:

\begin{align}
    &\hphantom{(2\times 3)( }%
        \overbrace{\hphantom{1 \times 3) = 2 \times 1} } \nonumber \\[-07pt]%
    &( \underbrace{ 2\times 
        \underbrace{
            3) ( 1 \times 3
            }%
        ) = ( 2 } %
    \times 1) \nonumber
\end{align}

The result is enter image description here I have used \overbrace to create the braces over my workflow. I want the same result, but without \overbrace, and with (two sided) arrows instead.

0

2 Answers 2

4

Use \overleftrightarrow and \underleftrightarrow.

\documentclass[a4paper]{article}
\usepackage{amsmath}
\begin{document}    
\begin{align}
    &\hphantom{(2\times 3)( }%
        \overleftrightarrow{\hphantom{1 \times 3) = (2 \times 1} } \nonumber \\[-07pt]% 
    &( \underleftrightarrow{ 2\times
        \underleftrightarrow{
            3) ( 1 \times 3
            }% 
        ) = ( 2 } %
    \times 1) \nonumber
\end{align}
\end{document}

arrows

1
  • Oke i think i wasn't clear about the type of arrows i want… this kind of arrows dl.dropboxusercontent.com/u/5239536/… The image is from a lecture a few years ago so i don't know how to make that kind of arrows and can't ask it anny more...
    – Jan-Bert
    Apr 11, 2015 at 8:34
1

You can use tikzmark. The options overlay and remember picture must be added to the subsequent tikzpicture. You will need to compile the document several times when you make changes.

enter image description here

Note that you can move the nodes and the arrows will follow if you make changes, such as placing the matrix dimensions in the standard way:

enter image description here

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{tikzmark}

\begin{document}

\[
(\tikzmarknode{A}{2}\times\tikzmarknode{B}{3})(\tikzmarknode{C}{1}\times\tikzmarknode{D}{3})
    =(\tikzmarknode{E}{2}\times\tikzmarknode{F}{1})
\]

%\[
%(\tikzmarknode{A}{2}\times\tikzmarknode{B}{3})(\tikzmarknode{D}{3}\times\tikzmarknode{C}{1})
%   =(\tikzmarknode{E}{2}\times\tikzmarknode{F}{1})
%\]

\begin{tikzpicture}[overlay, remember picture, shorten <=1pt, shorten >=1pt]
    \draw [<->] (A.south) --++(0,-.3) -| (E.south);
    \draw [<->] (B.south) --++(0,-.2) -| (D.south);
    \draw [<->] (C.north) --++(0,.2) -| (F.north);
\end{tikzpicture}

\end{document}

You must log in to answer this question.

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