Part answer to my own question, from Aditya Mahajan on ConTeXt mailing
list (verbatim, but with formatting and links):
Read about TDS (TeX Directory Structure).
You need to put files in $TEXMF/tex/plain/
subdirectory for Plain
format to find it, or in $TEXMF/tex/generic/
subdirectory for all
macro packages (plain, latex, context) to find it.
As experiment, placed eplain's source files in $HOME/texmf/tex/generic/eplain/
. No other copies visible. For a file testdox.tex
, containing \input eplain
, the command
luatex --fmt luatex-plain testdoc.tex
does indeed find eplain.tex
. Executed three of the “generate
” commands:
mktexlsr
context --generate
luatools --generate
And now all of the these command will find the file:
luatools --find-file eplain.tex
mtx-run --locate eplain.tex
kpsewhich eplain.tex
In addition, if others have problems with font locations in ConTeXt, for OTF fonts, using Alegreya* as an example, I
- created the directory: ''$HOME/texmf/fonts/opentype/huerta/alegreya'' and
- copied all the ''*.otf'' files there.
- By running the “
generate
” commands above,
- followed by the font update commands below,
\font\x = <font>
also now works without having to install the fonts in the operating system.
mtxrun --script fonts --update --force
mtxrun --script fonts --update --simple --force
Edit: Path issues solved. Works on Windows as well, just ensure you're happy with the setting of %TEXMFHOME%
, which you can set with a batch file, or permanently in %TEXMF%\tex\texmf\web2c\texmf.cnf
). I run this ctxenv.cmd
file from a Cmd Prompt console before starting to work with ConTeXt's LuaTeX:
@echo off
:: Sets ConTeXt environment for running ConTeXt tools.
:: NB: This includes setting TEXMFHOME and calling
:: .\tex\setuptex.bat. It also add the ''.\utl''
:: directory to your PATH. This file must live in
:: your ConTeXt base directory. It will set %CTX%
:: for convenience.
::
set CTX=%~dp0
set CTX=%CTX:~0,-1%
set PATH=%CTX%\utl;%CTX%\bin;%PATH%
set TEXMFHOME=%CTX%\local
.\tex\setuptex.bat
:: optional: remove the colons in front of these commands:
::mktexlsr
::context --generate
::luatools --generate
As for the TL math fonts setting problem, I'll rephrase as a new question.
*Alegrya: http://www.ctan.org/tex-archive/fonts/alegreya/
The simple file
\input pgf
\show\shipout
produces different results when compiled using TeX Live 2012, with PGF version 2.10, or under TeX Live 2014, with PGF version 3.0.0
Version 2.1.0
> \shipout=macro:
->\afterassignment \pgfutil@@EveryShipout@Test \setbox 255= .
Version 3.0.0
> \shipout=macro:
->\edef \AtBegShi@GroupLevel {\number \currentgrouplevel }\afterassignment \AtBegShi@Test \setbox \AtBeginShipoutBox =.
The conclusion we can draw from this code is that the main error in PGF 2.10, which was doing \setbox255=...
has been fixed. In my experiment, the example file you show (purged from the added code)
\input pgf
\setbox0=\hbox{A}
\shipout\box0
Hello world
\bye
compiles flawlessly and produces the expected result.
Best Answer
I hope this answer can clarify a few basic concepts for you.
TeX TeX is a (macro) programming language invented by Knuth. It is a Turing complete language. That is, theoretically you can do almost anything you can do with other languages, though not necessarily easily.
TeX Engine A program that can interpret the TeX language. It is like the perl program for the Perl language. The first TeX engine was written by Knuth. Nowadays, popular engines include
pdftex
,xetex
,luatex
.pdftex
is much faster than the other two though the other two provide extra functionality, especially for using opentype fonts.luatex
provides much more than fonts.LaTeX and ConTeXt These are formats. A format is just a set of TeX macros (well, not exactly so simple). They define a lot of macros for you to use. For example, LaTeX defines the
\documentclass
and\begin{document}
macros while ConTeXt defines\starttext
. It will take a much longer paragraph to answer what there really is in a format. For now, you may just think the programlualatex
is a shortcut for starting theluatex
engine, inputting the LaTeX macro packages (i.e., the format), and then processing your input. (I know this is not the exact explanation, but I believe it helps a beginner to understand).LuaLaTeX, XeLaTeX, pdfLaTeX, ... these are all just shortcuts for using the LaTeX format with a TeX engine.
In the question, you seems to think ConTeXt and LuaTeX are the same. This is not true. ConTeXt Mark IV requires LuaTeX as an engine to process this format. Just like many LaTeX packages and the forthcoming LaTeX3 format requires an engine with e-TeX features.
Please correct me if there's anything wrong with this answer.