Text FormattingSpace between List Items

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

Space between List Items

Post by marie2011 »

Dear forum members,

I was wondering if you could help me with this problem. I want to have less space between the lines of an {enumerate} environment.

Here is my minimal example:

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}


\begin{document}

\begin{enumerate}[label={\alph*},nolistsep]
\item First Item	
\item Second Item	
\item Third Item	
\end{enumerate}\vspace*{-\baselineskip}

\end{document}
My example is not working. That is the error I got:

Code: Select all

ERROR: Missing number, treated as zero.

--- TeX said ---
<to be read again> 
                   \c@* 
l.23 \begin{enumerate}[label={\alph*
                                    },nolistsep]
--- HELP ---
This is usually caused by a LaTeX command expecting but not finding
either a number or a length as an argument. You may have omitted an
argument, or a square bracket in the text may have been mistaken for
the beginning of an optional argument. This error is also caused by
putting \protect in front of either a length command or a command such
as \value that produces a number.
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.

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

Space between List Items

Post by localghost »

You need to load the enumitem package.

Code: Select all

\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\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}

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

Re: Space between List Items

Post by marie2011 »

Hello Thorsten,

Many thanks for your prompt answer.

How can I get the same, but with 1. / 2. / 3. and so on.

Many thanks in advance.

Regards,

Marie
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: Space between List Items

Post by Stefan Kottwitz »

Hi Marie,

Thorsten posted a link to the enumitem package above. There you can find the package documentation, which describes how to set the labels.

Creating hyperlinks is for helping, giving links for further reading, not just because underlined words look nice. ;-) (Actually, underlining doesn't look good - it's just the www heritage. :roll: )

Stefan
LaTeX.org admin
marie2011
Posts: 138
Joined: Mon Feb 06, 2012 4:58 pm

Re: Space between List Items

Post by marie2011 »

Hello Stefan,

I am not sure what you mean with "underlining".

What I need is:

1. First topic

2. Second topic

And so on.

Many thanks in advance.

Regards,

Marie
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: Space between List Items

Post by Stefan Kottwitz »

Hi Marie,

all what I wrote above concerns Thorstens link to enumitem. Links are usually underlined. But you can ignore the comment on underlining, it doesn't matter regarding the problem. Did you find the link?

Did you read the documentation already?

Stefan
LaTeX.org admin
marie2011
Posts: 138
Joined: Mon Feb 06, 2012 4:58 pm

Re: Space between List Items

Post by marie2011 »

Hello Stefan,

Could you say to me how it works? Unfortunately I do not have the time to do it myself. :(

What I need is:
1.
2.
3.
and not
a
b
c

And between the paragraph and the first item and the last item and the paragraph there should not be a space.


I am very very sorry.

Many thanks in advance.

Regards,

Marie
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Re: Space between List Items

Post by svend_tveskaeg »

You can at least look for it before asking others to do it for you. The point of this forum is to help people, not do their work for them.
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
marie2011
Posts: 138
Joined: Mon Feb 06, 2012 4:58 pm

Space between List Items

Post by marie2011 »

Dear forum members,

I am sorry for not having dealt with the problem myself. I solved part of it, i. e. 1. / 2. and so on.

Do you know how to make the space between the first and last item disappear? I do not know how to find this in the manual.

Here is my example:

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*.},noitemsep]
    \item First Item      
    \item Second Item      
    \item Third Item      
  \end{enumerate}
  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

Space between List Items

Post by localghost »

marie2011 wrote:[…] How can I get the same, but with 1. / 2. / 3. and so on. […]
I just complemented your code that you provided in your question. And this code contains options for the {enumerate} environment which generates small Latin letters as item labels. Hence I assume that you want the label right in this way. So I don't understand why you now want something else. Seems that this code is not written by yourself and you don't really understand what it is doing.
marie2011 wrote:[…] Do you know how to make the space between the first and last item disappear? I do not know how to find this in the manual. […]
There is no space between the first and last list items. You probably mean the space before and after list. And that seems to be the reason why you opened another thread.

And if the primary problem is solved, please accept the answer that led you to the solution.
Post Reply