-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ebbfc9
commit 8d9f9d3
Showing
5 changed files
with
72 additions
and
3 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,62 @@ | ||
\documentclass{article} | ||
\title{My Title} | ||
\documentclass{book} | ||
|
||
% Packages | ||
\usepackage{xeCJK} % 中文支持 | ||
\usepackage{indentfirst} % 首段缩进 | ||
\usepackage{listings} % 代码环境 | ||
\usepackage{enumitem} % 列表环境 | ||
\usepackage{graphicx} % 插图 | ||
\usepackage{amsmath} % 某个包依赖 | ||
\usepackage[colorlinks,breaklinks,linktoc=page,allcolors=linkcolor]{hyperref} % 交叉引用 | ||
\usepackage{xcolor} % 颜色 | ||
\usepackage[font={it}]{caption} % 设置图表和代码文件标题 | ||
\usepackage[numbered]{bookmark} % 设置书签 | ||
\usepackage[pagestyles,clearempty]{titlesec} % 设置页眉格式 | ||
\usepackage[a4paper,left=2cm,right=2cm,bottom=3.67cm]{geometry} % 设置页边距 | ||
|
||
\setCJKmainfont[ItalicFont=楷体,BoldItalicFont=楷体]{宋体} % 设置中文正文字体 | ||
\setCJKmonofont{宋体} % 设置中文等宽字体 | ||
\setmainfont{Times New Roman} % 设置英文正文字体 | ||
\setmonofont[Path=../fonts/,BoldFont=Inconsolata-Bold.ttf]{Inconsolata-Regular.ttf} % 设置英文等宽字体 | ||
|
||
\linespread{1.4} % 设置行距 | ||
\CJKsetecglue{\,} % 设置中英文间的空格 | ||
|
||
\setlist{nosep} % 设置列表垂直间距为0 | ||
\setlist[enumerate,itemize]{leftmargin=*,listparindent=1em} % 设置列表项缩进 | ||
|
||
\newpagestyle{front}{ % 自定义页眉格式 | ||
\sethead[\thepage][][\chaptertitle] % 偶数页页眉格式 | ||
{\chaptertitle}{}{\thepage} % 奇数页页眉格式 | ||
\headrule % 页眉下水平分隔线 | ||
} | ||
|
||
\newpagestyle{main}{ % 自定义页眉格式 | ||
\sethead[\thepage][][Chapter \thechapter: \quad \chaptertitle] % 偶数页页眉格式 | ||
{\thesection \quad \sectiontitle}{}{\thepage} % 奇数页页眉格式 | ||
\headrule % 页眉下水平分隔线 | ||
} | ||
|
||
\definecolor{linkcolor}{RGB}{187, 92, 226} % 定义链接颜色 | ||
\definecolor{stringcolor}{RGB}{255, 77, 156} % 定义代码字符串颜色 | ||
|
||
\lstset{ % 设置代码环境格式 | ||
basicstyle = \ttfamily\footnotesize, % 字体大小 | ||
breaklines = true, % 允许折行 | ||
keywordstyle= \color{blue}, % 关键字样式 | ||
language = C, % 编程语言 | ||
stringstyle = \color{stringcolor}, % 字符串样式 | ||
commentstyle= \color{gray}\itshape, % 注释样式 | ||
frameround = tttt, % 圆角边框 | ||
rulecolor = \color{lightgray}, % 边框颜色 | ||
escapechar = `, % 逃逸字符 | ||
} | ||
|
||
\lstnewenvironment{blacklisting} % 全黑代码环境,用于代码输出 | ||
{\lstset{keywordstyle=\color{black},stringstyle=\color{black},commentstyle=\color{black}}} | ||
{} | ||
|
||
\title{\textbf{xv6} \\ 一个简单的类Unix操作系统课程} | ||
\author{Russ Cox \\ Frans Kaashoek \\ Robert Morris} | ||
|
||
\begin{document} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,11 @@ | ||
Hello, world. | ||
\maketitle | ||
|
||
\setcounter{secnumdepth}{0} | ||
|
||
\frontmatter | ||
\pagestyle{front} | ||
\tableofcontents | ||
\include{foreword} | ||
|
||
\mainmatter | ||
\pagestyle{main} |