如何將多張圖像放在一起並在頁面上居中?

如何將多張圖像放在一起並在頁面上居中?

我不知道如何使圖像居中。目的是將圖像居中並使它們足夠大以延伸到裁剪線上方。

可選:是否可以控制影像的接近程度(換句話說,一個影像的下邊框與另一個影像的上邊框之間的間隙有多大)。

\documentclass[12pt]{extbook}
% ############################## geometry
\usepackage%[showframe]
           {geometry}
\geometry
  { hmarginratio =  1:1
  , vmarginratio = 1:1
  , bindingoffset = 0cm
  , onecolumn
  , a4paper
  , layoutwidth = 50 mm
  , layoutheight = 180 mm
  , layouthoffset=\dimexpr(\paperwidth-\csname Gm@layoutwidth\endcsname)/2\relax
   , layoutvoffset=\dimexpr(\paperheight-\csname Gm@layoutheight\endcsname)/2\relax
  , showcrop
  }
\usepackage{fancyhdr}
\usepackage{mwe}
\usepackage{graphicx}
% ############################### Document
\begin{document}
\pagenumbering{gobble}
\begin{figure}
\centering
\begin{minipage}[c]{\textwidth}
\centering
\noindent\includegraphics[width=5cm]{example-image}
\end{minipage}
\begin{minipage}[c]{\textwidth}
\centering
\noindent\includegraphics[width=5cm]{example-image}
\end{minipage}
\begin{minipage}[c]{\textwidth}
\centering
\noindent\includegraphics[width=5cm]{example-image}
\end{minipage}
\begin{minipage}[c]{\textwidth}
\centering
\noindent\includegraphics[width=5cm]{example-image}
\end{minipage}
\begin{minipage}[c]{\textwidth}
\centering
\noindent\includegraphics[width=5cm]{example-image}
\end{minipage}
\end{figure}
\end{document}

答案1

問題的陳述不是很清楚,但也許這就是你想要的。

\documentclass[12pt]{extbook}

% ############################## geometry
\usepackage{geometry}
\geometry{
  hmarginratio =  1:1,
  vmarginratio = 1:1,
  bindingoffset = 0cm,
  onecolumn,
  a4paper,
  layoutwidth = 50 mm,
  layoutheight = 180 mm,
  layouthoffset=\dimexpr(\paperwidth-\csname Gm@layoutwidth\endcsname)/2\relax,
  layoutvoffset=\dimexpr(\paperheight-\csname Gm@layoutheight\endcsname)/2\relax,
  showcrop
}

\usepackage{graphicx}

% ############################### Document

\begin{document}
\thispagestyle{empty}

{\parindent=0pt
 \newcommand{\shiftleft}{\hspace*{-0.5\dimexpr\csname Gm@layoutwidth\endcsname-\textwidth\relax}}

\shiftleft\includegraphics[width=5cm]{example-image}\shiftleft\vfill

\shiftleft\includegraphics[width=5cm]{example-image}\shiftleft\vfill

\shiftleft\includegraphics[width=5cm]{example-image}\shiftleft

}
\end{document}

在此輸入影像描述

相關內容