Open main menu

Changes

1,640 bytes added ,  07:33, 1 December 2022
m
Hints about old code
'''Beware: This page is very old, code might not work any more.''' On this page I will describe the things lessons learned while setting a CD booklet.
== Fit a text into a box ==
[[image:CD08-p11.png|120px]]
Floating Text around a picture inside any vbox environment is not possible and so the next two examples show text that runs through the graphical element.
 
The variant with a simple framedtext
<texcode>
\startbuffer[text]
\placefigure[left,none]{}{\framed[height=1cm]{graphic}}%
\input tufte
\stopbuffer
 
\starttext
\startstandardmakeup
\startframedtext[width=0.8\textwidth]
\getbuffer[text]
\stopframedtext
\stopstandardmakeup
\stoptext
</texcode>
 
And the variant with layers:
<texcode>
\definelayer[test]
[width=\paperwidth,height=\paperheight]
 
\startbuffer[text]
\placefigure[left,none]{}{\framed[height=1cm]{graphic}}%
\input tufte
\stopbuffer
 
\setlayerframed[test]
[preset=middle]
[width=0.6\textwidth,align=normal]
{\getbuffer[text]}
 
\setupbackgrounds[page][background=test]
 
\starttext
\startstandardmakeup
\stopstandardmakeup
\stoptext
</texcode>
 
But as always with ConTeXt: Hans to the rescue! He has just some time before my trials made a nice macro available in cont-new.tex with the adequate name \starthangaround. With this macro it is quite easy to float the text around the graphic. You only has to change the buffer-code:
<texcode>
% MkII code! Doesn’t work any more.
\startbuffer[text]
\starthangaround{\framed[height=1cm]{graphic}}%
\input tufte
\stophangaround
\stopbuffer
</texcode>
== Use Delicious OTF font with luatex / mkiv ==
 
Get the typescript for the [http://www.josbuivenga.demon.nl/delicious.html Delicious fonts]: [[Exljbris typescript#Delicious]]
 
Then type:
 
<texcode>
\usetypescript[delicious]
\setupbodyfont[delicious,ss,10pt]
</texcode>
== Protrusion with mkiv ==
</texcode>
(You can discard the background definition then) But this places the layer relative to the textarea and not as intended to the pagearea.
 
[[Category:Sample documents]]