Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-hacky way to configure topsep and itemsep #855

Open
tobiasBora opened this issue Jun 18, 2023 · 0 comments
Open

Non-hacky way to configure topsep and itemsep #855

tobiasBora opened this issue Jun 18, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@tobiasBora
Copy link

tobiasBora commented Jun 18, 2023

Unless I missed something, it is surprisingly difficult to configure in beamer the spacing in lists, as it is incompatible with the great enumitem package. Notably, to just remove the vertical space between the text and the list (usually called topsep), you need a crazy hack that basically redefines itemize https://tex.stackexchange.com/questions/115907/how-do-i-remove-white-space-above-itemize-command-in-beamer-using-enumitem Similarly, other hacks are needed to configure the \itemsep globally https://tex.stackexchange.com/questions/225736/latex-beamer-define-itemsep-globally

It would be great to propose a simple solution to these issues, to allow both local and global configuration of these parameters.

image

MWE

\documentclass{beamer}
\setbeamertemplate{itemize/enumerate body begin}{%
  \setlength{\leftmargini}{0em}% Adjusts the left horizontal margin between margin and text
  \setlength{\labelsep}{0mm}% Adjusts the space between bullet and text
}
\setbeamertemplate{itemize/enumerate subbody begin}{\setlength{\leftmarginii}{4cm}\setlength{\labelsep}{10mm}} % Adjust the left margin for nested lists
\setbeamertemplate{itemize/enumerate subsubbody begin}{\setlength{\leftmarginiii}{2em}} % Adjust the left margin for further nested lists
\setbeamertemplate{itemize item}[triangle] % Use a triangle bullet

\setbeamertemplate{itemize body item}{\setlength{\itemsep}{10cm}} % Adjust the space for nested lists


\begin{document}

\begin{frame}
  See that topsep does not work:
  \topsep100pt % does not work
  \setlength{\parsep}{0mm} %
  \begin{itemize}
    \setlength{\itemsep}{0mm} % important to be inside the itemize. to set it globally, see https://tex.stackexchange.com/questions/225736/latex-beamer-define-itemsep-globally
  \item We want no space between here and the next item
  \item Let us put instead lots of space for subitems
    \begin{itemize}
      \setlength{\itemsep}{10mm} % important to be inside the itemize. to set it globally, see https://tex.stackexchange.com/questions/225736/latex-beamer-define-itemsep-globally
    \item a
    \item b
    \end{itemize}
    \item Second item
  \end{itemize}
\end{frame}


\end{document}
@samcarter samcarter added the enhancement New feature or request label Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants