0

The current solution I found with minipages displays the two figures next to each other however it also adds a lot of space inbetween them. I'd like to have the two images be right next to each other with no space.

\begin{document}
\begin{figure}
    \centering
    \begin{minipage}{0.4\textwidth}
        \centering
        \href{https://link}{\includegraphics[width=5cm,height=5cm,keepaspectratio]{"image1".jpg}}
    \end{minipage}\hfill
    \begin{minipage}{0.4\textwidth}
        \centering
        \href{https://link}{\includegraphics[width=5cm,height=5cm,keepaspectratio]{"image2".jpg}}
    \end{minipage}
\end{figure}
\end{document}
  • 1
    You don't need to do anything: \includegraphics adds no space so just use two \include graphics. – David Carlisle Dec 29 '18 at 12:23
  • @DavidCarlisle I'm not sure I follow you. The code I'm using so far uses the \includegraphics twice but it still produces white space in between the two images. – WoeIs Dec 29 '18 at 13:42
  • 2
    You do not need minipage etc. Includegraphics is positioned exactly like a letter so XX has no space between and X X has a space. You are forcing a space of 0.2\textwidth – David Carlisle Dec 29 '18 at 13:56
  • @DavidCarlisle You're right! I wasn't aware it could be made so simple. Thank you! – WoeIs Dec 29 '18 at 14:39
  • In addition to the minipage adding space, the \hfill is adding as much space as possible. – TH. Dec 29 '18 at 17:16

Your Answer

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

Browse other questions tagged or ask your own question.