Text Formatting ⇒ Alignment
-
- Posts: 15
- Joined: Wed Oct 19, 2016 6:30 am
Alignment
Sir,
The following are doubts w.r.t .cls file:
1. How to align the "contents" text to right side of the page
2. How to give horizontal lines after "chapter 1" and before "chapter name" in first chapter (or corresponding chapter in general).
3. Similarly how to align the "chapter 1" and "chapter name" to right side of the page beside to page number.
Please solve and oblige
The following are doubts w.r.t .cls file:
1. How to align the "contents" text to right side of the page
2. How to give horizontal lines after "chapter 1" and before "chapter name" in first chapter (or corresponding chapter in general).
3. Similarly how to align the "chapter 1" and "chapter name" to right side of the page beside to page number.
Please solve and oblige
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Re: Alignment
Please post a minimal working example.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
- Stefan Kottwitz
- Site Admin
- Posts: 10290
- Joined: Mon Mar 10, 2008 9:44 pm
Alignment
Welcome to the forum!
We don't know which class file you use. Please tell us the name of the class, and it would be meaningful to post a code example of your document to change. Link:
minimal working example.
Stefan
We don't know which class file you use. Please tell us the name of the class, and it would be meaningful to post a code example of your document to change. Link:

Stefan
LaTeX.org admin
-
- Posts: 15
- Joined: Wed Oct 19, 2016 6:30 am
Alignment
Dear Sir,
Thanks for your suggestions and comments...!
The class file I am using is MastersDoctoralThesis file.
Thanks for your suggestions and comments...!
The class file I am using is MastersDoctoralThesis file.
-
- Posts: 15
- Joined: Wed Oct 19, 2016 6:30 am
Alignment
Hello sir,
Here is the minimal code:
Here is the minimal code:
Code: Select all
\documentclass[
12pt, % The default document font size, options: 10pt, 11pt, 12pt
oneside, % Two side (alternating margins) for binding by default, uncomment to switch to one side
english, % ngerman for German
onehalfspacing, % Single line spacing, alternatives: onehalfspacing or doublespacing
%draft, % Uncomment to enable draft mode (no pictures, no links, overfull hboxes indicated)
nolistspacing, % If the document is onehalfspacing or doublespacing, uncomment this to set spacing in lists to single
%liststotoc, % Uncomment to add the list of figures/tables/etc to the table of contents
%toctotoc, % Uncomment to add the main table of contents to the table of contents
parskip, % Uncomment to add space between paragraphs
%nohyperref, % Uncomment to not load the hyperref package
%headsepline, % Uncomment to get a line under the header
]{MastersDoctoralThesis} % The class file specifying the document structure
-
- Posts: 15
- Joined: Wed Oct 19, 2016 6:30 am
Alignment
Dear sir,
Here is screenshot of what actually i needed.
Here is screenshot of what actually i needed.
- Stefan Kottwitz
- Site Admin
- Posts: 10290
- Joined: Mon Mar 10, 2008 9:44 pm
Alignment
Here is an example using the
titlesec package:
Adjust as you desire. The command
Stefan

Code: Select all
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries\raggedleft}{\chaptertitlename\ \thechapter}
{20pt}{\Huge}
\raggedleft
does the right alignment.Stefan
LaTeX.org admin
-
- Posts: 15
- Joined: Wed Oct 19, 2016 6:30 am
Alignment
Dear Stefan Kottwitz
Thank you, thank you very much for your valuable suggestions and it works.
But I have couple of problems need to be solved, please suggest me regarding this.
The screenshot of the problem is attached with this post. Please do needful and oblige.
Thanking you,
Vinay Kumar N
Thank you, thank you very much for your valuable suggestions and it works.
But I have couple of problems need to be solved, please suggest me regarding this.
The screenshot of the problem is attached with this post. Please do needful and oblige.
Thanking you,
Vinay Kumar N
- Attachments
-
- Latex Corrections 2.png (53.24 KiB) Viewed 7309 times
- Stefan Kottwitz
- Site Admin
- Posts: 10290
- Joined: Mon Mar 10, 2008 9:44 pm
Alignment
You could add a line break with a title rule,
Regarding the page header style, you may play with this and change it:
Stefan
\\[0.5ex]\titlerule
, that is,Code: Select all
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries\raggedleft}{%
\chaptertitlename\ \thechapter\\[0.5ex]\titlerule}
{20pt}{\Huge}
Code: Select all
\providepairofpagestyles{thesisSimple}{%
\clearpairofpagestyles%
\automark[chapter]{chapter}
\ihead{\headmark}% Inner header
\ohead[\pagemark]{\pagemark}% Outer header
}
\ifoot{}% Inner footer
\ofoot{}% Outer footer
\pagestyle{thesisSimple}
\providepairofpagestyles[thesisSimple]{thesis}{%
\automark*[section]{}%
}
\providepairofpagestyles[thesisSimple]{review}{%
\ofoot[\ttitle/\authorname]{\ttitle/\authorname}
\ifoot[\today]{\today}
}
LaTeX.org admin