Difference between revisions of "Modules"

From Wiki
Jump to navigation Jump to search
(→‎Modules writing guidelines: Using xml specification file to show command setup)
m (→‎Included modules:: link to the new preliminary page)
Line 31: Line 31:
 
* [[source:m-streams.tex|m-streams]]: Synchronised typesetting from different sources
 
* [[source:m-streams.tex|m-streams]]: Synchronised typesetting from different sources
 
* [[source:m-subsub.tex|m-subsub]]: Defines 5 extra sectioning levels
 
* [[source:m-subsub.tex|m-subsub]]: Defines 5 extra sectioning levels
* [[source:m-tex4ht.tex|m-tex4ht]]: will become a tex4html interface for ConTeXt
+
* [[source:m-tex4ht.tex|m-tex4ht]]: convert a ConTeXt document to html, more about it on [[tex4ht]]
 
* [[source:m-tryout.tex|m-tryout]]: Contains temporary functions for testing
 
* [[source:m-tryout.tex|m-tryout]]: Contains temporary functions for testing
 
* [[source:m-units.tex|m-units]]: Structured input of values with [[units]]
 
* [[source:m-units.tex|m-units]]: Structured input of values with [[units]]

Revision as of 06:07, 27 August 2006

< 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.

Included modules:

Contributed modules:

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

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

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]