A fancy and beautiful type of enumerate
Here is a very naive and brute force proposal.
\documentclass{article}
\usepackage{tikz}
\newcommand{\SebastianoItem}[1]{\tikz[baseline=(SebastianoItem.base),remember
picture]{%
\node[fill=red!20,inner sep=4pt,font=\sffamily] (SebastianoItem){#1};}}
\newcommand{\SebastianoHighlight}{\tikz[overlay,remember picture]{%
\fill[red!20] ([yshift=4pt,xshift=-\pgflinewidth]SebastianoItem.east) -- ++(4pt,-4pt)
-- ++(-4pt,-4pt) -- cycle;
}}
\begin{document}
\renewcommand{\labelenumi}{\SebastianoItem{\arabic{enumi}}}
Some basic rules.
\begin{enumerate}
\item Never put pineapple on a pizza!
\item Never!!!! \SebastianoHighlight
\item Trust me!
\end{enumerate}
\end{document}
ADDENDUM: Brackets and colors. (Of course, if you have longer lists, you need to either extend the color list, or implement some mod condition.)
\documentclass{article}
\usepackage[x11names]{xcolor}
\usepackage{tikz}
% from https://tex.stackexchange.com/a/167024/121799
\newcommand{\ClaudioList}{red,DarkOrange1,Goldenrod1,Green3,blue!50!cyan,DarkOrchid2}
\newcommand{\SebastianoItem}[1]{\foreach \X[count=\Y] in \ClaudioList
{\ifnum\Y=#1\relax
\xdef\SebastianoColor{\X}
\fi
}
\tikz[baseline=(SebastianoItem.base),remember
picture]{%
\node[fill=\SebastianoColor,inner sep=4pt,font=\sffamily,fill opacity=0.5] (SebastianoItem){#1)};}
}
\newcommand{\SebastianoHighlight}{\tikz[overlay,remember picture]{%
\fill[\SebastianoColor,fill opacity=0.5] ([yshift=4pt,xshift=-\pgflinewidth]SebastianoItem.east) -- ++(4pt,-4pt)
-- ++(-4pt,-4pt) -- cycle;
}}
\begin{document}
\renewcommand{\labelenumi}{\SebastianoItem{\arabic{enumi}}}
Some general advices.
\begin{enumerate}
\item No fast food.
\item Don't drink to much alcohol.
\item No pineapple on pizza. \SebastianoHighlight
\item Don't use onions in food.
\end{enumerate}
\end{document}
Without tikz
.
Here I introduce the bangenumerate
environment, in which emphasized items are invoked with \item!
instead of \item
. The optional argument of \item
is still supported.
(Note: the syntax \item[]!
has no meaning, as the !
directive is overridden with the optional label. )
Color can be changed mid stream with an invocation of \colorlet{bangcolor}{...}
between \item
s.
EDITED to \smash
the label, so that larger values of \fboxsep
can be employed without affecting line spacing.
\documentclass{article}
\usepackage{xcolor,enumitem,amssymb}
\let\svitem\item
\let\thebang\relax
\colorlet{bangcolor}{red!50}
\newenvironment{bangenumerate}
{%
\fboxsep=3pt\relax%
\renewcommand\item[2][\relax]{%
\ifx!##2%
\def\thebang{\makebox[0pt][l]{\kern-1pt\textcolor{bangcolor}{%
\raisebox{1pt}{$\scriptstyle\blacktriangleright$}}}}%
\def\next{}%
\else%
\def\thebang{}%
\def\next{##2}%
\fi%
\ifx\relax##1\relax\svitem\else\svitem[##1]\fi\next%
}%
\begin{enumerate}[label={%
\smash{\colorbox{bangcolor}{\bfseries\sffamily\theenumi)}\thebang}}]%
}{\end{enumerate}}
\begin{document}
\begin{bangenumerate}
\item My macro for personalized \textbf{enumerate}. 1) or 2) or 3) \ldots has been adding without
\item automatic enumeration.
\item! This is that I have tried, quickly, only this morning.
\item[OTHER] It is very nice but not as the figure with the little arrow (for important enumerate).
\item Should be normal without a bang
\colorlet{bangcolor}{blue!30}
\item! Color change with bang
\end{bangenumerate}
\end{document}