I try to use new TeX format ConTeXt, but I find that some TeX primitives don't act any more. How sad I am when I find that.

An simple example is that in plain TeX, we can set the spaces between paragraphs like this

    The first paragraph.\par
    The second paragraph.

Unfortunately, when I do the same in ConTeXt it do nothing. It only support \setupwhitespace but not the original \parskip.

I am a newbie in ConTeXt, I only want to know why.

  • 5
    If you want to write plain TeX, use plain - not ConTeXt. – Martin Schröder Mar 21 '13 at 17:04
  • @morbusg \parindent and \parskip have very different meaning. – Lucas Li Mar 21 '13 at 17:17
  • @morbusg: I really feel so sorry about that. Indeed, It should be \parskip in the example rather that \parindent. – Lucas Li Mar 21 '13 at 17:44
  • @TimLi: No worries! :-) – morbusg Mar 21 '13 at 18:28

At the engine level, all formats use the same primitives (when using the same engine). However, each format may rename these and may also implement all, some or none of the plain TeX macros defined by the plain TeX format on top of the engine. Both ConTeXt and LaTeX2e implement some of the TeX primitives, but not all of them. For example, LaTeX users will expect \end to be a command to create an environment, as that format stores the \end primitive as \@@end. ConTeXt is the same: it implements it's own set of commands. As pointed out in a comment, if you want every plain TeX macro and TeX primitive, use plain.

| improve this answer | |
  • Maybe I am subjective, but sometimes I have to use some TeX primitives like \hbox, \vbox to achieve something, for instance, when designing the chapter title. How can I know what TeX primitives are permited? The reference manual hasn't enough information about this. – Lucas Li Mar 21 '13 at 17:23
  • 2
    @TimLi This is an issue in both LaTeX2e and ConTeXt: there are places where primitives are needed, but are not documented. I'm afraid you have to 'suck it and see'. As you say you are a beginner in ConTeXt, I'd say you should look for 'native' methods first. – Joseph Wright Mar 21 '13 at 17:25
  • Yeah, maybe users like me have to do that in order to make the codes work exactly. – Lucas Li Mar 21 '13 at 17:29
  • 4
    @TimLi: Whenever ConTeXt overwrites a TeX primitive, it saves the original using \normal..... So, you can always access the original primitives. But just having access to original primitives is not enough. In your example, the reason that \parskip does not work is because ConTeXt resets it to the value of \setupwhitespace at the end of each paragraph. – Aditya Mar 22 '13 at 23:22
  • 1
    @TimLi I am afraid that the details are only available in the sources. ConText user manual only describes \setupwhitespace command so that a user does not have to worry about \parskip. Maybe you can write a migration guide for plain tex users. – Aditya Mar 24 '13 at 13:51

ConTeXt also knows \parskip like all other primitives:

bar \parskip=2cm \par
baz \par

However, it makes more sense to use the ConTeXt specific macros

| improve this answer | |
  • 1
    Indeed, it works, but only between bar and baz. Following your advice, I will use the better \setupwhitespace. – Lucas Li Mar 22 '13 at 1:54

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.