Changes

Jump to navigation Jump to search
18,494 bytes added ,  11:39, 20 December 2023
Checkouts work now; hint about dev ML.
< [[The ConTeXt Way]]Modules are extensions to ConTeXt’s core functions.
Modules There are extensions to not as many modules for ConTeXt's as packages for LaTeX, because ConTeXt’s core functionsalready contains a lot that needs a package in LaTeX.
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=
==Installation== ===Basics===
The installation of extra files in TeX (called modules in ConTeXt) can be difficult
* texmf-project
but their existence depends on the TeX distribution; among these, texmf-local is the most common. ==Installation by hand== When you want to install a new single-file module, createthe subdirectories in the way described above and place the file there. Most modules consist of several files though and are distributed as ZIP archives that contain the necessary TDS tree.These you can unzip in the top-level directory (e.g. texmf-local/), and all files should be in the correct place. After the files are installed, you must update ConTeXt’s database to let it know where it can find the files:  context --generate (ConTeXt doesn’t use `ls-R` files or `kpsewhich` any more.) ==Installation by script (LMTX)== Since 2023-05, there’s a script for `mtxrun` to list and install modules, usually from https://modules.contextgarden.net. Some modules, get special treatment: For the [[TikZ]] modules files are downloaded from CTAN and patches for incompatibilities are applied. First, `cd` into the `tex` directory of your ConTeXt LMTX installation (above the texmf-* trees), the modules installer works only there.   mtxrun --script install-modules --list For the installation to work, you must change into the `tex` directory that contains the `texmf-*` trees.
===Installation by hand=== mtxrun --script install-modules --install filter simpleslides
When If you want list single modules to install a new module which is available as file only createthe subdirectories in the way described above and place the file there, formodules which are available as zip files with precreated subdorectories youcan unzip the archive in leave out the top-level directory prefix (e.g. texmft-local/* or whatever) and allfiles are on the correct place.!
After the files are placed at the right place But since there aren’t many, you have to update TeX's databaseto let it know where it can find the files, this is done for MkII withjust install all modules:
mktexlsr (command name depends on the TeX distribution)mtxrun --script install-modules --install --all
and for MkIV withPreviously, the ConTeXt LMTX distribution did not provide a built-in way to install or update modules. Here’s a method using `rsync`, to be run from the toplevel directory of the ConTeXt LMTX distribution, i.e. the directory that contains <tt>install.sh</tt>.
context Because the final <tt>tex/texmf--generatemodules</tt> must contain the union of all individual module directories, the commands create and leave an intermediate <tt>modules</tt> directory that wastes less than 50 MB.
# Synchronize all modules from ConTeXt Garden in the 'modules' directory, which is created if it doesn’t exist. rsync --recursive --links --times --info=progress2,remove,symsafe,flist,del --human-readable --del rsync://contextgarden.net/minimals/current/modules/ modules # Create the union of all modules in tex/texmf-modules (the directory is created if it doesn’t exist). # If you have personal modules in tex/texmf-modules, they won’t be modified. mkdir -p tex rsync -rlt --exclude==/VERSION --del modules/*/ tex/texmf-modules # You may delete the 'modules' directory to reclaim some space or keep it to speed up the next update. # rm -rf modules # Update the ConTeXt minimals===file database. mtxrun --generate
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==Installation by script (MkIV) ==
Users of the ConTeXt MkIV standalone can use the <tt>first-setup.sh --extras="t-simpleslides"</tt> script to install modules:
To E.g. to install more the simpleslides modules at the same time write:
first-setup.sh --extrasmodules="t-simpleslides,t-french"
The complete list of availables To install more modules in minimals isat the same time:
* t first-urwgaramond* tsetup.sh -account* t-algorithmic* modules="t-bnf* t-chromato* t-cmscbf* t-cmttbf* t-construction-plan* t-degrade* t-fixme* simpleslides,t-french* t-fullpage* t-games* t-gnuplot* t-layout* t-letter* t-lettrine* t-lilypond* t-mathsets* t-pgfplots* t-pgfplotstable* t-ruby* t-simplefonts* t-simpleslides* t-typearea* t-urwgaramond* t-vim* type-urwgothic* type-urwgaramond"
===TeX Live===
{{Note | description required}}TeX Live is a large TeX distribution for most common operating systems. It provides binaries and many other files necessary to run TeX and its flavors. Many ConTeXt modules are included.
<!--
The following modules are available:
* context-french
* context-games
* context-gantt
* context-gnuplot
* context-letter
* context-typearea
* context-vim
-->
==Usage==
When you load a module with <code>\usemodule[modulename]</code> ConTeXt looks for a file with the following names:
* m-modulaname modulename (core module)
* p-modulename (private module)
* s-modulename (ConTeXt style file)
* x-modulename (XML module)
* t-modulename (Third "third party " contributed module)
* modulename
Once a file is found , ConTeXt stops the search and loads the found file (only once).
When you have two file files with the same name but different prefixes , you can tell ConTeXt which file it should load with
<code>\usemodule[<prefix>][modulename]</code>
==Included modules:=Modules=* [[source:t-bib.tex|t-bib]]: [[Bibliography]] (maintained by Taco)* [[source:m-arabtex.tex|m-arabtex]]: loading as of Lagally's [[Arabian and Hebrew|ArabTeX]]* [[source:m2023-chart.tex|m09-chart]]: [[Flow Charts]]30* [[source:m-chemic.tex|m-chemic]]: [[Chemistry|PPCHTeX]] (chemical structure formulae)* [[source:m-cweb.tex|m-cweb]]: [[CWEB]] pretty printing* [[source:m-database.tex|m-database]]: creating simple tables (or forwarding data to user-defined commands) using [[m-database|comma/space/tab-separated values]]* [[source:m-dratex|m-dratex]]: loading of DraTeX* [[source:m-edtsnc.tex|m-edtsnc]]: support for editor synchronization, will replace m-pdfsync* [[source:m-educat.tex|m-educat]]: educational additions (for settings school tests or questionaires)* [[source:m-gamma.tex|m-gamma]]: [[Aleph|Omega]] support* [[source:m-graph.tex|m-graph]]: support for [[MetaPost]] graph module* [[source:m-layout.tex|m-layout]]: defines some [[Layout]] presets* [[source:m-level.tex|m-level]]: module for catching nesting errors* [[source:m-narrowtt.tex|m-narrowtt]]: using a narrower [[Latin Modern]] font for verbatim* [[source:m-newmat.tex|m-newmat]]: support for some AMSmath features, is loaded by [[Math with amsl|amsl]], see [[Math with newmat]]* [[source:m-pdfsnc.tex|m-pdfsnc]]: editor/PDF synchronization support (used by iTeXMac and TeXShop)* [[source:m-pictex.tex|m-pictex]]: needed for [[PicTeX]] without eTeX* [[source:m-plus.tex|m-plus]]: loads some extra features (currently empty)* [[source:m-pstric.tex|m-pstric]]: connection macros for [[PSTricks]] (PostScript tricks)* [[source:m-r.tex|m-r]]: typing and executing [http://www.r-project.org/ R] scripts* [[source:m-quest.tex|m-quest]]: module for fill-in forms (dutch only)* [[source:m-steps.tex|m-steps]]: Step Charts, see [[XML]] step charts* [[source:m-streams.tex|m-streams]]: Synchronised typesetting from different sources* [[source:m-subsub.tex|m-subsub]]: Defines 5 extra sectioning levels* [[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-units.tex|m-units]]: Structured input of values with [[units]]* [[source:m-visual.tex|m-visual]]: [[Visual Debugging]] (described in [[This Way]] no.7 [[magazine:0007|Faking Text and More]])==Macro modules==
==Contributed modules* {{code|x-asciimath}} ({{src|x-asciimath.mkxl}} etc.): Support for [http://asciimath.org/ ASCII math] input (used by [https://www.math4all.nl/ math4all])* {{code|m-asymptote}} ({{src|m-asymptote.mkiv}}): Inclusion of Asymptote code* {{code|m-barcodes}} ({{src|m-barcodes.mkiv}} {{src|m-barcodes.mkxl}}): generate [[Barcodes|barcodes]] using PStricks (MkIV), redirects to `m-zint` in LMTX.* {{code|x-calcmath}} ({{src|x-calcmath.mkxl}} {{src|x-calcmath.lmt}} etc.): calculator math syntax* {{code|x-cals}} ({{src|x-cals.mkiv}} {{src|x-cals.lua}}): XML cals table renderer* {{code|m-catchword}} ({{src|m-catchword.mkiv}}): show the first word of the next page in the footer (like in medieval manuscripts; Custode, Reklamante, Blatthüter)* {{code|m-chart}} ({{src|m-chart.lua}} {{src|m-chart.mkvi}}): [[Flow Charts]]* {{code|m-chemic}} ({{src|m-chemic.mkiv}}): dummy module, since [[Chemistry|PPCHTeX]] (chemical structure formulae) is now built in* {{code|x-chemml}} ({{src|x-.mkiv}} {{src|x-.lua}}): [[ChemML]] syntax support* {{code|m-circuitikz}} ({{src|m-circuitikz.mkiv}} {{src|m-circuitikz.mkxl}}):==drawing circuits with [[TikZ]]For * {{code|m-compatible}} ({{src|m-compatible.mkiv}}): compatibility for older versions (unattended since 2018)* {{code|m-crappyspec}} ({{src|m-crappyspec.mkxl}}): limit text to a list certain number of contributed modules characters per line* {{code|x-ct}} ({{src|x-ct.mkiv}} {{src|x-ct.lua}}): tabulate and combination structures in XML* {{code|m-cweb}} ({{src|m-cweb.mkiv}}): [[CWEB]] pretty printing* {{code|m-database}} ({{src|m-database.lua}} {{src|m-database.mkiv}}): creating simple tables (or forwarding data to user-defined commands) using comma/space/tab-separated values. Wiki: [[M-database]].* {{code|m-directives}} ({{src|m-directives.mkiv}}): just calls {{cmd|showdirectives}}* {{code|m-educat}} ({{src|m-educat.mkiv}}): educational additions (for settings school tests or questionaires)* {{code|x-entities}} ({{src|x-entities.mkiv}}): load character entities for HTML interpretation* {{code|m-escrito}} ({{src|m-escrito.mkiv}} {{src|m-escrito.lua}}): limited PostScript interpreter* {{code|m-examn}} ({{src|m-examn.mkiv}}): testing and examination in JavaScript (outdated)* {{code|m-fields}} ({{src|m-fields.mkiv}}): fill-in form field with JS check* {{code|m-format}} ({{src|m-format.mkiv}}): for formatting poetry (very old code)* {{code|x-foxet}} ({{src|x-foxet.mkiv}}): support for formatting objects, not usable* {{code|m-gimmicks}} ({{src|m-gimmicks.mkxl}}): “whatever comes up” (?)* {{code|m-gnuplot}} ({{src|m-gnuplot.mkxl}}): limited support for GNUplot via SVG* {{code|m-graph}} ({{src|m-graph.mkiv}} {{src|mp-grap.mpiv}}): support for [[MetaPost]] graph module* {{code|m-hemistich}} ({{src|m-hemistich.mkiv}}): hemistiches (half-line poetry)* {{code|x-html}} ({{src|x-html.mkiv}}): [[HTML|HTML_to_ConTeXt]] setup* {{code|m-ipsum}} ({{src|m-ipsum.mkiv}}): lorem ipsum filler text with options* {{code|m-json}} ({{src|m-json.mkiv}} {{src|m-json.mkxl}} {{src|util-jsn.lua}}): activates Lua functions to interprete JSON* {{code|m-layout}} ({{src|m-layout.mkiv}}): defines some [[Layout]] presets* {{code|x-ldx}} ({{src|x-ldx.mkiv}} {{src|x-ldx.ctx}} {{src|x-ldx.lua}}): Lua source code formatter* {{code|x-lmx-html}} ({{src|x-lmx-html.mkiv}} {{src|x-lmx-demo.mkiv}}): interpretation of filled-in HTML forms* {{code|m-logcategories}} ({{src|m-logcategories.mkiv}}): just calls {{cmd|showlogcategories}}* {{code|m-mathcrap}} ({{src|m-mathcrap.mkiv}}): use Unicode super-/subscripts in math (not recommended)* {{code|m-mathfun}} ({{src|m-mathfun.mkxl}}): “weird stuff” (?)* {{code|x-mathml}} ({{src|x-mathml.mkxl}} {{src|x-mathml.lmt}} {{src|x-mathml.mkiv}} {{src|x-mathml.lua}} {{src|x-mathml-basics.mkiv}}): [[MathML]] syntax support* {{code|x-mathml-html}} ({{src|x-mathml-html.mkiv}}): [[MathML]] syntax, support for some HTML tags* {{code|x-math-svg}} ({{src|x-math-svg.mkiv}} {{src|x-math-svg.lua}}): convert [[MathML]] to [[SVG]]* {{code|m-oldmath}} ({{src|m-oldmath.mkxl}}): support for some obsolete math commands like `\over`* {{code|m-matrix}} ({{src|m-matrix.mkiv}}): calculation and typsetting of [[Matrix_in_maths|matrices]]* {{code|m-maybe}} ({{src|m-maybe.mkiv}}): experimental code* {{code|m-media}} ({{src|m-media.mkiv}}): support for SWF and U3D (deactivated)* {{code|m-mkii}} ({{src|m-mkii.mkiv}}): re-activate some MkII font switches (no general MkII compatibility)* {{code|m-mkivhacks}} ({{src|m-mkivhacks.mkiv}}): temporary hacks* {{code|m-morse}} ({{src|m-morse.mkvi}}): convert text to Morse code and back* {{code|m-narrowtt}} ({{src|m-narrowtt.mkiv}}): using a narrower [[Latin Modern]] font for verbatim* {{code|m-nodechart}} ({{src|m-nodechart.mkvi}} {{src|m-nodechart.lua}}): extension for `m-chart` ([[Flow Charts]])* {{code|m-ntb-to-xtb}} ({{src|m-ntb-to-xtb.mkiv}}): map [[TABLE]] to [[xtables]]* {{code|m-obsolete}} ({{src|m-obsolete.mkiv}}): print obsolete module warning* {{code|m-old-columnsets}} ({{src|m-old-columnsets.mkiv}} {{src|page-set.mkiv}}): activates old [[Columns|columsets]] code* {{code|m-old-multicolumns}} ({{src|m-old-multicolumns.mkiv}} {{src|page-mul.mkiv}}): activates old [[Columns|multicolumn]] code* {{code|m-oldfun}} ({{src|m-oldfun.mkiv}}): old implementation of initials (drop caps) etc. (current: {{cmd|setupinitial}})* {{code|m-oldnum}} ({{src|m-oldnum.mkiv}}): old implementation of {{cmd|digit}}* {{code|m-openstreetmap}} ({{src|m-openstreetmap.mkxl}} {{src|m-openstreetmap.lmt}}): limited OSM XML renderer (no labels)* {{code|x-pandoc}} ({{src|x-pandoc.mkiv}}): Pandoc [[DocBook]] rendering (misleading name)* {{code|x-pfs-01}} ({{src|x-pfs-01.mkiv}}): [https://www.pfsense.org/ pfsense] status rendering* {{code|x-physml}} ({{src|x-physml.mkiv}}): [[PhysML]] syntax support* {{code|m-pictex}} ({{src|m-pictex.mkiv}}): [[PicTeX]] support for MkIV; not supported in LMTX any more* {{code|m-pipemode}} ({{src|m-pipemode.mkiv}}): disables directive `system.errorcontext` ({{cmd|disabledirective}})* {{code|m-polynomial}} ({{src|m-polynomial.mkxl}}): typesetting of polynomials* {{code|m-pstricks}} ({{src|m-pstricks.lua}} {{src|m-pstricks.mkiv}}): PStricks support for MkIV; not supported in LMTX any more* {{code|m-punk}} ({{src|m-punk.mkiv}}): support for the Punk metapost font* {{code|m-scite}} ({{src|m-scite.mkiv}}): syntax highlighting with [[Scite|SciTE]] lexers* {{code|x-setups}} ({{src|x-setups.mkiv}} etc.): load and typeset command syntax from interface files* {{code|m-simulate}} ({{src|m-simulate.mkiv}}): fake words, similar to `m-visual`’s {{cmd|fakewords}}* {{code|m-spreadsheet}} ({{src|m-spreadsheet.lua}} {{src|m-spreadsheet.mkiv}}): calculations in tables* {{code|m-sql}} ({{src|m-sql.mkiv}} {{src|util-sql.lua}}): access to SQL databases* {{code|m-steps}} ({{src|m-steps.lua}} {{src|m-steps.mkvi}} {{src|x-steps.mkiv}}): Step Charts, see [[XML]] step charts* {{code|m-subsub}} ({{src|m-subsub.tex}}): Defines subsections up to level 12; obsolete, part of the core* {{code|m-svg}} ({{src|m-svg.mkxl}}): auxiliary functions for [[SVG]] rendering via MetaPost* {{code|m-system-aliasing}} ({{src|m-system-aliasing.mkiv}}): support for file aliases incl. globbing (?)* {{code|m-system-readers}} ({{src|m-system-readers.mkxl}}): reading from files* {{code|m-three}} ({{src|m-three.mkiv}} {{src|mp-tres.mpiv}}): support for pseudo-3D projections with Metapost module `tres`* {{code|m-tikz}} ({{src|m-tikz.mkiv}} {{src|m-tikz.mkxl}}): [[TikZ]] support* {{code|m-tikz-pgfplots}} ({{src|m-tikz-pgfplots.tex}}): [[TikZ]] support* {{code|m-tikz-pgfplotstable}} ({{src|m-tikz-pgfplotstable.tex}}): [[TikZ]] support* {{code|m-timing}} ({{src|m-timing.mkiv}} {{src|m-timing.mkxl}}): where does TeX spend its processing time?* {{code|m-trackers}} ({{src|m-trackers.mkiv}}): just calls {{cmd|showtrackers}}* {{code|m-translate}} ({{src|m-translate.mkiv}}): text replacements* {{code|m-typesetting}} ({{src|m-typesetting.mkiv}}): sample pages for documentation (?)* {{code|x-udhr}} ({{src|x-udhr.mkiv}}): typeset the declaration of human rights in several languages as Unicode test files ([http://modulesunicode.contextgardenorg/udhr/ UDHR])* {{code|m-units}} ({{src|m-units.net mkiv}}): Structured input of values with [[units]]; obsolete, part of the modules sectioncore* {{code|m-visual}} ({{src|m-visual.mkiv}}): [[Visual Debugging]] (described in [[This_Way_-_My_Way#ThisWay|ThisWay]] no.7 [[magazine:0007|Faking Text and More]])* {{code|x-xfdf}} ({{src|x-xfdf.mkiv}}): support for XFDF (XML Forms Data Format, PDF form exports) files* {{code|m-zint}} ({{src|m-zint.mkiv}}): Generate [[Barcodes|barcodes] on contextgarden] using [http://www.netzint.org.uk zint]
<!--* {{todocode|list more modules or none of themm-}}({{src|m-.mkxl}}):* {{code|x-}} ({{src|x-.mkiv}} {{src|x-.lua}}):
these are outdated or part of the core:
* {{code|bibl-bib.lua}} ({{src|bibl-bib.mkiv}}): [[Bibliography]] (maintained by Taco)
* {{code|m-arabtex}} ({{src|m-arabtex.mkii}}): loading of Lagally's [[Arabian and Hebrew|ArabTeX]]
* {{code|m-datastrc}} ({{src|m-datastrc.tex}}):
* {{code|m-dratex}} ({{src|m-dratex.mkii}}): loading of DraTeX
* {{code|m-edtsnc}} ({{src|m-edtsnc.mkii}}): support for editor synchronization, will replace m-pdfsync
* {{code|m-level}} ({{src|m-level.mkii}}): module for catching nesting errors
* <strike>{{code|m-markdown}} ({{src|m-markdown.lua}} {{src|m-markdown.mkiv}}):</strike>
* {{code|m-newmat}} ({{src|m-newmat.tex}}): support for some AMSmath features, is loaded by [[Math with amsl|amsl]], see [[Math with newmat]]
* {{code|m-pdfsnc}} ({{src|m-pdfsnc.mkii}}): editor/PDF synchronization support (used by iTeXMac and TeXShop)
* <strike>[[source:m-quest.tex|m-quest]]: module for fill-in forms
* (dutch only)</strike>
* {{code|m-r}} ({{src|m-r.tex}}): typing and executing [http://www.r-project.org/ R] scripts
* {{code|m-streams}} ({{src|m-streams.tex}}): Synchronised typesetting from different sources
* {{code|m-tex4ht}} ({{src|m-tex4ht.mkii}}): convert a ConTeXt document to html, more about it on [[tex4ht]]
-->
 
==Style modules==
 
in `texmf-context/tex/context/modules/common`:
* {{code|s-cdr-00.tex}}: CD-ROM cover style
* {{code|s-faq-00.tex}} to `-03`: FAQ styles
* {{code|s-pre-00.tex}} to `-96`: Several old presentation styles (replaced by the following)
 
in `texmf-context/tex/context/modules/mkiv`:
* {{code|s-present-*.tex}}: Several presentation styles (examples in `texmf-context/doc/context/presentations/examples`)
 
… many more …
 
=Contributed Modules=
For a list of contributed modules see [http://modules.contextgarden.net the modules section] on contextgarden.net:
 
* [http://modules.contextgarden.net/account t-account] draw T-accounts
* [http://modules.contextgarden.net/algorithmic t-algorithmic] like LaTeX algorithmic
* [http://modules.contextgarden.net/animation t-animation] create animations
* [http://modules.contextgarden.net/annotation t-annotation] todo lists
* [http://modules.contextgarden.net/t-bnf t-bnf] BNF grammar
* [http://modules.contextgarden.net/chromato t-chromato] chromatograms
* [http://modules.contextgarden.net/cmscbf t-cmscbf] bold small caps
* [http://modules.contextgarden.net/cmttbf t-cmttbf] bold typewriter
* [http://modules.contextgarden.net/t-construction-plan t-construction-plan] figures with defined scale
* [http://modules.contextgarden.net/t-degrade t-degrade] degrading JPEG images
* [http://modules.contextgarden.net/fancybreak t-fancybreak] thought breaks
* [http://modules.contextgarden.net/filter t-filter] run external programs on inline code
* [http://modules.contextgarden.net/fixme t-fixme] like LaTeX fixme
* [http://modules.contextgarden.net/t-french t-french]
* [http://modules.contextgarden.net/fullpage t-fullpage]
* [http://modules.contextgarden.net/games t-games] board games
* [http://modules.contextgarden.net/gantt t-gantt] Gantt charts
* [http://modules.contextgarden.net/gnuplot t-gnuplot] include GNUplot graphics
* [http://modules.contextgarden.net/t-layout t-layout]
* [http://modules.contextgarden.net/letter t-letter] formal letters AKA correspondence
* [http://modules.contextgarden.net/t-lettrine t-lettrine] decorative paragraph starts (initials)
* [http://ctan.org/pkg/markdown t-markdown] render markdown documents
* [http://modules.contextgarden.net/mathsets t-mathsets] mathematical sets, probabilities etc.
* [http://modules.contextgarden.net/pararef t-pararef] {{cmd|startParagraph|link=no}}, for paragraphs as ‘thought blocks’ that may contain more than one 'TeX paragraph'. These paragraphs are numbered and can be referenced. See [[Paragraph Referencing]].
* [http://modules.contextgarden.net/ruby t-ruby] Ruby markup (for Chinese, not programming language)
* [http://modules.contextgarden.net/simpleslides t-simpleslides] presentations
* [http://modules.contextgarden.net/typearea t-typearea] like LaTeX/KoMa typearea (MkII)
* [http://modules.contextgarden.net/vim t-vim] syntax highlighting using vim’s syntax files
 
<!--
* [[Extended description|xdesc]] (extended description, e.g. for epigrams)
* [[Math with nath|nath]] (natural math, see [[Math]])
* [[Math with amsl|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)
* [[Gantt chartsModules/Karnaugh|Karnaugh]] (drawing Gantt charts): draws Karnaugh maps 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 <code>$TEXMF/tex/context/third</code> then run <code>luatools --generate</code>.
==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/This Way - My Way#MyWay|MyWayMy Way]] , User documentation on ConTeXt* `cgj` Articles for ConTeXt Journal (proceedings of ConTeXt meetings)
* [[Modules/Pracjourn|pracjourn]] Articles for [http://tug.org/pracjourn/ The PracTeX Journal]
* [[Modules/Maps|maps]] Articles for [http://www.ntg.nl/maps.html MAPS], the publication of NTG (Nederlandstalige TeX Gebruikersgroep or Netherlands TeX Group)
==Modules Module writing guidelines==
Prior to release 2005'''Please don’t publish font support modules any more!''' They’re usually unnecessary.05.25, ConTeXt silently truncated all file names Instead publish [[Typescripts_examples|typescripts]] in <cmd>usemodule</cmd> 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 foundthe wiki instead.
All modules should start with a block containing meta information about that module. There is a[[module template]] available to help setting that up correctly.==Module requirements==
While a module usually consists of one main file with a name like <btt>TODOt-modulename.[tex|ctx|mkiv|mkxl]</btt>, there can be many more files, and there should be some documentation. Please adhere to the filename conventions outlined in [#Usage].
Sort these files into folders according to TDS (TeX directory structure) – just have a look at the distribution to understand what goes where. * Module code and data files go into tex/context/third/modulename* Documentation files go into doc/context/third/modulename* You can also look at properly setup git repositories like that of [https://codeberg.org/fiee/context-simpleslides the simpleslides module]. === Module release file === * A release file is a ZIP archive that contains the necessary files in a TDS compliant structure.* The filename should be <code>t-modulename-version.zip</code>, where the version is usually a date like <tt>YYYY.MM.DD</tt> (but that’s up to you).* On the top level there must be a VERSION file that only contains your version string.* On the top level there should be a README(|.md|.txt) file with some metadata like a short description and author info.* On the top level there can be a LICENSE file containing the text of an open source license of your choice, if the license is not included in the README.* On the top level there must NOT be a folder with the module name, but only TDS folders like "doc" and "tex". The same applies for git/SVN repositories containing ConTeXt modules. VERSION and README files are important for publication on [https://ctan.org CTAN]. README is also displayed on git platforms like GitHub or Codeberg and should contain basic documentation. All top level files are ignored by the LMTX module installer. Instead of zip files, also tar.gz archives are possible, but the installer script can only handle zip – libzip is a necessary part of Lua(Meta)TeX, while other archive formats are not. === Module main file === All module files should start with a block containing ''meta information'' about that module.There is a [[Module template]] available to help setting up that header correctly. === License === Do not forget to specify a ''license'' as the permitted modes of distributiondepend on which one you choose.The [http://wiki.contextgarden.net/Read_Me#The_Code ConTeXt sources] are licensedeither under GPLv2 or the LPPL, so you might want to stick to these or a more permissivelicense.(Choose one: [http://www.opensource.org/].)Including the full text of your license in your source repo is best practice. In order to avoid ''conflicting macros'' it is essential for a module that it adheres to the [[Module_Namespaces|namespace convention]].After releasing a module its namespace[s] should be registered in the [[Module_Namespaces#List_of_Module_Namespaces|list]] for other module authors to know. ==XML Interface file== Each module should have an associated XML specification file (as in [http://source.contextgarden.net/tex/context/interface/cont-en.xml /tex/context/interface/cont-en.xml]). Probably one day this will become Its purpose is a comprehensive listing of the optional and non-optionalarguments accepted by macros defined in the module. From the interface a part good deal of documentation can be auto-generated,as are for instance the [http://pragma-ade.nl/general/qrcs/setup-en.pdf ConTeXt Quick Reference]and the initial input of the [http://texshowwiki.contextgarden.net/ texshowCategory:Reference/en Command Reference] and will also be easy-to-edit,which itself started as a wikification of the now obsolete ''TeXshow''.
When documenting your module, you can use
<texcode>
\usemodule[intsetups-loadbasics] %Allow xml parsing \loadsetups[mt-name-of-your-module.xml] % to load the file with definitions
\setup{nameofyourcommand}
</texcode>
An example:
<context source="yes">
\setuppapersize[A5]\usemodule[intsetups-loadbasics]\loadsetups[i-framed]\setup{externalfiguresetupframed}
</context>
By default, this places a frame around the setup. If you want to get gray backgroudbackground, as in context the ConTeXt documentation, add the followinga setup like:
<texcode>
\setupframedtexts
[setuptext]
[background=screencolor, backgroundcolor=lightgray,
frame=off]
</texcode>
 
Apart from the existing XML files in the ConTeXt tree, there is little
documentation online, so feel free to relay your questions to
the [[Mailing list|mailing list]].
 
==Self-documenting source code==
 
Source files are supposed to contain explanatory comments that document
implementation details and other peculiarities the reader should be
aware of.
 
In <tt>.tex</tt> files (and other files containing primarily TeX code, e.g.
<tt>.mki[iv]</tt>) any line beginning with the comment leader <tt>%D</tt>
will be treated as such a docstring.
Formatting is done via ordinary TeX commands.
 
In Lua files (e.g. <tt>.cld</tt>) multi-line comments start with
<tt>--[[ldx--</tt> and end with <tt>--ldx]]--</tt>.
Text inside those delimiters can be formatted using basic ''HTML'' tags.
Ordinary comments are still treated as part of the source and therefore
they will be typeset inside the listing.
 
Docstrings, though they appear to the [Lua]TeX interpreter as ordinary
comments, allow for pretty printing source code when used with two
dedicated modules:
* [[source:x-ldx.ctx|<tt>x-ldx.ctx</tt>]] for Lua files, and
* [[source:s-mod.ctx|<tt>s-mod.ctx</tt>]] for TeX files.
 
Thus, in order to generate the documentation for the hypothetical
''simple'' module you first have to `chdir` to the <tt>files</tt> subdirectory of
your checkout.
 
Next you run the pretty printer on its main file
<pre>
context --ctx=s-mod t-simple.tex
</pre>
to get a <tt>t-simple.pdf</tt> which contains the &ndash; sparse
&ndash; annotations in serif and the actual code as colorful listing.
 
Likewise the processing of Lua code, e.g. <tt>[[source:font-def.lua|font-def.lua]]</tt> from
the main ConTeXt tree:
<pre>
context --ctx=x-ldx font-def.lua
</pre>
Which should generate a font-def.pdf in your current directory.
 
==Publication and maintenance==
 
* Please upload your module(s) to https://modules.contextgarden.net! Our server scripts handle distribution for ConTeXt and CTAN.
* Register an account, then you can login to the “member section”.
* If you lost your password, please ask Taco or Mojca (via the mailing list if you don’t know them).
* Please read the help page (it’s mostly the same as here).
 
* Create a '''new module''' entry with a distinct name (e.g. “simple”; this will become the internal ID) and fill in the metadata:
** Title, e.g. “Simple” (This will get used in filenames!)
** Short and longer description (the short one gets published e.g. in CTAN updates).
** Home URL, if the module has a homepage, e.g. a wiki page or git repository.
** Keywords (for CTAN search)
** Type: Macro or font (Please don’t publish font modules any more!)
** Works with Mk... (please check)
** License (there are licenses missing, we need to fix that)
** Check “Put in download section” (yes please, allows installation by script)
** Check “Put in ConTeXt distribution” (not sure if this works)
** Check “Synch with CTAN” (yes please, makes it visible)
** CTAN location: e.g. “<tt>/macros/context/contrib/context-simple</tt>”
** Comment: for you or the server admins
* Create a '''new module version''' from a ZIP upload/download or checkout from SVN or git
** Log message: short information about changes in this version
** Version: usually YYYY.MM.DD, but up to you
** File upload / HTTP download URL: release file as ZIP, as outlined above
** SVN/GIT URL: repository checkout, structured like the ZIP, as outlined above
 
As an module author, it makes sense to subscribe to the [https://mailman.ntg.nl/mailman3/lists/dev-context.ntg.nl/ developers mailing list].

Navigation menu