0

I need to save as much space as possible in my document. So, I use \titleformat with the [runin] shape argument from the titlesec package to use the space after a section heading.

Whereas this works fine for text, I cannot manage to have the headings for \section{A} and \subsection{B} in the same line.

How can I do this?

...
\usepackage{titlesec}
...
% format
\titleformat{\section}[runin]
{\normalfont\large\bfseries}{\thesection}{1em}{}[\hspace*{1em}]
% spacing
\titlespacing{\section}{0pt}{1ex plus 1ex minus 0.5ex}{0pt}

% format
\titleformat{\subsection}[runin]
{\normalfont\normalsize\bfseries}{\thesubsection}{1em}{}[\hspace*{1em}]
% spacing
\titlespacing{\subsection}{0pt}{1ex plus 1ex minus 0.5ex}{0pt}
...

\section{Project 2}
\subsection{Project Title}
Awesome Science Project
\subsection{Principal Investigators (possible 1-4)}
\leavevmode \newline {\footnotesize
\begin{tabular}{ p{0.32\textwidth} p{0.32\textwidth}}
Prof. Dr. John Doe  Prof. & Prof. Dr. Jane Doe\\
01.01.1972  &01.01.1970\\
Miskatonic University&  Miskatonic University\\
\end{tabular}
}

enter image description here

  • 3
    Even if you want to save space, I suggest you not to do that at all. I will be very uncomfortable if I have to read a book/paper with such formatting. – user156344 Mar 28 at 9:52
  • Maybe I should have mentioned that we have a form that requires us to put the title in its own subsection. So, if I were to decide, the document would not include an own subsection for the title in the first place. However, if you know any solution for this admittedly messy style, I would appreciate it. – Alex Mar 28 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.