https://wiki.contextgarden.net/api.php?action=feedcontributions&user=SudipSinha&feedformat=atomWiki - User contributions [en]2024-03-28T15:49:54ZUser contributionsMediaWiki 1.34.1https://wiki.contextgarden.net/index.php?title=ConTeXt_Standalone&diff=24284ConTeXt Standalone2019-08-20T23:20:22Z<p>SudipSinha: /* Updating */</p>
<hr />
<div>{{Installation navbox}}<br />
<br />
The '''ConTeXt suite''' is a complete, up-to-date ConTeXt distribution that can be upgraded efficiently. It can also be used in parallel with existing TeX installations such as MikTeX, TeXLive, and so forth. The suite does not include LaTeX packages and binaries.<br />
<br />
Sometimes ConTeXt beta releases have issues. The ConTeXt suite allows you to test the latest ConTeXt release without worrying whether upgrading will corrupt a critical project. Multiple ConTeXt suite installations are possible. This allows, for example, a stable version and a beta version to run in parallel on the same computer.<br />
<br />
ConTeXt is also included in TeXlive. The ConTeXt suite is updated continuously, whereas ConTeXt in TeXlive is updated less often. In particular, <code>luatex</code> and <code>metapost</code> are under active development and their binaries are updated frequently. ConTeXt follows these developments, indeed often drives development. As the binaries included in the TeXlive distribution are only updated yearly, ConTeXt on TeXlive will necessarily be less current than the ConTeXt suite. The ConTeXt suite is self-contained and can happily coexist alongside another installed TeX distribution.<br />
<br />
{{TOClimit|limit=1}}<br />
<br />
= General Information =<br />
<br />
== Supported platforms ==<br />
<br />
{| style="border:1px solid #DDDDDD;"<br />
|- align="left" <br />
! Platform<br />
! Short name<br />
! Notes<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Windows<br />
| mswin<br />
| from [http://w32tex.org W32TeX]<br />
|- align="left"<br />
! Windows/CygWin<br />
| cygwin<br />
| same binaries as mswin<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Windows, 32 bit<br />
| win32<br />
| Alias for mswin<br />
|- align="left"<br />
! Windows, 64 bit<br />
| win64<br />
| <br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Linux, 32-bit<br />
| linux<br />
| Debian 8<br />
|- align="left"<br />
! Linux, 64-bit<br />
| linux-64<br />
| Debian 8<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Linux, ARM (low end.)<br />
| linux-arm<br />
| Raspbian 8<br />
|- align="left"<br />
! Linux, musl<br />
| linuxmusl-64<br />
| Alpine<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Mac OS X, Intel (64-bit)<br />
| osx-64<br />
| Mac OS X 10.6<br />
|- align="left"<br />
! FreeBSD, 32-bit<br />
| freebsd<br />
|<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! FreeBSD, 64-bit<br />
| freebsd-amd64<br />
|<br />
|- align="left"<br />
! OpenBSD 6.4, 32-bit<br />
| openbsd6.4<br />
|<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! OpenBSD 6.4, 64-bit<br />
| openbsd6.4-amd64<br />
|<br />
|- align="left"<br />
! OpenBSD 6.5, 32-bit<br />
| openbsd6.5<br />
|<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! OpenBSD 6.5, 64-bit<br />
| openbsd6.5-amd64<br />
|<br />
|- align="left"<br />
! Solaris, Intel<br />
| solaris-intel<br />
| Solaris 10 on [http://www.opencsw.org/about/ OpenCSW]<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Solaris, Sparc<br />
| solaris-sparc<br />
| Solaris 10 on [http://www.opencsw.org/about/ OpenCSW]<br />
|}<br />
<br />
* If you run into problems installing, check the available architectures in the minimal’s [http://minimals.contextgarden.net/setup/ setup folder]!<br />
* OpenBSD 6.4 binaries are compiled but are missing in the setup folder ATM (2019-07)<br />
<br />
If you want to support a new platform, please write to the [[ConTeXt Mailing Lists]]<br />
<br />
== Dependencies ==<br />
* Rsync (The windows binary of rsync is distributed within the suite)<br />
<br />
<br />
The following programs are not required for running ConTeXt, but their installation adds additional functionality.<br />
<br />
* curl : for including remote content<br />
* ghostscript : for converting PostScript images to PDF<br />
* graphicsmagick (convert) : for converting GIF and TIFF images<br />
* inkscape : for converting SVG and compressed SVG<br />
* mupdf (mudraw) : for converting PDF to PNG (used for ePub covers)<br />
* pstoedit : for converting PostScript to MetaPost outlines<br />
* zint : for providing barcodes<br />
* zip or 7zip : for EPUB generation<br />
<br />
== Disc space required ==<br />
ConTeXt macro files are small (less than 10MB), but the suite comes with various free fonts which considerably increase the size of the distribution to around 200MB).<br />
<br />
== Multiple instances of the installation ==<br />
Please note from the start that we recommend installing a complete ConTeXt installation for each project in a production environment. The installation tree is portable (see Moving the Installation Around, below) and can be located under the project's own directory. The advantage is to allow each project to use an instance of ConTeXt that is adapted to its coding and that only gets updated purposely. Since the ConTeXt Standalone is "bleeding edge" and subject to development, certain details in commands, syntax or rendering may evolve slightly. Having a vintage ConTeXt tree for each production project insures that one can come back years later and produce identical results.<br />
<br />
So as not to get carried away under this approach, one can eventually group projects by vintage, period or season, according to cycles of productivity.<br />
<br />
== Standalone ==<br />
<br />
* [[ConTeXt Standalone/FAQ|Standalone/FAQ]] <br />
* [[ConTeXt Standalone/Structure|Standalone/Structure]] <br />
* [[ConTeXt Standalone/Implementation|Standalone/Implementation]]<br />
* [[ConTeXt Standalone/TODO|Standalone/TODO]] <br />
* [[ConTeXt Standalone/Contents|Standalone/Contents]] <br />
* [[ConTeXt Standalone/TeX Live|Standalone/TeX Live]]<br />
* Browse the [http://minimals.contextgarden.net installation tree]<br />
<br />
<br />
<br />
= Unix-like platforms (Linux/MacOS X/FreeBSD/Solaris) =<br />
<br />
For Mac installation see also [http://wiki.contextgarden.net/Mac_Installation Mac installation page].<br />
<br />
== Single user installation ==<br />
<br />
Select a folder where you want to install ConTeXt. We recommend that you can use your <code>$HOME/context</code> directory. Create this folder. Then download and place it in <code>$HOME/context</code> directory. Open a terminal, then:<br />
<br />
<pre><br />
mkdir ~/context<br />
cd ~/context<br />
wget http://minimals.contextgarden.net/setup/first-setup.sh<br />
<br />
# Install the latest beta of ConTeXt<br />
# This takes a long time, so go have a coffee<br />
# Flags you can add to the first-setup.sh call:<br />
# --modules=all # Install all third-party modules<br />
# --context=current # Install latest stable version<br />
# --engine=luatex # Install only MkIV, leave out MkII<br />
# # This shrinks the install from 270 MB to 200 MB<br />
<br />
sh ./first-setup.sh --modules=all<br />
</pre><br />
<br />
== System-wide installation ==<br />
<br />
A system wide installation is recommended for users who are comfortable with the command line. Only the location of installing ConTeXt is different for a system wide installation.<br />
<br />
* on Linux you can use <code>/opt/context</code><br />
* on MacOS X you can use <code>/Applications/ConTeXt</code><br />
<br />
Note that, at present, while ''using'' MkIV, you need to have write permissions for the <code>$TEXMFCACHE</code> directory. This effectively means that only one user will be able to generate the formats unless you set the group permissions appropriately. For example:<br />
<br />
* <code>CONTEXT_HOME=/opt/context</code><br />
* <code>TEXMFCACHE=$CONTEXT_HOME/tex/texmf-cache</code><br />
* <code>chmod -R g+w $TEXMFCACHE</code><br />
<br />
<pre><br />
# Create the /opt/context directory -- change as appropriate or desired if you <br />
# want a different installation directory.<br />
cd /opt<br />
mkdir context<br />
<br />
cd context<br />
<br />
# Fetch the install script<br />
wget http://minimals.contextgarden.net/setup/first-setup.sh<br />
<br />
# Install the latest beta of ConTeXt<br />
# This takes a long time, so go have a coffee<br />
# Flags you can add to the first-setup.sh call:<br />
# --modules=all # Install all third-party modules<br />
# --context=current # Install latest stable version<br />
# --engine=luatex # Install only MkIV, leave out MkII<br />
# # This shrinks the install from 270 MB to 200 MB<br />
<br />
sh ./first-setup.sh --modules=all<br />
<br />
# change ownership to real rather than effective id<br />
chown -R `id -r -u`:`id -r -g` .<br />
</pre><br />
<br />
===Cache===<br />
<br />
To customize the cache directory and other options, see the [[Custom_Configuration|Custom Configuration]] page.<br />
<br />
===Font Directory===<br />
<br />
Add the OSFONTDIR into ./tex/setuptex. Go to under the line:<br />
<br />
# TODO: we could set OSFONTDIR on Mac for example<br />
<br />
(if you don't have the line above, go to the end of the file) and add there:<br />
<br />
export OSFONTDIR="/usr/local/share/fonts;$HOME/.fonts"<br />
<br />
For more information: [[Fonts in LuaTeX]]<br />
<br />
== Apache webserver installation ==<br />
<br />
Another common usecase is invoking ConTeXt from within a web application. Because web directories are often self-contained, and in the case of Apache under Ubuntu, ownership of the directory and its contents are assigned to a user and group without a login shell, e.g., <code>www-data:www-data</code> this prevents a web application from invoking a ConTeXt installation done using either the single-user or system-wide method listed above.<br />
<br />
In this case the solution is to install ConTeXt within the website tree, and ideally in the public sub-tree. The public sub-tree is commonly the home directory for the application and relative pathnames are resolved as if immediately below it.<br />
<br />
For example, in the case of the PHP web framework Laravel, ConTeXt can be installed alongside other assets in the <path-to-document-root>/public/context directory:<br />
<br />
<pre><br />
cd <path-to-document-root>/public<br />
mkdir context<br />
cd context<br />
wget http://minimals.contextgarden.net/setup/first-setup.sh<br />
<br />
# Install the latest beta of ConTeXt<br />
# This takes a long time, so go have a coffee<br />
# Flags you can add to the first-setup.sh call:<br />
# --modules=all # Install all third-party modules<br />
# --context=current # Install latest stable version<br />
# --engine=luatex # Install only MkIV, leave out MkII<br />
# # This shrinks the install from 270 MB to 200 MB<br />
<br />
sh ./first-setup.sh --modules=all<br />
</pre><br />
<br />
Once installed, you need to ensure that the permissions are correct for Apache to be able to access it (you will either need <code>sudo</code> privileges or root access):<br />
<br />
<pre><br />
$ cd <path-to-document-root>/public<br />
$ sudo chmod -R www-data:www-data context<br />
</pre><br />
<br />
Now as part of your application's invocation of ConTeXt, you will need to set up the shell environment. This is easily done by creating a simple BASH shell script, also to be installed in the public part of the document tree:<br />
<br />
<pre><br />
#!/usr/bin/env bash<br />
<br />
#<br />
# proccontext.sh<br />
#<br />
# To be installed in <path-to-document-root>/public/bin<br />
<br />
. <path-to-document-root>/public/context/tex/setuptex <path-to-document-root>/public/context/tex<br />
<br />
cd tex/spool<br />
context $1 > /tmp/context_run.log<br />
</pre><br />
<br />
Here the dynamically generated ConTeXt source file is expected to be found in the <code><path-to-document-root>/tex/spool</code> directory.<br />
<br />
Now within your application, you can invoke this shell script (in this case using PHP):<br />
<br />
<pre><br />
$cmd = "bin/proccontext.sh $input_filename";<br />
$last_line = system($cmd, $ret_val);<br />
</pre><br />
<br />
And the output will once again be found in <code><path-to-document-root>/tex/spool</code>.<br />
<br />
==Arch Linux==<br />
There’s a [https://aur.archlinux.org/packages/context-minimals-git PKGBUILD] in<br />
the AUR, provided by Aditya [https://github.com/adityam/context-pkgbuild].<br />
Install it using your favorite AUR frontend, e.g.<br />
<br />
<pre><br />
yaourt -S context-minimals-git<br />
</pre><br />
<br />
This will get you a fresh, up-to-date Context tree in<br />
<tt>/opt/context-minimals</tt>.<br />
<br />
== The funtoo way ==<br />
<br />
If you are using [http://funtoo.org funtoo] there are ebuilds that will make an installation as easy as installing any other package from portage. Take a look at the [[ConTeXt Standalone Funtoo]] Howto. This might also work for [http://www.gentoo.org gentoo], but is untested right now.<br />
<br />
== Proxy settings ==<br />
<br />
The installation script uses <code>rsync</code> to fetch the required files. So, if you are behind a proxy server, you need to tell the details to rsync. The easiest way to set this is to set <code>RSYNC_PROXY</code> variable in the terminal or your startup script (<code>.bashrc</code> or the corresponding file for your shell). Replace username, password, proxyhost and proxyport with the correct information<br />
<br />
export RSYNC_PROXY=username:password@proxyhost:proxyport<br />
<br />
Sometimes, when behind a firewall, port 873 may be closed for outgoing TCP connections. If port 22 is open for ssh connections, a trick that can be used is to connect to a computer located somewhere outside of the firewall and to tunnel port 873 (using the program <code>nc</code>).<br />
<br />
export RSYNC_CONNECT_PROG='ssh tunnelhost nc %H 873'<br />
<br />
where <code>tunnelhost</code> is the machine outside of the firewall on which you have <code>ssh</code> access. Of course, this machine must have <code>nc</code> and port 873 open for outgoing TCP connections.<br />
<br />
== Usage ==<br />
<br />
ConTeXt suite works in a non-interfering manner because it does not put anything in your <code>$PATH</code> and does not set any system variables. This in turn means that in order to use it, you need to do some initialization. An intialization script called <code>setuptex</code> is provided in <code>installation-dir/tex/</code>. <br />
<br />
=== Terminal/Command line ===<br />
<br />
To run context from a terminal, source <code>setuptex</code>:<br />
<br />
source /installation-dir/tex/setuptex<br />
<br />
=== Exclusive usage ===<br />
<br />
If you always use ConTeXt suite and '''never''' use LaTeX or plain TeX provided by another TeX distribution, you can add the following line to the startup script of your shell (For bash, the startup script is <code>$HOME/.bashrc</code>; for zsh it is <code>HOME/.zshrc</code>).<br />
<br />
source /installation-dir/tex/setuptex<br />
<br />
Then <code>setuptex</code> will always be sourced in your terminal.<br />
<br />
=== Integrating with an editor ===<br />
<br />
The easiest way to run ConTeXt from an editor is to open a terminal, source {{code|setuptex}} in the terminal, and then open your editor '''from the same terminal'''. <br />
<br />
Another option is to add {{code|/installation-dir/tex/texmf-<platform>/bin}} to the {{code|$PATH}} that the editor searches. The details vary depending on the editor. See [[Text Editors]] for instructions on integrating ConTeXt with various editors. <br />
<br />
For information about configuring [http://smultron.sourceforge.net/ Smultron] and [http://www.uoregon.edu/~koch/texshop/obtaining.html TeXShop] (which are popular TeX editors on Mac) see [[ConTeXt Standalone/Mac Installation]].<br />
<br />
<br />
== Updating ==<br />
<br />
For updating the ConTeXt suite, <br />
first update <code>first-setup.sh</code>, then run it. You could<br />
also create an alias or a little script “ctx-update”<br />
with the following example contents:<br />
<pre><br />
cd /opt/context<br />
rsync -ptv rsync://contextgarden.net/minimals/setup/first-setup.sh .<br />
sh ./first-setup.sh --modules=all<br />
</pre><br />
<br />
To update retain currently-installed modules:<br />
<pre><br />
sh ./first-setup.sh --keep<br />
</pre><br />
<br />
== Uninstalling ==<br />
<br />
ConTeXt suite does not touch anything outside its installation folder. So to uninstall it, you can simply remove the installation folder.<br />
<br />
== Remaking formats ==<br />
<br />
Normally, the update script should create the formats for you. If for some reason you need to recreate the formats, you can do the following:<br />
<br />
* For making MKII format.<br />
<br />
mktexlsr<br />
texexec --make --all <br />
<br />
* For making XeTeX format<br />
<br />
mktexlsr<br />
texexec --make --xtx --all <br />
<br />
* For making MKIV format<br />
<br />
mtxrun --generate<br />
context --make<br />
<br />
= Windows =<br />
<br />
If you want to use ConTeXt suite alongside MikTeX/TeXLive (needed if you also run LaTeX), follow the command-line installation method. <br />
<br />
== Installation ==<br />
<br />
=== Command line method ===<br />
Download [http://minimals.contextgarden.net/setup/context-setup-mswin.zip context-setup-mswin.zip] or [http://minimals.contextgarden.net/setup/context-setup-win64.zip context-setup-win64.zip], and unzip to a directory where you want to install ConTeXt. It is recommended that you choose a directory that does not have a space in its full path. Then open <code>cmd.exe</code>, go to the installation directory and run<br />
<br />
first-setup.bat<br />
<br />
This takes a long time, so go have a coffee. <br />
<br />
By default, the suite installs ConTeXt beta. If you want the stable version of ConTeXt, you can use <br />
<br />
first-setup.bat --context=current<br />
<br />
By default, the suite does ''not'' install modules and other third party content. If you want the modules (and have the bandwidth), you can use<br />
<br />
first-setup.bat --modules=all<br />
<br />
<br />
If the above installation instructions don't seem to answer your questions, see page [[Windows_Installation:_ConTeXt_Suite_with_SciTe| Windows Installation: ConTeXt Suite with SciTe]] for more detailed information.<br />
<br />
<br />
== Proxy settings ==<br />
<br />
The installation script uses <code>rsync</code> to fetch the required files. So, if you are behind a proxy server, you need to tell the details to rsync. The easiest way to set this is to set <code>RSYNC_PROXY</code> variable in the terminal as (replace username, password, proxyhost and proxyport with the correct information)<br />
<br />
set RSYNC_PROXY=username:password@proxyhost:proxyport<br />
<br />
or set the variable permanently as a Windows environment variable.<br />
<br />
Sometimes, when behind a firewall, port 873 may be closed for outgoing TCP connections. If port 22 is open for ssh connections, a trick that can be used is to connect to a computer located somewhere outside of the firewall and to tunnel port 873 (using the program <code>nc</code>).<br />
<br />
export RSYNC_CONNECT_PROG='ssh tunnelhost nc %H 873'<br />
<br />
where <code>tunnelhost</code> is the machine outside of the firewall on which you have <code>ssh</code> access. Of course, this machine must have <code>nc</code> and port 873 open for outgoing TCP connections.<br />
<br />
== Usage ==<br />
<br />
Before running ConTeXt, you need to run <code>setuptex.bat</code> which is provided in <code>installation-dir\tex\</code>. This can be done by typing<br />
<br />
installation-dir\tex\setuptex.bat<br />
<br />
on cmd.exe before you run ConTeXt. To avoid always having to type this, you can create a shortcut to cmd.exe and edit the command line to read (assuming you installed the suite in <code>C:\Programs</code>; otherwise replace <code>C:\Programs\</code> with your installation directory)<br />
<br />
C:\WINDOWS\System32\cmd.exe /k C:\Programs\context\tex\setuptex.bat<br />
<br />
This starts up a new command shell with the environment pre-loaded. Within the new shell you can just type <code>context</code> to run ConTeXt. E.g.<br />
<br />
C:\> context --version<br />
<br />
to check that you are running the version you think you're running.<br />
<br />
=== Use ConTeXt with Cygwin ===<br />
After installing the ConTeXt suite, you can run it under Cygwin. With Cygwin, you may use gmake and other Unix tools for your automated workflow.<br />
<br />
# Run <code>setuptex.bat</code> in DOS command prompt<br />
# In the same DOS prompt, enter Cygwin by running <code>cygwin.bat</code> (in your Cygwin installation directory)<br />
# Under Cygwin prompt, run <code> context.cmd test.tex </code>. Note that the <code>.cmd</code> extension is needed under Cygwin.<br />
<br />
== Updating ==<br />
<br />
If you used the command line method, just run <code>first-setup.bat</code> again to update the suite.<br />
<br />
<br />
== Uninstallation ==<br />
<br />
If you used the command-line installer, you can just delete the installation directory to uninstall the suite.<br />
<br />
<br />
== Troubleshooting ==<br />
<br />
* rsync sometimes has problems with paths with uppercase letters (like <code>c:\Temp</code> or <code>C:\Documents and Settings</code>). Installing into all-lowercase paths without spaces sometimes helps.<br />
* Directory-name length may also have an effect, due to Windows's 8.3 filename conventions. An indicator is if running "texexec --lua" on a file produces missing-file warnings containing Windows-created 8-character directory names, such as "C:\CONTEX~1\tex", where your ConTeXt directory is really "C:\context_minimals\tex". Be conservative and choose a short name like "C:\ctm\tex". Also, this may even work when an 8-character-or-less directory name like "C:\ctexmin\tex" doesn't.<br />
* If you're behind firewall and rsync times out, you need to open port 873 for outgoing TCP connections.<br />
* If you update luaTeX occasionally you may get something like <br />
<br />
<code>engine mismatch (luv: This is LuaTeX, Version beta-<version>-<date1> (TeX Live 2013/dev)(rev <number1>) <> bin: This is LuaTeX, Version beta-<version>-<date1> (TeX Live 2012/W32TeX)(rev <number2>)), forcing remake</code><br />
<br />
In which case your format will be remade every time you compile a file. In /texmf-mswin make sure that luatex.exe and texlua.exe have the same date; then also delete luatex.dll. This usually solves the problem.<br />
<br />
= Installing third party modules =<br />
<br />
The ConTeXt suite only comes with Taco's [[Bibliography|t-bib]] module. If you want to install [http://modules.contextgarden.net/ a new module], say Wolfgang's [[Letter|t-letter]] module, you can use<br />
first-setup.sh --modules="t-letter"<br />
<br />
If you want to install more than one extra module, you can separate them by commas. So, to install the t-letter and t-mathsets module, do<br />
sh ./first-setup.sh --modules="t-letter,t-mathsets"<br />
<br />
If you want to install all extra modules at once, do<br />
sh ./first-setup.sh --modules=all<br />
<br />
= Reverting to an older installation =<br />
<br />
If, for some reason, you want to revert to an older installation, you can do that by<br />
<br />
sh ./first-setup.sh --context=date<br />
<br />
where <code>date</code> is the date of one of the stable releases of ConTeXt. The complete list of old releases that are available is [http://minimals.contextgarden.net/current/context/ here].<br />
<br />
<br />
= Moving the installation tree around = <br />
<br />
According to this post, http://archive.contextgarden.net/message/20101129.144331.d721372f.en.html it's safe to move the installation tree across directory or machines (say you don't have broadband access). You just have to clean and regenerate the cache (./tex/texmf-cache/luatex-cache) with <br />
mtxrun --generate<br />
<br />
= Notes =<br />
<references/><br />
<br />
{{Getting started navbox}}<br />
[[Category:Installation]]<br />
[[Category:Standalone]]</div>SudipSinhahttps://wiki.contextgarden.net/index.php?title=ConTeXt_Standalone&diff=24283ConTeXt Standalone2019-08-20T23:18:50Z<p>SudipSinha: Add how to update keeping currently installed modules intact.</p>
<hr />
<div>{{Installation navbox}}<br />
<br />
The '''ConTeXt suite''' is a complete, up-to-date ConTeXt distribution that can be upgraded efficiently. It can also be used in parallel with existing TeX installations such as MikTeX, TeXLive, and so forth. The suite does not include LaTeX packages and binaries.<br />
<br />
Sometimes ConTeXt beta releases have issues. The ConTeXt suite allows you to test the latest ConTeXt release without worrying whether upgrading will corrupt a critical project. Multiple ConTeXt suite installations are possible. This allows, for example, a stable version and a beta version to run in parallel on the same computer.<br />
<br />
ConTeXt is also included in TeXlive. The ConTeXt suite is updated continuously, whereas ConTeXt in TeXlive is updated less often. In particular, <code>luatex</code> and <code>metapost</code> are under active development and their binaries are updated frequently. ConTeXt follows these developments, indeed often drives development. As the binaries included in the TeXlive distribution are only updated yearly, ConTeXt on TeXlive will necessarily be less current than the ConTeXt suite. The ConTeXt suite is self-contained and can happily coexist alongside another installed TeX distribution.<br />
<br />
{{TOClimit|limit=1}}<br />
<br />
= General Information =<br />
<br />
== Supported platforms ==<br />
<br />
{| style="border:1px solid #DDDDDD;"<br />
|- align="left" <br />
! Platform<br />
! Short name<br />
! Notes<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Windows<br />
| mswin<br />
| from [http://w32tex.org W32TeX]<br />
|- align="left"<br />
! Windows/CygWin<br />
| cygwin<br />
| same binaries as mswin<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Windows, 32 bit<br />
| win32<br />
| Alias for mswin<br />
|- align="left"<br />
! Windows, 64 bit<br />
| win64<br />
| <br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Linux, 32-bit<br />
| linux<br />
| Debian 8<br />
|- align="left"<br />
! Linux, 64-bit<br />
| linux-64<br />
| Debian 8<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Linux, ARM (low end.)<br />
| linux-arm<br />
| Raspbian 8<br />
|- align="left"<br />
! Linux, musl<br />
| linuxmusl-64<br />
| Alpine<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Mac OS X, Intel (64-bit)<br />
| osx-64<br />
| Mac OS X 10.6<br />
|- align="left"<br />
! FreeBSD, 32-bit<br />
| freebsd<br />
|<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! FreeBSD, 64-bit<br />
| freebsd-amd64<br />
|<br />
|- align="left"<br />
! OpenBSD 6.4, 32-bit<br />
| openbsd6.4<br />
|<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! OpenBSD 6.4, 64-bit<br />
| openbsd6.4-amd64<br />
|<br />
|- align="left"<br />
! OpenBSD 6.5, 32-bit<br />
| openbsd6.5<br />
|<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! OpenBSD 6.5, 64-bit<br />
| openbsd6.5-amd64<br />
|<br />
|- align="left"<br />
! Solaris, Intel<br />
| solaris-intel<br />
| Solaris 10 on [http://www.opencsw.org/about/ OpenCSW]<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Solaris, Sparc<br />
| solaris-sparc<br />
| Solaris 10 on [http://www.opencsw.org/about/ OpenCSW]<br />
|}<br />
<br />
* If you run into problems installing, check the available architectures in the minimal’s [http://minimals.contextgarden.net/setup/ setup folder]!<br />
* OpenBSD 6.4 binaries are compiled but are missing in the setup folder ATM (2019-07)<br />
<br />
If you want to support a new platform, please write to the [[ConTeXt Mailing Lists]]<br />
<br />
== Dependencies ==<br />
* Rsync (The windows binary of rsync is distributed within the suite)<br />
<br />
<br />
The following programs are not required for running ConTeXt, but their installation adds additional functionality.<br />
<br />
* curl : for including remote content<br />
* ghostscript : for converting PostScript images to PDF<br />
* graphicsmagick (convert) : for converting GIF and TIFF images<br />
* inkscape : for converting SVG and compressed SVG<br />
* mupdf (mudraw) : for converting PDF to PNG (used for ePub covers)<br />
* pstoedit : for converting PostScript to MetaPost outlines<br />
* zint : for providing barcodes<br />
* zip or 7zip : for EPUB generation<br />
<br />
== Disc space required ==<br />
ConTeXt macro files are small (less than 10MB), but the suite comes with various free fonts which considerably increase the size of the distribution to around 200MB).<br />
<br />
== Multiple instances of the installation ==<br />
Please note from the start that we recommend installing a complete ConTeXt installation for each project in a production environment. The installation tree is portable (see Moving the Installation Around, below) and can be located under the project's own directory. The advantage is to allow each project to use an instance of ConTeXt that is adapted to its coding and that only gets updated purposely. Since the ConTeXt Standalone is "bleeding edge" and subject to development, certain details in commands, syntax or rendering may evolve slightly. Having a vintage ConTeXt tree for each production project insures that one can come back years later and produce identical results.<br />
<br />
So as not to get carried away under this approach, one can eventually group projects by vintage, period or season, according to cycles of productivity.<br />
<br />
== Standalone ==<br />
<br />
* [[ConTeXt Standalone/FAQ|Standalone/FAQ]] <br />
* [[ConTeXt Standalone/Structure|Standalone/Structure]] <br />
* [[ConTeXt Standalone/Implementation|Standalone/Implementation]]<br />
* [[ConTeXt Standalone/TODO|Standalone/TODO]] <br />
* [[ConTeXt Standalone/Contents|Standalone/Contents]] <br />
* [[ConTeXt Standalone/TeX Live|Standalone/TeX Live]]<br />
* Browse the [http://minimals.contextgarden.net installation tree]<br />
<br />
<br />
<br />
= Unix-like platforms (Linux/MacOS X/FreeBSD/Solaris) =<br />
<br />
For Mac installation see also [http://wiki.contextgarden.net/Mac_Installation Mac installation page].<br />
<br />
== Single user installation ==<br />
<br />
Select a folder where you want to install ConTeXt. We recommend that you can use your <code>$HOME/context</code> directory. Create this folder. Then download and place it in <code>$HOME/context</code> directory. Open a terminal, then:<br />
<br />
<pre><br />
mkdir ~/context<br />
cd ~/context<br />
wget http://minimals.contextgarden.net/setup/first-setup.sh<br />
<br />
# Install the latest beta of ConTeXt<br />
# This takes a long time, so go have a coffee<br />
# Flags you can add to the first-setup.sh call:<br />
# --modules=all # Install all third-party modules<br />
# --context=current # Install latest stable version<br />
# --engine=luatex # Install only MkIV, leave out MkII<br />
# # This shrinks the install from 270 MB to 200 MB<br />
<br />
sh ./first-setup.sh --modules=all<br />
</pre><br />
<br />
== System-wide installation ==<br />
<br />
A system wide installation is recommended for users who are comfortable with the command line. Only the location of installing ConTeXt is different for a system wide installation.<br />
<br />
* on Linux you can use <code>/opt/context</code><br />
* on MacOS X you can use <code>/Applications/ConTeXt</code><br />
<br />
Note that, at present, while ''using'' MkIV, you need to have write permissions for the <code>$TEXMFCACHE</code> directory. This effectively means that only one user will be able to generate the formats unless you set the group permissions appropriately. For example:<br />
<br />
* <code>CONTEXT_HOME=/opt/context</code><br />
* <code>TEXMFCACHE=$CONTEXT_HOME/tex/texmf-cache</code><br />
* <code>chmod -R g+w $TEXMFCACHE</code><br />
<br />
<pre><br />
# Create the /opt/context directory -- change as appropriate or desired if you <br />
# want a different installation directory.<br />
cd /opt<br />
mkdir context<br />
<br />
cd context<br />
<br />
# Fetch the install script<br />
wget http://minimals.contextgarden.net/setup/first-setup.sh<br />
<br />
# Install the latest beta of ConTeXt<br />
# This takes a long time, so go have a coffee<br />
# Flags you can add to the first-setup.sh call:<br />
# --modules=all # Install all third-party modules<br />
# --context=current # Install latest stable version<br />
# --engine=luatex # Install only MkIV, leave out MkII<br />
# # This shrinks the install from 270 MB to 200 MB<br />
<br />
sh ./first-setup.sh --modules=all<br />
<br />
# change ownership to real rather than effective id<br />
chown -R `id -r -u`:`id -r -g` .<br />
</pre><br />
<br />
===Cache===<br />
<br />
To customize the cache directory and other options, see the [[Custom_Configuration|Custom Configuration]] page.<br />
<br />
===Font Directory===<br />
<br />
Add the OSFONTDIR into ./tex/setuptex. Go to under the line:<br />
<br />
# TODO: we could set OSFONTDIR on Mac for example<br />
<br />
(if you don't have the line above, go to the end of the file) and add there:<br />
<br />
export OSFONTDIR="/usr/local/share/fonts;$HOME/.fonts"<br />
<br />
For more information: [[Fonts in LuaTeX]]<br />
<br />
== Apache webserver installation ==<br />
<br />
Another common usecase is invoking ConTeXt from within a web application. Because web directories are often self-contained, and in the case of Apache under Ubuntu, ownership of the directory and its contents are assigned to a user and group without a login shell, e.g., <code>www-data:www-data</code> this prevents a web application from invoking a ConTeXt installation done using either the single-user or system-wide method listed above.<br />
<br />
In this case the solution is to install ConTeXt within the website tree, and ideally in the public sub-tree. The public sub-tree is commonly the home directory for the application and relative pathnames are resolved as if immediately below it.<br />
<br />
For example, in the case of the PHP web framework Laravel, ConTeXt can be installed alongside other assets in the <path-to-document-root>/public/context directory:<br />
<br />
<pre><br />
cd <path-to-document-root>/public<br />
mkdir context<br />
cd context<br />
wget http://minimals.contextgarden.net/setup/first-setup.sh<br />
<br />
# Install the latest beta of ConTeXt<br />
# This takes a long time, so go have a coffee<br />
# Flags you can add to the first-setup.sh call:<br />
# --modules=all # Install all third-party modules<br />
# --context=current # Install latest stable version<br />
# --engine=luatex # Install only MkIV, leave out MkII<br />
# # This shrinks the install from 270 MB to 200 MB<br />
<br />
sh ./first-setup.sh --modules=all<br />
</pre><br />
<br />
Once installed, you need to ensure that the permissions are correct for Apache to be able to access it (you will either need <code>sudo</code> privileges or root access):<br />
<br />
<pre><br />
$ cd <path-to-document-root>/public<br />
$ sudo chmod -R www-data:www-data context<br />
</pre><br />
<br />
Now as part of your application's invocation of ConTeXt, you will need to set up the shell environment. This is easily done by creating a simple BASH shell script, also to be installed in the public part of the document tree:<br />
<br />
<pre><br />
#!/usr/bin/env bash<br />
<br />
#<br />
# proccontext.sh<br />
#<br />
# To be installed in <path-to-document-root>/public/bin<br />
<br />
. <path-to-document-root>/public/context/tex/setuptex <path-to-document-root>/public/context/tex<br />
<br />
cd tex/spool<br />
context $1 > /tmp/context_run.log<br />
</pre><br />
<br />
Here the dynamically generated ConTeXt source file is expected to be found in the <code><path-to-document-root>/tex/spool</code> directory.<br />
<br />
Now within your application, you can invoke this shell script (in this case using PHP):<br />
<br />
<pre><br />
$cmd = "bin/proccontext.sh $input_filename";<br />
$last_line = system($cmd, $ret_val);<br />
</pre><br />
<br />
And the output will once again be found in <code><path-to-document-root>/tex/spool</code>.<br />
<br />
==Arch Linux==<br />
There’s a [https://aur.archlinux.org/packages/context-minimals-git PKGBUILD] in<br />
the AUR, provided by Aditya [https://github.com/adityam/context-pkgbuild].<br />
Install it using your favorite AUR frontend, e.g.<br />
<br />
<pre><br />
yaourt -S context-minimals-git<br />
</pre><br />
<br />
This will get you a fresh, up-to-date Context tree in<br />
<tt>/opt/context-minimals</tt>.<br />
<br />
== The funtoo way ==<br />
<br />
If you are using [http://funtoo.org funtoo] there are ebuilds that will make an installation as easy as installing any other package from portage. Take a look at the [[ConTeXt Standalone Funtoo]] Howto. This might also work for [http://www.gentoo.org gentoo], but is untested right now.<br />
<br />
== Proxy settings ==<br />
<br />
The installation script uses <code>rsync</code> to fetch the required files. So, if you are behind a proxy server, you need to tell the details to rsync. The easiest way to set this is to set <code>RSYNC_PROXY</code> variable in the terminal or your startup script (<code>.bashrc</code> or the corresponding file for your shell). Replace username, password, proxyhost and proxyport with the correct information<br />
<br />
export RSYNC_PROXY=username:password@proxyhost:proxyport<br />
<br />
Sometimes, when behind a firewall, port 873 may be closed for outgoing TCP connections. If port 22 is open for ssh connections, a trick that can be used is to connect to a computer located somewhere outside of the firewall and to tunnel port 873 (using the program <code>nc</code>).<br />
<br />
export RSYNC_CONNECT_PROG='ssh tunnelhost nc %H 873'<br />
<br />
where <code>tunnelhost</code> is the machine outside of the firewall on which you have <code>ssh</code> access. Of course, this machine must have <code>nc</code> and port 873 open for outgoing TCP connections.<br />
<br />
== Usage ==<br />
<br />
ConTeXt suite works in a non-interfering manner because it does not put anything in your <code>$PATH</code> and does not set any system variables. This in turn means that in order to use it, you need to do some initialization. An intialization script called <code>setuptex</code> is provided in <code>installation-dir/tex/</code>. <br />
<br />
=== Terminal/Command line ===<br />
<br />
To run context from a terminal, source <code>setuptex</code>:<br />
<br />
source /installation-dir/tex/setuptex<br />
<br />
=== Exclusive usage ===<br />
<br />
If you always use ConTeXt suite and '''never''' use LaTeX or plain TeX provided by another TeX distribution, you can add the following line to the startup script of your shell (For bash, the startup script is <code>$HOME/.bashrc</code>; for zsh it is <code>HOME/.zshrc</code>).<br />
<br />
source /installation-dir/tex/setuptex<br />
<br />
Then <code>setuptex</code> will always be sourced in your terminal.<br />
<br />
=== Integrating with an editor ===<br />
<br />
The easiest way to run ConTeXt from an editor is to open a terminal, source {{code|setuptex}} in the terminal, and then open your editor '''from the same terminal'''. <br />
<br />
Another option is to add {{code|/installation-dir/tex/texmf-<platform>/bin}} to the {{code|$PATH}} that the editor searches. The details vary depending on the editor. See [[Text Editors]] for instructions on integrating ConTeXt with various editors. <br />
<br />
For information about configuring [http://smultron.sourceforge.net/ Smultron] and [http://www.uoregon.edu/~koch/texshop/obtaining.html TeXShop] (which are popular TeX editors on Mac) see [[ConTeXt Standalone/Mac Installation]].<br />
<br />
<br />
== Updating ==<br />
<br />
For updating the ConTeXt suite, <br />
first update <code>first-setup.sh</code>, then run it. You could<br />
also create an alias or a little script “ctx-update”<br />
with the following example contents:<br />
<pre><br />
cd /opt/context<br />
rsync -ptv rsync://contextgarden.net/minimals/setup/first-setup.sh .<br />
sh ./first-setup.sh --modules=all<br />
</pre><br />
<br />
To update retain currently-installed modules:<br />
sh ./first-setup.sh --keep<br />
<br />
== Uninstalling ==<br />
<br />
ConTeXt suite does not touch anything outside its installation folder. So to uninstall it, you can simply remove the installation folder.<br />
<br />
== Remaking formats ==<br />
<br />
Normally, the update script should create the formats for you. If for some reason you need to recreate the formats, you can do the following:<br />
<br />
* For making MKII format.<br />
<br />
mktexlsr<br />
texexec --make --all <br />
<br />
* For making XeTeX format<br />
<br />
mktexlsr<br />
texexec --make --xtx --all <br />
<br />
* For making MKIV format<br />
<br />
mtxrun --generate<br />
context --make<br />
<br />
= Windows =<br />
<br />
If you want to use ConTeXt suite alongside MikTeX/TeXLive (needed if you also run LaTeX), follow the command-line installation method. <br />
<br />
== Installation ==<br />
<br />
=== Command line method ===<br />
Download [http://minimals.contextgarden.net/setup/context-setup-mswin.zip context-setup-mswin.zip] or [http://minimals.contextgarden.net/setup/context-setup-win64.zip context-setup-win64.zip], and unzip to a directory where you want to install ConTeXt. It is recommended that you choose a directory that does not have a space in its full path. Then open <code>cmd.exe</code>, go to the installation directory and run<br />
<br />
first-setup.bat<br />
<br />
This takes a long time, so go have a coffee. <br />
<br />
By default, the suite installs ConTeXt beta. If you want the stable version of ConTeXt, you can use <br />
<br />
first-setup.bat --context=current<br />
<br />
By default, the suite does ''not'' install modules and other third party content. If you want the modules (and have the bandwidth), you can use<br />
<br />
first-setup.bat --modules=all<br />
<br />
<br />
If the above installation instructions don't seem to answer your questions, see page [[Windows_Installation:_ConTeXt_Suite_with_SciTe| Windows Installation: ConTeXt Suite with SciTe]] for more detailed information.<br />
<br />
<br />
== Proxy settings ==<br />
<br />
The installation script uses <code>rsync</code> to fetch the required files. So, if you are behind a proxy server, you need to tell the details to rsync. The easiest way to set this is to set <code>RSYNC_PROXY</code> variable in the terminal as (replace username, password, proxyhost and proxyport with the correct information)<br />
<br />
set RSYNC_PROXY=username:password@proxyhost:proxyport<br />
<br />
or set the variable permanently as a Windows environment variable.<br />
<br />
Sometimes, when behind a firewall, port 873 may be closed for outgoing TCP connections. If port 22 is open for ssh connections, a trick that can be used is to connect to a computer located somewhere outside of the firewall and to tunnel port 873 (using the program <code>nc</code>).<br />
<br />
export RSYNC_CONNECT_PROG='ssh tunnelhost nc %H 873'<br />
<br />
where <code>tunnelhost</code> is the machine outside of the firewall on which you have <code>ssh</code> access. Of course, this machine must have <code>nc</code> and port 873 open for outgoing TCP connections.<br />
<br />
== Usage ==<br />
<br />
Before running ConTeXt, you need to run <code>setuptex.bat</code> which is provided in <code>installation-dir\tex\</code>. This can be done by typing<br />
<br />
installation-dir\tex\setuptex.bat<br />
<br />
on cmd.exe before you run ConTeXt. To avoid always having to type this, you can create a shortcut to cmd.exe and edit the command line to read (assuming you installed the suite in <code>C:\Programs</code>; otherwise replace <code>C:\Programs\</code> with your installation directory)<br />
<br />
C:\WINDOWS\System32\cmd.exe /k C:\Programs\context\tex\setuptex.bat<br />
<br />
This starts up a new command shell with the environment pre-loaded. Within the new shell you can just type <code>context</code> to run ConTeXt. E.g.<br />
<br />
C:\> context --version<br />
<br />
to check that you are running the version you think you're running.<br />
<br />
=== Use ConTeXt with Cygwin ===<br />
After installing the ConTeXt suite, you can run it under Cygwin. With Cygwin, you may use gmake and other Unix tools for your automated workflow.<br />
<br />
# Run <code>setuptex.bat</code> in DOS command prompt<br />
# In the same DOS prompt, enter Cygwin by running <code>cygwin.bat</code> (in your Cygwin installation directory)<br />
# Under Cygwin prompt, run <code> context.cmd test.tex </code>. Note that the <code>.cmd</code> extension is needed under Cygwin.<br />
<br />
== Updating ==<br />
<br />
If you used the command line method, just run <code>first-setup.bat</code> again to update the suite.<br />
<br />
<br />
== Uninstallation ==<br />
<br />
If you used the command-line installer, you can just delete the installation directory to uninstall the suite.<br />
<br />
<br />
== Troubleshooting ==<br />
<br />
* rsync sometimes has problems with paths with uppercase letters (like <code>c:\Temp</code> or <code>C:\Documents and Settings</code>). Installing into all-lowercase paths without spaces sometimes helps.<br />
* Directory-name length may also have an effect, due to Windows's 8.3 filename conventions. An indicator is if running "texexec --lua" on a file produces missing-file warnings containing Windows-created 8-character directory names, such as "C:\CONTEX~1\tex", where your ConTeXt directory is really "C:\context_minimals\tex". Be conservative and choose a short name like "C:\ctm\tex". Also, this may even work when an 8-character-or-less directory name like "C:\ctexmin\tex" doesn't.<br />
* If you're behind firewall and rsync times out, you need to open port 873 for outgoing TCP connections.<br />
* If you update luaTeX occasionally you may get something like <br />
<br />
<code>engine mismatch (luv: This is LuaTeX, Version beta-<version>-<date1> (TeX Live 2013/dev)(rev <number1>) <> bin: This is LuaTeX, Version beta-<version>-<date1> (TeX Live 2012/W32TeX)(rev <number2>)), forcing remake</code><br />
<br />
In which case your format will be remade every time you compile a file. In /texmf-mswin make sure that luatex.exe and texlua.exe have the same date; then also delete luatex.dll. This usually solves the problem.<br />
<br />
= Installing third party modules =<br />
<br />
The ConTeXt suite only comes with Taco's [[Bibliography|t-bib]] module. If you want to install [http://modules.contextgarden.net/ a new module], say Wolfgang's [[Letter|t-letter]] module, you can use<br />
first-setup.sh --modules="t-letter"<br />
<br />
If you want to install more than one extra module, you can separate them by commas. So, to install the t-letter and t-mathsets module, do<br />
sh ./first-setup.sh --modules="t-letter,t-mathsets"<br />
<br />
If you want to install all extra modules at once, do<br />
sh ./first-setup.sh --modules=all<br />
<br />
= Reverting to an older installation =<br />
<br />
If, for some reason, you want to revert to an older installation, you can do that by<br />
<br />
sh ./first-setup.sh --context=date<br />
<br />
where <code>date</code> is the date of one of the stable releases of ConTeXt. The complete list of old releases that are available is [http://minimals.contextgarden.net/current/context/ here].<br />
<br />
<br />
= Moving the installation tree around = <br />
<br />
According to this post, http://archive.contextgarden.net/message/20101129.144331.d721372f.en.html it's safe to move the installation tree across directory or machines (say you don't have broadband access). You just have to clean and regenerate the cache (./tex/texmf-cache/luatex-cache) with <br />
mtxrun --generate<br />
<br />
= Notes =<br />
<references/><br />
<br />
{{Getting started navbox}}<br />
[[Category:Installation]]<br />
[[Category:Standalone]]</div>SudipSinhahttps://wiki.contextgarden.net/index.php?title=ConTeXt_Standalone&diff=24217ConTeXt Standalone2019-05-29T21:16:26Z<p>SudipSinha: Minor spelling corrections</p>
<hr />
<div>{{Installation navbox}}<br />
<br />
The '''ConTeXt suite''' is a complete, up-to-date ConTeXt distribution that can be upgraded efficiently. It can also be used in parallel with existing TeX installations such as MikTeX, TeXLive, and so forth. The suite does not include LaTeX packages and binaries.<br />
<br />
Sometimes ConTeXt beta releases have issues. The ConTeXt suite allows you to test the latest ConTeXt release without worrying whether upgrading will corrupt a critical project. Multiple ConTeXt suite installations are possible. This allows, for example, a stable version and a beta version to run in parallel on the same computer.<br />
<br />
ConTeXt is also included in TeXlive. The ConTeXt suite is updated continuously, whereas ConTeXt in TeXlive is updated less often. In particular, <code>luatex</code> and <code>metapost</code> are under active development and their binaries are updated frequently. ConTeXt follows these developments, indeed often drives development. As the binaries included in the TeXlive distribution are only updated yearly, ConTeXt on TeXlive will necessarily be less current than the ConTeXt suite. The ConTeXt suite is self-contained and can happily coexist alongside another installed TeX distribution.<br />
<br />
{{TOClimit|limit=1}}<br />
<br />
= General Information =<br />
<br />
== Supported platforms ==<br />
<br />
{| style="border:1px solid #DDDDDD;"<br />
|- align="left" <br />
! Platform<br />
! Short name<br />
! Notes<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Windows<br />
| mswin<br />
| from [http://w32tex.org W32TeX]<br />
|- align="left"<br />
! Linux, 32-bit<br />
| linux<br />
| Debian 8<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Linux, 64-bit<br />
| linux-64<br />
| Debian 8<br />
|- align="left"<br />
! Linux, Arm (low end.)<br />
| linux-arm<br />
| Raspbian 8<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Mac OS X, Intel (64-bit)<br />
| osx-64<br />
| Mac OS X 10.6<br />
|- align="left"<br />
! FreeBSD, 32-bit<br />
| freebsd<br />
|<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! FreeBSD, 64-bit<br />
| freebsd-amd64<br />
|<br />
|- align="left"<br />
! OpenBSD 6.3, i386<br />
| openbsd6.3<br />
|<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! OpenBSD 6.3, 64-bit<br />
| openbsd6.3-amd64<br />
|<br />
|- align="left"<br />
! OpenBSD 6.4, i386<br />
| openbsd6.4<br />
|<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! OpenBSD 6.4, 64-bit<br />
| openbsd6.4-amd64<br />
|<br />
|- align="left"<br />
! Solaris, Intel<br />
| solaris-intel<br />
| Solaris 10 on [http://www.opencsw.org/about/ OpenCSW]<br />
|- align="left" style="background-color:#EEEEEE;"<br />
! Solaris, Sparc<br />
| solaris-sparc<br />
| Solaris 10 on [http://www.opencsw.org/about/ OpenCSW]<br />
|}<br />
<br />
*Note: we have stopped distributing binaries for kfreebsd. However, this system is still supported, and natively-compiled binaries can be installed from the Debian distribution.<br />
<br />
If you want to support a new platform, please write to the [[ConTeXt Mailing Lists]]<br />
<br />
== Dependencies ==<br />
* Rsync (The windows binary of rsync is distributed within the suite)<br />
<br />
<br />
The following programs are not required for running ConTeXt, but their installation adds additional functionality.<br />
<br />
* curl : for including remote content<br />
* ghostscript : for converting PostScript images to PDF<br />
* graphicsmagick (convert) : for converting GIF and TIFF images<br />
* inkscape : for converting SVG and compressed SVG<br />
* mupdf (mudraw) : for converting PDF to PNG (used for ePub covers)<br />
* pstoedit : for converting PostScript to MetaPost outlines<br />
* zint : for providing barcodes<br />
* zip or 7zip : for EPUB generation<br />
<br />
== Disc space required ==<br />
ConTeXt macro files are small (less than 10MB), but the suite comes with various free fonts which considerably increase the size of the distribution to around 200MB).<br />
<br />
== Multiple instances of the installation ==<br />
Please note from the start that we recommend installing a complete ConTeXt installation for each project in a production environment. The installation tree is portable (see Moving the Installation Around, below) and can be located under the project's own directory. The advantage is to allow each project to use an instance of ConTeXt that is adapted to its coding and that only gets updated purposely. Since the ConTeXt Standalone is "bleeding edge" and subject to development, certain details in commands, syntax or rendering may evolve slightly. Having a vintage ConTeXt tree for each production project insures that one can come back years later and produce identical results.<br />
<br />
So as not to get carried away under this approach, one can eventually group projects by vintage, period or season, according to cycles of productivity.<br />
<br />
== Standalone ==<br />
<br />
* [[ConTeXt Standalone/FAQ|Standalone/FAQ]] <br />
* [[ConTeXt Standalone/Structure|Standalone/Structure]] <br />
* [[ConTeXt Standalone/Implementation|Standalone/Implementation]]<br />
* [[ConTeXt Standalone/TODO|Standalone/TODO]] <br />
* [[ConTeXt Standalone/Contents|Standalone/Contents]] <br />
* [[ConTeXt Standalone/TeX Live|Standalone/TeX Live]]<br />
* Browse the [http://minimals.contextgarden.net installation tree]<br />
<br />
<br />
<br />
= Unix-like platforms (Linux/MacOS X/FreeBSD/Solaris) =<br />
<br />
For Mac installation see also [http://wiki.contextgarden.net/Mac_Installation Mac installation page].<br />
<br />
== Single user installation ==<br />
<br />
Select a folder where you want to install ConTeXt. We recommend that you can use your <code>$HOME/context</code> directory. Create this folder. Then download and place it in <code>$HOME/context</code> directory. Open a terminal, then:<br />
<br />
<pre><br />
mkdir ~/context<br />
cd ~/context<br />
wget http://minimals.contextgarden.net/setup/first-setup.sh<br />
<br />
# Install the latest beta of ConTeXt<br />
# This takes a long time, so go have a coffee<br />
# Flags you can add to the first-setup.sh call:<br />
# --modules=all # Install all third-party modules<br />
# --context=current # Install latest stable version<br />
# --engine=luatex # Install only MkIV, leave out MkII<br />
# # This shrinks the install from 270 MB to 200 MB<br />
<br />
sh ./first-setup.sh --modules=all<br />
</pre><br />
<br />
== System-wide installation ==<br />
<br />
A system wide installation is recommended for users who are comfortable with the command line. Only the location of installing ConTeXt is different for a system wide installation.<br />
<br />
* on Linux you can use <code>/opt/context</code><br />
* on MacOS X you can use <code>/Applications/ConTeXt</code><br />
<br />
Note that, at present, while ''using'' MkIV, you need to have write permissions for the <code>$TEXMFCACHE</code> directory. This effectively means that only one user will be able to generate the formats unless you set the group permissions appropriately. For example:<br />
<br />
* <code>CONTEXT_HOME=/opt/context</code><br />
* <code>TEXMFCACHE=$CONTEXT_HOME/tex/texmf-cache</code><br />
* <code>chmod -R g+w $TEXMFCACHE</code><br />
<br />
<pre><br />
# Create the /opt/context directory -- change as appropriate or desired if you <br />
# want a different installation directory.<br />
cd /opt<br />
mkdir context<br />
<br />
cd context<br />
<br />
# Fetch the install script<br />
wget http://minimals.contextgarden.net/setup/first-setup.sh<br />
<br />
# Install the latest beta of ConTeXt<br />
# This takes a long time, so go have a coffee<br />
# Flags you can add to the first-setup.sh call:<br />
# --modules=all # Install all third-party modules<br />
# --context=current # Install latest stable version<br />
# --engine=luatex # Install only MkIV, leave out MkII<br />
# # This shrinks the install from 270 MB to 200 MB<br />
<br />
sh ./first-setup.sh --modules=all<br />
<br />
# change ownership to real rather than effective id<br />
chown -R `id -r -u`:`id -r -g` .<br />
</pre><br />
<br />
===Cache===<br />
<br />
To customize the cache directory and other options, see the [[Custom_Configuration|Custom Configuration]] page.<br />
<br />
===Font Directory===<br />
<br />
Add the OSFONTDIR into ./tex/setuptex. Go to under the line:<br />
<br />
# TODO: we could set OSFONTDIR on Mac for example<br />
<br />
(if you don't have the line above, go to the end of the file) and add there:<br />
<br />
export OSFONTDIR="/usr/local/share/fonts;$HOME/.fonts"<br />
<br />
For more information: [[Fonts in LuaTeX]]<br />
<br />
== Apache webserver installation ==<br />
<br />
Another common usecase is invoking ConTeXt from within a web application. Because web directories are often self-contained, and in the case of Apache under Ubuntu, ownership of the directory and its contents are assigned to a user and group without a login shell, e.g., <code>www-data:www-data</code> this prevents a web application from invoking a ConTeXt installation done using either the single-user or system-wide method listed above.<br />
<br />
In this case the solution is to install ConTeXt within the website tree, and ideally in the public sub-tree. The public sub-tree is commonly the home directory for the application and relative pathnames are resolved as if immediately below it.<br />
<br />
For example, in the case of the PHP web framework Laravel, ConTeXt can be installed alongside other assets in the <path-to-document-root>/public/context directory:<br />
<br />
<pre><br />
cd <path-to-document-root>/public<br />
mkdir context<br />
cd context<br />
wget http://minimals.contextgarden.net/setup/first-setup.sh<br />
<br />
# Install the latest beta of ConTeXt<br />
# This takes a long time, so go have a coffee<br />
# Flags you can add to the first-setup.sh call:<br />
# --modules=all # Install all third-party modules<br />
# --context=current # Install latest stable version<br />
# --engine=luatex # Install only MkIV, leave out MkII<br />
# # This shrinks the install from 270 MB to 200 MB<br />
<br />
sh ./first-setup.sh --modules=all<br />
</pre><br />
<br />
Once installed, you need to ensure that the permissions are correct for Apache to be able to access it (you will either need <code>sudo</code> privileges or root access):<br />
<br />
<pre><br />
$ cd <path-to-document-root>/public<br />
$ sudo chmod -R www-data:www-data context<br />
</pre><br />
<br />
Now as part of your application's invocation of ConTeXt, you will need to set up the shell environment. This is easily done by creating a simple BASH shell script, also to be installed in the public part of the document tree:<br />
<br />
<pre><br />
#!/usr/bin/env bash<br />
<br />
#<br />
# proccontext.sh<br />
#<br />
# To be installed in <path-to-document-root>/public/bin<br />
<br />
. <path-to-document-root>/public/context/tex/setuptex <path-to-document-root>/public/context/tex<br />
<br />
cd tex/spool<br />
context $1 > /tmp/context_run.log<br />
</pre><br />
<br />
Here the dynamically generated ConTeXt source file is expected to be found in the <code><path-to-document-root>/tex/spool</code> directory.<br />
<br />
Now within your application, you can invoke this shell script (in this case using PHP):<br />
<br />
<pre><br />
$cmd = "bin/proccontext.sh $input_filename";<br />
$last_line = system($cmd, $ret_val);<br />
</pre><br />
<br />
And the output will once again be found in <code><path-to-document-root>/tex/spool</code>.<br />
<br />
==Arch Linux==<br />
There’s a [https://aur.archlinux.org/packages/context-minimals-git PKGBUILD] in<br />
the AUR, provided by Aditya [https://github.com/adityam/context-pkgbuild].<br />
Install it using your favorite AUR frontend, e.g.<br />
<br />
<pre><br />
yaourt -S context-minimals-git<br />
</pre><br />
<br />
This will get you a fresh, up-to-date Context tree in<br />
<tt>/opt/context-minimals</tt>.<br />
<br />
== The funtoo way ==<br />
<br />
If you are using [http://funtoo.org funtoo] there are ebuilds that will make an installation as easy as installing any other package from portage. Take a look at the [[ConTeXt Standalone Funtoo]] Howto. This might also work for [http://www.gentoo.org gentoo], but is untested right now.<br />
<br />
== Proxy settings ==<br />
<br />
The installation script uses <code>rsync</code> to fetch the required files. So, if you are behind a proxy server, you need to tell the details to rsync. The easiest way to set this is to set <code>RSYNC_PROXY</code> variable in the terminal or your startup script (<code>.bashrc</code> or the corresponding file for your shell). Replace username, password, proxyhost and proxyport with the correct information<br />
<br />
export RSYNC_PROXY=username:password@proxyhost:proxyport<br />
<br />
Sometimes, when behind a firewall, port 873 may be closed for outgoing TCP connections. If port 22 is open for ssh connections, a trick that can be used is to connect to a computer located somewhere outside of the firewall and to tunnel port 873 (using the program <code>nc</code>).<br />
<br />
export RSYNC_CONNECT_PROG='ssh tunnelhost nc %H 873'<br />
<br />
where <code>tunnelhost</code> is the machine outside of the firewall on which you have <code>ssh</code> access. Of course, this machine must have <code>nc</code> and port 873 open for outgoing TCP connections.<br />
<br />
== Usage ==<br />
<br />
ConTeXt suite works in a non-interfering manner because it does not put anything in your <code>$PATH</code> and does not set any system variables. This in turn means that in order to use it, you need to do some initialization. An intialization script called <code>setuptex</code> is provided in <code>installation-dir/tex/</code>. <br />
<br />
=== Terminal/Command line ===<br />
<br />
To run context from a terminal, source <code>setuptex</code>:<br />
<br />
source /installation-dir/tex/setuptex<br />
<br />
=== Exclusive usage ===<br />
<br />
If you always use ConTeXt suite and '''never''' use LaTeX or plain TeX provided by another TeX distribution, you can add the following line to the startup script of your shell (For bash, the startup script is <code>$HOME/.bashrc</code>; for zsh it is <code>HOME/.zshrc</code>).<br />
<br />
source /installation-dir/tex/setuptex<br />
<br />
Then <code>setuptex</code> will always be sourced in your terminal.<br />
<br />
=== Integrating with an editor ===<br />
<br />
The easiest way to run ConTeXt from an editor is to open a terminal, source {{code|setuptex}} in the terminal, and then open your editor '''from the same terminal'''. <br />
<br />
Another option is to add {{code|/installation-dir/tex/texmf-<platform>/bin}} to the {{code|$PATH}} that the editor searches. The details vary depending on the editor. See [[Text Editors]] for instructions on integrating ConTeXt with various editors. <br />
<br />
For information about configuring [http://smultron.sourceforge.net/ Smultron] and [http://www.uoregon.edu/~koch/texshop/obtaining.html TeXShop] (which are popular TeX editors on Mac) see [[ConTeXt Standalone/Mac Installation]].<br />
<br />
<br />
== Updating ==<br />
<br />
For updating the ConTeXt suite, <br />
first update <code>first-setup.sh</code>, then run it. You could<br />
also create an alias or a little script “ctx-update”<br />
with the following example contents:<br />
<pre><br />
cd /opt/context<br />
rsync -ptv rsync://contextgarden.net/minimals/setup/first-setup.sh .<br />
sh ./first-setup.sh --modules=all<br />
</pre><br />
<br />
== Uninstalling ==<br />
<br />
ConTeXt suite does not touch anything outside its installation folder. So to uninstall it, you can simply remove the installation folder.<br />
<br />
== Remaking formats ==<br />
<br />
Normally, the update script should create the formats for you. If for some reason you need to recreate the formats, you can do the following:<br />
<br />
* For making MKII format.<br />
<br />
mktexlsr<br />
texexec --make --all <br />
<br />
* For making XeTeX format<br />
<br />
mktexlsr<br />
texexec --make --xtx --all <br />
<br />
* For making MKIV format<br />
<br />
mtxrun --generate<br />
context --make<br />
<br />
= Windows =<br />
<br />
If you want to use ConTeXt suite alongside MikTeX/TeXLive (needed if you also run LaTeX), follow the command-line installation method. <br />
<br />
== Installation ==<br />
<br />
=== Command line method ===<br />
Download [http://minimals.contextgarden.net/setup/context-setup-mswin.zip context-setup-mswin.zip] or [http://minimals.contextgarden.net/setup/context-setup-win64.zip context-setup-win64.zip], and unzip to a directory where you want to install ConTeXt. It is recommended that you choose a directory that does not have a space in its full path. Then open <code>cmd.exe</code>, go to the installation directory and run<br />
<br />
first-setup.bat<br />
<br />
This takes a long time, so go have a coffee. <br />
<br />
By default, the suite installs ConTeXt beta. If you want the stable version of ConTeXt, you can use <br />
<br />
first-setup.bat --context=current<br />
<br />
By default, the suite does ''not'' install modules and other third party content. If you want the modules (and have the bandwidth), you can use<br />
<br />
first-setup.bat --modules=all<br />
<br />
<br />
If the above installation instructions don't seem to answer your questions, see page [[Windows_Installation:_ConTeXt_Suite_with_SciTe| Windows Installation: ConTeXt Suite with SciTe]] for more detailed information.<br />
<br />
<br />
== Proxy settings ==<br />
<br />
The installation script uses <code>rsync</code> to fetch the required files. So, if you are behind a proxy server, you need to tell the details to rsync. The easiest way to set this is to set <code>RSYNC_PROXY</code> variable in the terminal as (replace username, password, proxyhost and proxyport with the correct information)<br />
<br />
set RSYNC_PROXY=username:password@proxyhost:proxyport<br />
<br />
or set the variable permanently as a Windows environment variable.<br />
<br />
Sometimes, when behind a firewall, port 873 may be closed for outgoing TCP connections. If port 22 is open for ssh connections, a trick that can be used is to connect to a computer located somewhere outside of the firewall and to tunnel port 873 (using the program <code>nc</code>).<br />
<br />
export RSYNC_CONNECT_PROG='ssh tunnelhost nc %H 873'<br />
<br />
where <code>tunnelhost</code> is the machine outside of the firewall on which you have <code>ssh</code> access. Of course, this machine must have <code>nc</code> and port 873 open for outgoing TCP connections.<br />
<br />
== Usage ==<br />
<br />
Before running ConTeXt, you need to run <code>setuptex.bat</code> which is provided in <code>installation-dir\tex\</code>. This can be done by typing<br />
<br />
installation-dir\tex\setuptex.bat<br />
<br />
on cmd.exe before you run ConTeXt. To avoid always having to type this, you can create a shortcut to cmd.exe and edit the command line to read (assuming you installed the suite in <code>C:\Programs</code>; otherwise replace <code>C:\Programs\</code> with your installation directory)<br />
<br />
C:\WINDOWS\System32\cmd.exe /k C:\Programs\context\tex\setuptex.bat<br />
<br />
This starts up a new command shell with the environment pre-loaded. Within the new shell you can just type <code>context</code> to run ConTeXt. E.g.<br />
<br />
C:\> context --version<br />
<br />
to check that you are running the version you think you're running.<br />
<br />
=== Use ConTeXt with Cygwin ===<br />
After installing the ConTeXt suite, you can run it under Cygwin. With Cygwin, you may use gmake and other Unix tools for your automated workflow.<br />
<br />
# Run <code>setuptex.bat</code> in DOS command prompt<br />
# In the same DOS prompt, enter Cygwin by running <code>cygwin.bat</code> (in your Cygwin installation directory)<br />
# Under Cygwin prompt, run <code> context.cmd test.tex </code>. Note that the <code>.cmd</code> extension is needed under Cygwin.<br />
<br />
== Updating ==<br />
<br />
If you used the command line method, just run <code>first-setup.bat</code> again to update the suite.<br />
<br />
<br />
== Uninstallation ==<br />
<br />
If you used the command-line installer, you can just delete the installation directory to uninstall the suite.<br />
<br />
<br />
== Troubleshooting ==<br />
<br />
* rsync sometimes has problems with paths with uppercase letters (like <code>c:\Temp</code> or <code>C:\Documents and Settings</code>). Installing into all-lowercase paths without spaces sometimes helps.<br />
* Directory-name length may also have an effect, due to Windows's 8.3 filename conventions. An indicator is if running "texexec --lua" on a file produces missing-file warnings containing Windows-created 8-character directory names, such as "C:\CONTEX~1\tex", where your ConTeXt directory is really "C:\context_minimals\tex". Be conservative and choose a short name like "C:\ctm\tex". Also, this may even work when an 8-character-or-less directory name like "C:\ctexmin\tex" doesn't.<br />
* If you're behind firewall and rsync times out, you need to open port 873 for outgoing TCP connections.<br />
* If you update luaTeX occasionally you may get something like <br />
<br />
<code>engine mismatch (luv: This is LuaTeX, Version beta-<version>-<date1> (TeX Live 2013/dev)(rev <number1>) <> bin: This is LuaTeX, Version beta-<version>-<date1> (TeX Live 2012/W32TeX)(rev <number2>)), forcing remake</code><br />
<br />
In which case your format will be remade every time you compile a file. In /texmf-mswin make sure that luatex.exe and texlua.exe have the same date; then also delete luatex.dll. This usually solves the problem.<br />
<br />
= Installing third party modules =<br />
<br />
The ConTeXt suite only comes with Taco's [[Bibliography|t-bib]] module. If you want to install [http://modules.contextgarden.net/ a new module], say Wolfgang's [[Letter|t-letter]] module, you can use<br />
first-setup.sh --modules="t-letter"<br />
<br />
If you want to install more than one extra module, you can separate them by commas. So, to install the t-letter and t-mathsets module, do<br />
sh ./first-setup.sh --modules="t-letter,t-mathsets"<br />
<br />
If you want to install all extra modules at once, do<br />
sh ./first-setup.sh --modules=all<br />
<br />
= Reverting to an older installation =<br />
<br />
If, for some reason, you want to revert to an older installation, you can do that by<br />
<br />
sh ./first-setup.sh --context=date<br />
<br />
where <code>date</code> is the date of one of the stable releases of ConTeXt. The complete list of old releases that are available is [http://minimals.contextgarden.net/current/context/ here].<br />
<br />
<br />
= Moving the installation tree around = <br />
<br />
According to this post, http://archive.contextgarden.net/message/20101129.144331.d721372f.en.html it's safe to move the installation tree across directory or machines (say you don't have broadband access). You just have to clean and regenerate the cache (./tex/texmf-cache/luatex-cache) with <br />
mtxrun --generate<br />
<br />
= Notes =<br />
<references/><br />
<br />
{{Getting started navbox}}<br />
[[Category:Installation]]<br />
[[Category:Standalone]]</div>SudipSinhahttps://wiki.contextgarden.net/index.php?title=TikZ&diff=24082TikZ2019-03-05T19:56:23Z<p>SudipSinha: Edited the Commutative Diagrams section for more clarity</p>
<hr />
<div>< [[Modules]] | [[Graphics]] > <br />
<br />
[http://pgf.sourceforge.net/ TikZ/pgf] is a portable graphics package developed for LaTeX,<br />
also supporting ConTeXt. It is a possible alternative to [[MetaPost]] & [[MetaFun]]. <br />
<br />
TikZ is included as a (third party) module for ConTeXt.<br />
<br />
== Example ==<br />
<br />
From the TikZ/pgf [http://dl.contextgarden.net/modules/t-tikz/doc/generic/pgf/pgfmanual.pdf manual].<br />
<br />
<texcode><br />
\setupcolors[state=start]<br />
\definecolor[darkgreen][g=.5]<br />
\usemodule[tikz] <br />
<br />
\starttext<br />
<br />
\starttikzpicture[ scale=3,line cap=round<br />
axes/.style=, <br />
important line/.style={very thick},<br />
information text/.style={rounded corners,fill=red!10,inner sep=1ex} ]<br />
<br />
\draw[help lines,step=0.5cm] (-1.4,-1.4) grid (1.4,1.4);<br />
\draw (0,0) circle (1cm); <br />
\draw[->] (-1.5,0) -- (1.5,0) node[right] {$x$} coordinate(x axis);<br />
\draw[->] (0,-1.5) -- (0,1.5) node[above] {$y$} coordinate(y axis);<br />
\foreach \x/\xtext in {-1, -.5/-\frac{1}{2}, 1} <br />
\draw[xshift=\x cm] (0pt,1pt) -- (0pt,-1pt) <br />
node[below,fill=white] {$\xtext$};<br />
\foreach \y/\ytext in {-1, -.5/-\frac{1}{2}, .5/\frac{1}{2}, 1}<br />
\draw[yshift=\y cm] (1pt,0pt) -- (-1pt,0pt)<br />
node[left,fill=white] {$\ytext$};<br />
\filldraw[fill=green!20,draw=green!50!black] (0,0) -- (3mm,0pt) arc(0:30:3mm);<br />
\draw (15:2mm) node[green!50!black] {$\alpha$};<br />
\draw[important line,red]<br />
(30:1cm) -- node[left=1pt,fill=white] {$\sin \alpha$} (30:1cm |- x axis);<br />
\draw[important line,blue]<br />
(30:1cm |- x axis) -- node[below=2pt,fill=white] {$\cos \alpha$} (0,0);<br />
\draw[important line,orange!80!black] (1,0) -- node[right=1pt,fill=white] {<br />
$\displaystyle \tan \alpha \black =<br />
\frac{{\red \sin \alpha}}{\blue \cos \alpha}$}<br />
(intersection of 0,0--30:1cm and 1,0--1,1) coordinate (t);<br />
\draw (0,0) -- (t);<br />
\draw[xshift=1.85cm]<br />
node[right,text width=6cm,information text]<br />
{<br />
The {\darkgreen angle $\alpha$} is $30^\circ$ in the<br />
example ($\pi/6$ in radians). The {\red sine of<br />
$\alpha$}, which is the height of the red line, is<br />
\startformula<br />
{\red \sin \alpha} = 1/2.<br />
\stopformula<br />
By the Theorem of Pythagoras ...<br />
};<br />
\stoptikzpicture<br />
<br />
\stoptext<br />
</texcode><br />
<br />
[[Image:TikZ_example.png]]<br />
<br />
== Placing TikZ graphics ==<br />
<br />
You should wrap TikZ graphics inside \hbox when placing them, for example:<br />
<br />
<texcode><br />
<br />
\placefigure[here][fig:myfig]{My figure.}{\hbox{\starttikzpicture<br />
\draw (0, 0) circle (3cm);<br />
\stoptikzpicture}}<br />
<br />
</texcode><br />
<br />
Otherwise, positioning will not work (figure will not be centered). See [http://www.ntg.nl/pipermail/ntg-context/2007/023177.html this post] by Aditya Mahajan for explanation.<br />
<br />
== Example for commutative diagrams ==<br />
<br />
Hans Åberg wrote to the mailing list on 2016-10-06:<br />
<br />
There is a tikz-cd package at CTAN: https://www.ctan.org/tex-archive/graphics/pgf/contrib/tikz-cd?lang=en<br />
<br />
In order to use it, download the the file <code>tikzlibrarycd.code.tex</code> and put it in <code>CONTEXT_HOME/tex/texmf-modules/tex/generic/pgf/libraries/</code>. Then run<br />
<pre><br />
mtxrun --generate<br />
context --make<br />
</pre><br />
You should now be able to use tikz-cd.<br />
<br />
Makes sure to follow the translation rules in the manual for ConTeXt. In addition to that, it seems that you have to replace the apostrophe with "below".<br />
<br />
The first few examples in the manual, which compiled with latest ConTeXt:<br />
<br />
<texcode><br />
\usemodule[tikz]<br />
\usetikzlibrary[cd]<br />
<br />
\starttext<br />
<br />
\starttikzcd<br />
A \arrow{rd} \arrow{r}{𝜑} \NC B \NR<br />
\NC C<br />
\stoptikzcd<br />
<br />
\starttikzcd<br />
A \arrow[r, "\phi"] \arrow[d, red]<br />
\NC B \arrow[d, "\psi" red] \NR<br />
C \arrow[r, red, "\eta" blue]<br />
\NC D<br />
\stoptikzcd<br />
<br />
\starttikzcd<br />
A \arrow[r, "\phi" near start, "\psi" below, "\eta" near end] \NC B<br />
\stoptikzcd<br />
<br />
\starttikzcd<br />
T<br />
\arrow[drr, bend left, "x"]<br />
\arrow[ddr, bend right, "y"]<br />
\arrow[dr, dotted, "{(x,y)}" description] \NC \NC \NR<br />
\NC X \times_Z Y \arrow[r, "p"] \arrow[d, "q"]<br />
\NC X \arrow[d, "f"] \NR<br />
\NC Y \arrow[r, "g"] \NC Z<br />
\stoptikzcd<br />
<br />
\starttikzcd[column sep=tiny]<br />
\NC \pi_1(U_1) \ar[dr] \ar[drr, "j_1", bend left=20]<br />
\NC<br />
\NC[1.5em] \NR<br />
\pi_1(U_1\cap U_2) \ar[ur, "i_1"] \ar[dr, "i_2" below]<br />
\NC<br />
\NC \pi_1(U_1) \ast_{ \pi_1(U_1\cap U_2)} \pi_1(U_2) \ar[r, dashed, "\simeq"]<br />
\NC \pi_1(X) \NR<br />
\NC \pi_1(U_2) \ar[ur]\ar[urr, "j_2" below, bend right=20]<br />
\NC<br />
\NC<br />
\stoptikzcd<br />
<br />
\stoptext<br />
</texcode><br />
<br />
== See also ==<br />
<br />
[http://archive.contextgarden.net/message/20080219.024326.0e45446b.pt.html Discussion] on the ConTeXt user's list.<br />
<br />
[[Category:Modules]]<br />
[[Category:Graphics]]</div>SudipSinha