Difference between revisions of "MkIV Differences"

From Wiki
Jump to navigation Jump to search
m (code correction)
Line 48: Line 48:
 
<texcode>
 
<texcode>
 
\starttext
 
\starttext
\placefigure[here,force][]{none}{\externalfigure[image1/image.png][width=5cm]}
+
\placefigure[here,force,none]{}{\externalfigure[image1/image.png][width=5cm]}
\placefigure[here,force][]{none}{\externalfigure[image2/image.png][width=5cm]}
+
\placefigure[here,force,none]{}{\externalfigure[image2/image.png][width=5cm]}
 
\stoptext
 
\stoptext
 
</texcode>
 
</texcode>

Revision as of 11:09, 6 October 2009

In Mark IV, much has changed. Most of the changes are not noticeable at the source document level, but there are in fact a few important differences. This page attempts to list the intentional as well as the unavoidable incompatibilities between Mark IV and Mark II (but not bugs).

Command line

You start Mark IV with the context command, and Mark II with texexec. The two programs are not the same, and even though they have mostly the same command line, there are some differences. Mostly, this is because context is still lacking a number of options of texexec like for example --passon (those will probably be implemented at some point in the future), but it also parses the command line different. You must remember to always give the full name of the options, and then the effects should be almost unnoticeable.

Paragraph formatting

It should come as no surprise that mode=node generates different effects, but even with a traditional font setup there are incompatibilies unless you use tfm-only fonts.

Actual font usage

If you have a font in both OpenType and traditional Type 1, then Mark IV will typically use one version and Mark II the other. There is no guarantee that both sets have the same metrics.

Interword spacing

TFM-based (Type 1) fonts, especially those generated by afmtotfm, tend to use heuristics to decide on the width of the interword space instead of looking at the actual value inside the font. In Mark IV, it is much more likely that the actual value from the font is used, because Mark IV prefers the actual AFM files over any existing TFM files. As this affects interword spacing, linebreaks in Mark IV can be quite different from the ones in Mark II.

Line spacing

TFM-based fonts often have to round heights and depths to allow for restrictions in the TFM format. This affects individual glyphs but more importantly, it can change the value of '1ex'. This can affect line spacing, because ConTeXt by default uses the value '2.8ex' for the setting of \baselineskip.

Languages and Regimes

Mark IV needs your input to be in UTF-8. Legacy documents using 8bit encodings have to be converted to utf-8 before they are usable.

Linebreaks can be different because full-blown UTF-8 hyphenation patterns are used.

Fonts and Typescripts

Typescripts in Mark IV never specify any encoding at all (Unicode is mandatory)

Metapost

All inline metapost code in your document is executed in a large continuous run (and it seems that all metapost code is sometimes even interpreted twice). This means you should stay away from metapost equations unless you explicitly reset the used variables yourself.

Indices and sorting

Sort orders can be different because of changes to the sort order lists.


Images

When using mkii, following code will give you document with two identical images (2nd will be the copy of 1st) even if they are different.

Mkiv will give you what you expect, I mean two different images (of course only if they are different).

\starttext
\placefigure[here,force,none]{}{\externalfigure[image1/image.png][width=5cm]}
\placefigure[here,force,none]{}{\externalfigure[image2/image.png][width=5cm]}
\stoptext