3

I'm trying to make a cover using minipage for the logos on the top of the page, but it overloads the right margin

Here's the code:

\documentclass[hidelinks,a4paper,11pt,draft]{article}

\usepackage{graphicx}
\usepackage{geometry}
\usepackage{showframe}
\usepackage{draftfigure}

\begin{document}

\begin{titlepage}
    \begin{minipage}{\textwidth}
        $\vcenter{\hbox{\includegraphics[width=0.2\textwidth]{tyty.png}}}$
        \hfill
        $\vcenter{\hbox{\includegraphics[width=0.3\textwidth]{kile.png}}}$
    \end{minipage}%
\end{titlepage}

\end{document}

And here's a screenshot: enter image description here

1
  • 1
    Commenting out the \minipage environment does it for me. It is not needed here. your first image (tyty) is indented, use \noindent. Edit: Got ninja'ed, @David's answer provides a better and fuller explanation.
    – Huang_d
    May 21, 2017 at 19:57

1 Answer 1

5

It's indented by the paragarph indentation so

    \noindent
    \begin{minipage}{\textwidth}

but the minipage is doing nothing here, and \vcenter and \hbox are not really latex constructs either,

\documentclass[hidelinks,a4paper,11pt,draft]{article}

\usepackage{graphicx}
\usepackage{geometry}
\usepackage{showframe}
\usepackage{draftfigure}
\usepackage[export]{adjustbox}
\begin{document}

\begin{titlepage}
    \noindent
    \includegraphics[valign=c,width=0.2\textwidth]{tyty.png}%
        \hfill
    \includegraphics[valign=c,width=0.3\textwidth]{kile.png}%
\end{titlepage}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .