我正在尝试在图像之间放置箭头。我不想放置箭头图像,我更喜欢 LaTeX 方式解决方案。我使用了pointer
fromwasysym
包。结果如下所示。我知道那些箭头被视为文本,所以它们很小。
我怎样才能在图像之间放置居中的大箭头?
答案1
您可以使用\vcenter
它进行垂直居中。它需要数学模式。您可以使用字体命令来缩放箭头或\scalebox
graphicx\resizebox
包。
定义宏,以便您可以轻松地进行调整。
下面是一个使用 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}
答案2
我用过这个图像并将其重命名为newton.jpg
。
调整参数直到满足您的需要。
\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}
您可以通过如下所示的更改来显示框架\setlength{\arrayrulewidth}{1pt}
。
答案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}