Difference between revisions of "Modules"

From ConTeXt wiki
Jump to navigationJump to search
m (Installing contributed modules)
(Installation)
Line 4: Line 4:
  
 
There are not as many modules for ConTeXt as packages for LaTeX, because a lot of LaTeX package features are in ConTeXt's core.
 
There are not as many modules for ConTeXt as packages for LaTeX, because a lot of LaTeX package features are in ConTeXt's core.
 +
 +
==Installation==
 +
 +
===Basics===
 +
 +
The installation of extra files in TeX (called modules in ConTeXt) can be hard
 +
for people how are new in TeX or aren't interested in TeX programming themselve.
 +
 +
According to the TDS (TeX directory structure) and the ConTeXt developers user
 +
written files reside under the path
 +
 +
  $TEXMF/tex/context/third/<modulename>/<files>
 +
 +
in the private TeX directory ($TEXMF), private directories can have the names
 +
 +
* texmf-local
 +
* texmf-extra
 +
* texmf-project
 +
 +
but there existence depend on the TeX distribution and texmf-local is the most
 +
common one.
 +
 +
===Installation by hand===
 +
 +
When you want to install a new module which is available as file only create
 +
the subdirectories in the way described above and place the file there, for
 +
modules which are available as zip files with precreated subdorectories you
 +
can unzip the archive in the top-level directory (e.g. texmf-local/) and all
 +
files are on the correct place.
 +
 +
After the files are placed at the right place you have to update TeX's database
 +
to let it know where it can find the files, this is done for MkII with
 +
 +
  mktexlsr (command name depends on the TeX distribution)
 +
 +
and for MkIV with
 +
 +
  context --generate
 +
 +
===ConTeXt minimals===
 +
 +
Users of the ConTeXt minimals dont't have to download the module files and unzip
 +
them in the local directory because they can use the 'first-setup' for this.
 +
 +
To install for example the simpleslides modules you write
 +
 +
  first-setup.sh --extras="t-simpleslides"
 +
 +
To install more modules at the same time write
 +
 +
  first-setup.sh --extras="t-simpleslides,t-french"
 +
 +
The complete list of availables modules in minimals is:
 +
 +
* f-urwgaramond
 +
* f-urwgothic
 +
* t-account
 +
* t-algorithmic
 +
* t-bib
 +
* t-bnf
 +
* t-chromato
 +
* t-cmscbf
 +
* t-cmttbf
 +
* t-construction-plan
 +
* t-degrade
 +
* t-fixme
 +
* t-french
 +
* t-games
 +
* t-gnuplot
 +
* t-layout
 +
* t-letter
 +
* t-lettrine
 +
* t-lilypond
 +
* t-mathsets
 +
* t-simplefonts
 +
* t-simpleslides
 +
* t-taspresent
 +
* t-tikz
 +
* t-typearea
 +
* t-typescripts
 +
* t-vim
 +
 +
===TeX Live===
 +
 +
{{Note | description required}}
 +
 +
The following modules are available:
 +
 +
* context-account
 +
* context-bnf
 +
* context-chromato
 +
* context-construction-plan
 +
* context-degrade
 +
* context-french
 +
* context-games
 +
* context-gnuplot
 +
* context-letter
 +
* context-lettrine
 +
* context-lilypond
 +
* context-mathsets
 +
* context-simpleslides
 +
* context-taspresent
 +
* context-typearea
 +
* context-vim
  
 
==Included modules:==
 
==Included modules:==

Revision as of 16:48, 7 September 2009

< The ConTeXt Way

Modules are extensions to ConTeXt's core functions.

There are not as many modules for ConTeXt as packages for LaTeX, because a lot of LaTeX package features are in ConTeXt's core.

Installation

Basics

The installation of extra files in TeX (called modules in ConTeXt) can be hard for people how are new in TeX or aren't interested in TeX programming themselve.

According to the TDS (TeX directory structure) and the ConTeXt developers user written files reside under the path

 $TEXMF/tex/context/third/<modulename>/<files>

in the private TeX directory ($TEXMF), private directories can have the names

  • texmf-local
  • texmf-extra
  • texmf-project

but there existence depend on the TeX distribution and texmf-local is the most common one.

Installation by hand

When you want to install a new module which is available as file only create the subdirectories in the way described above and place the file there, for modules which are available as zip files with precreated subdorectories you can unzip the archive in the top-level directory (e.g. texmf-local/) and all files are on the correct place.

After the files are placed at the right place you have to update TeX's database to let it know where it can find the files, this is done for MkII with

 mktexlsr (command name depends on the TeX distribution)

and for MkIV with

 context --generate

ConTeXt minimals

Users of the ConTeXt minimals dont't have to download the module files and unzip them in the local directory because they can use the 'first-setup' for this.

To install for example the simpleslides modules you write

 first-setup.sh --extras="t-simpleslides"

To install more modules at the same time write

 first-setup.sh --extras="t-simpleslides,t-french"

The complete list of availables modules in minimals is:

  • f-urwgaramond
  • f-urwgothic
  • t-account
  • t-algorithmic
  • t-bib
  • t-bnf
  • t-chromato
  • t-cmscbf
  • t-cmttbf
  • t-construction-plan
  • t-degrade
  • t-fixme
  • t-french
  • t-games
  • t-gnuplot
  • t-layout
  • t-letter
  • t-lettrine
  • t-lilypond
  • t-mathsets
  • t-simplefonts
  • t-simpleslides
  • t-taspresent
  • t-tikz
  • t-typearea
  • t-typescripts
  • t-vim

TeX Live


NOTE: description required

The following modules are available:

  • context-account
  • context-bnf
  • context-chromato
  • context-construction-plan
  • context-degrade
  • context-french
  • context-games
  • context-gnuplot
  • context-letter
  • context-lettrine
  • context-lilypond
  • context-mathsets
  • context-simpleslides
  • context-taspresent
  • context-typearea
  • context-vim

Included modules:

Contributed modules:

For a list of contributed modules see the modules section on contextgarden.net.


TODO: list more modules or none of them (See: To-Do List)


  • xdesc (extended description, e.g. for epigrams)
  • nath (natural math, see Math)
  • amsl (AMSmath, see Math)
  • Gnuplot: support for direct inclusion of Gnuplot graphs out of the source (the module has been removed from the main distribution and will be included into third party modules again when ready)

File names of included modules start with "m-", but third party (contributed) modules should start with "t-".

In order to install a contributed module, copy its directory into $TEXMF/tex/context/third then run luatools --generate.

Special Purpose Modules

The following modules implement special formatting requirement for journals or magazines. These modules are distributed with ConTeXt, so you need not download anything.

Modules writing guidelines

Prior to release 2005.05.25, ConTeXt silently truncated all file names in \usemodule commands to 8 characters long and lowercased them to "prevent cross platform problems with filenames". Thus, module files that are to be used with older versions of ConTeXt must have filenames that fit those restrictions, or they will (somewhat cryptically) not be found.


TODO

Each module should have an associated specification file (as in /tex/context/interface/cont-en.xml). Probably one day this will become a part of texshow and will also be easy-to-edit.

When documenting your module, you can use

\usemodule[int-load] %Allow xml parsing 
\loadsetups[m-name-of-your-module.xml] % to load the file with definitions
\setup{nameofyourcommand}

An example:

\usemodule[int-load]
\loadsetups
\setup{externalfigure}

By default, this places a frame around the setup. If you want to get gray backgroud, as in context documentation, add the following

 \setupframedtexts
     [setuptext]
     [background=screen,
      frame=off]