Difference between revisions of "Mark IV"

From Wiki
Jump to navigation Jump to search
(→‎Fonts and typescripts: contents moved to dedicated page)
Line 52: Line 52:
 
=== Fonts and typescripts ===
 
=== Fonts and typescripts ===
  
This is detailed in [[Fonts in LuaTex]].
+
This is detailed in [[Fonts in LuaTeX]].
  
 
=== More sample code ===
 
=== More sample code ===
  
 
Other examples of Lua(TeX) code are to be found on [[User:Luigi.scarso#Luatex_examples|Luigi's user page]] as well as [http://luatex.bluwiki.com/ http://luatex.bluwiki.com/]
 
Other examples of Lua(TeX) code are to be found on [[User:Luigi.scarso#Luatex_examples|Luigi's user page]] as well as [http://luatex.bluwiki.com/ http://luatex.bluwiki.com/]

Revision as of 08:45, 8 August 2009

Introducing Mark IV

Mark IV is the name of the LuaTeX-aware part of ConTeXt; that is, when you use ConTeXt over the LuaTeX engine instead of PDFTeX or XeTeX. You run it with

texexec --lua filename

or

context filename

The first public beta has been released on the 6th of August, 2007. It will be available on TeX Live 2008 and MikTeX 2.8. Currently the easiest way to try it out is to install ConTeXt Minimals.

It takes advantage of the amazing capabilities of LuaTeX and opens up a whole new world of possibilities, in particular with fonts.

Installation and maintenance

The Mark IV code needs to be configured before it is usable. This page explains how to do that.

Troubleshooting

The environment variable TEXINPUTS has to be empty or unset. If not, you can get errors about "file.tex not found".

Sample code

Here are some examples of cool stuff you can do with Mark IV (test it!).

Lua core

The first thing you will want to test are the lua functions. Try

\ctxlua{a = 1.5 ; b = 1.8 ; c = a*b ; tex.print(c) ;}

or the equivalent:

\startlua
a = 1.5
b = 1.8
c = a*b
tex.print(c)
\stoplua

You can also do more elaborate calculations with the lua math library:

\ctxlua{tex.print("$\string\\sqrt{2} = " .. math.sqrt(2) .. "$")}

Note that the above works with any flavour of LuaTeX; nothing is actually ConTeXt-specific (except for \ctxlua and \startlua/\stoplua).

Fonts and typescripts

This is detailed in Fonts in LuaTeX.

More sample code

Other examples of Lua(TeX) code are to be found on Luigi's user page as well as http://luatex.bluwiki.com/