Text FormattingJustify Headings to left Side

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
mavericky99
Posts: 7
Joined: Sat Sep 17, 2011 6:04 am

Justify Headings to left Side

Post by mavericky99 »

can anyone help me making the section, subsection and subsubsections in thesis left justified. Actually they are centered. I want them to be left aligned...I want the chapter names to be center aligned and Section names left aligned.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Justify Headings to left Side

Post by localghost »

What you want should be the default behaviour. Show with a minimal example what is going wrong. If you are using a document class that is not listed on CTAN (please check that before), attach it to your next post by upload to the forum server.


Best regards and welcome to the board
Thorsten
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Justify Headings to left Side

Post by Stefan Kottwitz »

You could use the titlesec package. Or use features of the document class. However, we only can help you if you would at least tell us the name of that class.

Stefan
LaTeX.org admin
mavericky99
Posts: 7
Joined: Sat Sep 17, 2011 6:04 am

Justify Headings to left Side

Post by mavericky99 »

I want my thesis to look like the one in the picture. Please help me left align the sections in LaTeX.

Code: Select all

\documentclass[12pt,a4]{thesis}
\usepackage[pdftex]{graphicx}
\usepackage[titletoc]{appendix}
\usepackage[utf8x]{inputenc}
\usepackage{ucs}
\usepackage{amsfonts}
\usepackage{fullpage}
\usepackage{multirow}
\usepackage{tabularx}
\usepackage{rotating}
\usepackage{makeidx}
\usepackage{times}
\usepackage{amsmath}
\usepackage{multicol}
\usepackage{array}
\usepackage{titlesec}
\setcounter{secnumdepth}{3}
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}

\sectionfont{\normalsize\sc\leftmark}
	 
\linespread{1.3}
\normalsize{}

\begin{document}
\chapter{\textbf{INTRODUCTION AND PRELIMINARIES}}

\section{\textbf{INTRODUCTION}}
   
     I want only the introduction section left justified...and chapters centered as above...

\section{\textbf{PRELIMS}}
 
Left justification as shown in figure....

\end{document}
Attachments
Untitled.jpg
Untitled.jpg (28.59 KiB) Viewed 34303 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Justify Headings to left Side

Post by Stefan Kottwitz »

With the thesis.cls class I know, it can easily be done by adding the nocenter option:

Code: Select all

\documentclass[12pt,a4,nocenter]{thesis}
Stefan
LaTeX.org admin
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Justify Headings to left Side

Post by localghost »

Stefan's solution would align all headings to the left. And as he already suggested earlier, you can use the titlesec package to get the desired output. Here shown with a standard class.

Code: Select all

\documentclass[12pt,a4paper,english]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{geometry}
\usepackage[up,bf,raggedright]{titlesec}
\usepackage{blindtext}

\titleformat{\chapter}{\filcenter\normalfont\huge\bfseries}{\thechapter.}{20pt}{\huge}
\titlespacing*{\chapter}{0pt}{50pt}{20pt}

\begin{document}
  \blinddocument
\end{document}
For details refer to the package manual.

The blindtext package is not part of the solution, It has only been used to create dummy text. In this context you might also drop the babel package and its (global) language option.
mavericky99
Posts: 7
Joined: Sat Sep 17, 2011 6:04 am

Re: Justify Headings to left Side

Post by mavericky99 »

But the problem is I donot want the chapter headings to shift left...I only want the section and subsection headings to shift left...is there a way????
mavericky99
Posts: 7
Joined: Sat Sep 17, 2011 6:04 am

Re: Justify Headings to left Side

Post by mavericky99 »

respected sir,

when ever I do what u have said I am getting an error. The log file with the error is attached.
Attachments
anand.log
(4.4 KiB) Downloaded 423 times
mavericky99
Posts: 7
Joined: Sat Sep 17, 2011 6:04 am

Re: Justify Headings to left Side

Post by mavericky99 »

also sir using \documentclass{12pt, nocenter} has cleared my section headings problem but want u to help me allign the chapter names in the center as I have shown in the figure...I would be greatfull if u give me precise code.....
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Justify Headings to left Side

Post by localghost »

The titlesec package and the thesis class seem to be incompatible. Is there a special reason why you use this class? If not, think about using another one.
Post Reply