Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/RMarkdown/rticles/aea_article/setspace.sty
Views: 1115
%%% ======================================================================1%%% @LaTeX-style-file{2%%% filename = "setspace.sty",3%%% version = "6.7",4%%% date = "Fri 1 December 2000",5%%% time = "17:49 UT+11",6%%% author = "Geoffrey Tobin",7%%% address = "Department of Electronic Engineering8%%% Faculty of Science and Technology9%%% La Trobe University10%%% Bundoora VIC 308611%%% Australia",12%%% email = "G.Tobin@latrobe.edu.au (Internet)",13%%% telephone = "(+ 613) 9479-3736",14%%% FAX = "(+ 613) 9479-3025",15%%% supported = "yes",16%%% archived = "CTAN",17%%% distribution = "freely redistributable",18%%% keywords = "LaTeX package, line spacing",19%%% codetable = "ISO/ASCII",20%%% checksum = "11793 546 2608 21972",21%%% docstring = "setspace.sty is a LaTeX (2e) package.22%%% Comments and bug reports welcome!23%%%24%%% This includes GDG's modification to Erica Harris'25%%% setspace.sty. The main aspects of this26%%% modification deal with the definitions of27%%% \singlespacing \onehalfspacing, and28%%% \doublespacing, (these are near the beginning of29%%% the file). Primarily, these deal with adding30%%% fontsize changes to guarantee that the new31%%% baseline is properly defined and placed into32%%% action. The extra \vskip in the definition of33%%% \singlespacing seems to make for a cleaner34%%% transition from multiple spacing back to single35%%% spacing. These did not appear warrranted for36%%% other size changes.37%%%38%%% Modified by GDG on November 1, 1992, to allow39%%% for use of New Font Selection Scheme.40%%%41%%% Modified by GDG on June 4, 1993, to correct42%%% for spacing tokens in definition of \@setsize43%%% Thanks to Kaja P. Christiansen <kaja@daimi.aau.dk>44%%% for the fix!!45%%%46%%% Modified by GDG on May 24, 1994, to change toggle47%%% definition from \selectfont to \@newbaseline.48%%%49%%% Modified by GDG on May 25, 1994, to add50%%% definition of \everydisplay -- this part of51%%% the code was apparently written by Geoffrey52%%% Tobin on Thu 23 Jan 1992 and was provided by53%%% stanton@haas.berkeley.edu (Richard Stanton).54%%% This should help with some of the awkward math55%%% placements in changing spacings.56%%%57%%% Modified by GT on 23 Jan 1996, to correct58%%% \everymath bug, first reported by Mario59%%% Wolczko <mario@cs.man.ac.uk> on 9 June 1992.60%%%61%%% Modified by GT on 23 Jan 1996, to correct62%%% usage of comment characters in macro63%%% definitions.64%%%65%%% Modified by GT on 23 Jan 1996, to update66%%% (adjusted) \@xfloat definition for LaTeX2e.67%%% Bug report was courtesy of Kay Nettle.68%%%69%%% Modified by GT on 24 Jan 1996, to update70%%% (adjusted) \@footnotetext definition for71%%% LaTeX2e, and to add an adjusted LaTeX2e72%%% \@mpfootnotext definition for minipages.73%%% Bug report was courtesy Kay Nettle.74%%%75%%% Changed by GT on 6 Feb 1996, into a LaTeX2e76%%% package.77%%%78%%% Made more package-like by GT on 14 Feb 1996,79%%% by adding standard messages.80%%%81%%% GT replaced \@normalsize by \normalsize on 2882%%% Sep 1996. This change was successively83%%% advised by:84%%%85%%% Rowland J.~Bartlett86%%% <R.J.Bartlett@bolton.ac.uk>87%%% on Tue 6 Aug 96,88%%%89%%% Ted Stern90%%% <stern@amath.washington.edu>91%%% on Wed 7 Aug 96,92%%%93%%% Michal Jaegermann94%%% <michal@ellpspace.math.ualberta.ca>95%%% on Fri 27 Sep 96.96%%%97%%% GT: Sat 28 Sep 1996: Added call to98%%% \setspace@size in \setstretch, as suggested99%%% by David Hull <hull@cs.uiuc.edu>100%%% on Wed 24 July 1996.101%%%102%%% GT: Sat 28 Sep 1996: Pared \setspace@size103%%% mercilessly down to \@currsize, following104%%% advice given on Fri 27 Sep 1996 by Michal105%%% Jaegermann <michal@ellpspace.math.ualberta.ca>.106%%% Retained this macro for flexibility.107%%%108%%% Code rearranged by GT, Sat 28 Sep 1996, to give109%%% greater prominence to \setstretch.110%%%111%%% Also, GT changed (Sat 28 Sep 1996) many112%%% occurrences of \def to \newcommand,113%%% \renewcommand, or \newenvironment,114%%% as seemed appropriate.115%%%116%%% GT, Tue 10 Dec 1996: Following a suggestion117%%% by Ted Stern, the `single' spacing is now118%%% settable by the user. This is for slightly119%%% large fonts such as Lucida Bright.120%%%121%%% GT, Wed 11 Dec 1996: For simplicity and122%%% maintainability, call \onehalfspacing in123%%% the onehalfspace environment, and124%%% \doublespacing in the doublespace125%%% environment.126%%%127%%% GT, Wed 11 Dec 1996: Also deleted128%%% \setspace@size from \setstretch,129%%% as \@currsize suffices.130%%%131%%% Modified by Brett Presnell (BP)132%%% <presnell@maths.anu.edu.au> on 21 Mar 1998133%%% to add nodisplayskipstretch option, which134%%% turns off the stretching of the space135%%% before and after displays, which is often136%%% excessive, particularly with doublespaced137%%% documents. Also added the138%%% setdisplayskipstretch command, which allows139%%% the user to choose by how much to stretch140%%% the space before and after displays141%%% independently from the setting of142%%% baselinestretch. This works regardless of143%%% whether the nodisplayskipstretch option is144%%% in effect.145%%%146%%% GT, Wed 15 Apr 1998: Added the singlespace*147%%% environment requested by148%%% Mark Olesen <olesen@weber.me.queensu.ca>149%%% on Sat 24 May 1997 and Wed 18 June 1997.150%%% This is reported to give improved vertical151%%% spacing around itemize and quote environments.152%%%153%%% GT, Wed 15 Apr 1998: David Hull pointed out on154%%% Fri 12 Dec 1997 that the \belowdisplayskip line155%%% in the \everydisplay was mistyped. Now fixed.156%%%157%%% GT, Thu 26 Nov 1998: Finally got round to158%%% fixing the absence of \begingroup from159%%% onehalfspace and doublespace environments.160%%% Thanks to: Bernd Schandl, Ron Smith,161%%% Himanshu Gohel, and Kevin Ruland, for bringing162%%% it to my long overdue attention.163%%%164%%% GT, Tue 27 July 1999: On Saturday 24 July165%%% 1999, Alexander L. Wolf <alw@cs.colrado.edu>166%%% informed me that the \doublespace and167%%% \onehalfspace _macros_ are still at fault.168%%%169%%% GT, Fri 3 March 2000: Today Stefano170%%% Lacaprara of Italy brought my attention to171%%% the need to extend the commands and macros172%%% to point sizes other than 10, 11 and 12.173%%% Since there's no general formula for the174%%% line stretch values in terms of point size,175%%% and they vary only slightly between 10, 11176%%% and 12 pt, and furthermore the values were177%%% presumably optimised specifically for the178%%% Computer Modern fonts, i've chosen to use179%%% the 10 pt values as the generic defaults.180%%%181%%% GT, Fri 1 December 2000: George Pearson182%%% requested package options for the three183%%% common spacings.184%%%185%%% The checksum field above contains a CRC-16186%%% checksum as the first value, followed by the187%%% equivalent of the standard UNIX wc (word188%%% count) utility output of lines, words, and189%%% characters. This is produced by Robert190%%% Solovay's checksum utility."191%%% }192%%% ======================================================================193%% FILE: setspace.sty in SYS2.TEX.PUB.ISULATEX.STYLES194%% AUTHOR: Erica M. S. Harris195%% DATE: April 1990196%% MOD: March 1991197%%%198%%% Update to LaTeX (2e) : 6 Feb 1996.199%%% Description: LaTeX Document Package "setspace"200%%%201%%% Usage:202%%% \documentclass[...]{...}203%%% \usepackage{setspace}204%%%205%% Based on the doublespace option created by Stephen Page.206%%207%% This style option provides commands and environments for doing208%% double and one-and-a-half spacing based on pt size.209%%210%% Single spacing is the default.211%%212%% Three commands, \singlespacing, \onehalfspacing, and213%% \doublespacing, are for use in the preamble to set the overall214%% spacing for the document. If a different spacing is required then215%% the \setstretch{baselinestretch} command can be used in the216%% preamble to set the baselinestretch appropriately. The default217%% spacing with this style option is single spacing.218%%219%% Three environments, singlespace, onehalfspace, and doublespace,220%% allow the spacing to be changed within the document. Both the221%% onehalfspace and doublespace environments are intended to increase222%% the spacing, so the onehalfspace environment should not be used in223%% a double spaced document. If an increased spacing different from224%% one-and-a-half or double spacing is required then the spacing225%% environment can be used. The spacing environment takes one226%% argument which is the larger baselinestretch to use,227%% e.g., \begin{spacing}{2.5}.228%%229%% \footins is adjusted the same as \parskip - appears to work. Lose230%% stretch parts but don't consider that to be crucial231%%232%% Removed code for altering spacing before and after displayed233%% equations - just looked too much.234%%235%% MODS:236%% Redefinition of \spacing and \endspacing for consistency with237%% TeX 3.x inserted by George Greenwade. Modification provided by238%% Philip Ross (ROSS@UK.AC.ABDN.BIOMED) and John Byrne via INFO-TeX.239%%240%% PLEASE REPORT ANY BUGS241%%242%% Old Documentation follows:243%% 1. A new environment "singlespace" is provided, within which single244%% spacing will apply.245%% JFL - changed so that it works in regular text and so that246%% vertical space before and after is correctly computed247%% 2. Double spacing is turned off within footnotes and floats (figures248%% and tables).249%% 3. Proper double spacing happens below tabular environments and in250%% other places where LaTeX uses a strut.251%% 4. Slightly more space is inserted before footnotes.252%% 5. JFL - fixes spacing before and after displayed math253%%254%%255%% mods: Jean-Francois Lamy256%% lamy@ai.toronto.edu257%% lamy@utai.uucp258%%259%% POSSIBLE BUGS:260%% . Increasing struts may possibly cause some other obscure part of261%% formatting to fall over.262%% . \begin{singlespace}\begin{quote} produces the wrong spacing before263%% the quote (extra glue is inserted).264%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%265266\NeedsTeXFormat {LaTeX2e}[1994/12/01]267\def \filename {setspace.sty}268\def \filedate {2000/12/01}269\def \fileversion {6.7}270\ProvidesPackage {setspace}[\filedate\space\fileversion\space271Contributed and Supported LaTeX2e package]272\typeout {Package: `setspace' \fileversion\space <\filedate>}273274% BP: add nodisplayskipstretch option and \setdisplayskipstretch command.275276\newcommand{\displayskipstretch}{\baselinestretch}277\newcommand{\setdisplayskipstretch}[1]{\renewcommand{\displayskipstretch}{#1}}278\DeclareOption{nodisplayskipstretch}{\setdisplayskipstretch{1.0}}279280% GT: add George Pearsons' suggested options.281282\DeclareOption{singlespacing}{\AtEndOfPackage{\singlespacing}}283\DeclareOption{onehalfspacing}{\AtEndOfPackage{\onehalfspacing}}284\DeclareOption{doublespacing}{\AtEndOfPackage{\doublespacing}}285286\ProcessOptions287288% GT: Sat 28 Sep 1996: Widely using \newcommand, \renewcommand, and289% \newenvironment, instead of \def.290291% ** Line space commands.292293\newcommand{\setstretch}[1]{%294\def\baselinestretch{#1}%295\@currsize296}297298% GT: Sat 28 Sep 1996: spacing commands and environments modified to299% use \setstretch instead of \baselinestretch.300%301% GT: Sat 28 Sep 1996: No, I don't know understand the line spacing302% algorithms! If someone (LaTeX team) can enlighten me as to the303% general rule, please do! It would be very pleasant if setspace.sty304% were suited for document font sizes other than 10, 11 and 12 pt.305%306% GT: Tue 10 Dec 1996: Instead of fixing singlespacing to exact unity,307% allow user to redefine it (only slightly, please!) from its initial308% value of unity, in the case when a particular font is slightly larger309% or slightly smaller than its point size would indicate. This change310% affects setspace's single spacing commands, and LaTeX's footnote and311% float environments. The one and a half, double, and arbitrary312% spacing commands are unaltered.313314\newcommand{\SetSinglespace}[1]{%315\def\setspace@singlespace{#1}%316}317318% Here's the default single line spacing value.319\SetSinglespace{1}320321\newcommand{\singlespacing}{%322\setstretch {\setspace@singlespace}% normally 1323\vskip \baselineskip % Correction for coming into singlespace324}325326\newcommand{\onehalfspacing}{%327\setstretch{1.25}% default328\ifcase \@ptsize \relax % 10pt329\setstretch {1.25}%330\or % 11pt331\setstretch {1.213}%332\or % 12pt333\setstretch {1.241}%334\fi335}336337\newcommand{\doublespacing}{%338\setstretch {1.667}% default339\ifcase \@ptsize \relax % 10pt340\setstretch {1.667}%341\or % 11pt342\setstretch {1.618}%343\or % 12pt344\setstretch {1.655}%345\fi346}347348% ** Modification of the LaTeX command \@setsize.349350%---Stretch the baseline BEFORE calculating the strut size. This improves351% spacing below tabular environments etc., probably...352% Comments are welcomed.353354% GT: Sun 29 Sep 1996: Question: Is this code anywhere near correct355% since this part of LaTeX (in, eg, latex.ltx) has been greatly changed?356357% GT: Sun 29 Sep 1996: The meanings of the arguments to \@setsize358% appear to be (whatever these may signify) :359% current size; font baselineskip; ignored (!); and font size.360361% GT: Sun 29 Sep 1996: Note that \@setsize (in latest LaTeX,362% \@setfontsize, which is called by \@setsize) seems to be the only363% place in purely modern LaTeX where \@currsize is set, and ltxguide.cls364% seems to be the only file in the LaTeX base distribution that uses it!365366\def\@setsize#1#2#3#4{%367% Modified 1993.04.07--GDG per KPC368\@nomath#1%369\let\@currsize#1%370\baselineskip #2%371\baselineskip \baselinestretch\baselineskip372\parskip \baselinestretch\parskip373\setbox\strutbox \hbox{%374\vrule height.7\baselineskip375depth.3\baselineskip376width\z@}%377\skip\footins \baselinestretch\skip\footins378\normalbaselineskip\baselineskip#3#4}379380% ** Float and footnote adjustments to compensate for a change in the381% ** main text's line spacing.382383%---Increase the space between last line of text and footnote rule.384%\skip\footins 20pt plus4pt minus4pt385386%---Reset baselinestretch within floats and footnotes.387388% GT: Tue 23 Jan 1996: This is where the conflict with the combination389% of the color package and the figure environment used to occur.390391% Floats.392393% GT: Sat 28 Sep 1996: \@xfloat is the only place where \normalsize394% is still used in setspace.sty !395396\let\latex@xfloat=\@xfloat397\def\@xfloat #1[#2]{%398\latex@xfloat #1[#2]%399\def\baselinestretch{\setspace@singlespace}%400\normalsize401}402403% GT: Wed 24 Jan 1996: This footnote code was copied from LaTeX and404% modified rather naively. It had to be brought up to date, not only405% because of LaTeX's new color ability, but also because ther had406% been major changes to this code in LaTeX at least as far back as407% March 1992.408409% Normal, bottom of the page, footnotes.410%411% GT: Based HEAVILY on original LaTeX (2e) code. A standard hook would412% be MUCH preferred, so that LaTeX's footnote implementation needn't be413% copied each time it changes.414%415% GT: The \protected@edef requires at least the December 1994 LaTeX.416% This is precisely the kind of VERSION DEPENDENCY situation that417% cannot (AFAIK) be avoided, because LaTeX (2e) LACKS appropriate418% standard hooks and/or context markers.419420\long\def\@footnotetext#1{%421\insert\footins{%422% GT: Next line added. Hook desired here!423\def\baselinestretch {\setspace@singlespace}%424\reset@font\footnotesize425\interlinepenalty\interfootnotelinepenalty426\splittopskip\footnotesep427\splitmaxdepth \dp\strutbox \floatingpenalty \@MM428\hsize\columnwidth429\@parboxrestore430\protected@edef\@currentlabel{%431\csname p@footnote\endcsname\@thefnmark432}%433\color@begingroup434\@makefntext{%435\rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%436\color@endgroup}}437438% Minipage footnotes.439440\long\def\@mpfootnotetext#1{%441\global\setbox\@mpfootins\vbox{%442\unvbox \@mpfootins443% GT: Next line added. Hook desired here!444\def\baselinestretch {\setspace@singlespace}%445\reset@font\footnotesize446\hsize\columnwidth447\@parboxrestore448\protected@edef\@currentlabel{%449\csname p@mpfootnote\endcsname\@thefnmark}%450\color@begingroup451\@makefntext{%452\rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%453\color@endgroup}}454455% ** Line space environments.456457% A single spaced quote (say) is done by surrounding singlespace with quote.458459\newenvironment{singlespace}{%460\vskip \baselineskip461\setstretch {\setspace@singlespace}%462\vskip -\baselineskip463}{%464\par465}466467% GT (c/o Mark Olesen), Wed 15 April 1998.468469\newenvironment{singlespace*}{%470\setstretch {\setspace@singlespace}%471\vskip -\baselineskip472}{%473\vskip -0.5\baselineskip474}475476% spacing, doublespace and onehalfspace all are meant to INCREASE the477% spacing (i.e. calling onehalfspace from within doublespace will not478% produce a graceful transition between spacings)479%480% Next two definitions fixed for consistency with TeX 3.x481482% In order to use \newenvironment, while easily using same code for483% end of each environment, the code that used to be in \endspacing has484% been moved into a new (but internal) macro, \restore@spacing.485486\newcommand{\restore@spacing}{%487\par488\vskip \parskip489\vskip \baselineskip490\endgroup491\vskip -\parskip492\vskip -\baselineskip493}494495\newenvironment{spacing}[1]{%496\par497\begingroup % moved from \endspacing by PGBR 29-1-91498\setstretch {#1}%499}{%500\restore@spacing501}502503% one and a half spacing is 1.5 x pt size504\newenvironment{onehalfspace}{%505\begingroup506\onehalfspacing507}{%508\restore@spacing509}510511% double spacing is 2 x pt size512\newenvironment{doublespace}{%513\begingroup514\doublespacing515}{%516\restore@spacing517}518519% GT: EMSH chose to omit display math part that follows.520% She wrote (see above) that the "altered spacing before and after displayed521% equations ... just looked too much".522%523% Fix up spacing before and after displayed math524% (arraystretch seems to do a fine job for inside LaTeX displayed math,525% since array and eqnarray seem to be affected as expected).526% Changing \baselinestretch and doing a font change also works if done here,527% but then you have to change @setsize to remove the call to @nomath)528%529% GT: The \belowdisplayskip line was mistyped; now fixed, courtesy of530% David Hull.531%532% GT: Brett Parnell has addressed EMSH's concern by replacing533% \baselinestretch by \displayskipstretch in displays, as follows.534535\everydisplay\expandafter{%536\the\everydisplay537\abovedisplayskip \displayskipstretch\abovedisplayskip538\belowdisplayskip \displayskipstretch\belowdisplayskip539\abovedisplayshortskip \displayskipstretch\abovedisplayshortskip540\belowdisplayshortskip \displayskipstretch\belowdisplayshortskip541}542543\endinput544545%%% EOF.546547548