使用小型頁面減少並排放置的兩個影像之間的距離

使用小型頁面減少並排放置的兩個影像之間的距離

有人可以解釋如何手動控制使用 minipage 並排放置的兩個影像之間的距離嗎?

我嘗試使用 \hspace{-0.5cm} 但它似乎不起作用。

這就是我目前包含圖像的方式:

\begin{figure}[h]
  \begin{tabular}{cc}  
\hspace{-0.5cm}
      \begin{minipage}{.5\textwidth}
      \centering
      \includegraphics[width=6.0cm]{images/result1}
      \end{minipage} 
 &
 \hspace{-0.1cm}
      \begin{minipage}{0.5\textwidth}
      \centering
      \includegraphics[width=6.0cm]{images/result2}
      \end{minipage}
  \end{tabular}      
  \vspace{0.1cm}
  \caption{results}
\end{figure}

我嘗試修改[width=6.0cm]{0.5\textwidth},但我永遠無法在兩個圖像之間獲得真正的薄邊距。如果我忽略tabular環境,邊距會變窄,但圖像不再居中,而是黏在頁面的左邊框上。

答案1

表格和小頁都不需要,

在此輸入影像描述

\documentclass{article}

\usepackage{graphicx}

\begin{document}
\begin{figure}
\centering

\includegraphics[width=5cm]{example-image-a}%
\hspace{.25cm}%
\includegraphics[width=5cm]{example-image-b}%

\caption{two images .25cm apart}
\end{figure}
\end{document}

相關內容