3
\documentclass[11pt,]{article}
\usepackage{titlesec}
\titleformat{\section}[leftmargin]{\normalfont
\titlerule*[.6em]{\bfseries.}%
\vspace{6pt}%
\sffamily\bfseries\filleft}
{\thesection}{.5em}{}
\titlespacing{\section}
{8pc}{1.5ex plus .1ex minus .2ex}{1pc}
\begin{document}

\section{This is a section heading}
\begin{enumerate}
\item This is the first item and it is too low on the page...
\item This is another item
\item This is another item
\item This is another item
\item This is another item
\item This is another item
\item This is another item
\end{enumerate}
\section{This is a section heading}

This paragraph is fine ...
\end{document}

Why am I getting extra vertical space before a list but not before a paragraph?

1
  • Not sure of a general fix, but you can place \vspace{-23pt} after the \begin{enumerate}. Commented Feb 17, 2016 at 12:26

1 Answer 1

5

Just add this code between \section{…} and your list without adding blank lines:

...
\section{This is a section heading}
\leavevmode\vspace*{-\dimexpr\baselineskip+\topsep\relax}
\begin{enumerate}
...

enter image description here

6
  • I can't reproduce this with your suggestion: \documentclass[11pt]{article} \usepackage{titlesec} \titleformat{\section}[leftmargin] {\normalfont\titlerule*[.6em]{\bfseries.}\vspace{6pt}\sffamily\bfseries\filleft}{\thesection}{.5em}{} \titlespacing{\section}{8pc}{1.5ex plus .1ex minus .2ex}{1pc} \begin{document} \section{This is a section heading} \leavevmode\vspace*{-\dimexpr\baselineskip+\topsep\relax} \begin{enumerate} \item This is the first item and it is too low on the page... \item This is another item \end{enumerate} \section{This is a section heading} This para is fine \end{document} Commented Feb 17, 2016 at 21:27
  • I tried your code, and had an error message with part of the code containing invisible characters, it seems. It compiles fine after I've deleted these characters. Could you test with the \titleformat{…} command replaced with this one: \titleformat{\section}[leftmargin] {\normalfont\titlerule*[.6em]{\bfseries.}\vspace{6pt}\sffamily\bfseries\filleft}% {\thesection}{.5em}{} ? (Note: I'm utf8 encoded).
    – Bernard
    Commented Feb 17, 2016 at 22:14
  • I can't compile your code either because there is a 'ZERO WIDTH SPACE' (U+200B) after \filleft}. I didn't have it in my original code, sorry for inconvenience. I post an answer and a snap shot to show what I mean. Commented Feb 17, 2016 at 22:32
  • @ArashEsbati It works fine for me.
    – cfr
    Commented Feb 17, 2016 at 23:37
  • Please do let me know if you object to my having edited your answer for clarity.
    – cfr
    Commented Feb 17, 2016 at 23:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .