更改行距问题

更改行距问题

我正在使用大学模板,根据我的审阅者的说法,我的段落行距不是 1.5。因此,在尝试更改时,我在 cls 文件中发现了这一点。

\def\setstretch#1{\renewcommand{\baselinestretch}{#1}}

由于我是乳胶新手,所以我不知道它的作用,但上面的评论警告不要更改它,因为它可能会影响脚注、标题、标题等。我不知道#1 从哪里来,对我来说看起来像一个参数。

有人告诉我在每一章中添加行距以避免表格、边距等出现任何问题。这里是类部分,我认为它定义了所有间距等。我还发现了一个用于 setspace 的单独文件。

%    ***************************************
%    *     SINGLESPACE ANd DOUBLESPACE     *
%    ***************************************     


%-------------------------------------------------------------------------------
%
% LaTeX Document style option "doublespace"
% -- usage:  \documentstyle[...,doublespace,...]{...}
%
% This style option produces a double-spaced document by redefining
% the LaTeX parameter \baselinestretch to 2.
%
% It also fixes a number of problems with standard LaTeX, as follows:
%
% 1. A new environment "singlespace" is provided, within which single
%    spacing will apply.
%    JFL - changed so that it works in regular text and so that vertical
%    space is before and after is correctly computed
% 2. Double spacing is turned off within footnotes and floats (figures
%    and tables).
% 3. Proper double spacing happens below tabular environments and in other
%    places where LaTeX uses a strut.
% 4. Slightly more space is inserted before footnotes.
% 5. JFL - fixes spacing before and after displayed math
%
% Note: This version sets a baselinestretch of 2. If this is too much,
%    put  \setstretch{1.7}  (or some appropriate value) before the
%    \begin{document} command. To print the document with single spacing
%    again, without removing "singlespace" environments, just put a
%    \setstretch{1} at the top of the document.
%
% PLEASE REPORT ANY BUGS
%
%
% Known bugs:
%    . It might be nice if spacing before the footnote rule (\footins)
%      were provided in a tidier way.
%    . Increasing struts may possibly cause some other obscure part of
%      formatting to fall over.
%    . \begin{singlespace}\begin{quote} produces the wrong spacing before
%      the quote (extra glue is inserted).
%    . shouldn't @setsize stretch parskip as well?
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%---Set up double spacing

%\def\baselinestretch{1}


%---New command "\setstretch" (slightly more mnemonic... and easier to type)

\def\setstretch#1{\renewcommand{\baselinestretch}{#1}}

%---Stretch the baseline BEFORE calculating the strut size. This improves
%   spacing below tabular environments etc., probably...
%   Comments are welcomed.

\def\@setsize#1#2#3#4{\@nomath#1%
   \let\@currsize#1\baselineskip
   #2\baselineskip\baselinestretch\baselineskip
   \parskip\baselinestretch\parskip
   \setbox\strutbox\hbox{\vrule height.7\baselineskip
      depth.3\baselineskip width\z@}%
   \normalbaselineskip\baselineskip#3#4}


%---Increase the space between last line of text and footnote rule.
%   This is a very untidy way to do it!

\skip\footins 25pt plus4pt minus4pt


%---Reset baselinestretch within footnotes and floats. Originally stolen
%   from Stanford thesis style.

\def\@xfloat#1[#2]{\ifhmode \@bsphack\@floatpenalty -\@Mii\else
   \@floatpenalty-\@Miii\fi\def\@captype{#1}\ifinner
      \@parmoderr\@floatpenalty\z@
    \else\@next\@currbox\@freelist{\@tempcnta\csname ftype@#1\endcsname
       \multiply\@tempcnta\@xxxii\advance\@tempcnta\sixt@@n
       \@tfor \@tempa :=#2\do
                        {\if\@tempa h\advance\@tempcnta \@ne\fi
                         \if\@tempa t\advance\@tempcnta \tw@\fi
                         \if\@tempa b\advance\@tempcnta 4\relax\fi
                         \if\@tempa p\advance\@tempcnta 8\relax\fi
         }\global\count\@currbox\@tempcnta}\@fltovf\fi
    \global\setbox\@currbox\color@vbox\normalcolor\vbox\bgroup 
    \def\baselinestretch{1}\small\normalsize
    \boxmaxdepth\z@
    \hsize\columnwidth \@parboxrestore}
\long\def\@footnotetext#1{\insert\footins{\def\baselinestretch{1}\footnotesize
    \interlinepenalty\interfootnotelinepenalty 
    \splittopskip\footnotesep
    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
    \hsize\columnwidth \@parboxrestore
   \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}\@makefntext
    {\rule{\z@}{\footnotesep}\ignorespaces
      #1\strut}}}

% Stolen from MIT.
%
% A single spaced quote (say) is done by surrounding singlespace with quote.
%
\def\sspace{%
\vskip\parskip%
\vskip\baselineskip%
\def\baselinestretch{0.65}%
\ifx\@currsize\normalsize\@normalsize\else\@currsize\fi%
\vskip-\parskip%
\vskip-\baselineskip%
}

\def\endsspace{\par}

%  spacing, doublespace and onehalfspace all are meant to INCREASE the
%  spacing (i.e. calling onehalfspace from within doublespace will not
%  produce a graceful transition between spacings)
%
\def\spacing#1{\par%
 \def\baselinestretch{#1}%
 \ifx\@currsize\normalsize\@normalsize\else\@currsize\fi}

\def\endspacing{\par%
 \vskip \parskip%
 \vskip \baselineskip%
 \endgroup%
 \vskip -\parskip%
 \vskip -\baselineskip%
 \begingroup}

\def\onehalfspace{\spacing{1.5}}
\let\endonehalfspace=\endspacing

\def\dspace{\spacing{2}}
\let\dspace=\endspacing

% Fix up spacing before and after displayed math
% (arraystretch seems to do a fine job for inside LaTeX displayed math,
% since array and eqnarray seem to be affected as expected)
% Changing \baselinestretch and doing a font change also works if done here,
% but then you have to change @setsize to remove the call to @nomath)
%
\everydisplay{
   \abovedisplayskip \baselinestretch\abovedisplayskip%
   \belowdisplayskip \abovedisplayskip%
   \abovedisplayshortskip \baselinestretch\abovedisplayshortskip%
   \belowdisplayshortskip  \baselinestretch\belowdisplayshortskip}

设置空间

% You may freely use, modify, and/or distribute this file, without limitation. 
%%% ======================================================================
%%%  @LaTeX-style-file{
%%%     filename        = "setspace.sty",
%%%     codetable       = "ISO/ASCII",
%%%     checksum        = "11793 546 2608 21972",
%%%     docstring       = "setspace.sty is a LaTeX (2e) package.
%%%                        Comments and bug reports welcome!
%%%                        
%%%                        Solovay's checksum utility."
%%% }
%%% ======================================================================
%% FILE:   setspace.sty in SYS2.TEX.PUB.ISULATEX.STYLES
%% AUTHOR: Erica M. S. Harris
%% DATE:   April 1990
%% MOD:    March 1991
%%%
%%% Update to LaTeX (2e) :  6 Feb 1996.
%%% Description:  LaTeX Document Package "setspace"
%%%
%%% Usage:
%%%                \documentclass[...]{...}
%%%                \usepackage{setspace}
%%%
%%         Based on the doublespace option created by Stephen Page.
%%
%%         This style option provides commands and environments for doing
%%         double and  one-and-a-half spacing based on pt size.
%%
%%         Single spacing is the default.
%%
%%         Three commands, \singlespacing, \onehalfspacing, and
%%         \doublespacing, are for use in the preamble to set the overall
%%         spacing for the document.  If a different spacing is required then
%%         the \setstretch{baselinestretch} command can be used in the
%%         preamble to set the baselinestretch appropriately.  The default
%%         spacing with this style option is single spacing.
%%
%%         Three environments, singlespace, onehalfspace, and doublespace,
%%         allow the spacing to be changed within the document.  Both the
%%         onehalfspace and doublespace environments are intended to increase
%%         the spacing, so the onehalfspace environment should not be used in
%%         a double spaced document.  If an increased spacing different from
%%         one-and-a-half or double spacing is required then the spacing
%%         environment can be used.  The spacing environment takes one
%%         argument which is the larger baselinestretch to use,
%%         e.g., \begin{spacing}{2.5}.
%%
%%         \footins is adjusted the same as \parskip - appears to work. Lose
%%         stretch parts but don't consider that to be crucial
%%
%%         Removed code for altering spacing before and after displayed
%%         equations - just looked too much.
%%
%% MODS:
%%         Redefinition of \spacing and \endspacing for consistency with
%%         TeX 3.x inserted by George Greenwade.  Modification provided by
%%         Philip Ross ([email protected]) and John Byrne via INFO-TeX.
%%
%% PLEASE REPORT ANY BUGS
%%
%%   Old Documentation follows:
%%         1. A new environment "singlespace" is provided, within which single
%%            spacing will apply.
%%            JFL - changed so that it works in regular text and so that
%%            vertical space before and after is correctly computed
%%         2. Double spacing is turned off within footnotes and floats (figures
%%            and tables).
%%         3. Proper double spacing happens below tabular environments and in
%%            other places where LaTeX uses a strut.
%%         4. Slightly more space is inserted before footnotes.
%%         5. JFL - fixes spacing before and after displayed math
%%
%%
%%    mods:   Jean-Francois Lamy
%%            [email protected]
%%            [email protected]
%%
%% POSSIBLE BUGS:
%%    . Increasing struts may possibly cause some other obscure part of
%%      formatting to fall over.
%%    . \begin{singlespace}\begin{quote} produces the wrong spacing before
%%      the quote (extra glue is inserted).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\NeedsTeXFormat {LaTeX2e}[1994/12/01]
\def \filename {setspace.sty}
\def \filedate {2000/12/01}
\def \fileversion {6.7}
\ProvidesPackage {setspace}[\filedate\space\fileversion\space
  Contributed and Supported LaTeX2e package]
\typeout {Package: `setspace' \fileversion\space <\filedate>}

% BP: add nodisplayskipstretch option and \setdisplayskipstretch command.

\newcommand{\displayskipstretch}{\baselinestretch}
\newcommand{\setdisplayskipstretch}[1]{\renewcommand{\displayskipstretch}{#1}}
\DeclareOption{nodisplayskipstretch}{\setdisplayskipstretch{1.0}}

% GT: add George Pearsons' suggested options.

\DeclareOption{singlespacing}{\AtEndOfPackage{\singlespacing}}
\DeclareOption{onehalfspacing}{\AtEndOfPackage{\onehalfspacing}}
\DeclareOption{doublespacing}{\AtEndOfPackage{\doublespacing}}

\ProcessOptions

% GT:  Sat 28 Sep 1996:  Widely using \newcommand, \renewcommand, and
% \newenvironment, instead of \def.

% ** Line space commands.

\newcommand{\setstretch}[1]{%
  \def\baselinestretch{#1}%
  \@currsize
}

% GT:  Sat 28 Sep 1996:  spacing commands and environments modified to
% use \setstretch instead of \baselinestretch.
%
% GT:  Sat 28 Sep 1996:  No, I don't know understand the line spacing
% algorithms!  If someone (LaTeX team) can enlighten me as to the
% general rule, please do!  It would be very pleasant if setspace.sty
% were suited for document font sizes other than 10, 11 and 12 pt.
%
% GT:  Tue 10 Dec 1996:  Instead of fixing singlespacing to exact unity,
% allow user to redefine it (only slightly, please!) from its initial
% value of unity, in the case when a particular font is slightly larger
% or slightly smaller than its point size would indicate.  This change
% affects setspace's single spacing commands, and LaTeX's footnote and
% float environments.  The one and a half, double, and arbitrary
% spacing commands are unaltered.

\newcommand{\SetSinglespace}[1]{%
  \def\setspace@singlespace{#1}%
}

% Here's the default single line spacing value.
\SetSinglespace{1}

\newcommand{\singlespacing}{%
  \setstretch {\setspace@singlespace}%  normally 1
  \vskip \baselineskip  % Correction for coming into singlespace
}

\newcommand{\onehalfspacing}{%
  \setstretch{1.25}%  default
  \ifcase \@ptsize \relax % 10pt
    \setstretch {1.25}%
  \or % 11pt
    \setstretch {1.213}%
  \or % 12pt
    \setstretch {1.241}%
  \fi
}

\newcommand{\doublespacing}{%
  \setstretch {1.667}%  default
  \ifcase \@ptsize \relax % 10pt
    \setstretch {1.667}%
  \or % 11pt
    \setstretch {1.618}%
  \or % 12pt
    \setstretch {1.655}%
  \fi
}

% ** Modification of the LaTeX command \@setsize.

%---Stretch the baseline BEFORE calculating the strut size. This improves
%   spacing below tabular environments etc., probably...
%   Comments are welcomed.

% GT:  Sun 29 Sep 1996:  Question:  Is this code anywhere near correct
% since this part of LaTeX (in, eg, latex.ltx) has been greatly changed?

% GT:  Sun 29 Sep 1996:  The meanings of the arguments to \@setsize
% appear to be (whatever these may signify) :
% current size; font baselineskip; ignored (!); and font size.

% GT:  Sun 29 Sep 1996:  Note that \@setsize (in latest LaTeX,
% \@setfontsize, which is called by \@setsize) seems to be the only
% place in purely modern LaTeX where \@currsize is set, and ltxguide.cls
% seems to be the only file in the LaTeX base distribution that uses it!

\def\@setsize#1#2#3#4{%
  % Modified 1993.04.07--GDG per KPC
  \@nomath#1%
  \let\@currsize#1%
  \baselineskip #2%
  \baselineskip \baselinestretch\baselineskip
  \parskip \baselinestretch\parskip
  \setbox\strutbox \hbox{%
    \vrule height.7\baselineskip
           depth.3\baselineskip
           width\z@}%
  \skip\footins \baselinestretch\skip\footins
  \normalbaselineskip\baselineskip#3#4}

% ** Float and footnote adjustments to compensate for a change in the
% ** main text's line spacing.

%---Increase the space between last line of text and footnote rule.
%\skip\footins 20pt plus4pt minus4pt

%---Reset baselinestretch within floats and footnotes.

% GT:  Tue 23 Jan 1996:  This is where the conflict with the combination
% of the color package and the figure environment used to occur.

% Floats.

% GT:  Sat 28 Sep 1996:  \@xfloat is the only place where \normalsize
% is still used in setspace.sty !

\let\latex@xfloat=\@xfloat
\def\@xfloat #1[#2]{%
  \latex@xfloat #1[#2]%
  \def\baselinestretch{\setspace@singlespace}%
  \normalsize
}

% GT:  Wed 24 Jan 1996:  This footnote code was copied from LaTeX and
% modified rather naively.  It had to be brought up to date, not only
% because of LaTeX's new color ability, but also because ther had
% been major changes to this code in LaTeX at least as far back as
% March 1992.

% Normal, bottom of the page, footnotes.
%
% GT:  Based HEAVILY on original LaTeX (2e) code.  A standard hook would
% be MUCH preferred, so that LaTeX's footnote implementation needn't be
% copied each time it changes.
%
% GT:  The \protected@edef requires at least the December 1994 LaTeX.
% This is precisely the kind of VERSION DEPENDENCY situation that
% cannot (AFAIK) be avoided, because LaTeX (2e) LACKS appropriate
% standard hooks and/or context markers.

\long\def\@footnotetext#1{%
  \insert\footins{%
% GT:  Next line added.  Hook desired here!
    \def\baselinestretch {\setspace@singlespace}%
    \reset@font\footnotesize
    \interlinepenalty\interfootnotelinepenalty
    \splittopskip\footnotesep
    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
    \hsize\columnwidth
    \@parboxrestore
    \protected@edef\@currentlabel{%
      \csname p@footnote\endcsname\@thefnmark
    }%
    \color@begingroup
      \@makefntext{%
        \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
    \color@endgroup}}

% Minipage footnotes.

\long\def\@mpfootnotetext#1{%
  \global\setbox\@mpfootins\vbox{%
    \unvbox \@mpfootins
%  GT:  Next line added.  Hook desired here!
    \def\baselinestretch {\setspace@singlespace}%
    \reset@font\footnotesize
    \hsize\columnwidth
    \@parboxrestore
    \protected@edef\@currentlabel{%
      \csname p@mpfootnote\endcsname\@thefnmark}%
    \color@begingroup
      \@makefntext{%
       \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
   \color@endgroup}}

% ** Line space environments.

% A single spaced quote (say) is done by surrounding singlespace with quote.

\newenvironment{singlespace}{%
  \vskip \baselineskip
  \setstretch {\setspace@singlespace}%
  \vskip -\baselineskip
}{%
  \par
}

% GT (c/o Mark Olesen), Wed 15 April 1998.

\newenvironment{singlespace*}{%
  \setstretch {\setspace@singlespace}%
  \vskip -\baselineskip
}{%
  \vskip -0.5\baselineskip
}

%  spacing, doublespace and onehalfspace all are meant to INCREASE the
%  spacing (i.e. calling onehalfspace from within doublespace will not
%  produce a graceful transition between spacings)
%
% Next two definitions fixed for consistency with TeX 3.x

% In order to use \newenvironment, while easily using same code for
% end of each environment, the code that used to be in \endspacing has
% been moved into a new (but internal) macro, \restore@spacing.

\newcommand{\restore@spacing}{%
    \par
    \vskip \parskip
    \vskip \baselineskip
  \endgroup
  \vskip -\parskip
  \vskip -\baselineskip
}

\newenvironment{spacing}[1]{%
  \par
  \begingroup             % moved from \endspacing by PGBR 29-1-91
    \setstretch {#1}%
}{%
  \restore@spacing
}

% one and a half spacing is 1.5 x pt size
\newenvironment{onehalfspace}{%
  \begingroup
    \onehalfspacing
}{%
  \restore@spacing
}

% double spacing is 2 x pt size
\newenvironment{doublespace}{%
  \begingroup
    \doublespacing
}{%
  \restore@spacing
}

% GT:  EMSH chose to omit display math part that follows.
% She wrote (see above) that the "altered spacing before and after displayed
% equations ... just looked too much".
%
% Fix up spacing before and after displayed math
% (arraystretch seems to do a fine job for inside LaTeX displayed math,
% since array and eqnarray seem to be affected as expected).
% Changing \baselinestretch and doing a font change also works if done here,
% but then you have to change @setsize to remove the call to @nomath)
%
% GT:  The \belowdisplayskip line was mistyped; now fixed, courtesy of
% David Hull.
%
% GT:  Brett Parnell has addressed EMSH's concern by replacing
% \baselinestretch by \displayskipstretch in displays, as follows.

\everydisplay\expandafter{%
  \the\everydisplay
  \abovedisplayskip \displayskipstretch\abovedisplayskip
  \belowdisplayskip \displayskipstretch\belowdisplayskip
  \abovedisplayshortskip \displayskipstretch\abovedisplayshortskip
  \belowdisplayshortskip \displayskipstretch\belowdisplayshortskip
}

\endinput

%%% EOF.

以下是图片: 在此处输入图片描述

相关内容