#StackBounty: #sectioning #header-footer #two-column #titlesec #titleps Headers using titleps (and titlesec) don't work with custom…

Bounty: 50

I am introducing a new (custom) sectioning command (called subchapter) using the titlesec package. I am also using titleps (or more accurately the pagestyles option for titlesec) to put the title of a subchapter in the header. This works fine, except when I also put my document in twocolumn mode.

Interestingly, the introduction of a section seems to fix the issue, at least in my minimal working example. Here is the MWE:

documentclass[twocolumn]{report}  % Headers work fine if twocolumn mode is removed
usepackage[pagestyles]{titlesec}
usepackage{lipsum}

titleclass{subchapter}{top}[chapter]
newcounter{subchapter}
titleformat{subchapter}{largebfseries}{}{0pt}{}
titlespacing*{subchapter}{0pt}{0pt}{0pt}
settitlemarks{chapter,subchapter,section}
newpagestyle{main}{
  sethead{chaptertitle}{}{subchaptertitle}
  setfoot{}{thepage}{}}
pagestyle{main}

begin{document}
chapter{ABC}
lipsum[1]

subchapter{DEF}
lipsum[1]

%section{GHI} % Headers seem to work ok if this line is reinstated

lipsum[2-8]
end{document}

I guess the issue is then with twocolumn as an option and it may be an already known issue, but I couldn’t work out how to fix it.


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.