MikTeX

From Wiki
Jump to navigation Jump to search

< Windows Installation

MikTeX (http://www.miktex.org) is a magnificent Windows distribution for TeX, but:

  • ConTeXt is currently broken (possible to do some tweaking to make it work)
  • There is no LuaTeX available yet

This page deals with some MikTeX 2.7 specifics about ConTeXt.

Installing ConTeXt

Manual installation of ConTeXt is currently possible, but ...

This section should be removed as soon as possible. ConTeXt in MikTeX should be finally fixed!

Do not forget

Before porforming the steps written below, update MikTeX packages.

Things to check

Just a few things that you might want to check before proceeding ...

  • texmfstart doesn't exist
C:\>texmfstart
'texmfstart' is not recognized as an internal or external command,
operable program or batch file.
  • texexec misbehaves
C:\>texexec
texexec: The Windows command script file could not be found.

(texexec.exe has been present on this computer in C:\Program Files\MiKTeX 2.7\miktex\bin, but I don't know if that's because it was an old installation or because it's always there.)

  • ruby is installed: you get
C:\>ruby --version
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

instead of

C:\>ruby
'ruby' is not recognized as an internal or external command,
operable program or batch file.
  • perl is installed (if you want to use mptopdf)

Install ConTeXt base files

Two slightly different ways to install ConTeXt in MikTeX are described below. Choose either of them (but not both; they are equivalent).

Option 1: Installing into existing MikTeX architecture

Download ConTeXt

C:\Program Files\MiKTeX 2.7\bibtex
C:\Program Files\MiKTeX 2.7\context
C:\Program Files\MiKTeX 2.7\doc
C:\Program Files\MiKTeX 2.7\...
C:\Program Files\MiKTeX 2.7\web2c

but not

C:\Program Files\MiKTeX 2.7\cont-tmf\bibtex\...

Add ConTeXt binaries

  • Copy texexec.bat (and any other script that you might be using, like mptopdf.bat) from
C:\Program Files\MiKTeX 2.7\scripts\context\stubs\mswin

into

C:\Program Files\MiKTeX 2.7\miktex\bin
  • Delete
C:\Program Files\MiKTeX 2.7\miktex\bin\texexec.exe
C:\Program Files\MiKTeX 2.7\miktex\bin\mptopdf.exe

and any other foo.exe belonging to ConTeXt that has been replaced by foo.bat in the previous step.

  • Create a file C:\Program Files\MiKTeX 2.7\miktex\bin\texmfstart.bat with the following content:
@echo off
ruby "C:\Program Files\MiKTeX 2.7\scripts\context\ruby\texmfstart.rb" %*

Option 2: Installing separately

Download ConTeXt

  • Create a new folder
C:\Program Files\ConTeXt
C:\Program Files\ConTeXt\bibtex
C:\Program Files\ConTeXt\context
C:\Program Files\ConTeXt\doc
C:\Program Files\ConTeXt\...
C:\Program Files\ConTeXt\web2c

Set up a new tree in MikTeX

  • Open
Start Menu -> MikTeX 2.7 -> Settings
  • In tab Roots, choose Add ... button and add C:\Program Files\ConTeXt as a new path
  • In tab General, click on Refresh FNDB
  • Click OK

Add ConTeXt binaries to PATH

  • Go to
Control Panel -> System -> Advanced -> Environment Variables
  • Find PATH in System Variables and Edit it. Add ConTeXt stub path in front of the one for MikTeX, for example replace:
C:\Program Files\MiKTeX 2.7\miktex\bin;

with

C:\Program Files\ConTeXt\scripts\context\stubs\mswin;C:\Program Files\MiKTeX 2.7\miktex\bin;

(You could just as well copy all the bat files you need from there to some other place in PATH. For most people copying texexec.bat is almost enough. The important thing is to either delete or shield texexec.exe from MikTeX.)

  • Open a new command line and make sure that you now get
C:\>texexec
'texmfstart' is not recognized as an internal or external command,
operable program or batch file.
  • Create a new file texmfstart.bat anywhere in your PATH, for example in
C:\Program Files\ConTeXt\scripts\context\stubs\mswin\texmfstart.bat

with the following content:

@echo off
ruby "C:\Program Files\ConTeXt\scripts\context\ruby\texmfstart.rb" %*
  • Check that you now get the correct response from command line
C:\>texexec
TeXExec | version 6.2.0 - 1997-2006 - PRAGMA ADE/POD

TeXExec | --check        check versions
TeXExec | --figures      generate overview of figures
TeXExec | ...
TeXExec | --help --all   shows all switches

Make formats

  • Go to Start Menu -> MikTeX 2.7 -> Settings -> Formats -> New ...
Format key: ConTeXt (could be anything)
Format name: cont-en (could be anything)
Compiler: pdftex
Input file name: cont-en.tex
Description: ConTeXt format (could be anything)
(uncheck) Exclude this format ...
  • Choose the newly created format and Build it.
  • For mptopdf uncheck the box for excluding as well.