From 561aa8bb32180b6af9f1679bbb53890c898de68d Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Fri, 1 Nov 2024 14:49:29 +0100 Subject: [PATCH] Fix loading order of fancyhdr (#13118) This must be loaded after geometry (amends ca4fc01847c721) --- src/BufferParams.cpp | 6 ------ src/LaTeXFeatures.cpp | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 88b7242492..8ae748d46b 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -2176,12 +2176,6 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features, features.require("papersize"); } - if (tokenPos(tclass.opt_pagestyle(), '|', pagestyle) >= 0) { - if (pagestyle == "fancy") - os << "\\usepackage{fancyhdr}\n"; - os << "\\pagestyle{" << from_ascii(pagestyle) << "}\n"; - } - // only output when the background color is not default if (isbackgroundcolor) { // only require color here, the background color will be defined diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index dc939f0921..2b33fa70be 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -1381,6 +1381,12 @@ string const LaTeXFeatures::getPackages() const if (!params_.set_geometry.empty()) packages << params_.set_geometry; + if (tokenPos(params_.documentClass().opt_pagestyle(), '|', params_.pagestyle) >= 0) { + if (params_.pagestyle == "fancy") + packages << "\\usepackage{fancyhdr}\n"; + packages << "\\pagestyle{" << params_.pagestyle << "}\n"; + } + // These must be loaded after graphicx, since they try // to load graphicx without options if (mustProvide("rotating"))