# ConTeXt

ConTeXt is a document processing system based on TeX (technically, a macro package for TeX).

## Problem and solutions

On running `context`

if you get an error message, run ```
luatools
--generate
```

.

Compiling a context source with **luatex** in it.

texexec --luatex hello

**To check for a specific module**

ConTeXt third party modules are named `t-<modulename>.{tex,mkii,mkiv}`

. So you can run

mtxrun t-<modulename>.tex t-<modulename>.mkii t-<modulename>.mkiv

If the module is present, the above command will return the location of the module.

User module location on mac:

/usr/local/texlive/texmf-local/tex/context/third/ ~/Library/texmf/tex/context/third

## Resources

- ConTeXt Garden
- PracTeX Journal – online journal of the TeX user group.
- Aditya Mahajan’s ConTeXt related blog
- ConTeXt documentation sources
- Context Macros - Top Ten [pdf].
- ConTeXt Modules
- ConTeXt Manuals Source

## Articles/presentations

## Libraries/modules

- Simple slides by Aditya Mahajan

## Reference

- Installing opentype fonts (pdf).

## Tips

- Use simplefonts to set mainfont, sansfont, monofont etc., by name in ConTeXt. Looks very simple.

## Project structure

Via Sanjoy Mahajan –

Here’s is how I use projects/products/components in my current mathematics course (

). The project has one product, notes.tex (a textbook), as well as several pieces that aren’t grouped into products, but they share definitions. Some definitions are shared, like the printing papersize (letter), but some are specific to the product: for example, the textbook product uses a different typesetting page size (7”x9”, for eventual trimming), whereas the handouts and problem sets typeset for letter paper.

Here is the file structure: env.tex % project-wide definitions street-fighting-math.tex % project file (mentions env.tex) handouts/env_handouts.tex % common definitions for the handouts % some overriding the global ../env.tex handouts/nigeria.tex handouts/reading-memos.tex handouts/sine-picture.tex handouts/syllabus.tex handouts/your-turn.tex notes/notes.tex % product file (a textbook): % mentions env_notes.tex notes/env_notes.tex % definitions common to the product notes/analogy-again.tex % one component (chapter in the textbook) notes/analogy.tex % another component notes/dimensions.tex notes/discretization.tex notes/extreme-cases.tex notes/generalization.tex notes/picture-proofs.tex notes/taking-out-the-big-part.tex notes/why.tex % 1.tex, s1.tex etc. use env_problems.tex plus the project-wide ../env.tex problems/env_problems.tex % defintions common to the problems/solutions problems/1.tex % problem set 1 problems/2.tex problems/s1.tex problems/s2.tex When I say 'uses an environment file' or 'mentions blah.tex', here's an example, from problems/1.tex: \environment env % finds ../env.tex, the global settings \environment env_problems % ./env_problems.tex to override any of thse \starttext