Changes

Jump to navigation Jump to search
m
→‎Rotating: add mirror
=Scaling=
You The {{cmd|scale}} command is all-purpose, you can scale by factors or to a defined size. As a special case, you can insert symbols at a reduced size in the text flowusing {{cmd|getscaledglyph}}.
<context source=yes>
\getscaledglyph{.5}{Serif}{a} a \getscaledglyph{2}{Serif}{a}
</context>
 
= Mirroring =
</context>
<code>\{{cmd|mirror</code> }} makes a <code>\hbox</code> and mirrors the contents. If you want to have a longer paragraph mirrored, you have to make a <code>\vbox</code> manually.
<context source=yes>
\mirror{\vbox{Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do:
once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it, `\quote{and what is the use of a book,' } thought Alice `\quote{without pictures or conversation?'}}}
</context>
= Rotating =
You can {{cmd|rotate }} something by an arbitrary angle by saying something like  
<context source=yes>
\rotate[rotation=42]{the ultimate answer}
\rotate{the ultimate answer}
</context>
 
<context source=yes>
\ss Next generation L\rotate{m}\rotate{m}TSP\mirror{3}Al\rotate[rotation=270,location=high]{v}?
</context>
 
You can rotate a long paragraph as well.
==Location parameter==
An example by Hans Hagen showing the The influence of <code>location=</code> argument at different angles:
<context source=yes>
</context>
You can rotate a long paragraph as well.=== Rotating Figures ===
The following code shows how the location parameter influences rotation with a frame:
\stoptext
</texcode>
 
or, even nicer:
 
<context source="yes">
\useMPlibrary[dum]
\setupexternalfigures[width=4em,height=3em,frame=on,]
\dostepwiserecurse{0}{359}{45}{{\bf\recurselevel˚}\quad
\doloopoverlist{normal,depth,fit,broad,high,middle}{
\dontleavehmode\ruledhbox{%
\rotate[rotation=\recurselevel, location=\recursestring]{%
\externalfigure[\recursestring]
}%
}%
}\par
}
</context>
==In a box==
==Page dependent landscape figures==
Sometimes, in a double-sided portrait document, you may wish to rotate a landscape figure so that the top is towards the spine of the book – no matter whether it's it’s on an odd or even page. In this case the {{cmd|doifoddpageelse}} command can help:
<texcode>
<context source="yes">
\setupcolors[state=start]
\definedfont[SansBold at 20mm]
\baselineskip 0pt % switch off the space between the stripes
\lineskip 0pt
\def\MyLogo{\vbox{\hbox{\CONTEXT}\null}} % null is necessary for the whole bounding box
\clip[ny=3,y=1]{\color[yellow]{\MyLogo}}\clip[ny=3,y=2]{\color[orange]{\MyLogo}}\clip[ny=3,y=3]{\color[red]{\MyLogo}}</context> And here’s how to cut out a piece by measures (see also {{cmd|setupclipping}} and {{cmd|clip}}): <context source="yes">\clip[width=3cm, height=1cm, hoffset=1cm, voffset=5mm]{\externalfigure[cow][width=5cm]}
</context>
see also {{cmd|setupclipping}} and {{cmd|clip}}
=Further reading=
In Graphic transformations are implemented in [https://source.contextgarden.net/tex/context/base/mkiimkiv/coregrph-mistrf.mkii coremkiv grph-mistrf.mkiimkiv] (for MkII), there are some handy commands for graphical text manipulation definedand [https://source.contextgarden. {{todo|What is the equivalent for net/tex/context/base/mkiv ?}}/grph-trf.lua grph-trf.lua].
[[Category:Basics]]
[[Category:Graphics]]

Navigation menu