I want all my section headings and body text to be spaced as per below rule. I use article class.
Space before: 0pt
Space after: 50–100% of text size
Line spread = 135% of text size
How can this be done?
EDIT: MWE
\documentclass[12pt, oneside, a4paper]{article}
\usepackage{titlesec}% Define titles and spacing
\usepackage{lipsum}
\usepackage{fontspec}% Font specification
\usepackage{sectsty}% Section font
\usepackage{xcolor}% For colored things
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Font Declaration
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setmainfont{Futura Book.ttf}[
BoldFont = Futura Book Bold.ttf,
ItalicFont = Futura Book Italic BT.ttf,
BoldItalicFont = Futura Book Bold Italic.ttf]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Section Color.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\sectionfont{\color{blue}}
\subsectionfont{\color{gray}}
\subsubsectionfont{\color{gray}}
\paragraphfont{\color{gray}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Titlesec Customizations
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\titlespacing{\section}{0pt}{0pt}{0pt}
\titlespacing{\subsection}{0pt}{0pt}{0pt}
\titlespacing{\subsubsection}{0pt}{0pt}{0pt}
\begin{document}
\section{A Section}
\lipsum[1]
\subsection{Sub-Section}
\lipsum[2]
\end{document}
I was wondering, why do you need MWE? But while creating this MWE I realized there is something not agreeable between titlesec
and sectsty
. If I comment out the section color
instructions in preamble, titlesec
comes into effect.
Thank you Arne for suggesting MWE.
I need coloured section headings AND the tight spacing. Help?
0pt
. But it hasn't reduced the spacing.@
seems to have no effect.