Formatting Chapter title in report package

1,478 views
Skip to first unread message

dhrubajyoti mukherjee

unread,
Mar 11, 2010, 4:23:35 AM3/11/10
to latexus...@googlegroups.com
Dear all,

Greetings !!  I am using the report package for writing my thesis, since this is having similarities with the format of my university specifications.However, I need to make few changes in the report package in order to meet the university guidelines . Currently I am facing difficulties in formatting the Chapter title. I need the title centered and of 15pt font size. I tried to use the following syntax

\begin{center}
\chapter{\fontsize{15}{18}XYZ}
\label{\fontsize{15}{18}Chapter 1}
\end{center}

But this gives error! Please suggest any corrective measure possible.

With warm regards,
Dhruba

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

Peter Flynn

unread,
Mar 11, 2010, 5:14:15 AM3/11/10
to latexus...@googlegroups.com
On Thu, Mar 11, 2010 at 9:23 AM, dhrubajyoti mukherjee <dhrubajyot...@gmail.com> wrote:
Dear all,

Greetings !!  I am using the report package for writing my thesis, since this is having similarities with the format of my university specifications.However, I need to make few changes in the report package in order to meet the university guidelines . Currently I am facing difficulties in formatting the Chapter title. I need the title centered and of 15pt font size. I tried to use the following syntax

\begin{center}
\chapter{\fontsize{15}{18}XYZ}

You must follow the \fontsize command with \selectfont to make it have effect:

\chapter{\fontsize{15}{18}\selectfont XYZ}

You must also use the fix-cm package if you want non-standard font sizes. By default LaTeX uses fixed steps for font sizes. The fix-cm packages allows you to use any size.
 
\label{\fontsize{15}{18}Chapter 1}

You don't need or want the fontsize in the label. It is not useful. A label is usually just a word, eg

\label{intro}

You can refer to this elsewhere with \ref{intro} and it will give you the right number automatically.

But if you want to change all the chapter headings, it is better to reprogram it so they are all automatic. LaTeX is all about automation.

Copy the definition of \makechapterhead from report.cls into your own private .sty file. Then change the font size where I have shown below. Then you do not need to add the font size changes by hand every time.

------------------mythesis.sty
\usepackage{fix-cm}
\def\@makechapterhead#1{%
  \vspace*{50pt}% this is the amount of space at the top of the page
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
% The next line formats the words "Chapter n"
        \huge\bfseries \@chapapp\space \thechapter
        \par\nobreak
        \vskip 20pt% this is the gap between chapter number and title
    \fi
    \interlinepenalty\@M
% The next line formats the chapter title
    \fontsize{15}{18}\selectfont \bfseries #1\par\nobreak
    \vskip 40pt% this is the gap below the chapter title
  }}

-------------------mythesis.tex
\documentclass[12pt]{report}
\usepackage{mythesis}
\begin{document}
\chapter{My First Chapter}
text
\chapter[Short title for the table of contents]{A very long chapter
  title that goes on for several lines which would not fit in the
  table of contents}
text
\end{document}

But also look first for a package that does what you want. You can use this approach to automate your formatting if there is no package that does what you want.

///Peter

Biru Zhou

unread,
Mar 11, 2010, 11:03:48 AM3/11/10
to latexus...@googlegroups.com
Hey, Thanks!!

This is also useful for me too!!!

Cheers,

Biru

> --
> 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.
>

--
Biru loves La vie en rose

dhrubajyoti mukherjee

unread,
Mar 11, 2010, 12:53:00 PM3/11/10
to latexus...@googlegroups.com
Dear Peter,

A lot of thanks for your input. I still have one small doubt. How to install the style file, that I have created. I am using TeXnic Center along with MikTex 2.8.

Please write back to me.

With warm regards,
Dhruba

Peter Flynn

unread,
Mar 11, 2010, 1:31:03 PM3/11/10
to latexus...@googlegroups.com
On Thu, Mar 11, 2010 at 5:53 PM, dhrubajyoti mukherjee <dhrubajyot...@gmail.com> wrote:
Dear Peter,

A lot of thanks for your input. I still have one small doubt. How to install the style file, that I have created. I am using TeXnic Center along with MikTex 2.8.

If this is temporary, just for this document, then leave the style file in the same folder as your main document.

If you want to keep it for use with other documents (and maybe add to the style file for other changes), you should put it in a folder that your installation of TeX searches. This is a FAQ, read this first:

 http://www.tex.ac.uk/cgi-bin/texfaq2html?label=what-TDS

and then this:

 http://www.tex.ac.uk/cgi-bin/texfaq2html?label=install-where

///Peter

dhrubajyoti mukherjee

unread,
Mar 12, 2010, 12:26:13 PM3/12/10
to latexus...@googlegroups.com
Thanks Peter,

It was really useful !

Cheers,
Dhruba
Reply all
Reply to author
Forward
0 new messages