Changes

Jump to navigation Jump to search
2,243 bytes added ,  10:14, 23 May 2013
Add ipsum, letters to rectangles
% mode=mkiv
\setuppapersize[A7]
 
\starttext
\input khatt-en
% mode=mkiv
\setuppapersize[A7]
 
\usemodule[visual]
\setupsystem[random=10] 
\setupwhitespace[big]
\setuphead[section][style=tfd]
\starttext
\subjectsection{ \tfd \fakewords{3}{4} }
\fakewords{30}{40} % min, max
% mode=mkiv
\setuppapersize[A7]
 
\usemodule[visual]
\setupsystem[random=10] 
\setupwhitespace[big]
\setuphead[section][style=tfd]
\starttext
\subjectsection{ \tfd \fakewords{3}{4} }
\fakewords{30}{40} % min, max
== Lorem ipsum ==
The {{src|m-ipsum.mkiv}} module lets you define your own lorem ipsum commands. Such a command samples a number of lines, words, or paragraphs from an input file you specify, and typesets them. Thanks to the {{code|1=before=, after=, left=}}, and {{code|1=right=}} keys, you can decorate the sampled lines or words with code, allowing you to fake itemizations, headers, and all sorts of things.
 
<texcode>
\starttext
\ipsum[
alternative=paragraph,
n=3,
before=\blank,
after=\blank,
language=la
]
 
\ipsum[
alternative=lines,
before=\startitemize,
after=\stopitemize,
left=\startitem,
right=\stopitem,
language=la]
 
\page
 
\defineipsum
[ward]
[file=ward,
before=\blank,
after=\blank]
 
\defineipsum
[ward:itemize]
[ward]
[alternative=lines,
before={\startitemize[packed]},
after=\stopitemize,
left=\startitem,
right=\stopitem]
 
\ipsum[ward:itemize]
\stoptext
</texcode>
 
== Letters to rectangles ==
 
The typography chapter of the reference manual contains a piece of code that converts letters into black rectangles of the same width, height, and depth.
 
{{Multicol}}
<texcode>
% Converting every letter into a rectangle.
\def\somecharacter#1%
{\setbox0=\hbox{#1}%
\blackrule[width=\wd0,
height=\ht0,
depth=\dp0]}
 
\def\silhouette#1%
{\noindent \processtokens\somecharacter%
\somecharacter\relax\space
{#1}}
 
\starttext
The height and depth of lines differs.
 
\silhouette{The height and depth of lines
differs.}
\stoptext
</texcode>
{{Multicol-break}}
<context source=no>
% Converting every letter into a rectangle.
\def\somecharacter#1%
{\setbox0=\hbox{#1}%
\blackrule[width=\wd0,
height=\ht0,
depth=\dp0]}
 
\def\silhouette#1%
{\noindent \processtokens\somecharacter%
\somecharacter\relax\space
{#1}}
 
\starttext
The height and depth of lines differs.
 
\silhouette{The height and depth of lines
differs.}
\stoptext
</context>
{{Multicol-end}}

Navigation menu