[Tex/LaTex] 3 Columns Minipage with Alignments

horizontal alignmentminipage

I have the following title with bad alignments.

\documentclass[a4paper,12pt]{article}
\usepackage[landscape,margin=10mm]{geometry}

\pagestyle{empty}

\begin{document}

\begin{minipage}[r]{0.19\textwidth}
  \rule{30mm}{30mm}
\end{minipage}%
\hfill
\begin{minipage}[c]{0.58\textwidth}
  \begin{center}
    {\Huge Title}
  \end{center}
\end{minipage}%
\hfill
\begin{minipage}[r]{0.19\textwidth}
  \rule{30mm}{30mm}
\end{minipage}%

\end{document}

enter image description here
How can we make same the distances marked by red color?

Best Answer

Note that the reason why your example was not giving the desire result was because 0.19\textwidth was much larger than 30mm which \rule{30mm}{30mm} is.

enter image description here

Here is mwe:

\documentclass[a4paper,12pt]{article}
\usepackage[showframe,landscape,margin=10mm]{geometry}
\usepackage{calc}

\pagestyle{empty}
\newcommand{\logo}{\rule{30mm}{30mm}} % More than likely an \includegraphics here

\newlength\logowidth
\setlength{\logowidth}{\widthof{\logo}} % Place the logo declaration here

\begin{document}
\noindent
\begin{minipage}[c]{\logowidth}
  \logo
\end{minipage}\hfill
\begin{minipage}[c]{0.58\textwidth}
  \begin{center}
    {\Huge Title}
  \end{center}
\end{minipage}\hfill
\begin{minipage}[c]{\logowidth}
  \logo
\end{minipage}

\end{document}

enter image description here

Here is a version with graphics:

\documentclass[a4paper,12pt]{article}
\usepackage[showframe,landscape,margin=10mm]{geometry}
\usepackage{calc}
\usepackage{mwe} % For graphics purpose only.

\pagestyle{empty}
\newcommand{\logo}{\includegraphics[width=30mm]{example-image-a}}

\newlength\logowidth
\setlength{\logowidth}{\widthof{\logo}}

\begin{document}
\noindent
\begin{minipage}[c]{\logowidth}
  \logo
\end{minipage}\hfill
\begin{minipage}[c]{0.58\textwidth}
  \begin{center}
    {\Huge Title}
  \end{center}
\end{minipage}\hfill
\begin{minipage}[c]{\logowidth}
  \logo
\end{minipage}

\end{document}

enter image description here