1

If I have \documentclass[twoside]{report} and I change it to \documentclass[oneside]{report}, \usepackage{fancyhdr} automatically prints the left page header and footer. Is there a way to tell fancyhdr/LaTeX to apply the rightside header/footer if oneside is used?

... maybe with an if ... else statement?

I tried \@ifclasswith{report}{oneside}{True}{False} which yields You can't use \spacefactor in vertical mode. \@.

Stücke
  • 305
  • 1
    This looks like a failure to wrap \makeatletter ... \makeatother around the if statement. Does doing that at least get rid of that particular error? (There;s not enough information to say whether there isn't some other problem.) – barbara beeton Dec 30 '22 at 17:31

1 Answers1

0

I figured it out with help of this answer.

Add to the preabmle:

% Check if oneside or twoside
\makeatletter
\@ifclasswith{report}{oneside}{
TRUE
}{
FALSE
}
\makeatother

... e.g.

% Check if oneside or twoside
\makeatletter
\@ifclasswith{report}{oneside}{
\newcommand{\ThesisTitle}{Thesis title text to insert ONESIDE}
}{
\newcommand{\ThesisTitle}{Thesis title text to insert TWOSIDE}
}
\makeatother

Stücke
  • 305