1

I can't figure out how to center the images. The aim is to center the images and make them large enough to stretch over the cropping line.

Optionally: Is it possible to control how close the images are (in other words how big is the gap between the bottom border of one image and the top border of another image).

\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}
2

The statement of the problem is not very clear, but perhaps this is what you want.

\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}

enter image description here

  • Excellent! How can I control the vertical position? (the gap between them). I want to place all 5 images close to each other. This is meant to be bookmark :) – chejnik Feb 17 '16 at 12:20
  • 1
    @chejnik Put \vspace*{\fill} at the top and at the bottom, and \vspace{<whatever} between the images. – egreg Feb 17 '16 at 13:50
  • Thank you, I am using \vspace and I have added also command to shift it up \newcommand{\shiftup}{\vspace*{-0.15\dimexpr\csname Gm@layoutheight\endcsname-\textwidth\relax}} (regards to your code). – chejnik Feb 17 '16 at 14:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.