chapterstyle_看图王.png

下面我们用比较原始的方式改制默认的 Part 的样式如下:

chap1_1_看图王.png

代码如下:

\documentclass[a4paper]{book}
\usepackage[T1]{fontenc}
\usepackage{libertine}
\usepackage[table]{xcolor}
\makeatletter
%\renewcommand\thepart{\arabic{part}}
\def\@part[#1]#2{%
    \ifnum \c@secnumdepth >-2\relax
      \refstepcounter{part}%
      \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
    \else
      \addcontentsline{toc}{part}{#1}%
    \fi
    \markboth{}{}%
  \reset@font
  \parindent \z@
  \vspace*{10\p@}%
  \hbox{%
    \vbox{%
      \hsize=7mm%
      \begin{tabular}{@{}p{7mm}@{}}
        \makebox[7mm]{\scshape\strut\small\partname}\\
        \makebox[7mm]{\cellcolor{black}\Huge\color{white}\bfseries\strut\thepart\rule[-4cm]{0pt}{4cm}}%
      \end{tabular}%
      \makebox(0,0){\put(-10,-100){\fbox{\phantom{\rule[-4cm]{7mm}{4cm}}}}}
      }%
    \kern-2pt
    \vbox to 0pt{%
       \tabular[t]{@{}p{1cm}p{\dimexpr\hsize-2.1cm}@{}}\hline
          & \Huge\itshape\rule{0pt}{1.5\ht\strutbox}#1\endtabular}%
    }%
  \cleardoublepage
%  \vskip 100\p@
}
\makeatother

\begin{document}
\part{Books in \LaTeX}

\end{document}

点赞(0)

评论列表 共有 0 条评论

暂无评论
立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部