Difference between revisions of "Dummy text"
m (Text replacement - "pragma-ade.com" to "pragma-ade.nl") |
|||
(11 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
* For various short quotations, see {{cmd|input}}. | * For various short quotations, see {{cmd|input}}. | ||
− | * For words and paragraphs where the letters are formed by black boxes, see [http://www.pragma-ade. | + | * For words and paragraphs where the letters are formed by black boxes, see [http://www.pragma-ade.nl/general/magazines/mag-0007.pdf This Way: Faking Text and More]. The commands are defined in {{modulesrc|m-visual.mkiv}}. |
− | {{ | + | * For meaningless text, see [[M-ipsum]]. |
− | * For meaningless text, see [[m-ipsum]]. | + | |
+ | == \input == | ||
+ | |||
+ | The {{cmd|input| ''basename''}} command lets you input text from a {{code|.tex}} file. You don't have to provide your own dummy text: ConTeXt ships with a number of lovely quotations. You can find them described on the {{cmd|input}} page. | ||
+ | |||
+ | {{Multicol}} | ||
+ | <texcode> | ||
+ | % mode=mkiv | ||
+ | \setuppapersize[A7] | ||
+ | \starttext | ||
+ | \input khatt-en | ||
+ | \stoptext | ||
+ | </texcode> | ||
+ | {{Multicol-break}} | ||
+ | |||
+ | <context mode=mkiv> | ||
+ | % mode=mkiv | ||
+ | \setuppapersize[A7] | ||
+ | |||
+ | \starttext | ||
+ | \input khatt-en | ||
+ | \stoptext | ||
+ | </context> | ||
+ | {{Multicol-end}} | ||
+ | |||
+ | == Fake text == | ||
+ | |||
+ | The module {{modulesrc|m-visual.mkiv}} contains code to produce word-sized black rectangles in random lengths and numbers. | ||
+ | |||
+ | {{Multicol}} | ||
+ | <texcode> | ||
+ | % mode=mkiv | ||
+ | \setuppapersize[A7] | ||
+ | |||
+ | \usemodule[visual] | ||
+ | \setupsystem[random=10] | ||
+ | |||
+ | \setupwhitespace[big] | ||
+ | \setuphead[section][style=tfd] | ||
+ | |||
+ | \starttext | ||
+ | \section{ \fakewords{3}{4} } | ||
+ | |||
+ | \fakewords{30}{40} % min, max | ||
+ | |||
+ | \fakenwords{6}{2} % words, random seed | ||
+ | |||
+ | \startformula | ||
+ | \fakeformula | ||
+ | \stopformula | ||
+ | \stoptext | ||
+ | </texcode> | ||
+ | {{Multicol-break}} | ||
+ | |||
+ | <context mode=mkiv> | ||
+ | % mode=mkiv | ||
+ | \setuppapersize[A7] | ||
+ | |||
+ | \usemodule[visual] | ||
+ | \setupsystem[random=10] | ||
+ | |||
+ | \setupwhitespace[big] | ||
+ | \setuphead[section][style=tfd] | ||
+ | |||
+ | \starttext | ||
+ | \section{ \fakewords{3}{4} } | ||
+ | |||
+ | \fakewords{30}{40} % min, max | ||
+ | |||
+ | \fakenwords{6}{2} % words, random seed | ||
+ | |||
+ | \startformula | ||
+ | \fakeformula | ||
+ | \stopformula | ||
+ | \stoptext | ||
+ | </context> | ||
+ | {{Multicol-end}} | ||
+ | |||
+ | == Lorem ipsum == | ||
+ | The {{modulesrc|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. | ||
+ | |||
+ | {{Multicol}} | ||
+ | <texcode> | ||
+ | \usemodule[ipsum] | ||
+ | |||
+ | \setuppapersize[A7] | ||
+ | |||
+ | \starttext | ||
+ | \ipsum[ | ||
+ | alternative=words, | ||
+ | n=7, | ||
+ | before={[do]}, | ||
+ | inbetween=\space, | ||
+ | language=la | ||
+ | ] | ||
+ | |||
+ | \defineipsum | ||
+ | [ward:itemize] | ||
+ | [file=ward, | ||
+ | alternative=lines, | ||
+ | before={\startitemize[packed]}, | ||
+ | after=\stopitemize, | ||
+ | left=\startitem, | ||
+ | right=\stopitem] | ||
+ | |||
+ | \ipsum[ward:itemize] | ||
+ | \stoptext | ||
+ | </texcode> | ||
+ | {{Multicol-break}} | ||
+ | <context> | ||
+ | \usemodule[ipsum] | ||
+ | |||
+ | \setuppapersize[A7] | ||
+ | |||
+ | \starttext | ||
+ | \ipsum[ | ||
+ | alternative=words, | ||
+ | n=7, | ||
+ | before={[do]}, | ||
+ | inbetween=\space, | ||
+ | language=la | ||
+ | ] | ||
+ | |||
+ | \defineipsum | ||
+ | [ward:itemize] | ||
+ | [file=ward, | ||
+ | alternative=lines, | ||
+ | before={\startitemize[packed]}, | ||
+ | after=\stopitemize, | ||
+ | left=\startitem, | ||
+ | right=\stopitem] | ||
+ | |||
+ | \ipsum[ward:itemize] | ||
+ | \stoptext | ||
+ | </context> | ||
+ | {{Multicol-end}} | ||
+ | |||
+ | == 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> | ||
+ | \setuppapersize[A7] | ||
+ | % 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}} | ||
+ | |||
+ | [[Category:Tools]] |
Latest revision as of 08:27, 2 July 2022
- For various short quotations, see \input.
- For words and paragraphs where the letters are formed by black boxes, see This Way: Faking Text and More. The commands are defined in m-visual.mkiv.
- For meaningless text, see M-ipsum.
\input
The \input basename command lets you input text from a .tex
file. You don't have to provide your own dummy text: ConTeXt ships with a number of lovely quotations. You can find them described on the \input page.
% mode=mkiv \setuppapersize[A7] \starttext \input khatt-en \stoptext |
|
Fake text
The module m-visual.mkiv contains code to produce word-sized black rectangles in random lengths and numbers.
% mode=mkiv \setuppapersize[A7] \usemodule[visual] \setupsystem[random=10] \setupwhitespace[big] \setuphead[section][style=tfd] \starttext \section{ \fakewords{3}{4} } \fakewords{30}{40} % min, max \fakenwords{6}{2} % words, random seed \startformula \fakeformula \stopformula \stoptext |
|
Lorem ipsum
The 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 before=, after=, left=
, and right=
keys, you can decorate the sampled lines or words with code, allowing you to fake itemizations, headers, and all sorts of things.
\usemodule[ipsum] \setuppapersize[A7] \starttext \ipsum[ alternative=words, n=7, before={[do]}, inbetween=\space, language=la ] \defineipsum [ward:itemize] [file=ward, alternative=lines, before={\startitemize[packed]}, after=\stopitemize, left=\startitem, right=\stopitem] \ipsum[ward:itemize] \stoptext |
|
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.
% 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 |
|