Skip to content

Commit

Permalink
update getting started and mkbok
Browse files Browse the repository at this point in the history
use new mkbok tool instead of makepdfs
several chapters are updated
latex template is updated
  • Loading branch information
larrycai committed Feb 22, 2012
1 parent 1546baa commit bc6cfd5
Show file tree
Hide file tree
Showing 11 changed files with 535 additions and 93 deletions.
3 changes: 2 additions & 1 deletion .mkbok.yml
@@ -1,7 +1,8 @@
--- ---
name: kaiyuanbook name: kaiyuanbook
build: pdf,epub,html build: epub,pdf,html
lang: zh lang: zh
license: ccbyncnd30 license: ccbyncnd30
config: latex/config.yml config: latex/config.yml
template: latex/template.tex template: latex/template.tex

2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -7,6 +7,6 @@ before_script:
- gem install mkbok - gem install mkbok


rvm: rvm:
#- 1.9.3 - 1.9.3
- 1.8.7 - 1.8.7
script: which mkbok ; mkbok --lang zh --build pdf script: which mkbok ; mkbok --lang zh --build pdf
4 changes: 3 additions & 1 deletion README.md
@@ -1,12 +1,14 @@
# Software Development Book Contents# # 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 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. Hope you enjoy it, I hope it helps you learn better software development.


Please check BUILD.md for how to making ebooks by yourself, 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# #Errata#


Expand Down
36 changes: 31 additions & 5 deletions latex/template.tex
@@ -1,8 +1,10 @@
\documentclass[a4paper]{book} \documentclass[a4paper]{book}
\usepackage{tocbibind} % for toc show inside pdf
\usepackage[ \usepackage[
%urlbordercolor = {1 1 1}, %urlbordercolor = {1 1 1},
%linkbordercolor = {1 1 1}, %linkbordercolor = {1 1 1},
%citebordercolor = {1 1 1}, %citebordercolor = {1 1 1},
bookmarksnumbered, % add bookmark number in pdf output
urlcolor = blue, urlcolor = blue,
colorlinks = true, colorlinks = true,
citecolor = black, citecolor = black,
Expand All @@ -18,6 +20,7 @@
\usepackage[font=small,format=plain,labelfont=bf,up,textfont=it,up]{caption} \usepackage[font=small,format=plain,labelfont=bf,up,textfont=it,up]{caption}


\usepackage{titlesec} % texlive-latex-extra package \usepackage{titlesec} % texlive-latex-extra package
\usepackage[titletoc]{appendix} % this is used for \appendices


\definecolor{colorchapter}{RGB}{70,130,180} % SteelBlue \definecolor{colorchapter}{RGB}{70,130,180} % SteelBlue
\definecolor{colorsection}{RGB}{95,158,160} % CadetBlue \definecolor{colorsection}{RGB}{95,158,160} % CadetBlue
Expand Down Expand Up @@ -136,17 +139,33 @@
\renewcommand{\contentsname}{<%= config['con'] %>} \renewcommand{\contentsname}{<%= config['con'] %>}
\renewcommand{\figurename}{<%= config['fig'] %>} \renewcommand{\figurename}{<%= config['fig'] %>}
\renewcommand{\tablename}{<%= config['tab'] %>} \renewcommand{\tablename}{<%= config['tab'] %>}
\renewcommand{\appendixname}{<%= config['appendix'] %>}


% chapter % chapter
\makeatletter \makeatletter
\def\@makechapterhead#1{% \def\@makechapterhead#1{%

\vspace*{50\p@}% \vspace*{50\p@}%
{\parindent \z@ \raggedright \normalfont {\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne \ifnum \c@secnumdepth >\m@ne
\if@mainmatter \if@mainmatter
\color{colorchapter}\normalfont\huge\bfseries \prechap \thechapter \postchap \color{colorchapter}\normalfont\huge\bfseries\prechap{ }\thechapter{ }\postchap
\par\nobreak \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@ \vskip 20\p@
\fi \fi
\fi \fi
Expand All @@ -159,15 +178,16 @@
\linespread{1.3} \linespread{1.3}


\begin{document} \begin{document}
\frontmatter
\maketitle \maketitle
\thispagestyle{empty} \thispagestyle{empty}
\setcounter{tocdepth}{4} \setcounter{tocdepth}{4}

\frontmatter
<%= preface %>
\tableofcontents\newpage\thispagestyle{empty} \tableofcontents\newpage\thispagestyle{empty}


% customize header & footer % customize header & footer


\mainmatter
\fancyhf{} \fancyhf{}
\fancyhead[LE]{\color{colorheader}\quad\small\textbf\thepage\quad\quad\small\leftmark} \fancyhead[LE]{\color{colorheader}\quad\small\textbf\thepage\quad\quad\small\leftmark}
\fancyhead[RO]{\color{colorheader}\small\rightmark\quad\quad\small\textbf\thepage\quad} \fancyhead[RO]{\color{colorheader}\small\rightmark\quad\quad\small\textbf\thepage\quad}
Expand All @@ -179,5 +199,11 @@
%\renewcommand{\headrule}{\color{red}} % conflict with headrulewidth %\renewcommand{\headrule}{\color{red}} % conflict with headrulewidth
\pagestyle{fancy} \pagestyle{fancy}


\mainmatter
<%= latex %> <%= latex %>

\appendices
\renewcommand{\prechap}{\appendixname}
\renewcommand{\postchap}{}
<%= appendix %>
\end{document} \end{document}

0 comments on commit bc6cfd5

Please sign in to comment.