% language=us runpath=texruns:manuals/metafun

% author    : Hans Hagen
% copyright : ConTeXt Development Team
% license   : Creative Commons Attribution ShareAlike 4.0 International
% reference : pragma-ade.nl | contextgarden.net | texlive (related) distributions
% origin    : the ConTeXt distribution
%
% comment   : Because this manual is distributed with TeX distributions it comes with a rather
%             liberal license. We try to adapt these documents to upgrades in the (sub)systems
%             that they describe. Using parts of the content otherwise can therefore conflict
%             with existing functionality and we cannot be held responsible for that. Many of
%             the manuals contain characteristic graphics and personal notes or examples that
%             make no sense when used out-of-context.
%
% comment   : Some chapters might have been published in TugBoat, the NTG Maps, the ConTeXt
%             Group journal or otherwise. Thanks to the editors for corrections. Also thanks
%             to users for testing, feedback and corrections.
%
% comment   : This manual was originally written for MkII and as a consequence many examples
%             are coded in a bit different way than we would nowadays do in MkIV. But, as we
%             try to be downward compatible, it doesn't hurt.
%
% comment   : I also use this manual for benchmarking ConTeXt MkIV. On my current machine (a
%             2013 dell i7 laptop) one run takes some 18.1 seconds for LuaTeX and around 14.2
%             seconds for LuajitTeX which is quite okay given the amount of graphics (428
%             pages).
%
% comment   : This is one of the manuals that can be ordered at http://www.h2o-books.com and
%             it's actually meant to be read on paper.
%
% comment   : Before I started updating the manual to lmtx (luametafun) I made sure that it
%             processed okay in the february 2021 version of lmtx. The runtime for 448 pages
%             (which is 20 more than the previous test) is some 16.5 seconds (just below 16
%             with compact fonts). So we can safely conclude that we're not worse of with
%             respect to performance. (I use the same machine.)
%
% comment   : June 31 2020, in the process of checking manuals with the runpath feature, the
%             manual has 414 (some mkii and mkiv stuff has been removed) pages and processing
%             takes 14.2 seconds (13.7 with compact fonts). With about 29 pps for the removed
%             pages we then come to about 15.5 seconds so again we gained some (which is what
%             I expect with the more efficient \LUA|-|\METAPOST\ interfacing). It also means
%             that \LUAMETATEX|-|\LMTX\ is now comparable with \LUAJITTEX|-|\MKIV.

\enableexperiments[fonts.compact]

% \enablemode[optional]

% \enablemode[screen]
\enablemode[print]
% \enablemode[book]

% todo: check startintro .. stopintro each chapter

% \showframe

\startproduct metafun

\environment metafun-environment

\startnotmode[screen]
    \component   metafun-titlepage-paper
    \component   metafun-colofon-paper
\stopnotmode

\startmode[screen]
    \environment metafun-environment-screen
    \component   metafun-titlepage-screen
\stopmode

\startfrontmatter
    \component   metafun-introduction
    \component   metafun-contents
    \component   metafun-conventions
\stopfrontmatter

\startbodymatter
    \component   metafun-welcome
    \component   metafun-basics
    \component   metafun-embedding
    \component   metafun-layout
    \component   metafun-positioning
    \component   metafun-backgrounds
    \component   metafun-gadgets
    \component   metafun-effects
    \component   metafun-functions
\ifcase\contextlmtxmode
    \component   metafun-text
\else
    \component   metafun-text-lmtx
\fi
    \component   metafun-debugging
    \component   metafun-styles
    \component   metafun-examples
    \component   metafun-macros
    \component   metafun-lua
    %component   metafun-graphics
    \component   metafun-sneaky
\stopbodymatter

\startappendices
  % \component   metafun-programs
    \component   metafun-syntax
    \component   metafun-document
    \component   metafun-reference
  % \component   metafun-literature
\stopappendices

\startbackmatter
    \component   metafun-index
\stopbackmatter

\startmode[screen]
    \component   metafun-colofon-screen
\stopmode

\startnotmode[screen]
    \component   metafun-backpage
\stopnotmode

\stopproduct
