Place images as one row on latex

In this blog,  I will introduce four approaches for placing images as one row in latex.

First, use the minipage order, the code is as follows:

\begin{figure*}[!htb]
\begin{minipage}{a\linewidth}
  \includegraphics[width=4.0cm]{1color.png}
\end{minipage}\hfill
\begin{minipage}{b\linewidth}
  \includegraphics[width=4.0cm]{1depth.png}
\end{minipage}\hfill
\begin{minipage}{c\linewidth}
  \includegraphics[width=4.0cm]{1mask.png}  
\end{minipage}\hfill
\begin{minipage}{d\linewidth}
  \includegraphics[width=4.0cm]{1result.png}  
\end{minipage}
\begin{figure*}

notes that  a + b + c + d <= 1, and you should use the[!htb] to ignore the beautiful default design. 

if you want to place image as m*n form, the above method is also capable of doing such issue.


Second, use the array operator. 

\begin{figure*}
\begin{center}
$
\begin{array}{cc}
\includegraphics[width=1.15in]{1color.png} 
\includegraphics[width=1.15in]{1color.png} \includegraphics[width=1.15in]{1color.png} 
\includegraphics[width=1.15in]{1color.png} \includegraphics[width=1.15in]{1color.png}
\includegraphics[width=1.15in]{1color.png}
\end{array}
$
\end{center}
\caption{my caption}
\end{figure*}
 
if you want to place image as m*n form, you can utilize the & and \\ operator. 

Third, use the subfigure operator. Notes you should add the package.

\usepackage{subfigure}

\begin{figure*}[!htb]
\subfigure[text]{
\includegraphics[width=.24\textwidth]{1color.png}
}\hfill
\subfigure[text]{
\includegraphics[width=.24\textwidth]{1color.png}
}\hfill
\subfigure[text]{
\includegraphics[width=.24\textwidth]{1color.png}
}\hfill
\subfigure[text]{
\includegraphics[width=.24\textwidth]{1color.png}
}\hfill
\caption{blablabla}
\label{fig:whatever}
\end{figure*}
 
Four, use the subfloat operator. Notes you should add the package.

\usepackage{subfig}
\begin{figure*}[!htb]
\begin{center}
\subfloat{\includegraphics[width=4cm]{1color.png}} 
\subfloat{\includegraphics[width=4cm]{1color.png}}
\subfloat{\includegraphics[width=4cm]{1color.png}}
\subfloat{\includegraphics[width=4cm]{1color.png}}
\end{center}
\end{figure*}

Summary: if you want to place all images as one row, you'd better use the !htb.
 
Author: sgliu 11/22/2012 at Beijing

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值