I'm having some trouble getting proper padding around my section headers inside minipages.
\documentclass{article}
\usepackage[explicit]{titlesec}
\newcommand\Vhrulefill{\leaders\hrule height 0.7ex depth \dimexpr0.4pt-0.7ex\hfill\kern0pt}
\titleformat{\section}{\bfseries\large}{}{0pt}{\noindent\Vhrulefill~#1~\Vhrulefill}
\begin{document}
\begin{minipage}[t]{0.45\textwidth}
\section{Introduction}
Some content for the first section
\section{One More Section}
\begin{itemize}
\item Item 1
\item Item 2
\end{itemize}
\section{Another Section}
Some text outside of a list here
\section{Last section}
\begin{itemize}
\item One here
\item One more
\end{itemize}
\end{minipage}%
\hfill\vline\hfill
\begin{minipage}[t]{0.45\textwidth}
\section{Introduction}
Some content for the first section
\section{One More Section}
\begin{itemize}
\item Item 1
\item Item 2
\end{itemize}
\section{Another Section}
Some text outside of a list here
\section{Last section}
\begin{itemize}
\item One here
\item One more
\end{itemize}
\end{minipage}%
\end{document}
There's too little spacing before "One More Section" and too much after.
When I try to adjust it with \titlespacing
, it doesn't affect all the sections
Best Answer
Here are 3 solutions
multicols
environment frommulticol
packageparbox
commandminipage
it seems that we can't start a minipage with\section
so we used\
(space) or~