My problem: There's more space before my \chapter
that's inside a \minipage
environment than before any of the other chapters that are outside this environment.
What I'm after: Keep the same distance before every chapter. However, I'd like to keep the two chapers within the two minipages as they are (i.e. vertically aligned).
I'm using LuaLaTex–>PDF in order to use the Arial font, although that might be irrelevant.
I'd happily use any other solution that does not involve minipage if that is possible.
My MWE (using LuaLaTex–>PDF)
\documentclass[a4paper,10pt]{report}
\usepackage[T1]{fontenc}
\usepackage{fontspec}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage[top=20mm, bottom=20mm, left=20mm, right=20mm]{geometry}
\setmainfont{Arial}
\newfontfamily\secfont{Arial}
\definecolor{MSBlue}{rgb}{.204,.353,.541}
\definecolor{MSLightBlue}{rgb}{.31,.506,.741}
\definecolor{light-gray}{gray}{0.5}
\usepackage{sectsty}
\allsectionsfont{\secfont}
\usepackage{titlesec}
\newcommand{\hsp}{\hspace{0pt}}
\titlespacing*{\chapter}{0cm}{0.7cm}{0.2cm}[0pt]
\titlespacing*{\section}{0cm}{0.5cm}{0cm}[0pt]
\titleformat{\chapter}{\normalsize\bfseries\secfont\color{MSBlue}}{\hsp}{0pt}{\normalsize\bfseries\color{MSBlue}}[\vspace{0ex}\titlerule]
\titleformat{\section}{\large\bfseries\secfont}{\hsp}{0pt}{\large\bfseries}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}
\makeatother
\begin{document}
\pagestyle{empty}
\pagenumbering{gobble}
\chapter{Some chapter}
\section{some section}
{\color{light-gray}some small text}\\
\blindtext
\chapter{Some other chapter}
\section{some other section}
{\color{light-gray}Some small text}\\%
\blindtext%
\par\smallskip\nointerlineskip%
\noindent\begin{minipage}[t]{0.5\textwidth}
\chapter{Here it is} % <--- The culprit!
\begin{tabular}{l l}
\small
\textbf{cell1} &| cell6 \\
\textbf{cell2} &| cell7 \\
\textbf{cell3} &| cell8 \\
\textbf{cell4} &| cell9 \\
\textbf{cell5} &| cell10
\end{tabular}%
\end{minipage}%
%
\begin{minipage}[t]{0.5\textwidth}
\chapter{And the other one}
\small
Writing some text here
\end{minipage}%
\chapter{The next chapter}
\blindtext
\end{document}
Best Answer
If you add
You will see (xetex version luatex would be similar)
that the space above a normal chapter comes from
whereas the space above your boxed chapter pair is
The only real difference that I can see is
which is exactly
so you want to remove that from your definition.
Normally there would be difference in stretch glue between the boxed and unboxed headings, but your chapter space is fixed and does not have a stretch or shrink component, so you do not have that worry.