With the code below, I have a very large space between the section 1 heading and subsection 1.1 heading. I've tried to change the \titlespacing
options but I still can't reduce this large space.
What adjustments can I make to my code?
\documentclass[twoside,a4paper]{article}
\usepackage{blindtext}
\usepackage{graphicx}
\usepackage[dvipsnames]{xcolor}
\definecolor{verydarkblue}{HTML}{000052}
\XeTeXinputencoding iso-8859-1
\usepackage{geometry}
\geometry{a4paper,total={210mm,297mm},
left=20mm,right=20mm,top=25mm,bottom=25mm,}
\usepackage{setspace}
\onehalfspacing
\usepackage[compact]{titlesec}
\titlespacing\section{0pt}{0pt}{0pt}
\titlespacing\subsection{0pt}{0pt}{0pt}
\titlespacing\subsubsection{0pt}{0pt}{0pt}
\usepackage{parskip}
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\setmainfont{Calibri}
\date{}
\begin{document}
\newpage
\textcolor{verydarkblue}{\section*{\textbf{\textsc{{section 0}}}}}
\blindtext
\textcolor{verydarkblue}{\section{\textbf{\textsc{{section 1}}}}}
\textcolor{verydarkblue}{\subsection{\textit{subsection 1.1}}}
\blindtext
\end{document}
Best Answer
You should use the features of
titlesec
for setting color and font of titles.Don't load
xunicode
andxltxtra
; avoid using\XeTeXinputencoding
for new documents: save them as UTF-8.