0

I've been using Beamer for years. On almost every slide I have a \begin{itemize} and an \end{itemize} and all the \item Blah points in between. If there is nesting I need to carefully utilise the same constructs again:

\begin{itemize}
\item One
  \begin{itemize}
  \item One and a Half
  \end{itemize}
\item Two
\end{itemize}

It occurs to me I could instead use a simpler command which might just insert a bullet point with an optional preceding indent. The output of the code above could be obtained using something like:

\i0 One
\i1 One and a Half
\i0 Two

I imagine I might easily create such a simple command, perhaps using \bullet, but I would rather start by asking: is there something like this already; and has anyone has used this idiom for long enough to comment on its pros and cons.

  • If this were not beamer, you could use the outline package. – John Kormylo Dec 5 '19 at 0:23
1

You can use the \usebeamertemplate{} macro. In your case:

\usebeamertemplate{itemize item}
\usebeamertemplate{itemize subitem}
\usebeamertemplate{itemize subsubitem}

If you also wish to use their pre-defined colors, you can write

{\usebeamercolor[fg]{itemize item}\usebeamertemplate{itemize item}}

and similarly for subitem and subsubitem. Note the enclosing braces to make the color definition local.

\documentclass{beamer}

\newcommand{\Item}{\par\leavevmode
  \hbox to\labelwidth{\hss\usebeamercolor[fg]{itemize item}\usebeamertemplate{itemize item}}\hspace{\labelsep}}
\newcommand{\Subitem}{\par\leavevmode\hskip\leftmarginii
  \hbox to\labelwidth{\hss\usebeamercolor[fg]{itemize subitem}\usebeamertemplate{itemize subitem}}\hspace{\labelsep}}
\newcommand{\Subsubitem}{\par\leavevmode\hskip\leftmargini\hskip\leftmarginii
  \hbox to\labelwidth{\hss\usebeamercolor[fg]{itemize subsubitem}\usebeamertemplate{itemize subsubitem}}\hspace{\labelsep}}

\begin{document}

\begin{frame}
  \Item One
  \Item Two
\end{frame}

\end{document}

enter image description here

| improve this answer | |
  • How should I use that? When I insert those 3 lines, either within the preamble, or between the begin/end of a frame, I get the error: You can't use `\raise' in internal vertical mode. – user4417 Dec 6 '19 at 14:09
  • You should add \leavevmode in a macro – user94293 Dec 6 '19 at 18:29
  • I sense this is needing more knowledge of latex than I have. The example you provide has a smaller indentation than we would get with \begin{itemize} etc., and so too there is a slightly larger line separation. I didn't know \usebeamercolor, so maybe there is a way to get such sizes. But I when I defined \ItemS, replacing itemize item with itemize subitem in both places, I found that this produced no indentation relative to the \Item. – user4417 Dec 16 '19 at 23:42
  • 1
    Edited. But I won't recommend to use it. It is better to use \begin{itemize}...\end{itemize} – user94293 Dec 17 '19 at 11:59

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.