%# -*- coding: utf-8 -*-
\documentclass[cs4size,oneside,openany,nofonts,UTF8,CJKnormalspaces]
  {ctexbook}[2009/05/20]
\linespread{1.0}

%\includeonly{tiling}

\usepackage{amsmath}

\usepackage{makeidx}
\makeindex

\usepackage{geometry}
\geometry{screen,left=0.5cm,right=0.5cm,top=2cm,bottom=1cm}

\usepackage{fancyhdr}
\renewcommand{\headrulewidth}{0pt}
\pagestyle{fancy}
\fancyhf{}
\lhead{\normalfont\rightmark}
\rhead{\normalfont\thepage}
\fancypagestyle{plain}{\fancyhf{}}

\usepackage{float}
\floatplacement{htbp}
\AtBeginDocument{
  \renewcommand{\topfraction}{0.9} % default 0.7
  \renewcommand{\bottomfraction}{0.5} % default 0.3
  \renewcommand{\textfraction}{0.1} % default 0.2
  \renewcommand{\floatpagefraction}{0.8} % default 0.5
  \setlength{\floatsep}{3pt plus 1pt minus 1pt} % default 12pt plus2pt minus2pt
  \setlength{\textfloatsep}{6pt plus 1pt minus 1pt} % default 20pt plus2pt minus4pt
  \setlength{\intextsep}{3pt plus 1pt minus 1pt} % default 12pt plus2pt minus2pt
}

\usepackage{caption}
\captionsetup{skip=6pt} % default 10pt

\usepackage{xltxtra}
\usepackage{myfonts}

\usepackage{multicol}

\usepackage{xcolor}
\pagecolor{lightgray!50}

\usepackage{asymptote}
\usepackage{graphicx}
\usepackage{hyperref}
\hypersetup{
  bookmarksopen=false,
  pdfpagemode=FullScreen,
  colorlinks=false,
  pdfborder=0 0 0
}
\renewcommand\figureautorefname{图}

\usepackage{asysyntex}
\usepackage{listings}
\lstloadlanguages{[LaTeX]TeX}
\newcommand*\texcode{\expandafter\lstinline[language={[LaTeX]TeX}]}


\newcommand*\prgname[1]{\textsf{#1}}
\newcommand*\Asy{\textsf{Asymptote}}
\newcommand*\asyversion{1.79}
\begin{document}

\frontmatter

% 标题页
\begin{titlepage}
\vspace*{\stretch{1}}
\begin{center}
  {\zihao{2}\bfseries
  \Asy\ 范例教程}
\bigskip

  {\zihao{3}\rmfamily\itshape
  刘海洋}
\bigskip

  {\today}
\end{center}
\vspace*{\stretch{3}}
\end{titlepage}

% 版权页
\begingroup
\setlength{\parindent}{0pt}
\vspace*{\stretch{1}}
本文是基于 \Asy\ \asyversion{} 的一组教程。

\url{http://asy4cn.googlecode.com/}
\medskip

版权所有\copyright\ 2009 刘海洋，\nolinkurl{leoliu.pku@gmail.com}

{\setlength{\leftskip}{2em}
在 GNU General Public License（GNU 通用公共许可证）的条款下授予复制、发布和/或修改此文档的许可。许可证条款见附录 \ref{chap:license}。\par}
\endgroup
\newpage

\tableofcontents

\mainmatter
\include{xiantu}
\include{tiling}

\appendix
\include{gpl-3.0}

\printindex

\bibliographystyle{plain}
\bibliography{asy}
\end{document}
