# Producing centered asterisk to indicate new section

In a text (or a passage of a text) that is not subdivided by headings -- say, an essay --, a common tool to indicate the start of a new section is a simple asterisk (or other symbol), usually centered, but not necessarily so.

\documentclass[pagesize,fontsize=12pt,paper=a5,DIV=9]{scrartcl}
\usepackage{blindtext}
\begin{document}
\blindtext\par
\noindent
\makebox[\textwidth][c]{*}\par
\noindent
\blindtext
\end{document}


Something like this is necessary or useful because a mere blank line might not be clear enough, e.g. when the preceding paragraph ends with a line that's almost full, and/or when the start of the new section coincides with the start of a new page.

What I'd like to know is if there's an implementation of something like this somewhere in a *TeX package. Such an implementation would have to deal with a few things that make the whole thing a bit less simple than my example suggests:

• the asterisk must always stick to the last line of the section whose end it marks, i.e. it must not be split off onto a new page

• but: that last line might also be the last line of the page. In a one-sided document, it might be okay to \enlargethispage, if there's no footer that it might clash with. In a two-sided document this might be okay as well, but you might want to take into account readers who are sensitive enough to notice the difference in \textheight on a doube-page spread caused by the asterisk, and finding it awkward. Jan Tschichold, in his »Penguin Rules«, by the way, does not find it awkward.

• even if there's no footer, it might clash with footnotes. Such a clash might be even harder to anticipate.

There's probably some more things that need to be addressed. These are the first that came to my mind, and some of them have kept me from writing a satisfactory implementation of this myself so far -- which is why I'd like to know if someone else has tried it.

## update

As suggested by Ulrike, I tried memoir's \fancybreak. Here's an example that can be compared side-by-side to what Marc and egreg suggested.

\documentclass[11pt,a4paper,twoside=false]{memoir}
\usepackage{typearea}
\usepackage{kantlipsum}
\typearea{10}
%typearea etc. are just to create conditions identical to my scrartcl tests of Marc's egreg's solutions
\begin{document}
\kant[1-4]
\fancybreak{* * *}
\kant[1-4]
\end{document}


\fancybreak doesn't seem to tie the asterisks to the paragraph that they finish off.

• In the memoir class there is a fancybreak command. But I don't think that it addresses all your points. – Ulrike Fischer Mar 6 '13 at 15:36
• What happens when a section ends at the bottom of a page? (Even with \enlargethispage? – Yiannis Lazarides Mar 6 '13 at 15:42
• @UlrikeFischer -- just had a look at the memoir manual. It may not address all potential problems, but looks like something worth tinkering with. – Nils L Mar 6 '13 at 15:46
• @YiannisLazarides -- isn't that my point 2, the last line of the section being the last possible line of a page? – Nils L Mar 6 '13 at 15:47
• @NilsL Just wanted to make sure. I think some manual tinkering here and there will be necessary. – Yiannis Lazarides Mar 6 '13 at 15:51

This is how I'd do it:

\documentclass{article}
\usepackage{kantlipsum}
\newcommand{\finishsection}[1][0]{%
\ifhmode\unskip\fi % to emulate what \par does
\ifnum#1>0 \enlargethispage*{#1\baselineskip}\fi
\par\nopagebreak
\vbox to 3\baselineskip{\centering
\vss
$*$\qquad$*$\qquad$*$\par
\vss
}
}
\begin{document}
\kant[1-3]
\finishsection
\kant[4-5]
\end{document}


If you change -7\baselineskip into -8\baselineskip the asterisks will be moved to the next page. In such a situation you can do

\finishsection[1]


that will execute \enlargethispage*{1\baselineskip}. Maybe an automatic version with needspace is feasible, but in quality book production I'd go for manual check.

• Did a rough comparison between yours and Marc's suggestion. Marc's code seems to allow for the asterisks to be split off from the paragraph, ending up in the 1st line of a new page. Yours seems to tie the asterisk to the last line so tightly that the last line plus the asterisk gets split off -- resulting in a widow on the new page. Unless we're using \finishsection[1], which behaves like Marc's version. The \enlargethispage doesn't seem to do its work -- in my example, which is only slightly modified. It does work in yours. – Nils L Mar 7 '13 at 10:09
• that said, I agree that manual checking is always going to be necessary. But it would be nice to know how reliable an automated solution can get :) – Nils L Mar 7 '13 at 10:11
• Under tough conditions the previous solution could detach the asterisks from the last line, the current code shouldn't. About the automated solution: unless you use a deferred mechanism with \pdfypos, you can reliably query for the remaining space on a page between paragraphs, which might be too late for doing anything. – egreg Mar 7 '13 at 10:37
• just to make sure I'm getting your point (as I'm still in the process of fully understanding TeX's breaking mechanisms): between paragraphs, it is possible to reliably check if there's space left, but it might happen that the very moment we learn that there's no space left, we are already at a point where we can no longer \enlargethispage or append additional material to the paragraph that just ended? – Nils L Mar 7 '13 at 15:33
• @NilsL Exactly; TeX has typeset more than fits a page when it decides to make a page break. – egreg Mar 7 '13 at 15:46

Try this:

\documentclass[pagesize,fontsize=12pt,paper=a5,DIV=9]{scrartcl}
\usepackage{blindtext}
\def\EndSection{\section*{\hfill*\hfill\hfill}}
\begin{document}
\blindtext\par

\EndSection

\blindtext
\end{document}

• This would move the asterisk to the next page even if there's space left at the bottom – egreg Mar 6 '13 at 23:38
• @egreg I am aware and done on purpose. Stars at bottom of page or top of next should be manually adjusted. Had a look at quite a few paperbacks that have this style and none of the sections finish by the end of a page (I am sure writing was adjusted to suit). Newer trends are just to leave about 1-2cm of blank space between sections. – Yiannis Lazarides Mar 7 '13 at 3:03

\begin{center}

• This may insert a page break between the * * * and the \section`. – Werner Nov 29 '16 at 2:32