LyXEdit headers in memoir class

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
oldmankit
Posts: 9
Joined: Sun Feb 21, 2010 3:32 pm

Edit headers in memoir class

Post by oldmankit »

I'm using memoir class and trying to edit the headers and footers. I want to do two things. I can live without 2), as I can do it manually. However, 1) is necessary.

1) I'm happy with 'ruled' except I want \leftmark to be 'part' and \rightmark to be 'chapter'. First I tried using 'myheadings' in document>>settings>>page layout>>headings style. I then copied and pasted the latex code for 'ruled' from the memoir manual but changed chapter to part, and section to chapter.

Code: Select all

\makepsmarks{myheadings}{%
\nouppercaseheads
\createmark{part}{left}{shownumber}{}{. \space}
\createmark{chapter}{right}{nonumber}{}{}
\createplainmark{toc}{both}{\contentsname}
\createplainmark{lof}{both}{\listfigurename}
\createplainmark{lot}{both}{\listtablename}
\createplainmark{bib}{both}{\bibname}
\createplainmark{index}{both}{\indexname}
\createplainmark{glossary}{both}{\glossaryname}
}

\makepagestyle{myheadings}
\makeevenfoot{myheadings}{\thepage}{}{<draft>} % page numbers at the outside
\makeoddfoot{myheadings}{}{}{\thepage}
\makeheadrule{myheadings}{\textwidth}{\normalrulethickness}
\makeevenhead{myheadings}{\scshape\leftmark}{}{} % small caps
\makeoddhead{myheadings}{}{}{\rightmark}
Everything works except it is not getting the leftmark or rightmark in. I can't understand why not. When I tried using the 'ruled' style instead of 'myheadings', it simply did not take any notice of my changes to leftmark or rightmark. It called the old one (chapter+section).

2) I want to use 'empty' pagestyle for any pages with floats on. There is a way to do this in memoir, see page 128 of the manual. I thought the best way to do this would be to stick with 'myheadings' as the pagestyle, and then use a modified 'ruled' for pages without floats, and 'empty' for pages with floats.

Code: Select all

\mergepagefloatstyle{myheadings}{ruled}{empty}
It didn't work though. It doesn't detect any floats at all, so the whole document uses 'ruled'.

I have attached my test .lyx file, if that is any help.

As an aside, how do I redefine \bigskip? I want to make it bigger.

I really appreciate any help.
Attachments
tests.lyx.txt
(3.8 KiB) Downloaded 357 times
Last edited by oldmankit on Sat Dec 04, 2010 3:05 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Edit headers in memoir class

Post by meho_r »

1. Try reversing the order of \makepagestyle and \makepsmarks. Here's your code reordered (I'm using the code from your .lyx file):

Code: Select all

\makepagestyle{ruled}
\makeevenfoot{ruled}{\thepage}{}{<draft>} % page numbers at the outside
\makeoddfoot{ruled}{}{}{\thepage}
\makeheadrule{ruled}{\textwidth}{\normalrulethickness}
\makeevenhead{ruled}{\scshape\leftmark}{}{} % small caps
\makeoddhead{ruled}{}{}{\rightmark}

\makepsmarks{ruled}{%
\nouppercaseheads
\createmark{part}{left}{shownumber}{}{. \space}
\createmark{chapter}{right}{nonumber}{}{}
\createplainmark{toc}{both}{\contentsname}
\createplainmark{lof}{both}{\listfigurename}
\createplainmark{lot}{both}{\listtablename}
\createplainmark{bib}{both}{\bibname}
\createplainmark{index}{both}{\indexname}
\createplainmark{glossary}{both}{\glossaryname}
}

\mergepagefloatstyle{ruled}{ruled}{empty}

\pagestyle{ruled}
2. Page style for floats does work, but notice that it works only for "float pages", i.e., pages containing floats only. So, if you remove "And now for a float!" sentence placed just before the figure, you'll get an empty page style for the page the figure is on.

3. Don't forget to activate ruled page style after (re)definition:

Code: Select all

\pagestyle{ruled}
Attachments
tests.lyx.zip
(1.09 KiB) Downloaded 222 times
oldmankit
Posts: 9
Joined: Sun Feb 21, 2010 3:32 pm

Re: Edit headers in memoir class

Post by oldmankit »

Thank you so much, it's now working fine.
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Edit headers in memoir class

Post by localghost »

Now that the problem is solved, please be so kind and mark the topic (not the last post) accordingly as clearly written in the Board Rules (to be read before posting). Please keep that in mind for the future so that further reminder will not be necessary.


Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Post Reply