Input and compilation/Sample documents

Unofficial ConTeXt Wiki mirror

Last modified: 2026-08-28

🚧 This page is currently being revised and reconstructed.

Its structure, examples, and explanations are being updated for current ConTeXt and LuaMetaTeX. Please feel free to edit, correct, or improve this page while the revision is in progress.

Input and compilation · Overview · Project and file management · Sample documents

This page collects examples of complete or substantial ConTeXt documents: letters, theses, presentations, books, reports, graphical documents, and other real-world layouts.

The collection spans more than twenty years of ConTeXt development. Some examples are suitable starting points for current work; others are valuable mainly for studying document design or earlier ConTeXt techniques.

A sample document should therefore be read along two independent axes:

document type                    technical status
     |                                |
     +-- thesis                       +-- LMTX-tested
     +-- presentation                 +-- current, untested
     +-- book                         +-- legacy, untested
     +-- report                       +-- known deprecated code
     +-- graphics

A sample is not necessarily a template.

Sample documents are useful for studying how several ConTeXt mechanisms work together: page design, typography, document structure, project organization, graphics, notes, bibliographies, and reusable definitions.

Before reusing old source code in a new project, check the relevant commands, modules, fonts, and file organization with current ConTeXt.

For the complete category listing, see all sample documents in this wiki.

1. Finding an example

There are three useful ways to navigate this collection:

If you want to... Use
find a particular kind of document the thematic sections below
see when an example was created the chronological index
judge whether old code is safe to reuse the technical status

If you are primarily interested in organizing a substantial multifile document, see first Project and file management.

For page design and document structure, see also:

2. Chronological index

Where a creation or publication date is known, it is recorded here.

The date tells you when an example belongs in the history of ConTeXt; it does not by itself tell you whether the source still works.

Date Example Type Technical note
2023 ConTeXt for pres(id)ent(ation) Presentation Recent example
2023 Step-by-step book layout Book Recent tutorial
2014 Invoice 2 Invoice Not yet classified for current LMTX
2011 Fairy style Book Older example
2008 Proceedings style Book / proceedings Older example
2005 Conference presentation by Brooks Presentation Older external example
2004 Uno style Book Older example
2004 ConTeXt info style Presentation Older example
2004 Skdk style Presentation Older example
2001 Ubuch style Book Contains deprecated code

Examples for which no reliable creation or publication date is currently known remain in the thematic sections below.

Creation date and test date are different facts.

A page may eventually record, for example:

Created / published:   2004
Last tested with LMTX: 2026

An old example may work perfectly with current ConTeXt, while a newer example may still depend on particular fonts, modules, or assumptions.

3. Technical status

As pages are reviewed, their technical status should ideally be described independently of their age.

Status Meaning
LMTX-tested The example has recently been compiled and its relevant behaviour checked with current LuaMetaTeX/LMTX.
Current, not yet tested The example is relatively recent, but this wiki revision has not independently verified it.
Legacy, untested The example comes from an earlier ConTeXt generation and has not yet been checked with current LMTX.
Known deprecated code At least one part of the implementation is known to require modernization.

Unknown is better than guessed.

If an example has not been tested, mark it as untested rather than inferring compatibility from its date.

4. PRAGMA documents and official sources

The ConTeXt distribution itself contains manuals, demonstrations, and substantial source documents.

Useful starting points include:

These are particularly useful for studying how several ConTeXt mechanisms are combined in real documents.

4.1 Historical pdfTeX documentation

The following documents belong to an earlier stage of the ConTeXt/pdfTeX ecosystem and are retained primarily for historical and typographical interest:

5. Simple documents

These examples concentrate on relatively self-contained document types.

 German DIN Letter style by Holger Schöner.
 French Bauplan style.
 MLA style.
 Law Faculty University of Ljubljana style and citations for diploma theses and related work.
 Calendar script.
 Curriculum vitæ.
 Invoice using Wolfgang's letter module.
 Invoice 2 (2014).
 DIN lang folder.

6. Theses and academic projects

Theses are particularly useful sample documents because they commonly combine document structure, frontmatter and backmatter, bibliographies, figures, cross-references, environments, and multiple source files.

6.1 Aditya Mahajan's thesis

This is a complete thesis rather than a minimal template and is useful for studying how a large real document is assembled.

6.2 UTM thesis template

The repository includes separate document parts and project-level setup.

6.3 General thesis template

Another example of a substantial multifile thesis.

6.4 Older thesis example

Treat this as legacy source unless its current behaviour has been retested.

7. Labels, cards, and imposed material

These examples deal with several independent objects placed on one physical page.

8. Presentations and screen documents

See also Presentations.

8.1 Step-by-step presentation construction

Aditya Mahajan's Creating a clean presentation style in 40 commits develops a presentation environment incrementally.

Its pedagogical value lies in showing individual design decisions rather than presenting one large unexplained style file.

8.2 More recent presentation styles

8.3 Earlier presentation examples

These are useful for studying presentation design, but their implementation should be checked before being used as the basis of a current LMTX style.

8.4 Interactive screen document

9. Books and periodicals

Books are useful for studying the interaction between page layout, headings, notes, illustrations, and project organization.

9.1 Step-by-step book layout

9.2 Book examples in the Garden

Separate design from implementation.

An older book may still provide excellent ideas for chapter openings, running heads, margins, sidenotes, title pages, or page proportions even when some of its code needs modernization.

10. MetaPost and MetaFun documents

See Graphical programming with MetaPost and MetaFun.

Examples include:

These illustrate how MetaFun can form part of the architecture and visual language of a complete document.

11. Reports

The report example combines several mechanisms in one substantial design:

It is useful for studying how separate ConTeXt mechanisms can be combined into a coherent document rather than treated as isolated commands.

12. Reviewing an old sample

When updating an old example for current LMTX, use a conservative workflow:

compile the original sample
          |
          +-- works
          |      |
          |      +--> record current behaviour
          |
          +-- fails
                 |
                 v
          locate the failing mechanism
                 |
                 v
             minimal test
                 |
                 v
          update only what is needed
                 |
                 v
          compile the complete sample again

This preserves working techniques and makes each modernization traceable.

13. Suggested metadata for sample pages

As individual pages are reviewed, they should ideally record:

Document type:
Created / published:
ConTeXt generation:
Last tested with LMTX:
Special requirements:
Source available:

For example:

Document type:         presentation
Created / published:   2004
ConTeXt generation:    MkII / early MkIV
Last tested with LMTX: not yet tested
Special requirements: unknown
Source available:      yes

Unknown information should remain explicitly unknown rather than being guessed.

14. Contributing or modernizing a sample

A useful sample page should explain:

If an example no longer compiles, identify the obsolete mechanism when possible instead of simply declaring the whole document unusable.

15. Related pages

Input and compilation · Overview · Project and file management · Sample documents