[Tex/LaTex] use (LaTeX?) packages from CTAN in plain TeX

ctanlearningmacrosmiktexplain-tex

I have the following assumptions:

  • TeX is a kind of language
  • Plain TeX is the original environment for this language
  • LaTeX (and other environments) is a set of compiled macros written using TeX primitives.
  • Lets say MikTeX can organize those macros in local repository so I can reuse them in my LaTeX document.

But I am still not sure if CTAN contains packages for LaTeX or for TeX. Are they written using built-in LaTeX macros or written in pure TeX. If the second is true can I use those packages in plain TeX using \input? How should I organize macros from CTAN just download and put into the same folder with my document? Is there any package manager for plain TeX?

Best Answer

In short: Plain TeX and LaTeX are different macro packages that define different formats. So, in general, it is not possible to use LaTeX packages on top of Plain TeX. For a short introduction to all this rather specialized jargon you may check this blog post

It is possible to use some LaTeX packages on Plain TeX (graphics, color and hyperref, for instance), by faking some functionality of LaTeX; only that necessary to load and make the packages operative. Yet another macro package built on top of plain, eplain, has a built-in ability to load some basic LaTeX macro packages.

\beginpackages
  \usepackage{graphicx,color}
  \usepackage{url}
\endpackages

It is also possible to use some Plain TeX functionality in LaTeX documents with the plain package and the plain environment provided. Still, it's not the whole thing, but works for many things.

\usepackage{plain}
\begin{plain}
[plain stuff]
\end{plain}

You can find all this stuff in CTAN, which contains lots of thing TeX related. Beware though that you need to learn how to navigate in the tex-archive tree.

The MikTeX package manager deals mostly with LaTeX packages, so you may need to learn how to install Plain macro files manually.

Related Question