Use short titles so that the images don't show up in the table of contents. The macro \sectioncalc
computers \titlewidth
to be used for section titles. (The section number is not included.) A lot depends on how wide your titles are and how big the images (and how you want them placed relative to the titles). And you don't HAVE to use \maketitle
.
The 16pt is a bit of a kludge, but none of the lengths I found in \section
and \@startsection
worked.
\documentclass{article}
\usepackage{showframe}
\usepackage{mwe}
\newlength\titlewidth
\def\sectioncalc{\settowidth{\titlewidth}{\normalfont\Large\bfseries\thesection}%
\titlewidth=\dimexpr\textwidth-\titlewidth-16pt\relax}% \@tempskipa=18pt
\title{\parbox{\textwidth}{\raisebox{-0.5\height}{\includegraphics[width=2in]{example-image}}%
\hfill\parbox[c]{2in}{\textbf{This is a multiline title}}}}
\begin{document}
\maketitle
%\setcounter{section}{21}
\section[First Secdtion]{\sectioncalc\parbox[b]{\titlewidth}{First Section
\hfill\raisebox{-0.5\height}[0.5\height][0pt]{\includegraphics[width=2in]{example-image}}}}
\subsection{First Subsection}
\hangindent=-2.2in
\hangafter=-2
\lipsum[1]
\end{document}

wrapfig
, for example or doing it manually ;-)wrapfig
package allow me to wrap arround sections, or at least I never used it this way. It never occured to me it could do just that. Do you know a template that resembles what I want to do ?