This is a TeX macro package for processing the output from Jade/OpenJade in TeX (-t) mode. You can download it from Sourceforge; http://sourceforge.net/projects/jadetex/.
This documents is based on a note by FC describing his experience installing JadeTeX with OpenJade 1.3 and teTeX 1.06 (on Unix). It has since been expanded and checked by SR and SP. It is aimed to people who have perhaps some experience using TeX and LaTeX, enough to write up technical reports using simple macros, but know little or nothing about format files or the particulars of the TeX distribution structure, and consequently have a rough time with JadeTeX…
To use JadeTeX, you first of all should compile and install
OpenJade. The resulting openjade executable, used
-t tex flag, will format an
SGML/XML file and yield a TeX output file. Using
jadetex or pdfjadetex, you can
transform this into DVI or PDF;
from DVI, you can use a program like
dvips to get PostScript output. This note describes
how to build and install the former two programs,
jadetex and pdfjadetex.
The TeX output file uses a macro package, JadeTeX, built on
top of LaTeX, just as LaTeX is a macro package sitting on top of
plain TeX. It is probably possible to just stick an
\input at the top of your
.tex file and use the JadeTeX macros this
way, but that would be slow since TeX would need to parse and
compile the macro definitions every time you format your
.tex file. So what we do instead is to use
TeX (actually, initex) to read in the LaTeX
format, followed by the JadeTeX package, once, and dump the
compiled image to what is called a
This is the same way that LaTeX is usually employed. Once the
format file is built and installed, it is easy to arrange for
TeX to read it in quickly and automatically when you process a
But, as ever, there are complications, relating to TeX's capacity restrictions. TeX is designed to use a fixed amount of resources to process documents; for example, there is a maximum number of strings that can be allocated, and a maximum stack size. If a processing run exceeds the default limits, TeX will complain and refuse to continue. Unfortunately, OpenJade's TeX backend tends to exceed these default limits.
Fortunately, though, there is no need to recompile your TeX
binary. If you are using teTeX (or any other Web2c-based
distribution) there will be a file called
texmf.cnf in your installation which sets
the capacity parameters and is consulted every time TeX is
run. By adding the right parameter settings here, you can
ensure that JadeTeX will be unlikely to run out of memory.
texmf.cnf? You can find it in the
web2c directory under
texmf tree... which begs the question, where
texmf? The most
straightforward way to find it is to make sure all the TeX executables
are in your
PATH; then do:
kpsewhich -expand-var '$TEXMFMAIN'
and it will
respond with the location of your texmf tree. As you can see, it is also
$TEXMFMAIN, which is how I shall
refer to it in the sequel.
In a minute we are going to modify
increase the capacities, then build the JadeTeX format file and install
the JadeTeX executable(s). You may have a command
hugelatex, a version of latex with greater
capacity settings than the usual one, which is named simply
latex. If so, build your format file
using hugelatex rather than
latex, so that JadeTeX inherits the `huge'
settings. Otherwise, make sure your latex is big.
In addition, if you make any changes to the literate source of the
JadeTeX macro package (see below), a normal latex
may not do.
%original texmf.cnf -- runtime path configuration file for kpathsea. % (If you change or delete `original' on the previous line, the % distribution won't install its version over yours.)If it says
% TeX Live texmf.cnfthen you can skip all this and proceed to the next section, as TeX Live is already set up for JadeTeX
pool_size = 125000 pool_size.context = 750000Here,
pool_sizeis the name of the parameter in both cases, but the second one is qualified with
.context, which indicates that this setting will be preferred when using the ConTeXt macro package. We need to make similar accomodations not only for latex but also jadetex and pdfjadetex. Unfortunately, we don't know the minimal required values for every parameter and some of these values are probably ridiculously high, but no matter ...
% latex settings main_memory.latex = 1100000 param_size.latex = 1500 stack_size.latex = 1500 hash_extra.latex = 15000 string_vacancies.latex = 45000 pool_free.latex = 47500 nest_size.latex = 500 save_size.latex = 5000 pool_size.latex = 500000 max_strings.latex = 55000 font_mem_size.latex= 400000 % jadetex & pdfjadetex main_memory.jadetex = 1500000 param_size.jadetex = 1500 stack_size.jadetex = 1500 hash_extra.jadetex = 50000 string_vacancies.jadetex = 45000 pool_free.jadetex = 47500 nest_size.jadetex = 500 save_size.jadetex = 5000 pool_size.jadetex = 500000 max_strings.jadetex = 55000 main_memory.pdfjadetex = 2500000 param_size.pdfjadetex = 1500 stack_size.pdfjadetex = 1500 hash_extra.pdfjadetex = 50000 string_vacancies.pdfjadetex = 45000 pool_free.pdfjadetex = 47500 nest_size.pdfjadetex = 500 save_size.pdfjadetex = 5000 pool_size.pdfjadetex = 500000 max_strings.pdfjadetex = 55000Add these to the end of the file, or wherever makes you happy.
cp -R /usr/share/texmf/tex/latex/config /tmp cd /tmp/configNow do this:
tex -ini -progname=latex latex.iniThis will produce a file
latex.fmtin the same directory. Rename this to
latex.fmt, then become root and put it in
$TEXMFMAIN/web2c. This is where all the format files are kept. (You can delete the other copied files from
mv latex.fmt /usr/share/texmf/web2c
ln -s /usr/bin/tex /usr/local/bin/latexWhen tex is invoked, it looks at the name
Xit was invoked with, then loads the format file
$TEXMFMAIN/web2cbefore it starts processing the document. So creating this symbolic link is all that is needed to create the latex executable.
make installThis creates
pdfjadetex.fmt, puts them in
$TEXMFMAIN/web2cfor you (using kpsewhich to find
$TEXMFMAIN), and installs a few other auxiliary files under
ln -s /usr/bin/tex /usr/bin/jadetex ln -s /usr/bin/pdftex /usr/bin/pdfjadetex(changing the location of the binary directory to wherever your TeX is) and run mktexlsr so that your TeX distribution becomes aware of the newly installed files in
openjade -t tex -d demo.dsl demo.sgm jadetex demo.tex pdfjadetex demo.texYou're done!
dsssl.def, etc) can't be found. What did I do wrong?
jadetex.dtx. This is the literate source for the format file and other files installed under
$TEXMFMAIN/tex/jadetex. To format it, use latex:
latex jadetex.dtxYou will get tons of overfull hboxes but if you are using a nice big latex, it will work. Formatting the batch file
jadetex.inswill produce stripped sources (
jadetex.ltx), which can be compiled into format files as before:
latex jadetex.ins make -f Makefile.jadetex
quadding: #t), hyphenation must be on,
hyphenation?: #t, and a current language must be selected (e.g.,
language: 'EN) for JadeTeX to perform hyphenation.
-V tex-backendto your openjade command-line.