1

I would like do change my document. One part of it in two columns, because I want to left in left the text and in the right the picture.

I past the picture. enter image description here

The code is this one.

\begin{enumerate}
\item $ \vec{a} + \vec{b} $
\item $ \vec{a} - \vec{b} $
\item $ \vec{b} - \vec{a} $
\item $ 2\vec{a} $
\end{enumerate}

\noindent\begin{tikzpicture}[> = stealth]
\draw[gray,step=1cm] (0,0) grid +(9cm,6cm);
    \draw[ultra thick,red, ->]  (1,4) -- node[above] {\Large $\vec{a}$} +(2,1);
    \draw[ultra thick,blue,->]  (7,5) -- node[below left] {\Large $\vec{b}$} +(0,-3);
%%
%    \draw[ultra thick,red, ->]  (4,4) -- node[above] {$\vec{a}$} +(1,0);
%    \draw[ultra thick,blue,->]  (4,4) -- node[below left] {$\vec{b}$} +(1,-2);
%    %
    \draw[ultra thick,black,|-|] (3,1) -- node[below] {\Large $u$} +(1,0);
\end{tikzpicture}

enter image description here

ryuk
  • 2,257

1 Answers1

2

You have (at least) two possibilities to do this:

  • put enumerate and tikzpicure into two succesive minipages
  • use tabular or tabularx environments and put enumerate in the first cell and `tikzpicture into second one.

For example:

\begin{minipage}[t][][b]{3cm}
   \begin{enumerate}
\item $ \vec{a} + \vec{b} $
\item $ \vec{a} - \vec{b} $
\item $ \vec{b} - \vec{a} $
\item $ 2\vec{a} $
    \end{enumerate}
\end{minipage}%
\begin{minipage}[t][][b]{9cm}
    \begin{tikzpicture}[> = stealth]
\draw[gray,step=1cm] (0,0) grid +(9cm,6cm);
    \draw[ultra thick,red, ->]  (1,4) -- node[above] {\Large $\vec{a}$} +(2,1);
    \draw[ultra thick,blue,->]  (7,5) -- node[below left] {\Large $\vec{b}$} +(0,-3);
    \draw[ultra thick,black,|-|] (3,1) -- node[below] {\Large $u$} +(1,0);
    \end{tikzpicture}
\end{minipage}
Torbjørn T.
  • 206,688
Zarko
  • 296,517
  • thanks a lot. Unfortunately the text and the picture are not at a symmetric position. – ryuk Nov 15 '15 at 12:22
  • @ryuk Try replacing [t] with [c]. – Torbjørn T. Nov 15 '15 at 12:24
  • What you mind with "symmetric"? With given example in my answer they are top aligned and for enumerate is reserved less horisontal width as for tikzpicture. If you mind vertical symmetry, than use @TorbjørnT. suggestion. – Zarko Nov 15 '15 at 12:25
  • I'm sorry. I mean that the two minipage don't start at the same vertical position. – ryuk Nov 15 '15 at 12:29
  • @Zarko Well, to be precise, the baselines of the top line in each minipage are placed at the same vertical position. The baseline of the tikzpicture is at the bottom of the grid, so if you try your example you'll see that the bottom of the grid is at the same height as the baseline of the first point in the list. – Torbjørn T. Nov 15 '15 at 12:29
  • 1
    @ryuk If you want the top of the list aligned with the top of the tikzpicture, try replacing the [t] with [t][][b] (for both minipages). Edit: sorry, didn't notice your picture before now, I see that is what you want. – Torbjørn T. Nov 15 '15 at 12:33
  • Thank you. There is only an error

    \begin{enumerate} on input line 88 ended by \end{document}. \end{document} Overfull \hbox (85.75827pt too wide) in paragraph

    but in the pdf file it's ok! ;)

    – ryuk Nov 15 '15 at 12:35
  • sorry I made a mistake! now it's perfect! thanks a lot! :) – ryuk Nov 15 '15 at 12:40