Use texto como rótulos no ambiente itemize no beamer

Use texto como rótulos no ambiente itemize no beamer

Estou tentando usar texto como rótulos em um ambiente de itemização no beamer.

Eu tenho usado

\documentclass{beamer}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{enumitem}

\setitemize{%
    label=\usebeamerfont*{itemize item}
    \usebeamercolor[fg]{itemize item}
    \usebeamertemplate{itemize item}
}

\begin{document}

\begin{frame}

\begin{itemize}
\item \makebox[2.75cm][l]{$a$} iff $a$,
\item \makebox[2.75cm][l]{$b+c$} iff $a$,
\item \makebox[2.75cm][l]{$d$} iff $a$
\item \makebox[2.75cm][l]{$e+f$} iff $a$ and a lot of text which takes up multiple lines without correct alignment
\end{itemize}

\vfill

\begin{itemize}
\item[$a$] iff $a$,
\item[$b+c$] iff $a$,
\item[$d$] iff $a$
\item[$e+f$] iff $a$
\end{itemize}

\end{frame}

\end{document}

para produzir

insira a descrição da imagem aqui

O problema no primeiro ambiente itemize é que preciso que a segunda linha se alinhe com "iff $a$ e ..." na linha acima.

Tentei obter isso usando rótulos no ambiente itemize em vez de \makebox. Mas se eu fizer isso, ainda não defini a largura dos rótulos e perco os marcadores/setas azuis de itemização.

Responder1

Normalmente, beamernão funciona bem enumitem, há muitos problemas de compatibilidade. Aqui está um hack (não tão limpo) para resolver o seu problema. No entanto, isso quebrará a opção de sobreposição.

\documentclass{beamer}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{enumitem}

\setitemize{%
    label=\usebeamerfont*{itemize item}
    \usebeamercolor[fg]{itemize item}
    \usebeamertemplate{itemize item}
}


\makeatletter
\def\Myitemize#1{%
  \advance\beamer@descdefault by \labelsep%
  \list
  {}
  {\labelwidth\beamer@descdefault%
  \leftmargin\beamer@descdefault%
  \let\makelabel\beamer@descriptionitem
  \settowidth\labelwidth{\beamer@descriptionitem{#1}}%
  \setlength\leftmargin{\labelwidth}% 
  \addtolength\leftmargin{\labelsep}%
  }%
  \beamer@cramped%
  \raggedright
  \beamer@firstlineitemizeunskip%
}
\def\endMyitemize{\ifhmode\unskip\fi\endlist}
\long\def\beamer@descriptionitem#1{%
  \def\insertdescriptionitem{#1}%
  {\usebeamertemplate**{description item}}\hfil}
\makeatother  


\begin{document}

\begin{frame}

\begin{Myitemize}{$\blacktriangleright$ $b+c$} % <= longest label here
\item [$\blacktriangleright$ $a$  ] iff $a$,
\item [$\blacktriangleright$ $b+c$] iff $a$,
\item [$\blacktriangleright$ $d$  ] iff $a$,
\item [$\blacktriangleright$ $e+f$] iff $a$ and a lot of text which takes up multiple lines without correct alignment
\end{Myitemize}

\end{frame}

\end{document}

insira a descrição da imagem aqui

Editar:

Uma abordagem melhor seria esta:

\begin{itemize}
\item \makebox[2cm][l]{$a$}   iff $a$,
\item \makebox[2cm][l]{$b+c$} iff $a$,
\item \makebox[2cm][l]{$d$}   iff $a$,
\item \makebox[2cm][l]{$e+f$} \begin{minipage}[t]{7cm}
iff $a$ and a lot of text which takes up multiple lines without correct alignment, and a lot of text which takes up multiple lines without correct alignment
\end{minipage}
\end{itemize}

insira a descrição da imagem aqui

informação relacionada