我对 TeX 还很陌生,而且我有图形设计背景,所以如果我遗漏了一些非常明显的内容,我深表歉意。
我想修改回忆录的风格VZ14
。我想要的是:
=====h 双线========= 章节标题 =====h 双线========
这样顶线就会比底线稍粗。而且我不需要章节编号。
\makeatletter
\newcommand\thickhrulefill{\leavevmode \leaders \hrule height 1ex \hfill \kern \z@}
\setlength\midchapskip{10pt}
\makechapterstyle{VZ14}{
\renewcommand\chapternamenum{}
\renewcommand\printchaptername{}
\renewcommand\chapnamefont{\small\scshape}
\renewcommand\printchapternum{%
\chapnamefont\null\thickhrulefill\quad
\@chapapp\space\thechapter\quad\thickhrulefill}
\renewcommand\printchapternonum{%
\par\thickhrulefill\par\vskip\midchapskip
\hrule\vskip\midchapskip
}
\renewcommand\chaptitlefont{\small\scshape\centering}
\renewcommand\afterchapternum{%
\par\nobreak\vskip\midchapskip\hrule\vskip\midchapskip}
\renewcommand\afterchaptertitle{%
\par\vskip\midchapskip\hrule\nobreak\vskip\afterchapskip}
}
\makeatother
\chapterstyle{VZ14}
答案1
下面的代码显示了一种可能性:
\documentclass{memoir}
\newlength\chaptitlelength
\newlength\chaptitlerlength
\makeatletter
\newcommand\thickhrulefill[1]{%
\leavevmode \leaders \hrule height #1 \hfill \kern \z@}
\setlength\midchapskip{10pt}
\makechapterstyle{mystyle}{
\setlength\beforechapskip{0pt}
\renewcommand\chapternamenum{}
\renewcommand\printchaptername{}
\renewcommand\printchapternum{}
\renewcommand\chaptitlefont{\small\scshape\centering}
\renewcommand*{\printchaptertitle}[1]{%
\settowidth\chaptitlelength{\hspace*{1em}\chaptitlefont##1\hspace*{1em}}%
\ifnum\chaptitlelength>\dimexpr0.7\textwidth\relax%
\setlength\chaptitlelength{0.7\textwidth}%
\fi%
\setlength\chaptitlerlength{\textwidth}%
\addtolength\chaptitlerlength{-\chaptitlelength}%
\addtolength\chaptitlerlength{-2em}%
\noindent\parbox[c]{.5\chaptitlerlength}{\normalsize\thickhrulefill{0.3ex}\par\vskip-1.5ex\thickhrulefill{0.2ex}}\hspace*{1em}%
\parbox[c]{\chaptitlelength}{\chaptitlefont##1}\hspace*{1em}%
\parbox[c]{.5\chaptitlerlength}{\normalsize\thickhrulefill{0.3ex}\par\vskip-1.5ex\thickhrulefill{0.2ex}}%
}%
}
\makeatother
\chapterstyle{mystyle}
\begin{document}
\chapter{Test Chapter One}
\chapter{Test Chapter Two With a Long Title Spanning Two Lines And Some More Text}
\end{document}
这个想法是使用三个垂直居中的\parbox
es;第一个和第三个包含规则,中间一个包含标题;为防止标题太长,做了一些准备:中间框宽度不会超过,0.7\textwidth
以保证两行始终显示:
简短标题的图片:
长标题的图片:
当然,您可以根据需要随意调整设置。