0

image1 image2

The tex file to produce the image on the right is given below. The image on the left is produced by uncommenting \usepackage{parskip}. My aim is to set distance between headings and also distance between heading and text with \titlesec. But parskip package which is needed for adding space between paragraphs, undesirably adds space after headings. I would like to negate the effect of parskip on headings and easily adjust distances for headings with titlesec.

This post is for KOMA-Script classes, so I guess the solution there would not work for me.

\documentclass[a4paper,12pt]{report}

\renewcommand{\baselinestretch}{2}
\usepackage{parskip}
\setlength{\parindent}{0pt}
\usepackage{lipsum}
\usepackage{titlesec}
\titleformat{\chapter}[display]
    {\centering\fontsize{16}{1}\bfseries}{\chaptertitlename\ \thechapter}{0pt}{\fontsize{16}{1}}
\titlespacing*{\chapter}{0pt}{0pt}{0pt}

\begin{document}
    \chapter{INTRODUCTION}
    \lipsum[1]
\end{document}
3

\fontsize{16}{1} is wrong, the second argument is the distance of baselines and should always be larger then the fontsize.

Beside this you can reset \parskip and \baselinestretch in the heading:

\documentclass[a4paper,12pt]{report}

\renewcommand{\baselinestretch}{2}
\usepackage{parskip}
\setlength{\parindent}{0pt}
\usepackage{lipsum}
\usepackage{titlesec}
\titleformat{\chapter}[display]
    {\centering\parskip=0pt \renewcommand\baselinestretch{1}%
     \fontsize{16}{18}\bfseries}{\chaptertitlename\ \thechapter}{0pt}{\fontsize{16}{18}}
\titlespacing*{\chapter}{0pt}{0pt}{0pt}

\begin{document}
    \chapter{INTRODUCTION}
    \lipsum[1]
\end{document}
  • I would like to set the distance between INTRODUCTION and text as 24pt. Even though I set the distance as 0pt with \titlespacing*{\chapter}{0pt}{0pt}{0pt}, there is still some distance between them. Also, why you set the second argument of \fontsize{16}{18} as 18 but not 16? – Shibli Jun 8 at 9:54
  • I used 18 instead of 16 as normally the distance should be larger than the fontsize (the values for normalsize are e.g 12/14.5). If you have a new question ask a new question, don't ping only me personally in a comment. – Ulrike Fischer Jun 8 at 10:02

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.