Text FormattingNo Space before and after List

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
marie2011
Posts: 138
Joined: Mon Feb 06, 2012 4:58 pm

No Space before and after List

Post by marie2011 »

Dear forum members,

I was wondering if it is possible to make the space disappear between "Preceding text" and the first item and between the last item and the "Following text".

Code: Select all




\documentclass[
12pt,%
%  draft,%
  twoside,%
  BCOR10mm,%
%  bibtotocnumbered,% <= obsolete
bib=totoc,        % <= recommended
toc=listof,
toc=bibliography,
numbers=noenddot
]{scrreprt}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,ngerman,catalan,spanish]{babel}
\usepackage{enumitem}


\begin{document}
  Preceding Text. 
  \begin{enumerate}[label={\alph*},noitemsep]
    \item First Item      
    \item Second Item      
    \item Third Item      
  \end{enumerate}
  Following Text.
\end{document}



Many thanks in advance.

Regards,

Marie

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

marie2011
Posts: 138
Joined: Mon Feb 06, 2012 4:58 pm

No Space before and after List

Post by marie2011 »

Dear forum members,

I was able to do something in order to make the space disappear. Unfortunately there is still something missing, because despite the fact that the document compiles fine, I am still having problems with the space after the third item. I was wondering if you know how to solve this problem.

Code: Select all


\documentclass[
12pt,%
%  draft,%
  twoside,%
  BCOR10mm,%
%  bibtotocnumbered,% <= obsolete
bib=totoc,        % <= recommended
toc=listof,
toc=bibliography,
numbers=noenddot
]{scrreprt}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,ngerman,catalan,spanish]{babel}
\usepackage{enumitem}


\begin{document}
  Preceding Text. 
  \begin{enumerate}[label={\arabic*.},nolistsep]   
    \item First Item      
    \item Second Item      
    \item Third Item      
  \end{enumerate}\vspace*{-\baselineskip}
  Following Text.
\end{document}


Many thanks in advance.

Regards,

Marie
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

No Space before and after List

Post by localghost »

Just replace nolistsep by nosep in the options for the {enumerate} environment. And yes, this can be found in the enumitem manual.

Code: Select all

\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{enumitem}

\begin{document}
  Preceding Text.
  \begin{enumerate}[nosep]
    \item First Item
    \item Second Item
    \item Third Item
  \end{enumerate}
  Following Text.
\end{document}

Thorsten
Attachments
enumitem-enumerate-nosep.png
enumitem-enumerate-nosep.png (6.94 KiB) Viewed 32483 times
marie2011
Posts: 138
Joined: Mon Feb 06, 2012 4:58 pm

No Space before and after List

Post by marie2011 »

Hello Thorsten,

What I need is to have no spaces at all. I do not know how to do it between the last item and the "following text".

It should look like this:


Text
1.
2.
3.
Text


What I have now is:


Text
1.
2.
3.

Text



Many, many thanks in advance.

Regards,

Marie
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

No Space before and after List

Post by localghost »

marie2011 wrote:[…] What I need is to have no spaces at all. I do not know how to do it between the last item and the "following text". […]
I can't comprehend this behaviour. Please see the output attached to my first reply.
Post Reply