Skip to content

Commit

Permalink
Init fixing ch02
Browse files Browse the repository at this point in the history
  • Loading branch information
dieu committed May 10, 2012
1 parent 004e5f8 commit 2d2129a
Show file tree
Hide file tree
Showing 21 changed files with 3,693 additions and 3,958 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.swp
latex/*
book
*.pyg
!latex/makepdf
!latex/README
!latex/template.tex
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ On Mac OS X:

$ install calibre app
$ check ruby and rubygems
$ easy_install pygments
$ port install pandoc texlive +full texlive-xetex
$ gem install rdiscount

Expand Down
4 changes: 2 additions & 2 deletions latex/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
default:
font: Helvetica
font: Liberation Serif
bold: "{* Bold}"
mono: Courier
mono: Liberation Mono
prechap: "Chapter "
postchap: ""
presect: "Section "
Expand Down
10 changes: 6 additions & 4 deletions latex/makepdf
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,13 @@ def post_pandoc(string, config)
end

# Ensure monospaced stuff is in a smaller font
s /(\\verb(\W).*?\2)/, '{\footnotesize\1}'
s /(\\begin\{verbatim\}.*?\\end\{verbatim\})/m, '{\footnotesize\1}'
#s /(\\verb(\W).*?\2)/, '{\footnotesize\1}'
#s /(\\begin\{verbatim\}.*?\\end\{verbatim\})/m, '{\footnotesize\1}'

# Shaded verbatim block
s /(\\begin\{verbatim\}.*?\\end\{verbatim\})/m, '\begin{shaded}\1\end{shaded}'
s /(\\begin\{verbatim\})/m, '\begin{minted}[xleftmargin=25pt]{erlang}'
s /(\\end\{verbatim\})/m, '\end{minted}'
#s /(\\begin\{verbatim\}.*?\\end\{verbatim\})/m, '\begin{shaded}\1\end{shaded}'
end
end

Expand Down Expand Up @@ -156,7 +158,7 @@ figures do
cd($root)
3.times do |i|
print "\t\tPass #{i + 1}... "
IO.popen("xelatex -output-directory=\"#{dir}\" \"#{dir}/main.tex\" 2>&1") do |pipe|
IO.popen("cd #{dir} && pdflatex -shell-escape \"#{dir}/main.tex\" 2>&1") do |pipe|
unless $DEBUG
if ~/^!\s/
puts "failed with:\n\t\t\t#{$_.strip}"
Expand Down
15 changes: 9 additions & 6 deletions latex/template.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
\documentclass[a4paper]{book}
\usepackage{minted}
\usepackage[utf8]{inputenc}
\usepackage[russian]{babel}
\usepackage{cmap}
\usepackage[
%urlbordercolor = {1 1 1},
%linkbordercolor = {1 1 1},
Expand All @@ -8,7 +12,7 @@
citecolor = black,
linkcolor = black]{hyperref}
\usepackage{graphicx}
\usepackage{xltxtra}
% \usepackage{xltxtra}
\usepackage{fancyhdr}
\usepackage{booktabs}
\usepackage{indentfirst}
Expand All @@ -18,10 +22,9 @@

\definecolor{shadecolor}{gray}{0.90}

\setromanfont[Mapping=tex-text,BoldFont=<%= config['bold'] %>]{<%= config['font'] %>}
\setmonofont{<%= config['mono'] %>}
% \setromanfont[Mapping=tex-text,BoldFont=<%= config['bold'] %>]{<%= config['font'] %>}
% \setmonofont{<%= config['mono'] %>}

\XeTeXlinebreaklocale{<%= lang %>}
<%= config['langrule'] %>

\settowidth{\parindent}{<%= config['indent'] %>}
Expand Down Expand Up @@ -145,8 +148,8 @@
\fancyhf{}
\fancyhead[LE]{{\small\leftmark}}
\fancyhead[RO]{{\small\rightmark}}
\fancyhead[RE,LO]{{\small\savedauthor\hspace*{1ex}\textbf{\savedtitle}}}
\fancyfoot[LE,RO]{\small\textbf\thepage}
\fancyfoot[LE,RO]{{\small\textbf\thepage}}
\fancyfoot[RE,LO]{{\small\savedauthor\hspace*{1ex}\textbf{\savedtitle}}}
\pagestyle{fancy}

<%= latex %>
Expand Down
2 changes: 1 addition & 1 deletion makepdfs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
baseDir=`dirname $0`
outputDir=${baseDir}/pdf

exclude=('figures' 'figures-dia' 'figures-source' 'latex' 'makepdfs' 'pdf' 'README.md' 'AUTHORS.md' 'Rakefile' 'couchapp' 'epub' 'makeebooks' 'summary.rb' 'book' 'doc')
exclude=('figures' 'figures-dia' 'figures-source' 'latex' 'makepdfs' 'pdf' 'README.md' 'AUTHORS.md' 'Rakefile' 'couchapp' 'epub' 'makeebooks' 'summary.rb' 'book' 'doc' 'main.pyg')
dirContent=`ls $baseDir`
argString=""

Expand Down
4 changes: 2 additions & 2 deletions ru/01/Programming_Erlang_Ch01.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
как (написанные нами) модули обратного вызова приложения реализуют всю
его специфическую функциональность. Эта глава начинается с общего
обсуждения как работают поведения вообще, а потом переходит к описанию
поведения gen\_server (обобщенный сервер), как части стандартной
поведения gen_server (обобщенный сервер), как части стандартной
библиотеки Эрланг ОТР.

* Глава 17 «Mnesia («Мнезия») - база данных Эрланга» рассказывает о базе
Expand Down Expand Up @@ -184,7 +184,7 @@

* Приложение С - содержит каталог ресурсов по Эрланг.

* Приложение D - описывает библиотеку lib\_chan предназначенную для
* Приложение D - описывает библиотеку lib_chan предназначенную для
создания socet-распределенных приложений.

* Приложение Е - рассматривает техники анализа профилирования, отладки и
Expand Down
Loading

0 comments on commit 2d2129a

Please sign in to comment.