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. \@.

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.