Open main menu

Changes

334 bytes added ,  08:50, 19 September 2015
m
Link to sample pages again available
== A textbook ==
 
Jörg Hagmann
----
I wrote a biochemistry textbook in ConTeXt and would like to share the code. There is nothing special in it, but it might be useful to beginners. The book was compiled in Mk II, of course. Anything slightly non-trivial was contributed by experts, especially Wolfgang. You can download 8 sample pages from "http://www.ogbaselrepetitorium-biochemie.ch/Downloads/hagmann_biochemistry.pdf".
</texcode>
'''Language specific stuff'''. The book is written in German. By default, German quotes would show up as something like ,some text', quotations would be between ", the first one at the bottom of the line, the second one high (don't know how to show that here). I wanted "English" quotes and "guillemots" [http://en.wikipedia.org/wiki/Guillemet guillemets] for quotations:
<texcode>
</texcode>
'''New''': This and the following definitions don't work with recent (mkIV) versions of context. Instead, use <texcode>\define[2]\YourCommand{\framed[frame=off, etc...code as before}</texcode> '''Section titles'''. Red numbers and black title on top of a gray background. The problem was long titles: how to get the text properly aligned (if you don't do anything, the text of the second line will be left-aligned, under the section number). The solution was provided by Wolfgang Schuster(but see "New" above):
<texcode>
</texcode>
'''Subsections'''. "sans serif" on a gray background, but no numbering. The publisher wanted some distance between the left and the beginning of the subsection text, so I used Wolfgang's trick again(but see "New" above):
<texcode>
\setuptables[bodyfont=small]
\setupcaption[table][style={\ssx\setupinterlinespace[line=2.5ex]},align=left]
</texcode>
'''Tables II'''. Tables of width <0.5 times textwidth are automatically placed at the inner margin (Instructions can be found in "Details.pdf").
\startbodymatter
\setuppagenumbering[conversion=]
% \setuppagenumber[number=5] % Pagenumbering starts at page mkii\setcounter[userpage][5] % mkiv
\input /path/to/chapter_1.tex
\stoptext
</texcode>
 
 
[[Category:Sample documents]]
17

edits