I have a an itemize
environment in LaTeX. How can I represent a tick and a cross symbol instead of a dot?
[Tex/LaTex] How to represent cross and tick in itemize bullets
itemizesymbols
Related Solutions
For the first, beamer uses templates (itemize item
, itemize subitem
, itemize subsubitem
) to typeset the item symbol. See the section "Itemizations, Enumerations, and Descriptions" (11.1 in my version) in the beamer manual. If you read the source files beamerinnerthemedefault.sty
and beamerbaseauxtemplates.sty
you can see the syntax for declaring other choices for this template. So to define ticks (by which I understand checkmarks) and cross item icons you can do something like this:
\usepackage{pifont}
\defbeamertemplate{itemize item}{cross}{\scriptsize\raise1.25pt\hbox{\donotcoloroutermaths\ding{54}}}
\defbeamertemplate{itemize subitem}{cross}{\tiny\raise1.25pt\hbox{\donotcoloroutermaths\ding{54}}}
\defbeamertemplate{itemize subsubitem}{cross}{\tiny\raise1.25pt\hbox{\donotcoloroutermaths\ding{54}}}
\defbeamertemplate{itemize item}{tick}{\scriptsize\raise1.25pt\hbox{\donotcoloroutermaths\ding{52}}}
\defbeamertemplate{itemize subitem}{tick}{\tiny\raise1.25pt\hbox{\donotcoloroutermaths\ding{52}}}
\defbeamertemplate{itemize subsubitem}{tick}{\tiny\raise1.25pt\hbox{\donotcoloroutermaths\ding{52}}}
Then if you wanted to make those icons the default you would just do:
\setbeamertemplate{itemize item}[cross] % and so on.
But to use your custom icons to highlight the current item you can do this:
\documentclass{beamer}
\useinnertheme{rectangles}% or whatever inner theme you want
% template defs from above
\makeatletter
\newenvironment{crossenv}{%
\only{%
\beamer@computepref\@itemdepth% sets \beameritemnestingprefix
\setbeamertemplate{itemize \beameritemnestingprefix item}[cross]
}% overlay/action specification gets added here by beamer
}{%
}
\newenvironment{tickenv}{%
\only{%
\beamer@computepref\@itemdepth% sets \beameritemnestingprefix
\setbeamertemplate{itemize \beameritemnestingprefix item}[tick]
}% overlay/action specification gets added here by beamer
}{%
}
\makeatother
\begin{document}
\begin{frame}{Single list}
\begin{itemize}
\item<1- | tick@+-> foo
\item<1- | cross@+-> bar
\item<1- | tick@+-> foo, again
\end{itemize}
\end{frame}
\begin{frame}{Nested lists}
\begin{itemize}[<1-| cross@+>]
\item foo
\item bar
\begin{itemize}
\item bar one
\item bar none
\begin{itemize}
\item bar who?
\item bar none
\end{itemize}
\end{itemize}
\item baz
\end{itemize}
\end{frame}
\end{document}
Because the crossenv enviroment surrounds each selected item, the change in template is local. After the crossenv environment the template returns to whatever it was before. This means you don't need to know what the symbol is by default. So this will work with any inner theme you are using.
Final Edits: I think I finally got what you wanted. You have to only change the template at the current itemize level, which requires a bit of h@ckery. But diving into beamerbaselocalstructure.sty
revealed a solution.
Final Final Edits: Now with ticks and crosses both.
This should do what you need:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts}
\usepackage{newunicodechar}
\newunicodechar{✓}{\checkmark}
\newunicodechar{✠}{\maltese}
\begin{document}
\Large ✓ \quad ✠
\end{document}
Here's the result
Best Answer
With the
enumitem
package you can uselabel={}
to specify it on a per instance basis, or use\setlist[itemize,<n>]{label=<symbol>}
to set it based on the nesting level, where:<symbol>
is to be used at the given nesting level<n>
:Here I have used the
\checkmark
from theamsfonts
package, but you can use any symbol you like.References:
Code:
Without the
enumitem
package you could use\renewcommand{\labelitem<n>}{<symbol>}
to redefine the marker, where<n>
is a roman numeral (i
,ii
,iii
, oriv
) representing the nesting depth ofitemize
. The following yields a similar result to above: