2

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:

enter image description here

Output PDF I want:

enter image description here

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}
1
\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}

enter image description here

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.