What is the most minimal code to work with ConTeXt?

  • "work with"? What kind of work do you have in mind? – Charles Stewart Jan 13 '11 at 9:51
  • @Charles: To make it compilable. – xport Jan 13 '11 at 10:03
  • To test that your set up is working? – Charles Stewart Jan 13 '11 at 10:09
  • @Charles: Yes. I want to make a test. – xport Jan 13 '11 at 10:13

This is the most minimal. It just instructs TeX to stop.


While I'm at it. It's also the most minimal code for plain TeX. For LaTeX, the best I could do is this.


I guess

\catcode`@11 \@@end

is shorter, but it's less minimal since TeX has to execute two commands instead of just one.

  • @TH \stop for LaTeX should be the shorter? – Yiannis Lazarides Jan 13 '11 at 7:11
  • @Yiannis: Ah yes. Probably the shortest, but not the most minimal. It invokes the output routine. – TH. Jan 13 '11 at 9:22
  • What about \enddocument in LaTeX? Probably also not minimal, since that requires an aux file present. – Konrad Rudolph Jan 13 '11 at 11:19
  • @Konrad: That doesn't work. As you mentioned, it looks for \jobname.aux. – TH. Jan 13 '11 at 12:17
Hello world.

or even simpler

Hello world.
  • Well, actually I'm not a ConTeXt user. wiki.contextgarden.net/First_Document – Leo Liu Jan 13 '11 at 6:25
  • how about just \bye? – Yiannis Lazarides Jan 13 '11 at 6:30
  • @Yiannis: In fact, there's no difference, right? I think the key is "work" but not "most minimal". The first example works as most ConTeXt ducuments, and the second one works as Plain TeX. – Leo Liu Jan 13 '11 at 10:29

According to ConTeXt Garden,


is the minimal working example which produces a page and it is for both LuaTeX/MkIV and LuaMetaTeX/LMTX. It produces a blank PDF with a page number. Yeah, new answer to old question, but it's still shorter than \end :)

As Henri points out, ConTeXt will run with an empty input file, but it won't produce any PDF.

  • 1
    In fact, ConTeXt will even compile an empty file (but doesn't produce a PDF), whereas LaTeX will stop and ask for input. – Henri Menke Dec 30 '20 at 14:11
  • @HenriMenke I know the former because I accidentally did it before (Lua stuff without TeX output). I didn't know about the latter, tho. Nice remark. – Jairo A. del Rio Dec 30 '20 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.