# Can I change how titlesec prioritizes padding values?

I've run into a situation in a document where I sometimes have a section heading that follows directly after a subsection heading with no generic paragraph content inbetween. In these cases the value I set using \titleformat for padding before section headings seems to be ignored in favor of the value set for after subsection headings. See this MWE:

\documentclass{scrartcl}
\usepackage{titlesec}
\titlespacing*{\section}{0pt}{*6}{*1}
\titlespacing*{\subsection}{0pt}{*2}{*0}
\pagestyle{empty}
\begin{document}
Test
Test
\end{document}


Normally I do not want any space at all after the subsection headings, but in the case of a subsection->section transition in the document I would like to prioritize the use of the padding value I set for section headers. Is there a way this can be accomplished?

You must use the largestsep option to titlesec. The default is aftersep:

\documentclass{scrartcl}

\usepackage[largestsep]{titlesec}
\titlespacing*{\section}{0pt}{*6}{*1}
\titlespacing*{\subsection}{0pt}{*2}{*0}
\pagestyle{empty}
\begin{document}

Test

• Oh largestsep where have you been all my life?! – Caleb Nov 8 '14 at 9:07