Page Layoutmemoir | Creating Marks for Headers

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
ccordenier
Posts: 6
Joined: Mon Feb 22, 2010 10:03 pm

memoir | Creating Marks for Headers

Post by ccordenier »

I'm designing an academic journal based on the memoir class, but I'm having a bit of trouble getting the headers to work as I'd like them to.

The general idea is to have the name of the author jutting out from the outer margin on verso pages, with the title of the current issue next to it and aligned with the text block. On recto pages, the name of the part would jut out from the outer margin, with the name of the chapter next to it and aligned with the text block as well. I should mention that, as it's a journal, the author changes with every chapter.

As an example, take a look at pages 2 and 3 of the PDF I've attached:
sample.pdf
(179.04 KiB) Downloaded 172 times
The problem I'm having is finding a way to make the author appear in the header automatically. I'd also like to find a way to make the title of the issue appear automatically, but that's not all that important, since I can modify that manually every time I have to work on the design of a particular issue.

At the moment, this is the code I've come up with:

Code: Select all

% Purple color

\definecolor{dred}{HTML}{6F2151}

% Triangle for beneath headers, on recto and verso pages

\newcommand{\eptri}{%
	\rlap{\smash{\raisebox{-2.5pt}{%
	\begin{tikzpicture}%
	\draw[fill=dred,color=dred] (0,0) -- (0.4,0) -- (0,-0.4) -- (0,0)
	\end{tikzpicture}%
	}}}}

\newcommand{\optri}{%
	\llap{\smash{\raisebox{-2.5pt}{%
	\begin{tikzpicture}%
	\draw[fill=dred,color=dred] (0,0) -- (0.4,0) -- (0.4,-0.4) -- (0,0)
	\end{tikzpicture}%
	}}}}

% header code 
		
\makepagestyle{kingshf} 

\makeheadposition{kingshf}{flushright}{flushleft}{}{}

\makepsmarks{kingshf}{% 
	\nouppercaseheads 
	\createmark{chapter}{right}{nonumber}{}{}
	\createmark{part}{left}{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}
	}

\makeevenfoot{kingshf}%
	{\normalfont\bfseries\thepage}{}{}

\makeoddfoot{kingshf}%
	{}{}{\normalfont\bfseries\thepage}

\makeevenhead{kingshf}% 
	{\llap{\colorbox{dred}{\rule{85pt}{}\llap{\textcolor{white}{\scshape john smith}}}\optri\kern\marginparsep}\normalfont\itshape Issue Title}{}{}

\makeoddhead{kingshf}%
	{}{{{\normalfont\itshape\rightmark}\rlap{\kern\marginparsep\eptri\colorbox{dred}{\rlap{\textcolor{white}{\scshape\leftmark}}\rule{85pt}{}}}}
Any help with this would be great;) And if any of you find some code that could be better written, please do let me know since I'm always wanting to improve my LaTeX skills.

Thanks in advance,

Cedric

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

ccordenier
Posts: 6
Joined: Mon Feb 22, 2010 10:03 pm

Re: memoir | Creating Marks for Headers

Post by ccordenier »

Oops... I did forget to mention that since it's an academic journal, the author changes with every chapter (hence why I want to make it automatic).

Thanks a lot!
Post Reply