1

The university requires that the following conditions be met for the thesis. I use sectsy package to get the required font size and am using standard report class. How to get the proper spacing between the top margin and chapter number and chapter number and chapter title?

enter image description here

  • Package titlesec can be of help here. \titleformat and \titlespacing are the commands to read about. – Johannes_B Dec 18 '16 at 13:20
2

As Johannes_B writes: Use the package titlesec instead of sectsty because titlesec has more advanced features, including the ability to define custom spacing between the elements of a chapter.

You use the command

\titlespacing*{command}{left}{before-sep}{after-sep}[right-sep]

To define the spacing, see section 3.2, page 4 in the manual. For you, the correct values may be:

\titleformat{\chapter}[display]
    {\filcenter\normalfont\LARGE\bfseries}
    {\chaptertitlename\ \thechapter}{25mm}{\LARGE}  %% \LARGE gives 17.28 pt if main
                                                    %% font size is 10 or 11 pt, which
                                                    %% should be close enough
\titlespacing*{\chapter}{0mm}{75mm}{25mm}

The space between chapter number and the chapter text is defined by the 25 mm command in the \chapterformat. The space before and after the chapter by the \titlespacing. See section 9.2 in the manual to see the definition of all section commands in the standard class. You can then just redefine those to get the result you desire.

You will learn more if you read the manual and experiment and come back and ask more questions (if you search for titlesec, you will probably find most problem already solved).

  • Thanks for your suggestion but am working with Lyx and when I enter the above mentioned commands in the preamble, it gives me the following error. ! Package titlesec Error: Not allowed in `easy' settings. ! LaTeX Error: Missing \begin{document}. – Curious Dec 19 '16 at 4:45
  • @Curious I do not know Lyx, but I am pretty sure it is possible to enter LaTeX-code in the preamble. Maybe some LyX-experts may help you. – Sveinung Dec 19 '16 at 11:13
  • @Curious Looking into your error message, it seems that you have chosen one of the easy-options described in section 2.1 in the manual. Try loading titlesec without any options and see if it works better. – Sveinung Dec 19 '16 at 11:49
  • I didn't specify any option. I just copy paste the code written above to see whether it works or nor. – Curious Dec 19 '16 at 18:09
  • @Curious Did you remember to load titlesecin you preamble? I do not have LyX installed, and cannot test myself. – Sveinung Dec 19 '16 at 18:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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