ConTeXt Standalone

From Wiki
Jump to navigation Jump to search

< Installation | ConTeXt Minimals/Structure | ConTeXt Minimals/Implementation >

The Minimals are an attempt to provide the same functionality as the current Pragma's minimal ConTeXt distributions in the zip files.

They are hosted on http://minimals.contextgarden.net (equivalent to rsync://contextgarden.net/minimals/).

Everyone is invited to test this distribution, but is kindly asked for patience and understanding until we tidy up the details. You need to have rsync installed, for windows it's shipped together with the minimals.

Quick Start

Linux/Mac/FreeBSD

mkdir context && cd context
rsync -ptv rsync://contextgarden.net/minimals/setup/first-setup.sh .
./first-setup.sh

... go and have a coffee ...

and then put something equivalent (depending on where you have placed ConTeXt) of

source ~/context/tex/setuptex ~/context/tex

to ~/.bash_profile or do this each time when you want to initialize the environment to run the minimals:

cd ~/context/tex
. setuptex

or

. ~/context/tex/setuptex ~/context/tex

This will enable you to use both TeX Live and ConTeXt minimals without interferring with each other.

Mac newbie installation and configuration

The following assumes that you want to use ConTeXt and you are a not inside unix world (otherwise, see before). It guides you to install ConTeXt minimal installation under Mac in the typical Applications folder. Then it gives you some information about how to configure Smultron to work as an editor for ConTeXt. Smultron is a mac-only, open source text editor which is very easy to use and at the same time powerful (see also [1]).

ConTeXt installation

1. Create a folder inside your Applications folder and name it "ConTeXtMinimals"

2. Open a Terminal window (i.e. go under Utilities and open the Terminal app: a little window pops up)

3. type this: cd /Applications/ConTeXtMinimals/ it means "change directory": now we are working under the folder we have created

4. type this: rsync -ptv rsync://contextgarden.net/minimals/setup/first-setup.sh .

we have called rsync, a program which goes on the contexgarden site (--> you must be connected to internet) and download all the necessary files for us

Now (well, after a while...) we have all the required files into the /Applications/ConTeXtMinimals folder

Smultron installation and configuration

1. Smultron is a mac application. To install it, simply download the dmg and put the app under the Applications folder (as usual)

2. Open Smultron and go under Tools-->Handle Commands-->Show Commands Window

3. The resulting window allows you to define some commands which can be executed by Smultron. Substantially, this means that Smultron opens for you a Terminal, types the code you want and presses return.

4. Create a new command by pressing the "New Command" button and type a name (e.g. "minimalsTexexec"). Then, write in the text field at the bottom:

#!/bin/sh 

cd /Applications/ConTeXtMinimals/ 
. /Applications/ConTeXtMinimals/tex/setuptex /Applications/ConTeXtMinimals/tex
cd %%d
texexec %%p

Texexec is the command you should call from the Terminal to run ConTeXt. Now Smultron can do it for you.

5. Write your ConTeXt file with Smultron and save it. When you want to compile it, simply go under Tools-->Commands-->Other-->minimalsTexexec. This will generate a pdf file in the same folder of your .tex file.

6. If you want to experiment with LuaTeX simply add another command (you can name it e.g. "minimalsLua") with this text in its text field:

#!/bin/sh 
cd /Applications/ConTeXtMinimals/ 
. /Applications/ConTeXtMinimals/tex/setuptex /Applications/ConTeXtMinimals/tex
cd %%d
context %%p

6b. If you explore the Commands window, you will see that clicking under the Shortcut tab you can insert a shortcut

6c. If you want to see what ConTeXs is telling you (which is fundamental in case of unexpected behaviors) you can select Tools-->Handle Commands-->Show Command Result Window. This will open a window mirroring the content of the Terminal (i.e. what ConTeXt is communicating you)

Notes

1. All the process requires that you have installed on your machine rsync, ruby and perl. But if you are on macosx, Apple should already have provided it, so at 99% there should not be problems.

2. We are not using the famous TeXShop editor, because it is slighlty more complicated and typically you grab it bundled with a TeX distribution (like MacTeX), and opportunely configured. By using Smultron, we have created a completely autonomous and lightweight ConTeXTMinimals installation which can work aside MacTeX/TeXShop installation.


Windows

Note: rsync sometimes has problems with paths with uppercase letters (like c:\Temp or c:\Documents and Settings). Installing into all-lowercase paths sometimes helps.

Note: If you're behind firewall and rsync times out you need to open port 873 for outgoing TCP connections.

Using installer

You may not have MikTeX or TeX Live installed - the two installations will interfere with each other.

Just download and run the installer and hope for the best.

Using command-line tools

Download and unzip context-setup-mswin.zip

Run first-setup.bat, go for a coffee.

Before being able to use ConTeXt you need to run setuptex.bat to initialize the environment. A simple way to do it is to create a file startcontext.bat (use any name) somewhere in PATH and put this line into it

C:\Programs\context\tex\setuptex.bat C:\Programs\context\tex

Then, you can type startcontext into CMD whenever you want to use ConTeXt Minimals instead of MikTeX.

Testing

\starttext
Hello World!
\stoptext

Now, you should be able to run

context hello.tex

or

texexec hello.tex

context uses LuaTeX by default.

Goals

We wanted to provide:

  • an easy to (no-need-to-)install ConTeXt distribution
  • a fast and convenient way to update ConTeXt and binaries to the latest version (no need to fetch 100 MB when only minimal modifications have been made in the distribution)
  • a reference ConTeXt distribution
  • an easy way to revert to an older ConTeXt (in case the latest one is broken)

We do not plan to provide:

  • LaTeX packages (perhaps the really-basic-latex as an add-on package, but only if someone else has time to investigate what is needed)
  • extensive support for whatever binaries or packages which are otherwise standard in TeX distributions: use TeX Live or MikTeX for that purpose

The minimals contain:

  • ConTeXt
  • Fonts: most important TeX-aware ones
  • pdfTeX, XeTeX, LuaTeX and Metapost (latest version, if possible)
  • formats (need to be generated by user) for
    • ConTeXt, mptopdf and plain TeX for pdfTeX/XeTeX/LuaTeX
    • metafun and plain for Metapost
  • it would be nice to have tex4ht as a package if someone can figure out what is needed to make it work

Supported platforms

  • Windows
  • Linux (compiled with glibc 2.3.6)
  • Linux, 64-bit
  • Mac OS X Intel
  • Mac OS X PowerPC
  • FreeBSD
  • (Solaris)
  • other platforms on request (please send a mail to the ntg-context mailing list)

Installation

Prerequisites

You need to have two packages preinstalled:

  • rsync
  • ruby (at least 1.8)

First Installation

Please note that the location or name of that simple installation script may change! (It's a really stupid one, one could also call it a prototype.)

The needed files are under:

Well, to be honest, all you need to run it on linux/mac is this script (the rest of files will be downloaded autematically):

Take a look at it, modify it if needed and run it. On Windows you can either take that command-line version from the zip or

It will download about 200 MB.

Running

Just like for the old minimals, you have to add a command like

 source /opt/context/tex/setuptex /opt/context/tex 

to your system startup

Updating

For now, the main recipe to update is to run first-setup again. A command similar to ctxtools --updatecontext might be provided in the future.

TODO

(this will move to a better place)

Minor notes

  • document environmental variables/different modes of installation
  • split LM from rest of the fonts
  • --all switch to get all modules and all fonts
  • add font metric files from cont-fnt.zip
  • add Charis SIL
  • fix mvs
  • add the lua configuration file

Other notes

This is a description of how the first installation and any subsequent updates should work (or how it would be nice if they worked that way):

We need to:

  • create files README INSTALL
  • create a file minimals.lua (or some other self-explanatory name):
    • rsync location (default: rsync://contextgarden.net/minimals, could be anything)
    •  ??? installation location (default is simply the current location (pwd))
    • engines (default: all - pdftex, xetex, luatex, metapost)
    • formats (default: english + dutch context for all the installed engines, metapost, metafun; optional: other interfaces, plain pdftex, xetex)
    • fonts (need to be reorganized/improved anyway, perhaps a list of fonts should be fetched)
    • once in the future: supported font encodings for pdftex (default: texnansi, ec, optional: greek, t5, t2a, t2b, t2c, ...)
    • third party modules (list needs to be fetched form the garden, default)
    • context version (default: current, other options: beta, highly-experimental (for "Hans-and-Taco-only"), specific-date in the case of a fixed version issue a warning at next update)
    • interactive flag: shoud the script ask for changes interactively again or should it simply reaspect & use them (defaut: interactive for the first time, after that automatic)
  • improve first-setup(.sh, .bat) (or with some other self-explanatory name), which:
    • checks if rsync exists (if not, an error is issued, saying please install rsync first)
    • checks for perl and ruby and issues a similar error/warning (in fact, we can still proceed to the next step and download things even if perl & ruby are not installed, but that doesn't make much sense)
    • does rsync to installation files themselves (in case mtx-update has changed in the mean time)
    • reads in minimals.lua (which engines, formats, fonts, modules to download ...) if interactive is set to true, ask for default settings again, otherwise respect those settings and continue
    • asks for installation location
    • creates (or updates) the file with settings (if interactive)
    • fetch files with rsync
    • create formats
    • suggest what to put into .bash_profile (or equivalent locations) to have context initilized automatically
  • add unzip for windows

Binaries

Binaries are mostly taken from TeX Live 2007, but new ones are used whenever available.

Origin of the binaries

  • TeX Live 2007 for most binaries and most platforms
  • Akira's W32TeX for windows binaries (including metapost, LuaTeX, pdfTeX and XeTeX) - automatic
  • for pdfTeX, XeTeX, LuaTeX and metapost for other platforms added manually whenever possible (nice if it could be automated, but no idea how)
  • texmf/scripts/context/stubs from ConTeXt

List of included binaries

Core binaries

We will do our best to keep them as up to date as possible. If they're still not up to date for your platform and you know where to find them, please notify us, we will fix that. We might provide XeTeX and LuaTeX in separate packages (on TODO list).

  • pdftex
  • luatex
  • texlua, texluac (only symlinks on "unix" platforms, in Akira's distribution luatex.dll is used + 3 small executables)
  • xetex, xdvipdfmx
  • metapost
    • dvitomp
    • makempx
    • mpost
    • mpto (can this be replaced by ConTeXt's variant in future?)

Other binaries

  • kpathsea
    • kpseaccess
    • kpsestat
    • kpsewhich
  • different tools
    • bibtex
    • dvipos
    • mktexlsr
    • pdftosrc

Stubs & other ConTeXt-related

  • everything from texmf/scripts/context/stubs
  • luatools, mtxrun
  • texmfstart (take the latest version by Hans automatically: doesn't happen yet)

Font-related

Might be removed or moved to a special category of "font-related binaries", and only available as an additional package.

  • only left for testing
    • afm2pl
    • afm2tfm
    • ttf2afm
  • Knuth's
    • pltotf
    • tftopl
    • vftovp
    • vptovf

Might-be-removed-soon

  • dvipdfmx
  • dvips

ConTeXt

The Minimals provide several versions of ConTeXt:

  • stable
  • beta (suggested for living-on-the-edge ones; will default to stable if not available)
  • alpha (rarely used; will use beta if not available)
  • experimental (only for testing - not meant for general use)
  • date-based ones (currenty only a few versions available - planning to improve)

You can use

   --context=XXX

to get the desired version.

Fonts

Fonts are split in three packages:

  • used in both pdfTeX and XeTeX/LuaTeX: mostly math (pfb, map, enc, tfm)
  • used in pdfTeX only: pfb, map, enc, tfm (those that are not present in "common")
  • used in XeTeX/LuaTeX only: otf

Currently we have (the latest version, in sync with CTAN):

  • Latin Modern
  • Antykwa Torunska
  • Iwona & Kurier
  • TeX Gyre
  • ams

Other fonts to be added:

  • TODO

It is possible that we'll provide a really minimal package with LM only, and additional three packages (common, for new TeX, for old TeX) with all the other fonts.

  • fonts/data/<foundry>/<family|distro>/*
  • lm : always
  • gyre : all of them in one set, optional
  • rest : optional

Third-party modules & Other

  • TODO
  • also cont-* from Hans's page

Documentation

TODO

Implementation

See the implementation page.

Hans's requests

  • reorganize fonts into fonts/data/e-foundry/texgyre/<everything>
  • list directory contents
  • list of files to fetch an old ConTeXt version

Who are “we”?

Ein Teil von jener Kraft, / Die stets das Böse will, und stets das Gute schafft. :-)