LaTeX: Setspacing Package for single, double or one-half spacing
Sunday, July 09, 2006   Permanent link to this post
Most LaTeX authors face initial difficulty in adjusting spacing in their documents. Espacially when you need to shift between singlespacing, doublespacing and one-half spacing within a document, it can get really problematic. Here are two solutions to the spacing problem:
Redefine distance between text lines
This is the simplest solution - just redefine the spacing between text lines by a factor. If you make the factor 2.0, then you get double spacing. Similarly a factor of 1.5 will give you one-half spacing and if you do nothing you will get single spaced documents, which is the default.
The exact command (which you would need to keep in the preamble) is:
\renewcommand{\baselinestretch}{2.0}
Remember that the command above will make your entire document change spacing. You will have difficulties shifting spacing modes within the document.
Use "setspace" package
If you don't like the simple but crude method shown above - then you need the "setspace" package. This has very intuitive commands to set spacing as you need. First of all, you will need to load the package with the following simple command in the preamble:
\usepackage{setspace}
\singlespacing
The above will set the default spacing for your entire documen to single spacing. If you would rather than double spacing as default - then change the second line to \doublespacing. For one half spacing - you need to use \onehalfspacing. Intuitive right?
After setting the document default, if you want a particular part of the document to have different spacing (for example: I keep abstracts and references of my research papers as single spaced) then you can enclose them within the following commands:
\begin{singlespacing}
Your text here...
\end{singlespacing}
Instead of singlespacing, you can use doublespacing or onehalfspacing for corresponding results. If you need a specific spacing fraction - then you can use the following:
\begin{spacing}{2.0}
Your text here...
\end{spacing}{2.0}
Just change 2.0 to the exact spacing fraction desired.
Save Trees: Use "savetrees" package
If you have some flexibility in spacing and you want to do something good - then use the savetrees package. Include the following command in the preamble and let it do its thing:
\usepackage{savetrees}
You will be surprised to see how much paper this package can save!
I think this is enough on document spacing for most LaTeX users. If you have specific queries - then feel free to drop a comment.
   
There are 0 Comments. Post a Comment
Redefine distance between text lines
This is the simplest solution - just redefine the spacing between text lines by a factor. If you make the factor 2.0, then you get double spacing. Similarly a factor of 1.5 will give you one-half spacing and if you do nothing you will get single spaced documents, which is the default.
The exact command (which you would need to keep in the preamble) is:
\renewcommand{\baselinestretch}{2.0}
Remember that the command above will make your entire document change spacing. You will have difficulties shifting spacing modes within the document.
Use "setspace" package
If you don't like the simple but crude method shown above - then you need the "setspace" package. This has very intuitive commands to set spacing as you need. First of all, you will need to load the package with the following simple command in the preamble:
\usepackage{setspace}
\singlespacing
The above will set the default spacing for your entire documen to single spacing. If you would rather than double spacing as default - then change the second line to \doublespacing. For one half spacing - you need to use \onehalfspacing. Intuitive right?
After setting the document default, if you want a particular part of the document to have different spacing (for example: I keep abstracts and references of my research papers as single spaced) then you can enclose them within the following commands:
\begin{singlespacing}
Your text here...
\end{singlespacing}
Instead of singlespacing, you can use doublespacing or onehalfspacing for corresponding results. If you need a specific spacing fraction - then you can use the following:
\begin{spacing}{2.0}
Your text here...
\end{spacing}{2.0}
Just change 2.0 to the exact spacing fraction desired.
Save Trees: Use "savetrees" package
If you have some flexibility in spacing and you want to do something good - then use the savetrees package. Include the following command in the preamble and let it do its thing:
\usepackage{savetrees}
You will be surprised to see how much paper this package can save!
I think this is enough on document spacing for most LaTeX users. If you have specific queries - then feel free to drop a comment.
Labels: LaTeX
Teaching: Job Done with Perfect Ratings!!
I havn't posted anything in a while because I have been teaching - and it took every moment of my life over past three months to teach a 3 credit course in a half-term. I taught BIT 311: Decision Support with Excel during Spring 2006 term. More information about the course is available in my teaching page.
The good news is that I received a perfect 5.0/5.0 Instructor rating. I am thrilled to see that students appreciated all the hard work. Every year just a handful of instructors get a perfect rating - so I am quite happy with this!
Research is moving forward briskly. I have submitted one or more papers to ICIS, HICSS and CIST conferences. Hopefully some of these will get accepted. I am also submitting a paper to ISR special issue on Networks this month and then to JMIS special issue on "Trust in Online Communities" later in the summer. I have updated my website to include all these recent research efforts. You can see details of all my papers at my research page.
   
There are 0 Comments. Post a Comment
The good news is that I received a perfect 5.0/5.0 Instructor rating. I am thrilled to see that students appreciated all the hard work. Every year just a handful of instructors get a perfect rating - so I am quite happy with this!
Research is moving forward briskly. I have submitted one or more papers to ICIS, HICSS and CIST conferences. Hopefully some of these will get accepted. I am also submitting a paper to ISR special issue on Networks this month and then to JMIS special issue on "Trust in Online Communities" later in the summer. I have updated my website to include all these recent research efforts. You can see details of all my papers at my research page.
Labels: Teaching
Technorati Authority

