Skip to content

Commit

Permalink
Updated with the new typography from clicc.
Browse files Browse the repository at this point in the history
  • Loading branch information
zedshaw committed Mar 14, 2012
1 parent 36f376a commit 43377da
Show file tree
Hide file tree
Showing 41 changed files with 629 additions and 1,676 deletions.
9 changes: 5 additions & 4 deletions .dexy
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
"linenos": "true"
}
},
"*.conf|dexy": {},
"*Makefile|dexy": {},
"*.out|dexy": {},
"*.conf": {},
"*Makefile": {},
"*.out": {},
"*.css|jinja" : { },
"*.cfg|jinja" : { }
"*.cfg|jinja" : { },
"*.sty" : { }
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
.*.sw*
*.dSYM
*.o
code/ex[0-9][0-9]
code/ex[0-9]
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
JUNK_FILES=$(FINAL).* *.aux *.log styles/*.aux
SOURCE=book
WEBSITE=gear.fm:/var/www/learncodethehardway.org/c/
WEBSITE=learncodethehardway.org:/var/www/learncodethehardway.org/c/
FINAL=learn-c-the-hard-way

book:
dexy
cp Makefile output/
cp style.sty output/
${MAKE} -C output clean $(FINAL).pdf
rm -rf output/*.dvi output/*.pdf
${MAKE} -C output $(FINAL).pdf
Expand All @@ -18,9 +17,9 @@ $(FINAL).pdf:
pdflatex -halt-on-error $(FINAL).tex

html:
cd output && cp $(SOURCE)-html.tex $(FINAL).tex
cd output && htlatex $(FINAL).tex "book,index=1,2,next,fn-in"
gsed -i -f clean.sed output/*.html
cat output/fixes.css >> output/$(FINAL).css

view: $(FINAL).pdf
evince $(FINAL).pdf
Expand All @@ -32,8 +31,10 @@ clean:

release: clean $(FINAL).pdf draft $(FINAL).pdf sync

sync: book html
syncpdf: book
rsync -vz output/$(FINAL).pdf $(WEBSITE)/$(FINAL).pdf

sync: syncpdf html
rsync -vz output/$(FINAL).html $(WEBSITE)/book/index.html
rsync -vz output/*.html output/*.css $(WEBSITE)/book/

88 changes: 88 additions & 0 deletions book-html.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
\include{preamble-html}
\include{commands-html}

\title{
Learn C The Hard Way\\
\textit{A Clear \& Direct Introduction To Modern C Programming}
}
\author{Zed A. Shaw}
\date{July 2011}

\begin{document}

\frontmatter

\maketitle

\tableofcontents

\include{preface}
\mainmatter

\include{introduction}

\part{Basic Skills}
\include{ex0}
\include{ex1}
\include{ex2}
\include{ex3}
\include{ex4}
\include{ex5}
\include{ex6}
\include{ex7}
\include{ex8}
\include{ex9}
\include{ex10}
\include{ex11}
\include{ex12}
\include{ex13}
\include{ex14}
\include{ex15}
\include{ex16}
\include{ex17}
\include{ex18}
\include{ex19}
\include{ex20}
\include{ex21}
\include{ex22}
\include{ex23}
\include{ex24}
\include{ex25}
\include{ex26}

\part{Data Structures And Algorithms}
\include{ex27}
\include{ex28}
\include{ex29}
\include{ex30}
\include{ex31}
\include{ex32}
\include{ex33}
\include{ex34}
\include{ex35}
\include{ex36}
\include{ex37}
\include{ex38}
\include{ex39}
\include{ex40}
\include{ex41}
\include{ex42}
\include{ex43}
\include{ex44}
\include{ex45}
\include{ex46}
\include{ex47}
\include{ex48}
\include{ex49}
\include{ex50}
\include{ex51}
\include{ex52}
\include{next}

\part{Reviewing And Critiquing Code}
\include{krcritique}

\appendix

\end{document}

3 changes: 3 additions & 0 deletions clean.sed
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ d
/<div class="crosslinks"><p class="noindent">/{
r header.html
}
/<link rel="stylesheet" type="text\/css" href="learn-c-the-hard-way.css">/{
r styles.html
}
60 changes: 60 additions & 0 deletions commands-html.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@

\newcommand{\versal}[1]{\noindent{\Huge #1\kern-.10em}}
\newcommand{\file}[1]{{\bf\ttfamily #1}}
\newcommand{\ident}[1]{{\it\ttfamily #1}}
\newcommand{\func}[1]{{\it\ttfamily #1}}
\newcommand{\shell}[1]{{\it\ttfamily #1}}
\newcommand{\python}[1]{{\it\ttfamily #1}}
\newcommand{\ruby}[1]{{\it\ttfamily #1}}
\newcommand{\book}[2]{{\it\ttfamily #1} by {\it #2}}
\newcommand{\library}[1]{{\it\ttfamily #1}}
\newcommand{\program}[1]{{\it\ttfamily #1}}
\newcommand{\krc}{\ident{"K\&R C"} }

\newenvironment{aside}[1]
{
\begin{note}
\caption{\hfill\it #1}
\begin{quote}
\parindent 7.2pt
\parskip 5pt
}
{ \end{quote} \end{note} }

\newenvironment{Terminal}[1]
{
\begin{source}
\caption{\hfill\it #1}
\sffamily\small
}
{\end{source}}

\newenvironment{code}[1]
{
\begin{source}
\caption{\hfill\it #1}
\sffamily\small
}
{\end{source}}

\floatstyle{ruled}
\newfloat{note}{htpb}{lon}
\floatname{note}{Note}
\newfloat{source}{H}{los}
\floatname{source}{Source}
\newcommand{\listofnotes}{\listof{note}{List Of Notes}}
\newcommand{\listofsource}{\listof{source}{List Of Source}}

\newcommand{\rfc}[2]
{
\begin{center}
\ovalbox{
\begin{minipage}{.8\textwidth}
\begin{center}
{\bf #1:} {\it #2}
\end{center}
\end{minipage}
}
\end{center}
}

22 changes: 8 additions & 14 deletions commands.tex
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,23 @@
}
{ \end{quote} \end{note} }

\newenvironment{Terminal}[1]
\newenvironment{code}[1]
{
\begin{source}
\caption{\hfill\it #1}
\sffamily\small
\begin{framed}
\begin{parbox}[t]{\textwidth}
{\hfill\it\large #1}
\rule{\textwidth}{0.1pt}
\tt
}
{\end{source}}

\newenvironment{code}[1]
{
\begin{source}
\caption{\hfill\it #1}
\sffamily\small
\end{parbox}
\end{framed}
}
{\end{source}}

\floatstyle{ruled}
\newfloat{note}{htpb}{lon}
\floatname{note}{Note}
\newfloat{source}{H}{los}
\floatname{source}{Source}
\newcommand{\listofnotes}{\listof{note}{List Of Notes}}
\newcommand{\listofsource}{\listof{source}{List Of Source}}

\newcommand{\rfc}[2]
{
Expand Down
2 changes: 1 addition & 1 deletion ex10.tex
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ \section{What You Should See}

\begin{code}{ex10 output}
\begin{lstlisting}
<< d['code/ex10.out|dexy'] >>
<< d['code/ex10.out'] >>
\end{lstlisting}
\end{code}

Expand Down
2 changes: 1 addition & 1 deletion ex11.tex
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ \section{What You Should See}

\begin{code}{ex11 output}
\begin{lstlisting}
<< d['code/ex11.out|dexy'] >>
<< d['code/ex11.out'] >>
\end{lstlisting}
\end{code}

Expand Down
2 changes: 1 addition & 1 deletion ex12.tex
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ \section{What You Should See}

\begin{code}{ex12 output}
\begin{lstlisting}
<< d['code/ex12.out|dexy'] >>
<< d['code/ex12.out'] >>
\end{lstlisting}
\end{code}

Expand Down
2 changes: 1 addition & 1 deletion ex13.tex
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ \section{What You Should See}

\begin{code}{ex13 output}
\begin{lstlisting}
<< d['code/ex13.out|dexy'] >>
<< d['code/ex13.out'] >>
\end{lstlisting}
\end{code}

Expand Down
2 changes: 1 addition & 1 deletion ex14.tex
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ \section{What You Should See}

\begin{code}{ex14 output}
\begin{lstlisting}
<< d['code/ex14.out|dexy'] >>
<< d['code/ex14.out'] >>
\end{lstlisting}
\end{code}

Expand Down
2 changes: 1 addition & 1 deletion ex15.tex
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ \section{What You Should See}

\begin{code}{ex15 output}
\begin{lstlisting}
<< d['code/ex15.out|dexy'] >>
<< d['code/ex15.out'] >>
\end{lstlisting}
\end{code}

Expand Down
2 changes: 1 addition & 1 deletion ex16.tex
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ \section{What You Should See}

\begin{code}{ex16 output}
\begin{lstlisting}
<< d['code/ex16.out|dexy'] >>
<< d['code/ex16.out'] >>
\end{lstlisting}
\end{code}

Expand Down
2 changes: 1 addition & 1 deletion ex17.tex
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ \section{What You Should See}

\begin{code}{ex17 output}
\begin{lstlisting}
<< d['code/ex17.out|dexy'] >>
<< d['code/ex17.out'] >>
\end{lstlisting}
\end{code}

Expand Down
2 changes: 1 addition & 1 deletion ex18.tex
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ \section{What You Should See}

\begin{code}{ex18 output}
\begin{lstlisting}
<< d['code/ex18.out|dexy'] >>
<< d['code/ex18.out'] >>
\end{lstlisting}
\end{code}

Expand Down
4 changes: 2 additions & 2 deletions ex19.tex
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ \subsection{The Object Source File}

\begin{code}{The Makefile}
\begin{lstlisting}
<< d['code/ex19.1.Makefile|dexy'] >>
<< d['code/ex19.1.Makefile'] >>
\end{lstlisting}
\end{code}

Expand Down Expand Up @@ -243,7 +243,7 @@ \section{What You Should See}

\begin{code}{ex19 output}
\begin{lstlisting}
<< d['code/ex19.out|dexy'] >>
<< d['code/ex19.out'] >>
\end{lstlisting}
\end{code}

Expand Down
4 changes: 2 additions & 2 deletions ex2.tex
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ \section{Using Make}

\begin{code}{A simple Makefile}
\begin{lstlisting}
<< d['code/ex2.1.Makefile|dexy'] >>
<< d['code/ex2.1.Makefile'] >>
\end{lstlisting}
\end{code}

Expand Down Expand Up @@ -96,7 +96,7 @@ \section{What You Should See}

\begin{Terminal}{Full build with Makefile}
\begin{lstlisting}
<< d['code/ex2.out|dexy'] >>
<< d['code/ex2.out'] >>
\end{lstlisting}
\end{Terminal}

Expand Down
2 changes: 1 addition & 1 deletion ex20.tex
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ \section{What You Should See}

\begin{code}{ex20 output}
\begin{lstlisting}
<< d['code/ex20.out|dexy'] >>
<< d['code/ex20.out'] >>
\end{lstlisting}
\end{code}

Expand Down
2 changes: 1 addition & 1 deletion ex22.tex
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ \section{What You Should See}

\begin{code}{ex22 output}
\begin{lstlisting}
<< d['code/ex22.out|dexy'] >>
<< d['code/ex22.out'] >>
\end{lstlisting}
\end{code}

Expand Down
2 changes: 1 addition & 1 deletion ex24.tex
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ \section{What You Should See}

\begin{code}{ex24 output}
\begin{lstlisting}
<< d['code/ex24.out|dexy'] >>
<< d['code/ex24.out'] >>
\end{lstlisting}
\end{code}

Expand Down
Loading

0 comments on commit 43377da

Please sign in to comment.