From: Felix Lee Date: Thu, 14 Sep 2023 10:10:24 +0000 (+0800) Subject: add fancychap customer style defines X-Git-Url: https://www.ivnss.com/gitweb/?a=commitdiff_plain;h=58644502b6e98149d57c5981891aa061bb13576f;p=lkmpgcn add fancychap customer style defines --- diff --git a/lkmpg_cn.tex b/lkmpg_cn.tex index 64a73c3..a822343 100644 --- a/lkmpg_cn.tex +++ b/lkmpg_cn.tex @@ -44,7 +44,6 @@ \input{lib/kernelsrc} % FIXME: classify with chapters instead of sections -\renewcommand{\thesection}{\arabic{section}} \author{Peter Jay Salzman, Michael Burian, Ori Pomerantz,\and Bob Mottram,% Jim Huang, Felix Lee} @@ -52,7 +51,46 @@ Jim Huang, Felix Lee} \title{Linux内核模块编程指南} %% \renewcommand{\contentsname}{\begin{center}目 录\end{center}} +\renewcommand{\chaptername}{章} \linespread{1.2} +%%% +\makeatletter + \usecolortrue + % pzc (Zapf Chancelery) is nice. ppl (Palatino) is cool too. + \ChNumVar{\fontsize{76}{80}\usefont{OT1}{pzc}{m}{n}\selectfont} + \ChTitleVar{\raggedleft\Large\sffamily\bfseries} + + \setlength{\myhi}{10pt} % Space between grey box border and text¶ + \setlength{\mylen}{\textwidth} + \addtolength{\mylen}{-2\myhi} + \renewcommand{\DOCH}{%¶ + \settowidth{\py}{\CNoV\thechapter} + \addtolength{\py}{10pt} % Amount of space by which the +% % number is shifted right + \fboxsep=0pt%¶ + \colorbox[gray]{.95}{\rule{0pt}{40pt}\parbox[b]{\textwidth}{\hfill}}%¶ + \kern-\py\raise20pt%¶ + \hbox{\color[gray]{.05}第\CNoV\thechapter{\large{章}}}\\%¶ + } + + \renewcommand{\DOTI}[1]{% + \nointerlineskip\raggedright%¶ + \fboxsep=\myhi% + \vskip-1ex% + \colorbox[gray]{.85}{\parbox[t]{\mylen}{\CTV\FmTi{#1}}}\par\nobreak%¶ + \vskip 40\p@%¶ + } + + \renewcommand{\DOTIS}[1]{%¶ + \fboxsep=0pt + \colorbox[gray]{.85}{\rule{0pt}{40pt}\parbox[b]{\textwidth}{\hfill}}\\% + \nointerlineskip\raggedright% + \fboxsep=\myhi% + \colorbox[gray]{.85}{\parbox[t]{\mylen}{\CTV\FmTi{#1}}}\par\nobreak% + \vskip 40\p@%¶ + } + +\makeatother %% \begin{document} \begin{CJK}{UTF8}{song}