Some time ago, reading this entry I found a nice image and a pointer to a better book entitled "Thinking Forth". To my surprise, the LaTeX sources of the book were ready to download, with pearls like:
%% There's no bold typewriter in Computer Modern.
%% Emulate with printing several times, slightly moving
\newdimen\poormove
\poormove0.0666pt
\newcommand{\poorbf}[1]{%
\llap{\hbox to \poormove{#1\hss}}%
\raise\poormove\rlap{#1\hss}%
\lower\poormove\rlap{#1\hss}%
\rlap{\hbox to \poormove{\hss}\hbox{#1}}%
#1}
%\let\poorbf=\textbf
\renewcommand{\poorbf}[1]{{\fontencoding{OT1}\fontfamily{cmtt}\fontseries{b}\selectfont#1}}
in which it can simulate the bold stroking of a font that doesn't have it. Since reading that, I was unaware of \llap
and such, but now I can use them to define boxes, etc.
So, my question is twofold:
There are two comprehensive reference guides/recipe books for TeX:
In both cases, the sources are also available.
As lindelof mentions, the TeXBook is also available, albeit in a form that prevents compilation (Knuth wished people to look at the source for inspiration but not to reproduce the book freely):
On the LaTeX side of things, resources a little more scarce from the programming point of view. The best free reference that I know of is
Of course there's also
but that doesn't cover so much programming "stuff". The LaTeX sources themselves contain some useful nuggets, but the quality of the documentation ranges from excellent to non-existent in parts; this should be available in your distribution with texdoc source2e
.
Other large LaTeX packages obviously have the source to their documentation available; a notable example is the memoir class:
memman.tex
is the documentation)I'm sure there are many more books with their source available; these are just the first ones that come to mind that happen to also be able TeX and/or LaTeX.
Believe it or not, but the source code to the TeXbook is actually freely downloadable:
TeXbook source code package
Not that I'd recommend it (unless you've got a lot of time and caffeine to spare), but I learned a lot from just reading the latex.ltx file. I learned a lot not only about LaTeX but also of course about TeX. It's a heavy read though and I'd suggest reading a book about TeX first before diving into the latex.ltx file.
I wanted to know about how "optional" parameters actually worked and reading the latex.ltx file really helped me understand.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With