I'm using memoir for an onesided document, but I wanted to have both the chapter and section numbers and names in the header.
I'm using this to achieve it (from Including both chapter name and name of section in header using memoir)
\pagestyle{ruled}
\makeoddhead{ruled}{\sffamily\leftmark}{}{\sffamily\rightmark}
This works great most of the time, however for the ToC and bibliography, both of which are two pages long, I have the same label twice in the header, which looks terrible.
I would like to only show the \rightmark if it's different from the \leftmark. Or somehow change the labeling of those two things. For example it works OK in introduction, which is an \unnumberedchapter and has no \section. I've tried changing \bibsection to \unnumberedchapter but that didn't help.
Thanks.


\expandafterhas always been a sticking point for me, too. I'll certainly go for this method in the future. – Mike Renfro May 11 '14 at 13:02