1

I would like to make a cover letter with two logos. I based my attempt on @egreg's answer for a similar question but I want two logos instead of one. I thought I managed but I realized (using \usepackage[showframe]{geometry}) that the image to the left is not perfectly aligned with the margin.

\documentclass[11pt]{letter}
\usepackage[showframe]{geometry}
\geometry{
  textwidth=6.5in,
  textheight=8.5in,
}
\usepackage{graphicx}
\usepackage{lipsum}

\begin{document}

\begin{letter}{mr. so and so \\ 123 main st \\ blah blah, IL 60617}

\makebox[\linewidth]{
  \makebox[0pt][l]{\raisebox{-.5\height}{\includegraphics[height=3cm]{example-image}}}%
  \hfill
  \begin{tabular}{c}
  \large\bfseries Cowbell Place \\ 
  PO Box 5551212 \\ Chicago, IL 60617
  \end{tabular}\hfill
  \makebox[0pt][r]{\raisebox{-.5\height}{\includegraphics[height=3cm]{example-image}}}%
}

\vspace{2cm}

\signature{some dude}

\opening{mr. so and so,}

\lipsum[1-2]

\closing{Sincerely,}

\end{letter}

\end{document}

How do I make it perfectly aligned with the margin?

0
1

You have correctly protected your

\makebox[0pt][l]{\raisebox{-.5\height}{\includegraphics[height=3cm]{example-image}}}%
% [... other stuff ...]
\makebox[0pt][r]{\raisebox{-.5\height}{\includegraphics[height=3cm]{example-image}}}%

from spurious spaces by adding comment signs % at the end of the line, but you forgot one in the first \makebox

\makebox[\linewidth]{
% [ ... ]
}

The new line after the opening brace is treated as a space, and that's the empty space you see between the border and the image.

\makebox[\linewidth]{%  <--- THIS ONE IS IMPORTANT TOO
  \makebox[0pt][l]{\raisebox{-.5\height}{\includegraphics[height=3cm]{example-image}}}%
  \hfill
  \begin{tabular}{c}
  \large\bfseries Cowbell Place \\ 
  PO Box 5551212 \\ Chicago, IL 60617
  \end{tabular}\hfill
  \makebox[0pt][r]{\raisebox{-.5\height}{\includegraphics[height=3cm]{example-image}}}%
}

enter image description here

1
  • There you go -- I always forget something. Thank you for setting me straight, @campa. :) Apr 12 at 11:27

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.