![如何确保带有两个徽标的求职信与页边距完全对齐?](https://linux22.com/image/432038/%E5%A6%82%E4%BD%95%E7%A1%AE%E4%BF%9D%E5%B8%A6%E6%9C%89%E4%B8%A4%E4%B8%AA%E5%BE%BD%E6%A0%87%E7%9A%84%E6%B1%82%E8%81%8C%E4%BF%A1%E4%B8%8E%E9%A1%B5%E8%BE%B9%E8%B7%9D%E5%AE%8C%E5%85%A8%E5%AF%B9%E9%BD%90%EF%BC%9F.png)
我想制作一封带有两个徽标的求职信。我根据@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}}}%
}