1

I want to create a custom description environment in beamer, but when enumerate the only the label with description, the entry of the next itemize environment is directly to the side of the original label. I want it to be below it instead

enter image description here

\documentclass[aspectratio=169, xcolor={x11names},t]{beamer}

\usetheme{Dresden}

\defbeamertemplate{description item}{descriptionbasmah}{\hspace{0mm}\insertdescriptionitem\strut}
\makeatletter
\newenvironment{descriptionbasmah}{%
    \par%
    \begin{minipage}{\linewidth}%
        \vspace{0.47em}%
        \begin{description}%
            \setbeamerfont{description item}{shape=\itshape\fontencoding{T1}\selectfont, series=\mdseries, family*=ptm}
            \setbeamercolor{description item}{fg=DarkOrange1}%
            \setbeamertemplate{description item}[descriptionbasmah]%
        }{%
        \end{description}%
    \end{minipage}%
    \vspace{0.1961em}%
}
\makeatother

\makeatletter
    \newcommand{\setHangDescription}{\beamer@descriptionwidth=\dimexpr -\labelsep \relax}
\makeatother

\setHangDescription

\usepackage{blindtext}

\begin{document}

\begin{frame}
    
    \begin{descriptionbasmah}
        
        \item[HabibiAllahYehfadoh] BasmahWantsMeHappy

        \begin{itemize}
            
            \item 
            
        \end{itemize}
        
        \item[HabibiAllahYehfadoh] 
        
        \begin{itemize}
            
            \item 
            
        \end{itemize}
        
    \end{descriptionbasmah}
    
\end{frame}

\end{document}
1

1 Answer 1

1

You can make sure that the subitem start in a new line by not leaving the parent item empty, e.g. by inserting a space:

\documentclass[aspectratio=169, xcolor={x11names},t]{beamer}

\usetheme{Dresden}

\defbeamertemplate{description item}{descriptionbasmah}{\hspace{0mm}\insertdescriptionitem\strut}
\makeatletter
\newenvironment{descriptionbasmah}{%
    \par%
    \begin{minipage}{\linewidth}%
        \vspace{0.47em}%
        \begin{description}%
            \setbeamerfont{description item}{shape=\itshape\fontencoding{T1}\selectfont, series=\mdseries, family*=ptm}
            \setbeamercolor{description item}{fg=DarkOrange1}%
            \setbeamertemplate{description item}[descriptionbasmah]%
        }{%
        \end{description}%
    \end{minipage}%
    \vspace{0.1961em}%
}
\makeatother

\makeatletter
    \newcommand{\setHangDescription}{\beamer@descriptionwidth=\dimexpr -\labelsep \relax}
\makeatother

\setHangDescription

\usepackage{blindtext}

\begin{document}

\begin{frame}
    
    \begin{descriptionbasmah}
        
        \item[HabibiAllahYehfadoh] BasmahWantsMeHappy

        \begin{itemize}
            
            \item 
            
        \end{itemize}
        
        \item[HabibiAllahYehfadoh] ~
        
        \begin{itemize}
            
            \item 
            
        \end{itemize}
        
    \end{descriptionbasmah}
    
\end{frame}

\end{document}

enter image description here

You must log in to answer this question.

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