2

I have a cover letter with the following:

\documentclass[12pt]{letter}
\usepackage[left=1.0in,top=1.0in,right=1.0in,bottom=1.0in]{geometry}
\title{title}
    \author{author}
    \date{date}
    \usepackage{geometry}
    \geometry{letterpaper, portrait, margin=1in}
    \pagenumbering{gobble} 
    \begin{document}
    \begin{flushright}\hfill\begin{tabular}{l@{}}
        Name \\
        Address \\
        City, State 12345 \\\\
        00 Month Year
    \end{tabular}
    \end{flushright}

\bigskip 

\begin{flushleft}
    Name \\
    School \\
    Address \\
    City, State 12345 \\
 \end{flushleft}

The text box with \begin{tabular} (first instance of name, address, etc.) appears to be flush with the 1 inch margin on the right side. However, for some reason, there is a tiny space between the text box and the 1 inch margin on the top. Using a tape measure the space is 1/16th of an inch. How do I remove this space and make the text box flush with the top 1 inch margin? Thanks

6
  • And be aware that the code snippet cannot be compiled by others without additional work. Commented Jan 27, 2021 at 23:14
  • Make sure that you read and understand tex.meta.stackexchange.com/questions/228/… Commented Jan 27, 2021 at 23:19
  • you have provided no example that shows the problem but I would guess removing the \hfill and using \begin{tabular}[t] would fix it (if the problem is what i guess it is) Commented Jan 27, 2021 at 23:20
  • I edited my question to give more info, should be able to compile now. Sorry about that
    – Pond892
    Commented Jan 27, 2021 at 23:47
  • Please consider to accept the provided answer if it was helpful. Commented Jan 28, 2021 at 3:58

2 Answers 2

2

The tabular lines have a minimum height, which is \ht\strutbox and is larger than the height of a capital letter.

You need to remove this difference. However, a vertical space at the top of a page would be removed unless you use \vspace*; this trigger the insertion of \topskip glue and also \lineskip glue because the tabular needs to be typeset with b alignment.

\documentclass{article}
\usepackage{geometry}
\geometry{letterpaper, portrait, margin=1in,showframe}

\begin{document}

\begin{flushright}
%% remove the \topskip, the \lineskip and the difference
%% between a capital letter and the height of a strut
\vspace*{\dimexpr\fontcharht\font`N-\ht\strutbox-\topskip-\lineskip}
%% Now typeset the tabular with bottom alignment
\begin{tabular}[b]{l@{}}
Name \\
Address \\
City, State 12345 \\\\
00 Month Year
\end{tabular}
\end{flushright}

\end{document}

enter image description here

The rules are the effect of showframe, in order to clearly show the placement. Remove the option for the production version.

I wouldn't bother with this tiny difference, which actually is 1/46th of an inch, at 10pt size and 1/37th at 12pt size, in any case less than 2pt.

1
  • Thanks, when you say don't bother, do you mean a little space remains even after making the changes you suggest? Perhaps there is a better approach to inserting a top right address (cover letter style) than \begin{tabular} such that the issue doesn't arise?
    – Pond892
    Commented Jan 27, 2021 at 23:53
0

I found there is actually this option: https://texblog.org/2007/08/15/writing-a-letter-in-latex/ which lets me format a cover letter automatically. My question above came about as a result of trying to format a cover letter manually rather than using the linked method.

1

You must log in to answer this question.

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