Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I frequently write slides in beamer, and besides a few macros I use (e.g. for two-column frame), I often type \begin{itemize} and \end{itemize}. What would be a nice TeXish way for either starting the itemization automatically when \item outside of itemization/enumeration is encountered?

Or alternately, how to write a macro which would do something like (pseudocode, this does not work unfortunately as it is):

\documentclass{beamer}
\usepackage{etextools}
\def\firstitem{\begin{itemize}\AfterGroup{\end{itemize}}\item}
\begin{document}
    \begin{frame}{title}
        \firstitem a
        \item b
    \end{frame}
\end{document}
share|improve this question
1  
But how would you know when the itemize is complete? By giving an unbalanced \end without the corresponding \begin? Ugh. –  Steven B. Segletes Feb 18 at 11:24
1  
As Steven says, you have to tell LaTeX when the itemize ends; so why obfuscating your input? –  egreg Feb 18 at 11:34
2  
If you tire of typing in the \begin{itemize}, you could always create a shortcut macro: \def\BI{\begin{itemize}} \def\EI{\end{itemize}} so that the invocation would be \BI \item first \item second \EI –  Steven B. Segletes Feb 18 at 12:03
    
@StevenB.Segletes: at the end of the enclosing group (column, block, frame) -- that's why I thought of using \AfterGroup. –  eudoxos Feb 18 at 12:56
    
Would that work if you wanted to continue with non-itemized content within the same frame? –  Steven B. Segletes Feb 18 at 13:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.