Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Possible Duplicate:
Right-align chapter/section/subsection header

I need to align the chapter and its heading to the right. Please help me with it

share|improve this question

marked as duplicate by lockstep, Werner, Marco Daniel, Gonzalo Medina, Mico May 21 '12 at 20:43

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Which documentclass do you use: book, memoir, scrbook, or something else? –  Mico May 21 '12 at 10:17
    
I use report. I am writing a thesis –  Vidhya May 21 '12 at 10:31

2 Answers 2

Assuming you're using a documentclass such as report or book, you could load the sectsty package with the command

\usepackage{sectsty}

and insert the instruction

\chapterfont{\raggedleft}

in the preamble to get chapter headers to be right-aligned. To get all levels of sectioning headers in this style, issue the command

\allsectionsfont{\raggedleft}
share|improve this answer
    
I use documentclass{report}. How can I install the package? From where will I get the pacakge? –  Vidhya May 21 '12 at 10:32
    
Dont worry it is not a package.. It is included in the report class already.. Just run it. It should work.. –  royce May 21 '12 at 10:43
    
If you use a TeX distribution such as TeXLive, the sectsty package should already be loaded. If you use MiKTeX, its package autoloader should download and install the package the first time it's encountered. I've added an explanation of how to load the sectsty package to my answer. –  Mico May 21 '12 at 11:33
    
@royce sectstyis not included in the report-class. It is a separate package, certainly included in most modern distributions. –  Sveinung May 21 '12 at 19:10

If you cannot install the sectsty-package, you can also hack the definitions of \@makechapterhead and \@makeschapterhead:

\documentclass{report}

\makeatletter
\def\@makechapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedleft
    \normalfont
    \ifnum \c@secnumdepth >\m@ne
      \huge\bfseries \@chapapp\space \thechapter
      \par\nobreak
      \vskip 20\p@
    \fi
    \interlinepenalty\@M
    \Huge \bfseries #1\par\nobreak
    \vskip 40\p@
  }}
\def\@makeschapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedleft
    \normalfont
    \interlinepenalty\@M
    \Huge \bfseries  #1\par\nobreak
    \vskip 40\p@
  }}
\makeatother

\begin{document}
\chapter*{Test}
\chapter{Introduction}
\end{document}

The code is borrowed from Vincent Zoonekynd and slightly modified.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.