如何调整图形以适应单元格高度?

如何调整图形以适应单元格高度?

我有一张如下的表格'''

 \begin{table*}
 \centering
 \caption{******}
 \label{my-label}
 \begin{tabular}{ m{3cm} m{4cm} m{5cm}  }
 \toprule
 \textbf{Behavior}  
     &  \multicolumn{1}{c}{\textbf{Description}} & \textbf{Formula} \\ 
 \midrule           
 \includegraphics[width=0.15\textwidth,trim = 10 10 10 10,clip=true] 
  {separation.jpg}  
  & Separation: 
  &
  $\begin{aligned} 
  f_{s_{i}}=-\frac{w_{s}}{n_{i}}\sum_{j=1}^{n}g(d_{ij})d_{ij} \\
  g(d_{ij}) =
  \begin{cases} 
        1 & d_{ij}\leq r_{h}\\
       exp(-\frac{(d_{ij}-r_{h})^{2}}{\sigma^{2}})   & d_{ij}> r_{h}
  \end{cases}
  \end{aligned}$    
 \\ \hline
 \centering
 \includegraphics[width=0.15\textwidth,trim = 10 10 10 10,clip=true] 
 {alignment.jpg}  
 & Alignment:  
 &
 $\begin{aligned} 
 f_{s_{i}}=-\frac{w_{s}}{n_{i}}\sum_{j=1}^{n}g(d_{ij})d_{ij} \\
 g(d_{ij}) =
   \begin{cases} 
        1 & d_{ij}\leq r_{h}\\
       exp(-\frac{(d_{ij}-r_{h})^{2}}{\sigma^{2}})   & d_{ij}> r_{h}
     \end{cases}
   \end{aligned}$
   \\ \hline 
   \includegraphics[width=0.15\textwidth,trim = 10 10 10 10,clip=true] 
   {cohesion.jpg}  
  & Cohesion:
   &
   $\begin{aligned}
   f_{s_{i}}=-\frac{w_{s}}{n_{i}}\sum_{j=1}^{n}g(d_{ij})d_{ij} \\
   g(d_{ij}) =
    \begin{cases} 
        1 & d_{ij}\leq r_{h}\\
        exp(-\frac{(d_{ij}-r_{h})^{2}}{\sigma^{2}})   & d_{ij}> r_{h}
   \end{cases}    
   \end{aligned}$

  \end{tabular}
  \end{table*} 

如何才能使后两张图片看起来像第一张(相同大小)?

答案1

我从“相同尺寸”理解的意思是宽度相同?在这种情况下,您可以将第一张图片的宽度存储在新的长度中\newlength\picone,并在以下图片中使用该测量值。es\fbox仅用于显示宽度,\centering在第二张图片之前也将其删除。(此处的所有图片均由 Google 提供)

\documentclass{article}
\usepackage{amsmath,graphicx,array,booktabs}
\begin{document}

\newlength\picone
\settowidth\picone{\includegraphics[width=0.15\textwidth,trim = 10 10 10 10,clip=true]{separation.jpg}}

\begin{figure}[!t]
 \centering
 \fbox{\includegraphics[width=2.2in,trim = 10 10 10 10,clip=true]{flocks.jpg}}

 \caption{********** }
\label{fig_1}
\end{figure}


 \begin{table*}
 \centering
 \caption{******}
 \label{my-label}
 \begin{tabular}{ m{3cm} m{4cm} m{5cm}  }
 \toprule
 \textbf{Behavior}  
     &  \multicolumn{1}{c}{\textbf{Description}} & \textbf{Formula} \\ 
 \midrule           
 \fbox{\includegraphics[width=0.15\textwidth,trim = 10 10 10 10,clip=true] 
  {separation.jpg}}  
  & Separation: 
  &
  $\begin{aligned} 
  f_{s_{i}}=-\frac{w_{s}}{n_{i}}\sum_{j=1}^{n}g(d_{ij})d_{ij} \\
  g(d_{ij}) =
  \begin{cases} 
        1 & d_{ij}\leq r_{h}\\
       exp(-\frac{(d_{ij}-r_{h})^{2}}{\sigma^{2}})   & d_{ij}> r_{h}
  \end{cases}
  \end{aligned}$    
 \\ \hline
 %\centering
 \fbox{\includegraphics[width=\picone,trim = 10 10 10 10,clip=true] 
 {alignment.jpg}}  
 & Alignment:  
 &
 $\begin{aligned} 
 f_{s_{i}}=-\frac{w_{s}}{n_{i}}\sum_{j=1}^{n}g(d_{ij})d_{ij} \\
 g(d_{ij}) =
   \begin{cases} 
        1 & d_{ij}\leq r_{h}\\
       exp(-\frac{(d_{ij}-r_{h})^{2}}{\sigma^{2}})   & d_{ij}> r_{h}
     \end{cases}
   \end{aligned}$
   \\ \hline 
   \fbox{\includegraphics[width=0.15\textwidth,trim = 10 10 10 10,clip=true] 
   {cohesion.jpg}}  
  & Cohesion:
   &
   $\begin{aligned}
   f_{s_{i}}=-\frac{w_{s}}{n_{i}}\sum_{j=1}^{n}g(d_{ij})d_{ij} \\
   g(d_{ij}) =
    \begin{cases} 
        1 & d_{ij}\leq r_{h}\\
        exp(-\frac{(d_{ij}-r_{h})^{2}}{\sigma^{2}})   & d_{ij}> r_{h}
   \end{cases}    
   \end{aligned}$

  \end{tabular}
  \end{table*} 


\end{document}

在此处输入图片描述

相关内容