Regarding line spacing

198 views
Skip to first unread message

dhrubajyoti mukherjee

unread,
Mar 19, 2010, 6:50:10 AM3/19/10
to latexus...@googlegroups.com
Dear all,

Can you please let me know \setstretch{} for specifying double spacing. Does it depend on font size? If it does, then what is it's value for 12pt font.

I am using a modified version of report class for writing my thesis. How can I modify the spacing of thesis title only. I tried using \singlespacing or \doublespacing command inside the \title{} command. But it doesn't work.

Please write back to me.

With warm regards,
Dhruba
--
Dhrubajyoti Mukherjee
MS Research Scholar,
Structural Engg. Division,
Civil Engg. Department,
IIT Madras,Chennai.

Peter Flynn

unread,
Mar 19, 2010, 4:14:29 PM3/19/10
to latexus...@googlegroups.com
On Fri, Mar 19, 2010 at 10:50 AM, dhrubajyoti mukherjee <dhrubajyot...@gmail.com> wrote:
Dear all,

Can you please let me know \setstretch{} for specifying double spacing. Does it depend on font size? If it does, then what is it's value for 12pt font.

If you are using the setspace package, then yes, the double spacing does depend on the font size. But \doublespacing is built in...why are you trying to modify \setstretch?
 
I am using a modified version of report class for writing my thesis. How can I modify the spacing of thesis title only. I tried using \singlespacing or \doublespacing command inside the \title{} command. But it doesn't work.

"It doesn't work" is not meaningful without seeing your file, so I will make a guess...
If you only want to change the spacing for the title, just put \doublespacing in your title:

\documentclass{report}
\usepackage{setspace}
\begin{document}
\title{\doublespacing I am using a modified version of report
  class
for writing my thesis. How can I modify the spacing of
  thesis title
only?} 
\author{Dhrubajyoti Mukherjee}
\maketitle
Text to check that the wide line-spacing in the title has not
polluted
the remainder of the document.
\end{document}

But check that your modified report class does not try to do other stuff (like running heads with the fancyhdr package) with the internal \@title, otherwise you'll get double spacing where you don't want it.

Ideally, title spacing should be done by redesigning the \maketitle command. If your modified report class already does this, then you will need to make the spacing changes there instead.

Are the modifications your own or is this a university thesis class? Can we see it?

///Peter

dhrubajyoti mukherjee

unread,
Mar 20, 2010, 1:53:56 AM3/20/10
to latexus...@googlegroups.com
Dear Peter,

Thanks for writing back. The class file I am using is for writing thesis in my university. I am attaching the whole file for your understanding. I am writing a MS thesis. The university guideline requires double spacing between lines and triple spacing between paras. It also requires Times Roman 12pts for regular text, 15 pts for Chapter headings, 12 pts for Section  and subsection headings. I also have doubts if the font size of the section heading is maintained.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This is a class for LaTeX2e that should format a report as per
% the IITM Thesis guidelines.  The page layout is set using the
% geometry package.  The double/singlespacing is setup using
% setspace.  Figure captions are set using the hang option of
% caption2.  natbib is used to do the citation using an
% author-year format. I've made an iitm.bst file that formats
% the references as per the IITM guidelines.
%
% To use this class do the following:
%  \documentclass[options]{iitmdiss}
%
% Options:
%
%   PhD, MS, MTech or BTech -- generates the appropriate title page
%   and loads the report class.
%
%   synopsis -- Generates the title page for the synopsis.  This also
%   loads the article class instead of the report.

% Example:
%
% \documentclass[PhD,synopsis]{iitmdiss}
% \documentclass[MS]{iitmdiss}
%
% IMPORTANT NOTICE:
%
%   PLEASE DO NOT MESS WITH THE MARGINS AND GENERAL FORMATTING SETUP
%   IN THIS FILE UNLESS YOU ARE ABSOLUTELY SURE THAT THE FORMAT DOES NOT
%   MATCH WITH THE THESIS GUIDELINES.  FOR EXAMPLE, DO NOT CHANGE THE
%   MARGINS AND SPACING JUST TO MAKE YOUR THESIS LARGER!
%
% Notes:
%
%   * I am using as much of the Thesis guidelines for the spacing
%     and margins as I can.
%   * I have used newdiss.cls by R.~K.~Hariram, U.~V.~Ravindra et al.
%     as a reference and a source for some of the macros.
%   * This class will assume a4paper with 12pt fonts.
%   * I am no TeXpert so feel free to clean up the mess.
%
% Prabhu Ramachandran <pra...@ae.iitm.ac.in>
% March 2005.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\NeedsTeXFormat{LaTeX2e}

\ProvidesClass{iitmdiss}[2005/03/09 Class for IIT-Madras Dissertations]

\newif\if@PhD
\newif\if@MS
\newif\if@MTech
\newif\if@BTech
\newif\if@Synopsis

\DeclareOption{PhD}{\@PhDtrue}
\DeclareOption{MS}{\@MStrue}
\DeclareOption{MTech}{\@MTechtrue}
\DeclareOption{BTech}{\@BTechtrue}
\DeclareOption{synopsis}{\@Synopsistrue}
\ProcessOptions\relax

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%  Load the correct class.
\if@Synopsis
    \LoadClass[12pt,a4paper]{article}
\else
    \LoadClass[12pt,a4paper]{report}
\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Geometry and page layout
\RequirePackage[compat2,a4paper,left=1.5in,right=1in,top=1in,bottom=0.667in,
                nohead]{geometry}[2002/07/08]
\parskip 8pt

\renewcommand{\@pnumwidth}{2.5em}
%\renewcommand{\@tocrmarg}{2.5em}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Using setspace to do the single/double spacing.  Setspace also
%% makes all tables and figures have single spacing automatically.
\RequirePackage{setspace}
\RequirePackage{atbeginend} % used to redefine the list environs
\setstretch{1.667} %this is where my doubt is ... originally this value was 1.5. I modified it. But I am not sure whether it's correct.

\BeforeBegin{itemize}{\vspace*{-5ex}\begin{singlespace}}
\AfterEnd{itemize}{\end{singlespace}}

\BeforeBegin{enumerate}{\vspace*{-5ex}\begin{singlespace}}
\AfterEnd{enumerate}{\end{singlespace}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% The figure captioning is done correctly via the hang option.
%%\RequirePackage[hang]{caption2}  -> TeX generates error
\RequirePackage[hang]{caption}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Bibliography
%
% natbib allows easy switching of citation style and using it along
% with the iitm.bst makes things perfect.
\RequirePackage[authoryear,round]{natbib}
%\RequirePackage[numbers,square]{natbib}
\bibliographystyle{iitm}

\newcommand{\bibstyle@iitm}{\bibpunct{(}{)}{;}{a}{,}{,}%
     \gdef\NAT@biblabel##1{##1. }}
%
\setlength{\bibhang}{0pt}
\citestyle{iitm}
%\citestyle{unsrt_newen}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Other useful macros.  Many of these are modifications from newdiss.cls

% \division{division name} -- user macro to declare name of division.
\def\division#1{\gdef\@division{#1}}

% \department{department name} -- user macro to declare name of department.
\def\department#1{\gdef\@department{#1}}


%\RequirePackage[dvips]{graphicx}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The title page

\def\maketitle{%
  \pagenumbering{roman}
  \thispagestyle{empty}
  \newpage
  \null
  \setcounter{page}{0}
  \parskip=0pt
  \begin{center}%
  \let \footnote \thanks
  \vglue 0in % this makes top margin 2in
  \vskip -5ex%
  \if@Synopsis
    {\large \em SYNOPSIS OF \par}
  \fi
    {\Large \bf \expandafter{\@title} \par}%
    \vskip 10ex%
    {\normalsize
      \if@PhD
         {\em A THESIS }\par
         \vskip 5ex%
         \if@Synopsis
            {\normalsize \em to be submitted by \par}
         \else
            {\normalsize \em submitted by \par}
         \fi
         \vskip 5ex%
         {\bf \large\MakeUppercase{\@author}\par\par}
         \vskip 5ex%
         {\em for the award of the degree }\par
         \vskip 5ex%
         {\em of} \par
         \vskip 5ex%
         {\bf \large \MakeUppercase{Doctor of Philosophy}} \par
       \else
         \if@MS
            {\em A THESIS }\par
            \vskip 5ex%
            {\normalsize \em submitted by \par}
            \vskip 5ex%
            {\bf \large\MakeUppercase{\@author}\par\par}
            \vskip 5ex%
            {\em for the award of the degree }\par
            \vskip 5ex%
            {\em of} \par
            \vskip 5ex%
            {\bf \large \MakeUppercase{Master Of Science}} \par
            (by Research) \par
         \else
           {\em A Project Report }\par
           \vskip 5ex%
           {\normalsize \em submitted by \par}
           \vskip 5ex%
           {\bf \large\MakeUppercase{\@author}\par\par}
           \vskip 5ex%
           {\normalsize \em in partial fulfilment of the requirements\par
             for the award of the degree of \par}
           \vskip 5ex%
           \if@MTech
             {\bf MASTER OF TECHNOLOGY}
           \fi
           \if@BTech
              {\bf BACHELOR OF TECHNOLOGY}
           \fi
         \fi
      \fi
    }
  \end{center}%

  \vspace*{0.50in}
  %\centerline{\psfig{figure=emblem.ps}}
 %\centerline{\includegraphics{iitm.eps}}
 \centerline{\includegraphics[scale=0.75]{iitm}}
 \vspace*{-0.20in}
  \begin{center}
    \bf\singlespacing\large{{\@division\ DIVISON\\
    DEPARTMENT OF \@department\\
     INDIAN INSTITUTE OF TECHNOLOGY MADRAS.}}
    \vglue 0.50em
    {\bf \large \@date}\par
  \end{center}
  \parskip 8pt
}

\def\titlepage{\newpage\thispagestyle{empty}\c@page\z@}
\def\endtitlepage{\newpage}

\if@Synopsis
   \renewcommand\refname{REFERENCES}
\else
   % QUOTATIONS
   %
   \def\quotations{\chapter*{\centerline{QUOTATIONS}}
   %\addcontentsline{toc}{chapter}{QUOTATIONS}
   }

   % DEDICATION
   %
   \def\dedication{\chapter*{\centerline{DEDICATION}}
   %\addcontentsline{toc}{chapter}{DEDICATION}
   }

   % CERTIFICATE
   %
   %   - this produces a certificate page as per IITM Regulations
   %     comment the following lines out to get it working.
   %
   \def\certificate{%% A preliminary chapter
     \clearpage
     \vspace*{36pt}
     \centerline{\Large \bf THESIS CERTIFICATE}
     \vskip 25pt
     \thispagestyle{empty}
     \typeout{Certificate}
     \setcounter{page}{0}
   }

   % ACKNOWLEDGEMENTS
   %
   \def\acknowledgements{\chapter*{\centerline{ACKNOWLEDGEMENTS}}
     \addcontentsline{toc}{chapter}{ACKNOWLEDGEMENTS}
   }

   % ABSTRACT
   %   - this produces pages suitable for an IITM Abstract
   \def\abstract{\chapter*{\centerline{ABSTRACT}}
   \addcontentsline{toc}{chapter}{ABSTRACT}
   }

   % GLOSSARY
   %
   \def\glossary{\chapter*{\centerline{GLOSSARY}}
   \addcontentsline{toc}{chapter}{GLOSSARY}
   }

   % ABBREVIATIONS
   %
   \def\abbreviations{\chapter*{\centerline{ABBREVIATIONS}}
   \addcontentsline{toc}{chapter}{ABBREVIATIONS}
   }

   % Use the nomencl package for the NOTATION section.

   % Makes the chapter heading
   \def\@makechapterhead#1{%
     {\parindent \z@ \raggedright \normalfont
       \ifnum \c@secnumdepth >\m@ne
       \begin{center}
         \Large\bfseries \@chapapp\space \thechapter
       \end{center}
       \par\nobreak
       \vskip 20\p@
       \fi
       \interlinepenalty\@M
       \Large \bf
       \begin{center}
         #1\par\nobreak     
       \end{center}
       \vskip 20\p@
       \thispagestyle{empty}
     }}

   % Makes the chapter heading for \chapter* commands
   \def\@makeschapterhead#1{%
     \vspace*{25\p@}%
     {\parindent \z@ \raggedright
       \normalfont
       \interlinepenalty\@M
       \Large \bfseries #1\par\nobreak
       \vskip 20\p@
     }}


   %LIST OF PAPERS
   \def\listofpapers{
           \normalbaselines
           \chapter*{\centerline{LIST OF PAPERS BASED ON THESIS}}
           \markboth{LIST OF PAPERS BASED ON THESIS}{LIST OF PAPERS BASED ON THESIS}
           %\addcontentsline{toc}{chapter}{LIST OF PAPERS BASED ON THESIS}
   }

  
   % CV
   \def\CV{\chapter*{\centerline{CURRICULUM VITAE}}}

   % Comittee
   \if@PhD
       \def\committee{\chapter*{\centerline{DOCTORAL COMMITTEE}}}
   \else
       \if@MS
          \def\committee{\chapter*{\centerline{GENERAL TEST COMITTEE}}}
        \fi
   \fi


   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   % Renewed commands to set the titles of various pages correctly.
   \renewcommand\contentsname{\centering TABLE OF CONTENTS}
   \renewcommand\listfigurename{\centering LIST OF FIGURES}
   \renewcommand\listtablename{\centering LIST OF TABLES}
   \renewcommand{\chaptername}{CHAPTER}
   \renewcommand\bibname{\centering REFERENCES}
   \renewcommand\appendixname{APPENDIX}
\fi

Peter Flynn

unread,
Mar 20, 2010, 7:04:45 AM3/20/10
to latexus...@googlegroups.com
On Sat, Mar 20, 2010 at 5:53 AM, dhrubajyoti mukherjee <dhrubajyot...@gmail.com> wrote:
Dear Peter,

Thanks for writing back. The class file I am using is for writing thesis in my university. I am attaching the whole file for your understanding. I am writing a MS thesis. The university guideline requires double spacing between lines and triple spacing between paras. It also requires Times Roman 12pts for regular text, 15 pts for Chapter headings, 12 pts for Section  and subsection headings. I also have doubts if the font size of the section heading is maintained.

At a first glance there are rather a lot of things wrong with this, and a lot of it uses obsolete commands. It also references at least one non-standard package (atbeginend). I'll have a closer look over the weekend. But a quick test shows that it does double-space the title, so I'm not clear what the problem you're having is there.

///Peter

dhrubajyoti mukherjee

unread,
Mar 20, 2010, 9:19:00 AM3/20/10
to latexus...@googlegroups.com
Dear Peter,

double-spacing the Thesis title looks a little odd to me. I was hoping if I can reduce the spaces between them.

With warm regards,
Dhruba


--
You received this message because you are subscribed to the Google Groups "LaTeX Users Group" group.
To post to this group, send email to latexus...@googlegroups.com.
To unsubscribe from this group, send email to latexusersgro...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/latexusersgroup?hl=en.

Peter Flynn

unread,
Mar 20, 2010, 10:22:21 AM3/20/10
to latexus...@googlegroups.com
On Sat, Mar 20, 2010 at 1:19 PM, dhrubajyoti mukherjee <dhrubajyot...@gmail.com> wrote:
Dear Peter,

double-spacing the Thesis title looks a little odd to me. I was hoping if I can reduce the spaces between them.

I agree, but if that is the rule, you have to abide by it, I assume :-)

Some universities have very strange ideas about layout (including the requirement for double-spacing, which has been obsolete since the death of the typewriter).

///Peter
 

dhrubajyoti mukherjee

unread,
Mar 21, 2010, 6:20:14 AM3/21/10
to latexus...@googlegroups.com
Any idea on how can I change the section font size. Currently I think currently it is having 15pt size.

I want to change it to 12pt.

I tried using syntax \section{\normalfont{XYZ}} and  \section[12pt]{XYZ}. But it did not change.

Please write back to me in this regard.

With warm regards,
Dhruba

Peter Flynn

unread,
Mar 21, 2010, 7:25:07 AM3/21/10
to latexus...@googlegroups.com
On Sun, Mar 21, 2010 at 10:20 AM, dhrubajyoti mukherjee <dhrubajyot...@gmail.com> wrote:
Any idea on how can I change the section font size.
Currently I think currently it is having 15pt size

Unlikely, but you can always check to make sure. Depending on the size you have specified in the optional arguments to your \documentclass command (if any, eg 10pt, 11pt, 12pt), the size for \section will be different. In your class file (article.cls/report.cls/book.cls/etc) it says \Large in the definition for \newcommand\section, but \Large gets redefined by your size option as 14pt on 18pt baseline for sizes 10pt and 11pt text; and as 17pt on 22pt baseline for the 12pt text size.
 
I want to change it to 12pt.

Use the sectsty package, then say

\sectionfont{\fontsize{12}{14}\selectfont}

(that's actually rather small for a section heading, but if that's what they're asking for, that will do it). Bear in mind that LaTeX uses step sizes of fonts by default; if you want a special size you will need to use the fix-cm package to allow arbitrary sizes.
 
I tried using syntax \section{\normalfont{XYZ}} and  \section[12pt]{XYZ}. But it did not change.

No, never. Always make changes like this using packages, for consistency. It saves manual typing and mistakes.

\normalfont does not take an argument, so the extra curly braces are not meaningful: all it does is change the font (not the size) back to your default typeface.

\normalsize
will set the font size to the document text size, so if you have specified \documentclass[12pt]{...} then with sectsty you could also say \sectionfont{\normalsize} instead of the example above. See http://latex.silmaril.ie/formattinginformation/chapter8.html#c233

The optional argument to \section is for a short title to use in a Table of Contents. What you typed will print the section title XYZ and put "12pt" as the section title in your table of contents! (see http://latex.silmaril.ie/formattinginformation/chapter3.html#sections).

///Peter

dhrubajyoti mukherjee

unread,
Mar 21, 2010, 7:46:52 AM3/21/10
to latexus...@googlegroups.com
Dear Peter,

Thanks for replying. I tried using sectsty package. But even including the package is messing up the alignment and font sizes of the chapter title. Can I use any alternate strategy.

With warm regards,
Dhruba

Peter Flynn

unread,
Mar 21, 2010, 9:20:26 AM3/21/10
to latexus...@googlegroups.com
I had a closer look at this.

\documentclass[PhD]{iitmdiss}
\usepackage{mathptmx}
\begin{document}
\title{A very long title that will need to be broken over several
  lines, in order to test the line-spacing}
\author{Peter Flynn}
\division{div}
\department{dept}
\maketitle
\clearpage\doublespacing
What's wrong with iitmdiss.cls:
\begin{itemize}
\item It references a non-standard package (\textsf{atbeginend}).
\item The \textsf{graphicx} package line was commented out, even
  though the class file references an image (\verb+iitm+).
\item It uses a lot of obsolete commands, eg \verb+\em+, \verb+\bf+,
  \verb+\centerline+, etc.
\item The localisation settings (\verb+\@division+,
  \verb+\@department+, etc) are not defaulted.
\item It does not invoke the right typeface (the \textsf{mathptmx}
  package for Times).
\item It uses \verb+\setstretch+\ instead of \verb+\doublespacing+.
\end{itemize}
\end{document}

Peter Flynn

unread,
Mar 21, 2010, 9:21:38 AM3/21/10
to latexus...@googlegroups.com
On Sun, Mar 21, 2010 at 11:46 AM, dhrubajyoti mukherjee <dhrubajyot...@gmail.com> wrote:
Dear Peter,

Thanks for replying. I tried using sectsty package. But even including the package is messing up the alignment and font sizes of the chapter title. Can I use any alternate strategy.

Including it without using any of the commands will not have any effect by itself.
Perhaps something else you are doing is affecting this.

///Peter
 

dhrubajyoti mukherjee

unread,
Mar 21, 2010, 12:28:33 PM3/21/10
to latexus...@googlegroups.com
Dear Peter,

Once I added the sectsty command into the class file, instead in the tex file., the problem with font sizing got solved. Thanks a lot !! I still have one more doubt. What should be the value of x in \setstretch{x}. I have used x=1.667, but I am no so sure of it. What is the role of \setstretch here. or can I use \doublespacing command here.


\RequirePackage{setspace}
\RequirePackage{atbeginend} % used to redefine the list environs
\setstretch{1.667}

I also looked into the comments you posted. Thanks for going through the code. This particularly drew my attention


\item It does not invoke the right typeface (the \textsf{mathptmx}
  package for Times).

I am supposed to use Times Roman (and not Times New Roman) through out the thesis. Is it being violated .


Please write back to me.

Peter Flynn

unread,
Mar 21, 2010, 2:02:45 PM3/21/10
to latexus...@googlegroups.com
On Sun, Mar 21, 2010 at 4:28 PM, dhrubajyoti mukherjee <dhrubajyot...@gmail.com> wrote:
Dear Peter,

Once I added the sectsty command into the class file, instead in the tex file., the problem with font sizing got solved. Thanks a lot !! I still have one more doubt. What should be the value of x in \setstretch{x}. I have used x=1.667, but I am no so sure of it. What is the role of \setstretch here. or can I use \doublespacing command here.

You probably shouldn't be using \setstretch at all. Use \doublespacing instead. The \setstretch command is intended only for use if you want to define an additional spacing command (eg \triplespacing).

///Peter

Reply all
Reply to author
Forward
0 new messages