diff --git a/README.md b/README.md index 1446003f92d22cd099bbbd658aaa07f91605a646..d8ab3ec4cf43bc29751736bc1d642d06e469fc5c 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Here `<options>` is a comma-separated list of the following keywords: | `fourier` | This provides much improved typography by activating the fourier font package (based on [Adobe’s Utopia](https://fonts.adobe.com/fonts/utopia) family) along with the [cmap](https://www.ctan.org/pkg/cmap) and [microtype](https://www.ctan.org/pkg/microtype) packages; all those are required for this option. | | `hyperref` | If the [hyperref](https://www.ctan.org/pkg/hyperref) and [xcolor](https://www.ctan.org/pkg/xcolor) packages are installed, this creates PDF output with clickable and all-black links. The packages are set up with sane default options, but to modify the behaviour, simply use the `\hypersetup` command; see the `hyperref` documentation for details. | | `colour` | If the `hyperref` option is used, this sets clickable links to have a sane default colour (sepia for internal links, blue for external URLs). | -| `fancyhdr` | If the [fancyhdr](https://www.ctan.org/pkg/fancyhdr) package is installed, this creates nice page headers and footers (with sane default settings); to modify this behaviour, simply use the commands described in the `fancyhdr` documentation. This may produce warnings if used without `twoside` in the `documentclass`. +| `fancyhdr` | If the [fancyhdr](https://www.ctan.org/pkg/fancyhdr) package is installed, this creates nice page headers and footers (with sane default settings); to modify this behaviour, simply use the commands described in the `fancyhdr` documentation. ### Usage diff --git a/edmaths.sty b/edmaths.sty index 9880be24fe02c9cf7043617cadff234eb57616d6..4685de0443bdcc43870ffb891483e948e3e0abba 100644 --- a/edmaths.sty +++ b/edmaths.sty @@ -107,13 +107,21 @@ \RequirePackage{fancyhdr} \pagestyle{fancy} \fancyhf{} - % NOTE if this is used without `twoside` in \documentclass{...} then fancyhdr will - % complain that the 'E' used here is useless. - \fancyhead[RO,LE]{\thepage} - \fancyfoot[RO,LE]{\thepage} - \fancyhead[LO]{\it\@title} - \fancyhead[RE]{\@author} - \fancyfoot[RE,LO]{} + % if \fancyhead or \fancyfoot are used without `twoside` in \documentclass{...} then + % fancyhdr will complain that the 'E' used here is useless, so need to condition. + \if@twoside% + %%% put the stuff for true here (twoside=true) + \fancyhead[RO,LE]{\thepage} + \fancyfoot[RO,LE]{\thepage} + \fancyhead[LO]{\it\@title} + \fancyhead[RE]{\@author} + \fancyfoot[RE,LO]{} + \else% + %%% put the stuff for false here (twoside=false) + \fancyhead[LO]{\it\@title~~$\cdot$~~\@author} + \fancyhead[R]{\thepage} + \fancyfoot[R,LO]{} + \fi% } {}