Graphics – Stacking Asterisks to Form Chapter Dividers with Stackengine for Elegant Layouts

definitiongraphicsstackstackenginestacking-symbols

This question is an extension of the earlier post Best Way to Produce This Chapter Divider Image

Consider the code:

\documentclass{book}
\usepackage{stackengine}
\usepackage{graphicx}
\def\asterisks{\par\vspace{1.6em}{\centering\scalebox{1.5}{%
  \stackon[-0.15pt]{\bfseries*~*~*}{\bfseries*}}\par}\vspace{.5em}\par}
  
\begin{document} \vspace*{35pt}
\thispagestyle{empty}
\LARGE

\asterisks
\end{document}

which produces the stack:

enter image description here

Now, suppose that I would like to add a single asterisk directly underneath the row containing three asterisks.

According to the documentation for stackon and stackunder,

enter image description here

And so, I figured that I could treat the asterisk that I want to add as the anchor, upon which the other two rows of asterisks would rest atop, as such:

\def\asterisks{\par\vspace{1.6em}{\centering\scalebox{1.5}{%
  \stackon[-0.15pt]{\bfseries*}{\bfseries*~*~*}{\bfseries*}}\par}\vspace{.5em}\par}

but alas,

when I run this, I get

enter image description here

My interpretation of the documentation is obviously incorrect.

QUESTION: Could someone point out the error of my reasoning and indicate how I may produce (i) a three-tiered asterisk stack with the top row containing one asterisk, the row beneath it—three asterisks, and the row beneath it—one asterisk; and, (2) From there, how I may add another tier on the bottom containing a single asterisk, thereby producing a four-tiered image of a cross. (From there, I probably will be able to generalize the process.)

Thank you.

Best Answer

There are various syntaxes that can be employed. Here, I focus on the stacks themselves, omitting code dealing with above/below space and centering.

In the first incarnation, I use a \Shortstack, in which successive rows (in this case 3) are specified. In the second example, I use a \stackunder{\stackon{base}{top}}{bottom} approach.

\documentclass{book}
\usepackage{stackengine}
\usepackage{graphicx}
\begin{document} \vspace*{35pt}
\thispagestyle{empty}
\LARGE

{\bfseries\setstackgap{S}{.15pt}\scalebox{1.5}{\Shortstack{* {* * *} *}}

\vspace{1in}
{\bfseries\scalebox{1.5}{\stackunder[.15pt]{\stackon[.15pt]{* * *}{*}}{*}}}
\end{document}

enter image description here

For the 4-row version, something like the \Shortstack approach most likely works best:

\documentclass{book}
\usepackage{stackengine}
\usepackage{graphicx}
\begin{document} \vspace*{35pt}
\thispagestyle{empty}
\LARGE

{\bfseries\setstackgap{S}{.15pt}\scalebox{1.5}{\Shortstack{* {* * *} * *}}
\end{document}

enter image description here

Related Question