我想制作一封带有两个徽标的求职信。我根据@egreg的回答尝试了类似的问题但我想要两个徽标,而不是一个。我以为我成功了,但我意识到(使用\usepackage[showframe]{geometry}
)左侧的图像与边距没有完全对齐。
\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}
我如何才能使其与边缘完美对齐?
答案1
您已正确保护了您的
\makebox[0pt][l]{\raisebox{-.5\height}{\includegraphics[height=3cm]{example-image}}}%
% [... other stuff ...]
\makebox[0pt][r]{\raisebox{-.5\height}{\includegraphics[height=3cm]{example-image}}}%
%
通过在行尾添加注释符号来消除虚假空格,但你在第一个中忘记了一个\makebox
\makebox[\linewidth]{
% [ ... ]
}
左括号后的新行被视为空格,这就是边框和图像之间看到的空白区域。
\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}}}%
}