0

I am writing a formal letter and found this template. I liked it very much and I am using it with a few changes. My problem is after I include my signature at the very end, my name starts from a new page even though there is enough space.

My working example:

\documentclass[11pt, a4paper]{letter} % Specify the font size (10pt, 11pt and 12pt) and paper size (letterpaper, a4paper, etc)
\usepackage{graphicx} % Required for including pictures
\usepackage{microtype} % Improves typography
\usepackage{gfsdidot} % Use the GFS Didot font: http://www.tug.dk/FontCatalogue/gfsdidot/
\usepackage[T1]{fontenc} % Required for accented characters
\usepackage{placeins}

\usepackage{float}
\usepackage{caption}

\newfloat{figure}{htbp}{figs}

% Create a new command for the horizontal rule in the document which allows thickness specification
\makeatletter
\def\vhrulefill#1{\leavevmode\leaders\hrule\@height#1\hfill \kern\z@}
\makeatother

%----------------------------------------------------------------------------------------
%   DOCUMENT MARGINS
%----------------------------------------------------------------------------------------

\textwidth 6.75in
\textheight 9.25in
\oddsidemargin -.25in
\evensidemargin -.25in
\topmargin -1.5in
%----------------------------------------------------------------------------------------
%   SENDER INFORMATION
%----------------------------------------------------------------------------------------

\def\Who{Your name} % Your name
\def\What{Your title} % Your title
\def\Where{Your department/institution} % Your department/institution
\def\Address{Your address} % Your address
\def\CityZip{ Your city, zip code, country, etc} % Your city, zip code, country, etc
\def\Email{Your email address} % Your email address
\def\TEL{Your phone number} % Your phone number

%----------------------------------------------------------------------------------------
%   HEADER AND FROM ADDRESS STRUCTURE
%----------------------------------------------------------------------------------------

\address{
\includegraphics[width=1.5in]{logo.png} % Include the logo of your institution
\hspace{5.1in} % Position of the institution logo, increase to move left, decrease to move right
\vskip -0.7in~\\ % Position of the text in relation to the institution logo, increase to move down, decrease to move up
~\\[0.05in] % Reduce the whitespace above the horizontal rule
\hspace{1.8in}\vhrulefill{1pt} \\ % Horizontal rule, adjust hspace if your logo is wide and \vhrulefill for the thickness of the rule
\hspace{\fill}\parbox[t]{2.85in}{ % Create a box for your details underneath the horizontal rule on the right
\footnotesize % Use a smaller font size for the details
\Who \\ \em % Your name, all text after this will be italicized
\What \\
\Where\\ % Your department
\Address\\ % Your address
\CityZip\\ % Your city and zip code
\TEL\\ % Your phone number
\Email\\ % Your email address
}
\hspace{-1.1in} % Horizontal position of this block, increase to move left, decrease to move right
\vspace{-1in} % Move the letter content up for a more compact look
}

%----------------------------------------------------------------------------------------
%   TO ADDRESS STRUCTURE
%----------------------------------------------------------------------------------------

\def\opening#1{\thispagestyle{empty}
{\centering\fromaddress \vspace{1.in} \\ % Print the header and from address here, add whitespace to move date down
January 28, 2016\hspace*{\fill}\par}
{\raggedright \toname \\ \toaddress \par} % Print the to name and address
\vspace{0.4in} % White space after the to address
\noindent #1 % Print the opening line
}

%----------------------------------------------------------------------------------------

\begin{document}

%----------------------------------------------------------------------------------------
%   TO ADDRESS
%----------------------------------------------------------------------------------------

\begin{letter}
{Someone\\
Some position\\
Some company\\
Street\\
City\\
}

%----------------------------------------------------------------------------------------
%   LETTER CONTENT
%----------------------------------------------------------------------------------------

\opening{Dear Sir/Madam,}

Bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
 bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
  bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
   bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla.

Bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
 bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
  bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
   bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
    bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
     bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla.

 bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
  bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
   bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
    bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla

 bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
  bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
   bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
    bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla

Sincerely,
\begin{figure}[!h]
\includegraphics[width=1.5in]{sig.png}
\end{figure}

My name

%----------------------------------------------------------------------------------------

\end{letter}
\end{document}

I know it is a long code, but I didn't want to skip anything. Since I do not know what causes the problem.

Here is the output: enter image description here

Thank you.

  • I guess that your scanned signature contains a lot of blank area below the blue sign. You can use \fbox{} around it to see the used area. – Sigur Jan 29 '16 at 21:07
  • Also, you don't need to use figure environment to include the signature. – Sigur Jan 29 '16 at 21:08
  • @Sigur No, I cropped the image. Also checked with fbox, no blank area. – massakrienen Jan 29 '16 at 21:16
  • 1
    I suppose there is quite a big margin at the bottom of the page. You can add \usepackage[showframe]{geometry} temporarily to make the margins visible. – Benjamin Jan 29 '16 at 22:38
  • @Benjamin Yes, you are right. I increased the textheight and it worked. Thanks. If you convert your comment into an answer, I will accept it. – massakrienen Jan 29 '16 at 23:07
0

Setting the page layout like this:

\textwidth 6.75in
\textheight 9.25in
\oddsidemargin -.25in
\evensidemargin -.25in
\topmargin -1.5in

is not very intuitive. It is not clear how big the actual margins are. You should use the geometry package for that. With it you can easily specify the margins like this.

\usepackage[left=1.5cm, right=1.5cm, top=0.5cm, bottom=2cm]{geometry}

While setting up your document you can also add the showframe option to visualize the current page layout.

enter image description here

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.