7

Do I need to download a distribution -TeXLive or MiKTeX- to compile a ConTeXt code?

1 Answers1

10

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 latexmk makes 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 latexmkrc file 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 context magic 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.
  • 2
    @ljrk ConTeXt Live runs LMTX. TL 2020 doesn't include it. Docker images include MkIV and LMTX. Is that what you mean? –  Mar 06 '21 at 23:42
  • Yup, perfect answer now! – ljrk Mar 07 '21 at 09:44
  • @JairoA.delRio ConTeXt only work with MikTeX 2.9 , https://wiki.contextgarden.net/MikTeX – Mamoun Mohammed Mar 13 '21 at 21:32
  • @MamounMohammed I don't use MiKTeX nor Windows, so I cannot test it now. Are you having trouble with a double installation? –  Mar 13 '21 at 21:39
  • I meant ConTeXt work with MikTeX 2.9, But you mentioned "MiKTeX doesn't include a ConTeXt" – Mamoun Mohammed Mar 13 '21 at 21:46
  • you can check from ConTeXt website – Mamoun Mohammed Mar 13 '21 at 21:47
  • @MamounMohammed "MiKTeX doesn't include ConTeXt". That's true. I never said ConTeXt and MiKTeX cannot be installed together. –  Mar 13 '21 at 21:48
  • 1
    @MamounMohammed I find your remarks strange and unexpected because I use ConTeXt on a daily basis and I know MiKTeX doesn't support it (maybe somewhere in the past it did, as mentioned in the link you share), but it isn't the case anymore. Furthermore, that info is outdated (current LuaTeX is 1.12) –  Mar 13 '21 at 21:54