Changes

Jump to navigation Jump to search
1,328 bytes added ,  07:30, 1 December 2022
deleted "hangaround" section (MkII)
as in the Plain format) and the more familiar {{cmd|dontleavehmode}}
({{src|syst-aux.mkiv}}).
Just use the chosen macro immediately before the <code>\framed</code> macro and
everything should be fine:
This is a [[Right_and_left|FAQ item]].
<span id="setupnotation v setupnote"></span>
== Footnotes: The Difference between {{cmd|setupnotation}} and {{cmd|setupnote}} ==
(For more definite answers concerning the ''notes'' mechanism, use the
source, Luke: {{src|strc-not.mkvi}}.)
 
== Float Insertion Issues ==
</texcode>
Another solution can be the less-known ''hangaround environment''({{cmd|starthangaround}}, cf.[[Using_Graphics#Flow_text_around_a_picture|Hangaround]]).It lets the text of a given paragraph (the content of the environment)flow around a box (the first argument).In contrast to real floats it does not place a caption.This poses === The “paragraph in a group” problem in MkIV as the new code will not allow placingcaptions arbitrarily.[[http://repo.or.cz/w/context.git/blob/refs/heads/origin:/tex/context/base/strc-flt.mkvi#l257]](If you desparately need separate captions please send a featurerequest to one of the[[ConTeXt_Mailing_Lists#Mailing Lists]]).===
<context source="yes" mode="mkii">\starttext\input dawkinsAnother common issue with sidefloats is starting a paragraph in a group.
\starthangaround{<context source="yes" mode="mkiv"> \framedplacefigure[align=right,frame=off,width=.3\textwidthnone]{ }{\externalfigure [cow] [width=0.325\textwidth]\crlf} %% NB the fake caption works *only in mkii* \placefloatcaption [figure] [ref:acow] {A smiling Dutch cowLorem ipsum dolor sit amet, consectetur adipiscing elit. {\italic Bos primigenius taurus}} }}\input dawkins\stophangaround
{\input dawkinsbf Oeps} \stoptextsamplefile{lorem}
</context>
As you can see the paragraph starting with “Oeps” just overflows into the picture.
That is a well-known problem and there are posts about it on the mailing
list every once in a while. The sidefigure mechanism uses <code>\parshape</code> to
make the paragraph flow around the figure. The <code>\parshape</code> primitive only
applies to a single paragraph, so ConTeXt communicates the current
<code>\parshape</code> settings to the next paragraph using <code>\everypar</code>. However, when
a new paragraph starts in a group, i.e.
<texcode>
{\bf Oeps} ...
</texcode>
TeX inserts the <code>\everypar</code> tokens inside that group because only the
first letter starts the paragraph. That is to say is effectively looks
like this
<texcode>
% \everypar inserted inside the group
% ~~~v
{\bf \the\everypar Opes} ...
% ~~~~~~~~~~~~~~~~~~~~~^
% Setting of \everypar are discarded again when leaving the group and \parshape is lost.
</texcode>
You have to explicitly start a new paragraph before opening a group.
The easiest way to do this is
<texcode>
\dontleavehmode{\bf Oeps} ...
</texcode>
Now the <code>\everypar</code> tokens are inserted directly after {{cmd|dontleavehmode}}
outside the group and the problem goes away.
= Syntax =
== Assignments ==
 
Spaces before commas or before the closing <code>]</code> are '''''not''''' ignored in ConTeXt. That is a common pitfall and leads to errors that can be confusing for beginner, especially those coming from LaTeX, where this is the default behaviour. Formatting your keys like this might look nice but leads to spurious spaces:
<context source="yes" mode="mkiv">
\getparameters[test]
[ foo=bar
, hello=world
]
“\testfoo” “\testhello”
</context>
Instead it is recommended to adhere to the style that is used in the ConTeXt source to avoid problems with trailing spaces:
<context source="yes" mode="mkiv">
\getparameters[test]
[foo=bar,
hello=world]
“\testfoo” “\testhello”
</context>
In the most common form of key-value type arguments, ConTeXt will
pass being omitted.
In [[MetafunMetaFun - MetaPost in ConTeXt]], the default Metapost format in Context, the booleans
<code>mfun_first_run</code> and <code>mfun_trial_run</code> allow
detecting the individual stages:
\stoptext
</texcode>
 
[[Category:Basics]]
[[Category:Tools]]

Navigation menu