Open main menu

Changes

4,405 bytes added ,  13:27, 9 August 2020
m
Text replacement - "<cmd>" to "{{cmd|"
= 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 differentdifferently. You must remember to always give the full name of the options, and then the effects should be almost unnoticeable.
= Parameter processing =
Mark IV delegates lots an ever growing amount of the key-value processing to lua, and as a result you often have should always provide 'expanded' numbersin Mark IV:
\setuplayout[width=\the\hizehsize] % not just \hsize
\definetypeface [joke] [ss] [sans] [joke] [default] [rscale=0.9] % not just .9
 
The underlying reason is that the scanning via lua does not have the special behaviour of TeX itself.
= Paragraph formatting =
Mark IV extends the {{cmd|definefontfeature}} to make full use of the lua opentype engine by adding '''mode=node''', and various opentype tags features that you want on or off. In the distribution, there is only one case of this: <texcode>\definefontfeature [arabic] [mode=node,language=dflt,script=arab,ccmp=yes, init=yes,medi=yes,fina=yes,isol=yes, liga=yes,dlig=yes,rlig=yes,clig=yes,calt=yes, mark=yes,mkmk=yes,kern=yes,curs=yes]</texcode> It should come as no surprise that such a '''mode=node''' generates different effects, but even with a traditional font setup there are incompatibilies unless you use tfm-only fonts, because the metric information of fonts used in Mark IV (afm, ttf, otf) are often subtly different from the tfm metrics used by Mark II.
== 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.
HH: this This is related to open type fonts metrics not having the limitations of traditional tfm metrics (and the fact that internally luatex has some limitatiosn limitations removed)
== Interword spacing ==
Linebreaks can be different because full-blown UTF-8 hyphenation patterns are used.
 
Even strange symbols can be directly used in your source code, your code may become more human readable. You can use this [[Symbols/utf8|handy utf-8 list]] or use program like [http://live.gnome.org/Gucharmap Gucharmap] or [http://utils.kde.org/projects/kcharselect/ kcharselect] for copy/pasting some characters. If you're using Linux, you can also use ~/.XCompose file.
 
HH: regimes still work so unless something is broken other encodings also should work but going utf8 is definitely wise
= Fonts and Typescripts =
Typescripts in Mark IV never specify any encoding at all (Unicode is mandatory).
= Metapost =
This means there are two things you have to watch out for:
# You should load the MP packages you need in <{{cmd>|startMPinclusions</cmd>}}..<{{cmd>|stopMPinclusions</cmd>}}; not inside a graphic.
# You have to make sure that you do not re-state equations that were already solved in a previous graphic.
These are in fact the exact same rules that you have to adhere to in mkii MkII if {{cmd|runMPgraphicsfalse}} is active.  Another difference is the way text is handled in MkIV. In particular, color (<cmdcode>runMPgraphicsfalsewithcolor</cmdcode> )is activenot applied to metapost text. For example, <texcode>draw thelabel(decimal i, (i, 0) scaled 1cm) withcolor red ;</texcode> currently does <b>not</b> work in MkIV. However, <texcode>label(textext("\color[red]"& decimal i), (i, 0) scaled 1cm) ;</texcode> does work. This second solution works both in MkIV and in MkII.(Note that <code>\color[red]</code> can be abbreviated <code>\red</code>.)
= Indices and sorting =
Sort orders can be different because of changes to the sort order lists.
 
= Images =
The official way of placing image in in mkivMkIV:
<texcode>
\placefigure[middle,none]{}{...}
</texcode>
mkii The MkII way was
<texcode>
\placefigure[middle]{none}{...}
= Logos =
The logo commands (<{{cmd>|definelogo</cmd> }} c.s.) do not exist in mkivMkIV; use layers instead. = Itemizations = ''Bare'' {{cmd|item}} paragraphs (without enclosing list) are not allowed. = Nomarking/Select = {{cmd|nomarking}} is currently broken and will likely be removed from MkIV; use {{cmd|select}} instead: <texcode>\defineselector [caption] [max=2,n=2] % alternate {short}{long} caption \starttext \placefigure {\select{caption} {A cow} {This image represents a typical black and white milk cow. In many regions of the world, cows may look quite different.} } {\externalfigure[cow]} \setupselector [caption] [n=1]\completelistoffigures \stoptext</texcode>  = Table of Contents = If you want to modify [[Table of Contents|TOC]] you may find that <code>level</code> parameter has recently(02/2010) and probably for ever no effect in [[Mark IV]]. You may use layers {{cmd|placelist}}[chapter,section] insteadof {{cmd|setupcombinedlist}}[content][level=2]. = Grid typesetting = The implementation in MkIV is completely new, and various details have changed. The most important difference seems to be that the new grid by default is less tolerant for superscripts, but it can be made so by using {{cmd|setuplayout}}[grid=tolerant]. = External figures = There was a change in the default path search for external figures, but I don't know the exact details off-hand.IIRC, the main problem is that texmf tree images are now found before local images. To change this ordering,use the <tt>location</tt> key to {{cmd|setupexternalfigures}}: <texcode>\setupexternalfigures[location={local,global,default}]</texcode> <tt>local</tt>: current directory + <tt>..</tt> + <tt>../..</tt> <tt>global</tt>: paths set with <tt>directory=...</tt> <tt>default</tt>: texmf tree = Frames = The macro <tt>\setuplocalframed</tt> is no longer defined in Mark IV (08.2010).You can use the <tt>\getparameters</tt> macro as adequate substitute. = Trialtypesetting = The macros for (de)activating trial typesetting (<tt>\trialtypesettingtrue</tt> and <tt>\trialtypesettingfalse</tt>) have been changed. They are no longer part of a <tt>\newif</tt> statement. The new names are <texcode>\settrialtypesetting</texcode> for activation and <texcode>\resettrialtypesetting</texcode> for deactivation. = Programming internals = == <tt>read*file</tt> Commands like <tt>\readlocfile</tt> no longer default to a <tt>.tex</tt> extension, explicit file extensions are now required. = Sectioning = In MkIV, after <tt>\setuphead[section][placehead=no]</tt> there may still be some output on the page, because MkIV stores the reference target(s) to the section in an invisible box on the current page. Use <tt>\setuphead[section][placehead=hidden]</tt> if that interferes with the rest of your typesetting[[Category:Tools]]