Eufisky - The lost book

精致的章节样式

在TeX使用中,很多时候想别出心裁地设计属于自己的版面或者文章样式,尤其是用TeX来设计版面和样式,做起来非所见所得,对于设计来说有了更高要求,需要我们有较多绘图和版面的知识。  

如下几个样式来自网络供大家参考:选自:http://web.slzm.de/blog/latex/schone-kapiteltitelseiten-in-latex/

效果图:

代码设计:

 

\documentclass{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage
{xcolor}
\usepackage{blindtext}
\usepackage{fix-cm}
\usepackage{titlesec}
\usepackage{tikz} % Style 2, 3, 4
\usetikzlibrary{calc} % 2, 3, 4
\usetikzlibrary{decorations,decorations.shapes,shapes} % 3
% Style 1
%\renewcommand{\thechapter}{\Roman{chapter}}
\titleformat{\chapter}[display]
{\bfseries\Large}
{ %\Huge\textsc{\chaptertitlename}
\hfill\fontsize{120}{70}\selectfont\color{lightgray}\textbf{\thechapter}}
{-2ex}
{\filleft\fontsize{50}{70}\selectfont\scshape}
[\vspace{0ex}]
% Style 2
\titleformat{\chapter}[display]
{\bfseries\Large}
{\hfill \tikz[remember picture] \node[] (nr) {\fontsize{120}{70}\selectfont\color{lightgray}\textbf{\thechapter}};
\begin{tikzpicture}[overlay,remember picture]
\coordinate (leftborder) at ($(nr)-(100,0)$);
\coordinate (left) at ($(nr.west)-(1.5,0)$);
\draw[line width=2em] ($(nr.north east)+(0,1)$) -- ($(nr.north west)+(0,1)$) -- (left) -- (leftborder);
\end{tikzpicture}}
{-2ex}
{\filleft\fontsize{50}{70}\selectfont\scshape}
[\vspace{0ex}]
% Style 3
\titleformat{\chapter}[display]
{\bfseries\Large}
{\hfill \tikz[remember picture] \node[] (nr) {\fontsize{120}{70}\selectfont\color{lightgray}\textbf{\thechapter}};
\begin{tikzpicture}[overlay,remember picture]
\coordinate (leftborder) at ($(nr)-(100,0)$);
\coordinate (left) at ($(nr.west)-(1.5,0)$);
\draw[decoration={shape backgrounds,shape size=.5cm,shape=signal},signal from=west, signal to=east,decorate, draw=red!50!black, fill=red!50, decoration={shape sep=.5cm},line join=round] (leftborder) -- (left);
\end{tikzpicture}}
{-2ex}
{\filleft\fontsize{50}{70}\selectfont\scshape}
[\vspace{0ex}]
% Style 4
\titleformat{\chapter}[display]
{\bfseries\Large}
{\hfill \tikz[remember picture] \node[] (nr) {\fontsize{120}{70}\selectfont\color{blue!50!black}\textbf{\thechapter}~};
\begin{tikzpicture}[overlay,remember picture]
\coordinate (leftborder) at ($(nr)-(100,0)$);
\coordinate (leftborderhigh) at ($(nr.north west)-(100,0)$);
\coordinate (leftborderlow) at ($(nr.south west)-(100,0)$);
\coordinate (left) at ($(nr.west)-(1.5,0)$);
\fill[blue!20!white] (leftborderhigh) -- ($(nr.north west)+(0,0.5)$) -- (left) -- (leftborder) -- cycle;
\fill[blue!20!white] (leftborderlow) -- ($(nr.south west)-(0,0.5)$) -- (left) -- (leftborder) -- cycle;
\draw[blue!50!black,line width=0.1em,line join=round] (left) -- ($(nr.south west)-(0,0.5)$) -- ($(nr.south east)-(0,0.5)$) -- ($(nr.north east)+(0,0.5)$) -- ($(nr.north west)+(0,0.5)$) -- (left) -- (leftborder);
\end{tikzpicture}}
{-2ex}
{\filleft\fontsize{50}{70}\selectfont\scshape}
[\vspace{0ex}]
% ==========================
% DOKUMENT
% ==========================
\begin{document}
\chapter{Einleitung}
\blindtext
\chapter{Hauptteil}
\blindtext
\chapter{Schluss}
\blindtext
\end{document}

LaTeX手工制作漂亮的章节样式

LaTeX的默认样式,很多用户觉得太朴实了,总想让自己的样式有些新意。下面便是一个很好的例子,这个样式在memoir class中也有,稍有差异。

效果图:

PrettyChapterHeadings

代码如下:

\documentclass[parskip,headsepline, headtopline, %
footsepline, oneside, 12pt, headings=small]{scrbook}
\usepackage[ngerman, english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{color}
\usepackage{pdfpages} % To include other PDFs

% To insert dummy text
\usepackage{blindtext}

% Provide a command to include pretty quotes
\usepackage{ragged2e} %justify dictum
\renewcommand*{\dictumwidth}{.5\textwidth}
\newcommand{\setChapterQuote}[3]{\setchapterpreamble[o]{%
\dictum[#2 \emph{#3}]{\justifying {#1}}}}

%Set font to times
\usepackage{txfonts}

% Define own Chapter style
% Pretty chapter pages
%------------------------------------------
\definecolor{nicered}{rgb}{.647,.129,.149}
\usepackage{soul}

\makeatletter
\newsavebox{\feline@chapter}
\newcommand\feline@chapter@marker[1][4cm]{%
\sbox\feline@chapter{%
\resizebox{!}{#1}{\fboxsep=1pt%
\colorbox{nicered}{\color{white}\bfseries\sffamily\thechapter}%
}}%
\rotatebox{90}{%
\resizebox{%
\heightof{\usebox{\feline@chapter}}+\depthof{\usebox{\feline@chapter}}}%
{!}{\scshape\so\@chapapp}}\quad%
\raisebox{\depthof{\usebox{\feline@chapter}}}{\usebox{\feline@chapter}}%
}
\newcommand\feline@chm[1][4cm]{%
\sbox\feline@chapter{\feline@chapter@marker[#1]}%
\makebox[0pt][l]{% aka \rlap
\makebox[1cm][r]{\usebox\feline@chapter}%
}}   

\renewcommand*{\chapterformat}{%
\hspace{\leftmargin} \feline@chm[2.5cm] % Height of the colored box
\hspace{2cm}
}
\makeatother

\begin{document}

% Chapter A
\setChapterQuote{A thought is an idea in transit.}{Pythagoras}{582 B.C. - 497 B.C.}
\chapter{First chapter}
\blindtext[5]

% Chapter B
\setChapterQuote{Much wisdom often goes with fewest words.}{Sophocles}{496 B.C. - 406 B.C.}
\chapter{Second chapter}
\blindtext[5]

\end{document}

选自:http://mk85.de/?p=177%3C/a%3E