LaTeX forum ⇒ Text FormattingAlignment

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
vinaykumarn
Posts: 8
Joined: Wed Oct 19, 2016 6:30 am

Alignment

Postby vinaykumarn » Wed Oct 19, 2016 6:37 am

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

User avatar
Johannes_B
Site Moderator
Posts: 3232
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Wed Oct 19, 2016 8:11 am

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.

User avatar
Stefan Kottwitz
Site Admin
Posts: 7883
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Thu Oct 20, 2016 12:20 pm

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: Infominimal working example.

Stefan
Site admin

vinaykumarn
Posts: 8
Joined: Wed Oct 19, 2016 6:30 am

Postby vinaykumarn » Wed Nov 16, 2016 7:38 am

Dear Sir,
Thanks for your suggestions and comments...!
The class file I am using is MastersDoctoralThesis file.

ghuczek
Posts: 23
Joined: Sun Dec 23, 2012 8:09 pm

Postby ghuczek » Sat Nov 19, 2016 12:50 am

What is the XXXXX that is written inside these brackets?

\documentclass{XXXXX}

Post the smallest amount of code you can that shows the problem you are trying to correct. That is needed to give you specific advice.

vinaykumarn
Posts: 8
Joined: Wed Oct 19, 2016 6:30 am

Postby vinaykumarn » Sat Nov 19, 2016 1:02 pm

Hello sir,
Here is the minimal code:
  1. \documentclass[
  2. 12pt, % The default document font size, options: 10pt, 11pt, 12pt
  3. oneside, % Two side (alternating margins) for binding by default, uncomment to switch to one side
  4. english, % ngerman for German
  5. onehalfspacing, % Single line spacing, alternatives: onehalfspacing or doublespacing
  6. %draft, % Uncomment to enable draft mode (no pictures, no links, overfull hboxes indicated)
  7. nolistspacing, % If the document is onehalfspacing or doublespacing, uncomment this to set spacing in lists to single
  8. %liststotoc, % Uncomment to add the list of figures/tables/etc to the table of contents
  9. %toctotoc, % Uncomment to add the main table of contents to the table of contents
  10. parskip, % Uncomment to add space between paragraphs
  11. %nohyperref, % Uncomment to not load the hyperref package
  12. %headsepline, % Uncomment to get a line under the header
  13. ]{MastersDoctoralThesis} % The class file specifying the document structure

vinaykumarn
Posts: 8
Joined: Wed Oct 19, 2016 6:30 am

Postby vinaykumarn » Sat Nov 19, 2016 1:28 pm

Dear sir,

Here is screenshot of what actually i needed.
Latex Query.png
Latex Query.png (47.02 KiB) Viewed 427 times

User avatar
Stefan Kottwitz
Site Admin
Posts: 7883
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Sat Nov 19, 2016 4:53 pm

Here is an example using the titlesec package:

  1. \usepackage{titlesec}
  2. \titleformat{\chapter}[display]
  3. {\normalfont\huge\bfseries\raggedleft}{\chaptertitlename\ \thechapter}
  4. {20pt}{\Huge}


Adjust as you desire. The command \raggedleft does the right alignment.

Stefan
Site admin

vinaykumarn
Posts: 8
Joined: Wed Oct 19, 2016 6:30 am

Postby vinaykumarn » Sun Nov 20, 2016 8:06 am

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
Attachments
Latex Corrections 2.png
Latex Corrections 2.png (53.24 KiB) Viewed 404 times

User avatar
Stefan Kottwitz
Site Admin
Posts: 7883
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Sun Nov 20, 2016 12:13 pm

You could add a line break with a title rule, \\[0.5ex]\titlerule, that is,

  1. \titleformat{\chapter}[display]
  2. {\normalfont\huge\bfseries\raggedleft}{%
  3. \chaptertitlename\ \thechapter\\[0.5ex]\titlerule}
  4. {20pt}{\Huge}


Regarding the page header style, you may play with this and change it:

  1. \providepairofpagestyles{thesisSimple}{%
  2. \clearpairofpagestyles%
  3. \automark[chapter]{chapter}
  4. \ihead{\headmark}% Inner header
  5. \ohead[\pagemark]{\pagemark}% Outer header
  6. }
  7. \ifoot{}% Inner footer
  8. \ofoot{}% Outer footer
  9. \pagestyle{thesisSimple}
  10. \providepairofpagestyles[thesisSimple]{thesis}{%
  11. \automark*[section]{}%
  12. }
  13. \providepairofpagestyles[thesisSimple]{review}{%
  14. \ofoot[\ttitle/\authorname]{\ttitle/\authorname}
  15. \ifoot[\today]{\today}
  16. }


Stefan
Site admin


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 1 guest