I'd go with a key-value syntax:
\documentclass[openany]{book}
\usepackage{titlesec}
\usepackage{xparse}
\titleformat{\section}
{\normalfont\Large\sffamily\printcurrentsurtitle}
{\thesection}
{1em}
{}
\ExplSyntaxOn
\keys_define:nn { crowell/section }
{
surtitle .tl_set:N = \l_crowell_section_surtitle_tl,
toc .tl_set:N = \l_crowell_tocentry_tl,
header .tl_set:N = \l_crowell_header_tl,
}
\NewDocumentCommand{\Section}{sO{}m}
{
\keys_set:nn { crowell/section }
{
surtitle = {},
toc = { #3 },
header = { #3 },
#2
}
\IfBooleanTF{#1}
{\section*{#3}}
{
\section[
\tl_if_empty:NF \l_crowell_section_surtitle_tl
{ \l_crowell_section_surtitle_tl : ~ }
\l_crowell_tocentry_tl
]{#3}
\markright{\l_crowell_header_tl}
}
}
\NewDocumentCommand{\printcurrentsurtitle}{ }
{
\tl_if_empty:NF \l_crowell_section_surtitle_tl
{
\mbox{\normalsize\MakeUppercase{\l_crowell_section_surtitle_tl}}\par
}
}
\ExplSyntaxOff
\begin{document}
\tableofcontents
\chapter{Title}
\Section[surtitle=Science and Society]{The Galileo Affair}
\Section{No surtitle for this one}
\Section*[surtitle=Unnumbered]{Section}
\Section[
surtitle=Science and Society,
header=TGA,
toc=Abbrev
]{The Galileo Affair}
\newpage
\mbox{}
\end{document}
Here is the TOC
Note that the value given for toc=
is what's added next to the surtitle in the TOC; in the header you'll get the section title, or what's specified as value for header=
(in this case page 3 will have “TGA”.
titlesec
may be able to do this, but with complicated layouts I generally just start a document class from scratch. Then again, I have a tendency to re-invent the wheel.\part
?