Changes

Jump to navigation Jump to search
2,372 bytes removed ,  09:07, 3 April 2014
m
Fix a typo.
 == Introducing Mark IV (and MkVI) ==
<center><font color='#663366' size='+3'><strong> Happy birthday MMark 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.! </strong></font></center>&nbsp;You run it with
<div class='floatright'>[http://wiki.contextgarden.net/images/0/0e/MKIV.avi < context>\starttext\externalfigure[/opt/local/texmf/tex/context/sample/.hahaha/MKIV.png]\stoptext</context>]<font size='+1'><strong>''Accelerate to Mark IV!''</strong></font></div>Today is the birth date of Mark IV, the coming of which we have been longing for since many years.filename
Life! Health! Prosperity!There are fundamental differences between Mark IV and Mark II that you should be aware of. Many parts of ConTeXt have been redesigned from scratch making extensive use of the Lua programming language. And that is besides the heavy use of LuaTeX-only features in MkIV. As a result, there are a few intentional incompatibilities between the two ConTeXt versions. See [[MkIV Differences]] for these details.
== Introducing Mark IV ==The first public beta has been released on the 6th of August, 2007. Currently the easiest way to try it out is to install [[ConTeXt Standalone]].
Mark IV is It takes advantage of the name amazing capabilities of the [[LuaTeX]]-aware part and opens up a whole new world of ConTeXt; that ispossibilities, when you use ConTeXt over the LuaTeX engine instead of PDFTeX or XeTeX. You run it in particular with <code>texexec --lua</code>fonts.
In the distribution the MkIV files have suffix 'mkiv'. There are also files with suffix 'mkvi' and more will follow. The first public beta has been released on the 6th of August, 2007 most significant difference is that these files use a different (and still somewhat experimental) syntax. == Installation and maintenance == The Mark IV code needs to be configured before it is readily available on usable. [[http:Running Mark IV|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/module/livewhatever not found".contextgarden.net/ ConTeXt Live] TEXINPUTS can *always* be a problem and really should not be used at all any more. It takes advantage of is a historical environment variable from the amazing capabilities of LuaTeX nineties, and opens up it overrules just about every path in a whole new world of possibilitiesmodern texmf tree. If you need something special, in particular with fontsuse TEXMFLOCAL or TEXMFPROJECT instead.
== Sample code ==
Here are some examples of cool stuff you can do with Mark IV ([http://live.contextgarden.net/ test it!]). 
=== Lua core ===
=== Fonts and typescripts ===
==== Good ol' typescripts ==== Of course, Mark IV allows you to use typescripts as you've always done; for example: <texcode>\usetypescriptThis is detailed in [palatino][texnansiFonts in LuaTeX]\setupbodyfont[palatino,12pt]effe fietsen 2: \input tufte $\sqrt{2}$ \eogonek.
\sc effe fietsen 2: \input tufte $\sqrt{2}$ \eogonek</texcode> That's as simple as using a traditional ConTeXt typescript! But ... how is it any different, then? Well, the difference is that in Mark IV, we can use an Opentype font directly, so that what is done here: when we want to use Palatino, the [[TeX Gyre]] equivalent (“Pagella”) is called and we can use its Opentype “features”; read on. ==== Opentype features ==== A “feature”, in the Opentype jargon, is a set of rules describing changes in the appearance of the text. Hmm, that's not very precise. Let's show some examples. First of all, you have to know that features are referred to by 4-letter tags, and you will see this a lot. One of them is ‘smcp‘, for “small caps“. Let's consider the following Mark IV-only More sample code: <texcode>\definefontfeature[smallcaps][language=DFLT,script=latn,smcp=yes]\font\palasmallcaps=texgyrepagella-regular*smallcaps\palasmallcaps This is a text in small capitals.</texcode> Here you basically define a (Mark IV) feature with the name ”smallcaps”, and associate it with the (Opentype) feature “smcp”. You have to specify which script you want to use it with; scripts in Opentype are also tagged with four letters, and “latn” is of course Latin. Then you define a TeX font with that feature. You can see what features are defined in a particular font with the following bit of code <texcode>\ctxlua{ fontname = 'texgyrepagella-regular.otf'  --[[ First read the font data. This makes heavy use of some of the Mark IV code]] tfmdata = fonts.tfm.read_and_define("file:" .. fontname, 655360) font = tfmdata.shared.otfdata if font then gsubfeatures = fonts.otf.analyze_features(font.gsub) gposfeatures = fonts.otf.analyze_features(font.gpos) end  if gsubfeatures then table.sort(gsubfeatures) % We want our list sorted alphabetically! tex.sprint("\\rm GSUB features: \\tt ") % Beware: you don't want \rm to be interpreted by lua (\rm would yield carriage return + letter m)! for _, feat in ipairs(gsubfeatures) do tex.sprint(feat) tex.sprint(' ') end else tex.sprint("\\rm No GSUB features") end tex.sprint("\\par")  if gposfeatures then tex.sprint("\\rm GPOS features: \\tt ") table.sort(gposfeatures) for _, feat in ipairs(gposfeatures) do tex.sprint(feat) tex.sprint(' ') end else tex.sprint("\\rm No GPOS features") end}</texcode>
It prints the list Other examples of Lua(TeX) code are to be found on the page[[User:Luigi. Youscarso#Luatex_examples|Luigi'll notice there are two sets of features, each one of them defined in a different table of the Opentype fonts user page]] as well as [http: the <code>GSUB</code> table (for Glyph SUBstitution) gives rules for replacing glyphs in certains circumstances (think of ligatures/luatex.bluwiki.com/ http: f + i -> fi); the <code>GPOS</code> table (Glyph POSititioning) gives rules for moving glyphs (think of kerning: A + V -> A <kerning> V)/luatex.bluwiki.com/]
Incidentally, the above code gives some basic examples of [[Category:LuaTeX programming, a mixture of both Lua and TeX programming with some special features (features in the general sense, not the Opentype one :-).]]
1

edit

Navigation menu