On 11/30/24 06:41, fcana...@gmail.com wrote:
Greetings, I am trying to produce the following header structure: 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. 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)
Hi,There is a workaround, although it is a mild PITA. Go to Document > Settings > Page Layout and set "Page style" to "Default". Next, go to Document > Settings > Local Layout and add "Provides fancyhdr 1" (without the quotation marks). Then drop down to LaTeX Preamble and add "\usepackage{fancyhdr}" and "\pagestyle{fancy}".
An MWE is attached. Paul
newfile1.lyx
Description: application/lyx
-- lyx-devel mailing list lyx-devel@lists.lyx.org https://lists.lyx.org/mailman/listinfo/lyx-devel