2

The second fully voted answer of ths question suggest that to use \itemsep0em for reduce the spaces between items locally. But how can I define it to be implemented for whole the document and for just the enumerate list. Here is my code sample:

 \documentclass[]{article}
 \usepackage{enumitem}
 \begin{document}
 \begin{enumerate}
            \item[a] $f=x^2-3y^2-8x+9y+3xy$
            \item[b] $f=x^2+4y^2-6x+16y$
            \item[c]$f=xy-x+y$
            \item[d] $f=\dfrac{5x^3}{3}+\dfrac{2}{3}y^3-\dfrac{15}{2}x^2+y^2-4y+7$
 \end{enumerate}
 \end{document}

and I want to set a certain value for the space between items globally. Should it be like the following cod:

\AtBeginEnvironment{enumerate}{\itemsep}{0pt}

Sorry if the above code makes you annoyed. 😞

Thanks for your time! 🙏🙏

2
  • 3
    you are already loading (but not using) the enumitem package which gives declarations to set the global list parameters and an optional argument to set them per list, without ever needing to reference \itemsep and related lengths explicitly. see texdoc enumitem Dec 9, 2021 at 8:56
  • 2
    Since you are using enumitem you can use \setlist[enumerate]{itemsep=0pt,}. You can include any other cusomizatiosn in the setlist and that will apply to all enumerate lists Dec 9, 2021 at 9:44

1 Answer 1

1

You can also define a new environment:

\documentclass{article}

\newenvironment{my_enumerate}{
\begin{enumerate}
  \setlength{\itemsep}{0pt}
  \setlength{\parskip}{0pt}
}{\end{enumerate}}

\begin{document}
\begin{my_enumerate}
    \item[a] $f=x^2-3y^2-8x+9y+3xy$
    \item[b] $f=x^2+4y^2-6x+16y$
    \item[c] $f=xy-x+y$
    \item[d] $f=\frac{5x^3}{3}+\frac{2}{3}y^3-\frac{15}{2}x^2+y^2-4y+7$
\end{my_enumerate}
\end{document}

If you need them even closer, you can use negative numbers, but be careful not to cause overlapping text.

1
  • 1
    Thnaks so much. Thank you for the time!
    – Mikasa
    Dec 9, 2021 at 12:05

You must log in to answer this question.

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