6

I am trying to put arrows between images. I did not want to put arrow images, I prefer LaTeX way solution. I used pointer from wasysym package. The result can be seen below. I know those arrows are considered as text, so they are tiny.

alt text

How can I put centered, big arrows between images?

14

You could use \vcenter for vertical centering. It requires math mode. You could use font commands for scaling arrows or \scalebox or \resizebox of the graphicx package.

Define macros, so you could make adjustments easily.

Here's an example, using your pointer of wasysym:

\documentclass{article} 
\usepackage{graphicx}
\usepackage{wasysym}
\newcommand*{\vimage}[1]{\vcenter{\hbox{\includegraphics{#1}}}}
\newcommand*{\vpointer}{\vcenter{\hbox{\scalebox{2}{\Huge\pointer}}}}
\begin{document}
$\vimage{one}\vpointer
\vimage{two}\vpointer
\vimage{three}$
\end{document}

alt text

  • How would you change those colors to say "yellow"? Cant get it to work – eleijonmarck Oct 20 '15 at 17:48
  • @eleijonmarck You could use one of the commands \color or \textcolor. Perhaps post a new question if you don't know these commands or how to use them here. You can link to here. Comments are just not for solutions or alternative way or follow-up questions. – Stefan Kottwitz Oct 20 '15 at 19:17
6

I used this image and rename it as newton.jpg.

alt text


Adjust the parameter until it suits your need.

\documentclass[final,cmyk,table]{article}
\usepackage[a4paper,margin=2cm]{geometry}
\usepackage{graphicx}
\usepackage{amsbsy}%bold math
\usepackage{amsmath}
\usepackage{xcolor}
\usepackage{array}
\usepackage{longtable}
\usepackage{calc}

% adjust until suit your need.
\setlength{\arrayrulewidth}{0pt}
\setlength{\tabcolsep}{10pt}% you can change to a smaller. E.g., 5pt or less.
\arrayrulecolor{red}
\newenvironment{MyCrazyTable}[6][2cm]%
{%
    \newcolumntype{O}[1]%
    {%
        >{%
            \begin{minipage}[c][#1][c]%
            {%
                    ##1\linewidth-2\tabcolsep-1.5\arrayrulewidth%
            }%
            \vspace{\tabcolsep}%
         }%
        c%
        <{%
                \vspace{\tabcolsep}%
                \end{minipage}%
         }%
    }%
    \newcolumntype{I}[1]%
    {%
        >{%
            \begin{minipage}[c][#1][c]%
            {%
                    ##1\linewidth-2\tabcolsep-\arrayrulewidth%
            }%
            \vspace{\tabcolsep}%
         }%
        c%
        <{%
                \vspace{\tabcolsep}%
                \end{minipage}%
         }%
    }%
    \begin{longtable}%
    {%
        |>{\centering}O{#2}%
        |>{\centering}I{#3}%
        |>{\centering}I{#4}%
        |>{\centering}I{#5}%
        |>{\centering}O{#6}%
        |%
    }%
    \hline\ignorespaces%
}%
{%
    \end{longtable}%
}

\newcommand{\myrow}{%
\includegraphics[scale=0.35]{newton.jpg}%
&%
\scalebox{1.1}{$\boldsymbol{\longrightarrow}$}%
&
\includegraphics[scale=0.35]{newton.jpg}%
&%
\scalebox{1.1}{$\boldsymbol{\Longrightarrow}$}%
&
\includegraphics[scale=0.35]{newton.jpg}%
\tabularnewline\hline%
}



\makeatletter
\newcommand\ratio[2]{%
  \strip@pt\dimexpr#1pt/#2\relax
}
\makeatother  


\begin{document}
\begin{MyCrazyTable}[5cm]%
    {\ratio{9}{33}}%adjust please
    {\ratio{3}{33}}%adjust please
    {\ratio{9}{33}}%adjust please
    {\ratio{3}{33}}%adjust please
    {\ratio{9}{33}}%adjust please
\myrow
\myrow
\end{MyCrazyTable}
\end{document}

You can show the frame by changing \setlength{\arrayrulewidth}{1pt} as shown below. alt text

  • I suggest to comment out [c][#1][c] to make the height automatically get adjusted. – xport Dec 29 '10 at 20:00
3
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[demo]{graphicx}
\def\Arrow{\raisebox{-.5\height}{\scalebox{4}{$\Rightarrow$}}}
\def\Image#1{\raisebox{-.5\height}{\includegraphics[width=3cm]{#1}}}
\pagestyle{empty}
\begin{document}

\Image{foo}\Arrow%
\Image{bar}\Arrow%
\Image{baz}

\end{document}
  • very good. they are not centered though. – nimcap Dec 29 '10 at 20:13

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.