Changes

Jump to navigation Jump to search
2,091 bytes removed ,  17:46, 7 May 2023
new module installer script; restructuring & removing outdated information
Modules are extensions to ConTeXt's ConTeXt’s core functions.
There are not as many modules for ConTeXt as packages for LaTeX, because ConTeXt’s core already contains a lot of LaTeX that needs a package features are in ConTeXt's coreLaTeX.
=Installation=
* 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 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 pre-created subdirectories youcan unzip the archive in the top-level directory (e.g. texmf-local/) and allfiles are on the correct place.
After the Most modules consist of several files though and are placed at distributed as ZIP archives that contain the right place necessary TDS tree.These you have to update TeX's databaseto let it know where it can find unzip in the top-level directory (e.g. texmf-local/), and all files, this is done for MkII withshould be in the correct place.
mktexlsr (command name depends on After the TeX distribution) and for MkIV withfiles are installed, you must update ConTeXt’s database to let it know where it can find the files:
context --generate
==(ConTeXt standalone==doesn’t use `ls-R` files or `kpsewhich` any more.)
Users of the ConTeXt standalone ==Installation by script (formerly "minimals"LMTX) distribution don't have to download the module files and unzip them in the local directory, because they can use the <tt>first-setup</tt> script for this.==
To As of 2023-05-07, there’s a script for `mtxrun` to list and install for example modules, usually from https://modules.contextgarden.net. Some modules, get special treatment: For the simpleslides [[TikZ]] modules you writefiles are downloaded from CTAN and patches for incompatibilities are applied.
firstmtxrun -setup.sh -script install-modules="t-simpleslides"-list
To mtxrun --script install more -modules at the same time write--install --all
firstPreviously, the ConTeXt LMTX distribution did not provide a built-setupin 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 --modules="t-simpleslides,t-french"</tt>.
The complete list Because the final <tt>tex/texmf-modules</tt> must contain the union of availables all individual module directories, the commands create and leave an intermediate <tt>modules in standalone is:</tt> directory that wastes less than 50 MB.
* [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* [http://modules.contextgarden.net/t-lettrine t-lettrine] decorative paragraph starts (initials)* [http://modules.contextgarden.net/t-lilypond t-lilypond] include musical scores with GNU LilyPond* [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]].* t-pgfplots* [http://modules.contextgarden.net/ruby t-ruby] Ruby markup (for Chinese, not programming language)* [http://modules.contextgarden.net/simplefonts t-simplefonts] simplified font mechanism* [http://modules.contextgarden.net/simpleslides t-simpleslides] presentations* [http://modules.contextgarden.net/typearea t-typearea] like LaTeX/KoMa typearea* [http://modules.contextgarden.net/typescripts t-typescripts] collection of typescripts* [http://modules.contextgarden.net/urwgaramond t-urwgaramond]* [http://modules.contextgarden.net/urwgothic t-urwgothic]* [http://modules.contextgarden.net/vim t-vim] syntax highlighting using vim’s syntax files (some of these are obsolete...) ==ConTeXt LMTX== As of 2020-06-06, the ConTeXt LMTX distribution does not provide a built-in way to install or update modules. However, (something like) the following can be used to install and update all modules together with the rest of the distribution. The snippet must be run from the toplevel directory of the ConTeXt LMTX distribution, i.e. the directory that contains <tt>install.sh</tt>. Because the final <tt>tex/texmf-modules</tt> must contain the union of all individual module directories, the snippet creates and leaves an intermediate <tt>modules</tt> directory in the toplevel directory of the ConTeXt LMTX distribution. There may be a more clever way of using <tt>rsync</tt>, that does not need an intermediate directory. On the other hand, as of 2020-06-06, only 37MB of space are wasted.  # Transfer all modules from the ConTeXt Garden. # # No -p (--perms) is given to rsync, because, as of 2020-06-06, many # files (e.g. all files in # modules/t-letter/tex/context/third/letter/style) would come out # world-writeable, which may pose a significant security risk on a # multi-user system. # # The --chmod=D755,F644 may not be necessary. However, as of # 2020-06-06, without it files come out with executable bits set. rsync -rltsv --new-compress --delete --chmod=D755,F644 \ rsync://contextgarden.net/minimals/current/modules/ \ modules # Recreate tex/texmf-modules as an empty directory. WARNING: This # assumes that you have nothing but modules from ConTeXt Garden in # tex/texmf-modules. rm -rf tex/texmf-modules mkdir -p tex/texmf-modules # Create the union of all modules in tex/texmf-modules. for module in modules/* ; do rsync -rlts --exclude=/VERSION ${module}/ tex/texmf-modules done # Update the ConTeXt LMTX distribution. Alternatively, if you do not # want to do that, you have to run mtxrun --generate. sh ./install.sh Here is a simplified version of this procedure, tested with MacOS 10.15 on 2020-12-12. There doesn't seem to be any perm issues anymore.   # Synchronize all modules from the ConTeXt Garden in the directory 'modules'directory, which is created if it doesn't 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 doesn’t exist). # If you have personal modules in tex/texmf-modules, they won't won’t be modified.
mkdir -p tex
rsync -rlt --exclude=/VERSION --del modules/*/ tex/texmf-modules
# You may delete the 'modulemodules's directory to reclaim some space or keep it to speed up the next update.
# rm -rf modules
# Update the ConTeXt LMTX distributionfile database. # Alternatively, if you do not want to do that, you have to run mtxrun --generate  ==Installation by script (MkIV) == Users of the ConTeXt MkIV standalone can use the <tt>first-setup</tt> script to install modules: E.g. to install the simpleslides modules: sh ./installfirst-setup.sh--modules="t-simpleslides"
To install more modules at the same time:
 
first-setup.sh --modules="t-simpleslides,t-french"
==TeX Live==
TeX Live is a large TeX distribution for most Linux and BSD based 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-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 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>
=Contributed Modules=
For a list of contributed modules see [http://tlcontrib.metatex.org/ tlcontrib] and/or [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* [http://modules.contextgarden.net/t-lettrine t-lettrine] decorative paragraph starts (initials)* [http://modules.contextgarden.net/t-lilypond t-lilypond] include musical scores with GNU LilyPond* [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] {{todocmd|startParagraph|list 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]].* t-pgfplots* [http://modules or none .contextgarden.net/ruby t-ruby] Ruby markup (for Chinese, not programming language)* [http://modules.contextgarden.net/simplefonts t-simplefonts] simplified font mechanism* [http://modules.contextgarden.net/simpleslides t-simpleslides] presentations* [http://modules.contextgarden.net/typearea t-typearea] like LaTeX/KoMa typearea* [http://modules.contextgarden.net/typescripts t-typescripts] collection of them}}typescripts* [http://modules.contextgarden.net/urwgaramond t-urwgaramond]* [http://modules.contextgarden.net/urwgothic t-urwgothic]* [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]])
* [[Modules/Karnaugh|Karnaugh]]: 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=
* [[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)
-->
=Module writing guidelines=
==Module requirements==
While a module usually consists of one main file with a name like <tt>t-modulename.[tex|ctx|mkiv|mkxl]</tt>, there can be many more files, and there should be some documentation. Please sort adhere to the filename convention outlined in [#Usage]. Sort these files in into folders according to TDS (TeX directory structure) – just have a look at the distribution. BTW <tt>t-</tt> is for “third party” modules, that means everything that isn’t part of the distributionto understand what goes where.
=== 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 an 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 LICENSE file containing the text of an open source license of your choice.
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 adhere 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.
(as in [http://source.contextgarden.net/tex/context/interface/cont-en.xml /tex/context/interface/cont-en.xml]).
Its purpose is a comprehensive listing of the optional and non-optional
arguments that a macro accepted by macros defined in the module accepts
From the interface a 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]
</context>
By default, this places a frame around the setup. If you want to get gray background, as in the context ConTeXt documentation, add the followinga setup like:
<texcode>
</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]].
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>.
* [[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
[https://bitbucket.org/wolfs/simplefonts/src ''simplefonts'']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>
to get a <tt>t-simplefonts.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>
Which should generate a font-def.pdf in your current directory.
 
<!-- offline as of 2023-04
(The autogenerated documentation of all ConTeXt sources has been
made available by Luigi at [http://foundry.supelec.fr/gf/project/modules/].
Go there for examples of the output.)
-->
==Publication and maintenance==
* If you lost your password, please ask Taco or Mojca (via the mailing list if you don’t know them).
* Create a '''new module''' entry with a distinct name (e.g. prettyprinter“prettyprinter”) and fill in the metadata:
** Title, e.g. “My Pretty Printer”
** Short and longer description (the short one gets published e.g. in CTAN updates).
** Works with Mk... (please check)
** License
** Check Put “Put in download section section” (yes please, allows installation by rsync)** Check Put “Put in ConTeXt distribution distribution” (not sure if this works)** Check Synch “Synch with CTAN CTAN” (yes please, makes it visible)
** CTAN location: e.g. “<tt>/macros/context/contrib/context-prettyprinter</tt>”
** Comment: for you or the server admins

Navigation menu