3

I am using the following template for a document. The only problem I have is the last digit of the number "1900" does not line up with the "s" in the word "apples" on the right side of the file (please refer to the screenshot at the bottom). It seems "1900" would need one extra space to the right to exactly line up with the word "Apples". I don't know how to make that happen.

\documentclass[9pt]{article}
\usepackage{fullpage}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[usenames]{color}

\leftmargin=0.25in
\oddsidemargin=0.25in
\textwidth=6.0in
\topmargin=-0.25in
\textheight=9.25in

\raggedright

\pagenumbering{gobble}

\def\bull{\vrule height 0.8ex width .7ex depth -.1ex }
% DEFINITIONS

\newenvironment{changemargin}[2]{%
  \begin{list}{}{%
    \setlength{\topsep}{0pt}%
    \setlength{\leftmargin}{#1}%
    \setlength{\rightmargin}{#2}%
    \setlength{\listparindent}{\parindent}%
    \setlength{\itemindent}{\parindent}%
    \setlength{\parsep}{\parskip}%
  }%
  \item[]}{\end{list}
}

\newcommand{\lineover}{
    \begin{changemargin}{-0.05in}{-0.05in}
        \vspace*{-8pt}
        \hrulefill \\
        \vspace*{-2pt}
    \end{changemargin}
}

\newcommand{\header}[1]{
    \begin{changemargin}{-0.5in}{-0.5in}
        \scshape{#1}\\
    \lineover
    \end{changemargin}
}

\newcommand{\contact}[4]{
    \begin{changemargin}{-0.5in}{-0.5in}
        \begin{center}
            {\Large \scshape {#1}}\\ \smallskip
            {#2}\\ \smallskip 
            {#3}\\ \smallskip
            {#4}\smallskip
        \end{center}
    \end{changemargin}
}


% END DEFINITIONS

\begin{document}

\header{I Eat Apples}
\begin{body}
    \vspace{14pt}
    \textbf{One Apple} \hfill {Jan 1900}
    \vspace*{-4pt}
    \begin{itemize} \itemsep -0pt  % reduce space between items
        \item Two Apples \hfill{Apples}
    \end{itemize}
\end{body}

\end{document}

enter image description here

David Carlisle
  • 757,742
hpt
  • 31

1 Answers1

3

The problem is an unwanted white space by an end of line, the line with "Jan 1900". The following line \vspace*{-4pt} also belongs to the paragraph that ends with \begin{itemize}. Thus there are two spaces by line ends at the end of the paragraph. However TeX only removes one space by an internal \unskip and replaces it by \parfillskip. Thus the result at the end of this paragraph is:

(Jan 1900)<space><\parfillskip (0pt plus 1fil)>

The problem is solved by either inserting an emtpy line before \vspace. Then the paragraph has already ended and \vspace is called in vertical mode without effect of its line end.

Or at least one of the line ends is commented as shown in the example file:

\documentclass{article}
\begin{document}
    \textbf{One Apple} \hfill {Jan 1900}%
    \vspace*{-4pt}
    \begin{itemize} \itemsep -0pt  % reduce space between items
        \item Two Apples \hfill{Apples}
    \end{itemize}
\end{document}

Result

Heiko Oberdiek
  • 271,626