I have some sections that have no direct text (other than subsections). For these blank sections, I am trying to make the subsection text (or heading) start at the same place as those sections that do have text. This seems to be specific to using leftmargin formatting of the title.
Here is an MWE:
\documentclass[a4paper]{article}
\usepackage{titlesec,lipsum}
\titleformat{\section}[leftmargin]
{}
{}
{0em}
{}
\titlespacing{\section}
{0cm}{1cm}{2cm}
\begin{document}
\section{section with text}
Section text
\subsection{subsection}
\lipsum[2]
\section{section with no text}
\subsection{subsection}
\lipsum[2]
\end{document}
The following image shows what I mean. I am trying to make "2.1 subsection" start at the same relative place as "section text". (In this particular document it does not make sense, but my particular document has a lot more formatting.)

