Permalink
Browse files

update getting started and mkbok

use new mkbok tool instead of makepdfs
several chapters are updated
latex template is updated
  • Loading branch information...
1 parent 1546baa commit bc6cfd5c441d1246a950c141bd027e730b9cf9c4 @larrycai committed Feb 22, 2012
View
@@ -1,7 +1,8 @@
---
name: kaiyuanbook
- build: pdf,epub,html
+ build: epub,pdf,html
lang: zh
license: ccbyncnd30
config: latex/config.yml
template: latex/template.tex
+
View
@@ -7,6 +7,6 @@ before_script:
- gem install mkbok
rvm:
- #- 1.9.3
+ - 1.9.3
- 1.8.7
script: which mkbok ; mkbok --lang zh --build pdf
View
@@ -1,12 +1,14 @@
# Software Development Book Contents#
+[![Build Status](https://secure.travis-ci.org/larrycai/kaiyuanbook.png)](http://travis-ci.org/larrycai/kaiyuanbook)
+
This is the book for how to write opensource books, it covers markdown,pandoc,latex
Hope you enjoy it, I hope it helps you learn better software development.
Please check BUILD.md for how to making ebooks by yourself,
-Original contribution is to [Pro Git](http://github.com/progit/progit)
+credit to [Pro Git](http://github.com/progit/progit)
#Errata#
View
@@ -1,8 +1,10 @@
\documentclass[a4paper]{book}
+\usepackage{tocbibind} % for toc show inside pdf
\usepackage[
%urlbordercolor = {1 1 1},
%linkbordercolor = {1 1 1},
%citebordercolor = {1 1 1},
+ bookmarksnumbered, % add bookmark number in pdf output
urlcolor = blue,
colorlinks = true,
citecolor = black,
@@ -18,6 +20,7 @@
\usepackage[font=small,format=plain,labelfont=bf,up,textfont=it,up]{caption}
\usepackage{titlesec} % texlive-latex-extra package
+\usepackage[titletoc]{appendix} % this is used for \appendices
\definecolor{colorchapter}{RGB}{70,130,180} % SteelBlue
\definecolor{colorsection}{RGB}{95,158,160} % CadetBlue
@@ -136,17 +139,33 @@
\renewcommand{\contentsname}{<%= config['con'] %>}
\renewcommand{\figurename}{<%= config['fig'] %>}
\renewcommand{\tablename}{<%= config['tab'] %>}
+\renewcommand{\appendixname}{<%= config['appendix'] %>}
% chapter
\makeatletter
\def\@makechapterhead#1{%
-
\vspace*{50\p@}%
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
- \color{colorchapter}\normalfont\huge\bfseries \prechap \thechapter \postchap
- \par\nobreak
+ \color{colorchapter}\normalfont\huge\bfseries\prechap{ }\thechapter{ }\postchap
+ \par\nobreak
+ \vskip 20\p@
+ \fi
+ \fi
+ \interlinepenalty\@M
+ \color{colorchapter}\normalfont\Huge\bfseries #1\par\nobreak
+ \vskip 40\p@
+ }}
+
+% this is for non-normal chapter like Acknownledgement, Preface, Contents
+\def\@makeschapterhead#1{%
+ \vspace*{50\p@}%
+ {\parindent \z@ \raggedright \normalfont
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ \color{colorchapter}\normalfont\huge\bfseries \thechapter{ }
+ \par\nobreak
\vskip 20\p@
\fi
\fi
@@ -159,15 +178,16 @@
\linespread{1.3}
\begin{document}
-\frontmatter
\maketitle
\thispagestyle{empty}
\setcounter{tocdepth}{4}
+
+\frontmatter
+<%= preface %>
\tableofcontents\newpage\thispagestyle{empty}
% customize header & footer
-\mainmatter
\fancyhf{}
\fancyhead[LE]{\color{colorheader}\quad\small\textbf\thepage\quad\quad\small\leftmark}
\fancyhead[RO]{\color{colorheader}\small\rightmark\quad\quad\small\textbf\thepage\quad}
@@ -179,5 +199,11 @@
%\renewcommand{\headrule}{\color{red}} % conflict with headrulewidth
\pagestyle{fancy}
+\mainmatter
<%= latex %>
+
+\appendices
+\renewcommand{\prechap}{\appendixname}
+\renewcommand{\postchap}{}
+<%= appendix %>
\end{document}
Oops, something went wrong.

0 comments on commit bc6cfd5

Please sign in to comment.