发布时间:2012-05-29 09:39:40
文章类别:页面设置
原文地址:http://blog.sina.com.cn/s/blog_5e16f1770102epal.html

QQ群:91940767/145316219/141877998/80300084/194770436
淘宝店:http://latexstudio.taobao.com
技巧续篇:http://latexstudio.net/
常见数学公式问题集下载

如图所示:

chapterfirstpage

选自:http://www.latex-community.org/forum/viewtopic.php?f=47&t=10214

代码节选:

\documentclass[a4paper,openany]{amsbook}
\usepackage{calc}
\usepackage{flowfram}
\usepackage{lipsum}
\usepackage{mathptmx}
\definecolor{Dark}{gray}{.40}
\definecolor{Light}{gray}{.60}
\onecolumn
% Lengths to be adjusted as required
% Width of block containing chapter number
\newlength\numblockwidth
\setlength{\numblockwidth}{1cm}
% Height of chapter heading bar
\newlength\headbarheight
\setlength{\headbarheight}{1cm}
\newlength\headbarwidth
\setlength\headbarwidth{\textwidth-\numblockwidth}
% Height gap between chapter heading and text
\newlength\Vgap
\setlength{\Vgap}{5mm}
% Width of left bar
\newlength\leftbarwidth
\setlength{\leftbarwidth}{0.1\textwidth}
% Width of gap between left bar and text
\newlength\Hgap
\setlength{\Hgap}{5mm}
% Height of left bar
\newlength\leftbarheight
\setlength{\leftbarheight}{\textheight-\Vgap-\headbarheight}
% Width remaining for text body on first page of chapter
\newlength\chapbodywidth
\setlength{\chapbodywidth}{\textwidth-\Hgap-\leftbarwidth}
\newlength\offset
% Frames for first page of chapters
\newdynamicframe[none]{\leftbarheight}{\leftbarwidth}{0pt}{0pt}[leftbar]
\setlength{\offset}{\leftbarheight+\Vgap}
\newdynamicframe[none]{\numblockwidth}{\headbarheight}
{0pt}{\offset}[chapnum]
\newdynamicframe[none]{\headbarwidth}{\headbarheight}{\numblockwidth}{\offset}[chaphead]
\newflowframe[none]{\chapbodywidth}{\leftbarheight}
{\leftbarwidth+\Hgap}{0pt}[chapbody]
\setdynamicframe*{chapnum}{textcolor=white,backcolor=black,valign=c}
\setdynamicframe*{chaphead}{textcolor=white,backcolor=Dark,valign=c}
\setdynamicframe*{leftbar}{textcolor=Light,backcolor=Dark,valign=c,angle=90}
\def\thechaptertitle{}
\setdynamiccontents*{chaphead}{\huge\bfseries\thechaptertitle}
\setdynamiccontents*{leftbar}{\centering\fontsize{26pt}{28pt}\selectfont
\bfseries\thechaptertitle\par}
\setdynamiccontents*{chapnum}{\centering\huge\bfseries\thechapter\par}
\newcount\nextpage
\makeatletter
\let\orgchap\chapter
\def\chapter{%
\nextpage=\c@page
\advance\nextpage by 1\relax
\xdef\thispage{\number\nextpage}%
\setdynamicframe*{chapnum,chaphead,leftbar}{pages=\thispage}%
\setflowframe*{chapbody}{pages=\thispage}%
\setflowframe{1}{pages={<\thispage,>\thispage}}%
\clearpage
\@afterindentfalse
\secdef\@chapter\@schapter
}%
\def\@makechapterhead#1{\def\thechaptertitle{#1}\par}
\makeatother
\title{A Sample Document}
\author{A.N. Author}
\begin{document}
\maketitle
\chapter{Academic Plan}
\lipsum
\end{document}


点赞(0)

评论列表 共有 0 条评论

暂无评论
立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部