2

I'd like to create this vertical space globally using enumitem. The key style=nextline pushes the item content to its own line as I want, but I'd like some added vertical space of my choice. Here's my MWE:

\documentclass{article}

\usepackage{enumitem}

\setlist[description]{%
  labelindent=0em, 
  leftmargin=1.5em,
  font={\large\bfseries},
  style=nextline
}

\begin{document}

\begin{description}
  \item[Backgammon] One of the oldest known games, Backgammon was played
  by the ancient Mesopotamians.  
\end{description}

\end{document}
2

Final code:

\documentclass{article}

\usepackage{enumitem}

\def\myitem[#1]{\item[#1\vspace{8pt}]}

\setlist[description]{%
  labelindent=0em, 
  leftmargin=1.5em, 
  font={\large\bfseries},
  style=nextline,
}



\begin{document}

test

\begin{description}
  \myitem[Backgammon] One of the oldest known games, Backgammon was played
    by the ancient Mesopotamians.
  \myitem[Chess]
    \begin{itemize}\myitem[] %%%IF THE FIRST DESCRIPTION ITEM HAS A LIST AS A BODY WE NEED TO START LIKE THIS TO TRIGGER THE NEW LINE
      \item First inside
      \item Second inside
    \end{itemize}
    Newer than Backgammon with subtracted the factor of luck (as possible)

    \begin{itemize}
    \item First inside
      \item Second inside
    \end{itemize}
    \begin{enumerate}
    \item Numbered 1
      \item Numbered two
    \end{enumerate}
    \begin{description}
    \myitem[Nested In chess] test text body od description
     \begin{enumerate}
    \item Numbered 1
      \item Numbered two
     \end{enumerate}
     \myitem[More description in Chess] test description body after enumeration
    \end{description}
\end{description}

Next paragraph and test if itemize and enumerate is ok:

\begin{itemize}
\item first
 \item second
\end{itemize}

\begin{enumerate}
\item a
\item b
\end{enumerate}

\end{document}

enter image description here

Edit after accepted of OP and his new request:

Comments about edit: The redefinition of item inside the new list was followed by the new lists that was inside the defined environment. This caused problems in inserting a mew list or something in the environment we defined.

As a solution I redefined \begin command to include a redefinition to \item as was before the change... This way the new environments that need the old item will find it as it was... The nested will "redefine the redefined after the redefinition" ->funny but truth... and it will work. The environments that not using \item, will not have problems (But that is a guess since I can not know the code of every environment and the possible conflicts with my hack)...

Result: Had to do it here, but I can not guarantee the non-danger of such hacks and I can understand anyone who will not accepted as good programming practice... I hope that he understands that this practice solves many problems of non latex experts with as less effort as possible... (Still not recomended to professionals :P )

If a list follows our environment it will redefine the item to it's original and so the newlist we made will not use the redefined command of item and will not break the line. In this case after the following \begin of the list in our description, we can add an empty \myitem[] but we will probably still find problems if the description list has more than one items...(not tested) So the above is simpler and better.

\documentclass{article}

\usepackage{enumitem}

\let\olditem=\item
\def\myitem[#1]{\olditem[#1\vspace{8pt}]}
\let\oldbegin\begin
\def\begin{\let\item\olditem\oldbegin}

\setlist[description]{%
  before=\let\item\myitem,
  labelindent=0em, 
  leftmargin=1.5em, 
  font={\large\bfseries},
  style=nextline,
}



\begin{document}

test

\begin{description}
  \item[Backgammon] One of the oldest known games, Backgammon was played
    by the ancient Mesopotamians.
  \item[Chess]
    \begin{itemize}\myitem[]
      \item First inside
      \item Second inside
    \end{itemize}
    Newer than Backgammon with subtracted the factor of luck (as possible)

    \begin{itemize}
    \item First inside
      \item Second inside
    \end{itemize}
    \begin{enumerate}
    \item Numbered 1
      \item Numbered two
    \end{enumerate}
    \begin{description}
    \item[Nested In chess] test text
     \begin{enumerate}
    \item Numbered 1
      \item Numbered two
    \end{enumerate} 
    \end{description}
\end{description}

Next paragraph and test if itemize and enumerate is ok:

\begin{itemize}
\item first
 \item second
\end{itemize}

\begin{enumerate}
\item a
\item b
\end{enumerate}

\end{document}

Output:

enter image description here

Old Answer:

Here is a solution:

\documentclass{article}

\usepackage{enumitem}

\let\olditem=\item
\def\myitem[#1]{\olditem[#1\vspace{8pt}]}


\setlist[description]{%
  before=\let\item\myitem,
  labelindent=0em, 
  leftmargin=1.5em, 
  font={\large\bfseries},
  style=nextline,
}


\begin{document}

test

\begin{description}
  \item[Backgammon] One of the oldest known games, Backgammon was played
    by the ancient Mesopotamians.
  \item[Chess] Newer than Backgammon with subtracted the factor of luck (as possible)
\end{description}

Next paragraph and test if itemize and enumerate is ok:

\begin{itemize}
\item first
 \item second
\end{itemize}

\begin{enumerate}
\item a
\item b
\end{enumerate}

\end{document}

Output:

enter image description here

| improve this answer | |
  • That's nice. I don't quite understand, though, how the\vspace works where it is located "inside" the \item label argument. It seems like it should be placed "after" the \item command? But it works, so I'm not arguing! – steven_nevets Jan 17 '18 at 3:51
  • @steven_nevets... the \vspace command works after it will find a \par or something that gives the ability of vertical spacing. Try to use it inside the body of a paragraph to see... – koleygr Jan 17 '18 at 4:09
  • So what triggers it here? – steven_nevets Jan 17 '18 at 4:12
  • Check this code : \def\myitem[#1]#2{\olditem[#1]\vspace{8pt}#2} You see clear that the vspace is one with the text following the "item header"... So it will be used after finish with item and will be equivalent to an \itemsep increase. but if you put it like mine is the same as : \def\myitem[#1]#2{\olditem[#1\vspace{8pt}]#2}. This is more close to the real replacement my code does... .. and the nextline option comes after (just after) my vspace... The nextline is triggering my vspace exactly when the "]" been read. – koleygr Jan 17 '18 at 4:21
  • The nextline! Of course! Thanks for the solution and explanation. – steven_nevets Jan 17 '18 at 4:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.