当有足够空间时文本将从新页面开始

当有足够空间时文本将从新页面开始

我正在写一封正式信函,发现模板。我非常喜欢它,并且做了一些改动后仍在使用。我的问题是,在最后加上我的签名后,我的名字会从新页面开始,尽管空间足够。

我的工作示例:

\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}

我知道这是一个很长的代码,但我不想跳过任何东西。因为我不知道是什么导致了这个问题。

输出如下: 在此处输入图片描述

谢谢。

答案1

像这样设置页面布局:

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

不太直观。不清楚实际边距有多大。您应该使用几何包为此。使用它,您可以轻松指定这样的边距。

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

在设置文档时,您还可以添加showframe可视化当前页面布局的选项。

在此处输入图片描述

相关内容