LyX reverses the order of geometry and fancyhdr packages

fcanatay at gmail.com fcanatay at gmail.com
Sat Nov 30 11:41:00 UTC 2024


Greetings,

I am trying to produce the following header structure:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-1.png
Type: image/png
Size: 25904 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20241130/41a34c21/attachment-0002.png>
-------------- next part --------------



This is easy to do in LaTeX:

\documentclass{article}
\usepackage{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}

\begin{document}

\lhead{left}
\chead{center}
\rhead{right}

Some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some

\end{document}


When I try to type the same document in LyX, however, the output comes out incorrect.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-2.png
Type: image/png
Size: 31369 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20241130/41a34c21/attachment-0003.png>
-------------- next part --------------




Notice how the header dimensions are different than the text dimensions. The reason appears to be that LyX insists on loading the geometry package, which changes the default margins, after fancyhdr. The same thing happens when I import the above tex file into LyX---the order of the packages is reversed and geometry is loaded last, resulting in the incorrect output as in the second picture.

Is there a way to make LyX respect the correct order of loading packages or some workaround to produce the correct output as in the first picture?

Best,

Fatihcan Atay (using LyX 2.4.2.1 on Mac silicon)





 




More information about the lyx-devel mailing list