# Alternating/looping section dividers

I would like to create a section dividers that alternate/loop around several possibilities.

Code I have now:

\documentclass{article}

\usepackage{halloweenmath}
\def\SectionDivider{$$\mathwitch \mathwitch \mathwitch$$}

\begin{document}

1
\SectionDivider
2
\SectionDivider
3
\SectionDivider
4
\SectionDivider
5
\SectionDivider
6
\SectionDivider
7

\end{document}


Output PDF I have now:

Output PDF I want:

The above desired PDF was accomplished with the following code, but I want \SectionDivider to do this automatically for me, looping through (i) witches; (ii) pumpkins; and (iii) ghosts.

\documentclass{article}

\usepackage{halloweenmath}
\def\SectionDivider{$$\mathwitch \mathwitch \mathwitch$$}

\begin{document}

1
\SectionDivider
2
$$\pumpkin \pumpkin \pumpkin$$
3
$$\mathrightghost \mathrightghost \mathrightghost$$
4
\SectionDivider
5
$$\pumpkin \pumpkin \pumpkin$$
6
$$\mathrightghost \mathrightghost \mathrightghost$$
7

\end{document}

• – Werner Mar 29 '18 at 3:31

\documentclass{article}
\newcounter{SecDiv}\setcounter{SecDiv}{-1}
\usepackage{halloweenmath}
\newcommand{\SectionDivider}{\stepcounter{SecDiv}
\ifnum\theSecDiv=3
\setcounter{SecDiv}{0}
\fi
\typeout{\theSecDiv}
\ifcase\theSecDiv
$$\mathwitch \mathwitch \mathwitch$$
\or
$$\pumpkin \pumpkin \pumpkin$$
\or
$$\mathrightghost \mathrightghost \mathrightghost$$
\fi
}

\begin{document}

1
\SectionDivider
2
\SectionDivider
3
\SectionDivider
4
\SectionDivider
5
\SectionDivider
6
\SectionDivider
7

\end{document}