Do I need to download a distribution -TeXLive or MiKTeX- to compile a ConTeXt code?
No. You don't even need to download anything. By the way, MiKTeX doesn't include a ConTeXt distribution, whereas TeXLive does. Some options for using ConTeXt are presented below:
- As Marijn says, there's a standalone version available here. It includes ConTeXt LMTX (LuaMetaTeX) and ConTeXt MkIV (LuaTeX). I'd recommend this as it's updated at least once a week.
- Another possibility, a bit rudimentary one, is ConTeXt Live. Nowadays it runs ConTeXt LMTX. It works for small documents and sometimes I use it for answers in this site.
- Yet another possibility discovered by David Carlisle through abusing
latexmkmakes possible to compile ConTeXt files in Overleaf. However, TL 2020 (and some older versions) only includes ConTeXt MkII (pdfTeX/XeTeX) and ConTeXt MkIV (LuaTeX). LMTX isn't currently (2020) available. As for the trick itself, you need to create a
latexmkrcfile with the following content:
$pdflatex="context --result=output %S; cp output.log /compile/output.log;cp output.pdf /compile/output.pdf"; $recorder=0; $pdf_mode=1;
- TeXLive.net runs TeX snippets, so you can also run small ConTeXt documents. Using the
% !TEX contextmagic comment is mandatory so that the document isn't compiled as a LaTeX one. For an example, try
https://texlive.net/run?%25%20!TEX%20context%0A%0A%5Cstarttext%0Ahello%0A%5Cstoptext%0A(courtesy of David Carlisle). It currently (March 2021) runs ConTeXt MkIV from TeXLive 2020.
- There are Docker images too. Images are for LMTX, MkIV (current release or "beta") and MkIV (TL "stable", annual release). MkII isn't available. To be honest, I'm not familiar with Docker itself, so I cannot elaborate here.