我借用了一些代码精美排版展示
并尝试使用memoir
不带类的类进行相同的装饰fancyhdr
以下是 MWE:
\documentclass[twoside,12pt,english]{memoir}
\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage{color}
\definecolor{marron}{RGB}{60,30,10}
\definecolor{darkblue}{RGB}{0,0,80}
\definecolor{lightblue}{RGB}{80,80,80}
\definecolor{darkgreen}{RGB}{0,80,0}
\definecolor{darkgray}{RGB}{0,80,0}
\definecolor{darkred}{RGB}{80,0,0}
\definecolor{shadecolor}{rgb}{0.97,0.97,0.97}
\usepackage{lettrine}
\input Acorn.fd
\newcommand*\initfamily{\usefont{U}{Acorn}{xl}{n}}
\usepackage{fourier-orns}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{#1}}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\makeheadrule}
{\@width #2\@height #3 }
{\color{darkgray}\raisebox{-2.1pt}[10pt][10pt]{\leafright} \hrulefill \raisebox{-2.1pt}[10pt][10pt]{~~~\decofourleft \decotwo\decofourright~~~} \hrulefill \raisebox{-2.1pt}[10pt][10pt]{ \leafleft}%
}
{}
{}
\makeatother
\nouppercaseheads
\makepagestyle{myruled}
\makeevenhead{myruled}{\thepage}{}{}
\makeoddhead{myruled}{}{\rightmark}{\thepage}
\makeevenfoot{myruled}{}{}{}
\makeoddfoot{myruled}{}{}{}
\makeatletter % because of \@chapapp
\makepsmarks{myruled}{
\nouppercaseheads
\createmark{chapter}{both}{nonumber}{\@chapapp\ }{. \ }
\createmark{section}{right}{shownumber}{}{. \ }
}
\makeatother
\pagestyle{myruled}
\begin{document}
\chapter{Test}
Test. \newpage
\section{Plant\ae}
Test section.
\newpage
Test.
\end{document}
如果我首先移动装饰代码,则{}
什么都不会显示....我该如何重新定义memoir
内置代码hrule
?
输出:
附言:同样的问题makefootrule
答案1
这似乎有效
\renewcommand\myruledheadrule{%
\color{darkgray}\raisebox{-2.1pt}[10pt][10pt]{\leafright}%
\hrulefill%
\raisebox{-2.1pt}[10pt][10pt]{~~~\decofourleft%
\decotwo\decofourright~~~} \hrulefill%
\raisebox{-2.1pt}[10pt][10pt]{ \leafleft}%
\vskip-24pt
}
您可能需要更改\vskip-24pt
零件。规则的最终高度应为零。
\makeheadrule{name}{}{}
只是定义\nameheadrule