Difference between revisions of "Command/setupinitial"
< Command
Jump to navigation
Jump to search
Line 91: | Line 91: | ||
</cd:description> | </cd:description> | ||
<cd:examples><cd:example title="The following example produces an awful-looking initial, but it illustrates how some of these parameters work."><context mode="mkiv" source="yes"> | <cd:examples><cd:example title="The following example produces an awful-looking initial, but it illustrates how some of these parameters work."><context mode="mkiv" source="yes"> | ||
− | \definepapersize[sheet][width=120mm,height= | + | \definepapersize[sheet][width=120mm,height=200mm] |
\setuppapersize[sheet] | \setuppapersize[sheet] | ||
\setuppagenumbering[location=] | \setuppagenumbering[location=] | ||
− | \setuplayout[width= | + | \setuplayout[width=100mm,backspace=15mm,topspace=0mm,header=0mm,headerdistance=0mm] |
\starttext | \starttext | ||
Line 100: | Line 100: | ||
Here is some text 1. | Here is some text 1. | ||
− | \setupinitial[color=darkred, distance= | + | \setupinitial[color=darkred, distance=10mm, n=2, m=2, before={\blank[big]\hairline\blank[big]}] |
\placeinitial | \placeinitial | ||
\input knuth | \input knuth | ||
Line 109: | Line 109: | ||
\setupinitial[n=3, m=4] | \setupinitial[n=3, m=4] | ||
+ | \placeinitial | ||
+ | \input knuth | ||
+ | |||
+ | \blank[2*big] | ||
+ | |||
+ | Here is some text 3. | ||
+ | |||
+ | \setupinitial[location=margin,n=3, m=1,distance=5mm] | ||
\placeinitial | \placeinitial | ||
\input knuth | \input knuth | ||
Line 114: | Line 122: | ||
\stoptext | \stoptext | ||
− | </context></cd:example><cd:example title="Details about | + | </context></cd:example><cd:example title="Details about hoffset"><context mode="mkiv" source="yes"> |
− | \definepapersize[sheet][width=120mm,height= | + | \definepapersize[sheet][width=120mm,height=200mm] |
\setuppapersize[sheet] | \setuppapersize[sheet] | ||
\setuppagenumbering[location=] | \setuppagenumbering[location=] | ||
− | \setuplayout[width= | + | \setuplayout[width=100mm,backspace=15mm,topspace=0mm,header=0mm,headerdistance=0mm] |
\starttext | \starttext | ||
Line 131: | Line 139: | ||
Here is some text 2. | Here is some text 2. | ||
+ | |||
+ | \setupinitial[hoffset=0mm] | ||
+ | \placeinitial | ||
+ | T{\tt\bf hoffset=0mm}~\input knuth | ||
\setupinitial[hoffset=5mm] | \setupinitial[hoffset=5mm] | ||
\placeinitial | \placeinitial | ||
− | T{\tt hoffset=5mm}\input knuth | + | T{\tt\bf hoffset=5mm}~\input knuth |
\setupinitial[hoffset=-5mm] | \setupinitial[hoffset=-5mm] | ||
\placeinitial | \placeinitial | ||
− | T{\tt hoffset=-5mm}\input knuth | + | T{\tt\bf hoffset=-5mm}~\input knuth |
+ | |||
+ | \stoptext | ||
+ | |||
+ | </context></cd:example><cd:example title="Details about voffset"><context mode="mkiv" source="yes"> | ||
+ | \definepapersize[sheet][width=120mm,height=200mm] | ||
+ | \setuppapersize[sheet] | ||
+ | \setuppagenumbering[location=] | ||
+ | \setuplayout[width=100mm,backspace=15mm,topspace=0mm,header=0mm,headerdistance=0mm] | ||
+ | |||
+ | \starttext | ||
+ | |||
+ | Here is some text 1. | ||
+ | |||
+ | \setupinitial[color=darkred] | ||
+ | \placeinitial | ||
+ | \input knuth | ||
+ | |||
+ | \blank[2*big] | ||
+ | |||
+ | Here is some text 2. | ||
+ | \setupinitial[voffset=0mm] | ||
+ | \placeinitial | ||
+ | T{\tt\bf voffset=0mm}~\input knuth | ||
\setupinitial[voffset=5mm] | \setupinitial[voffset=5mm] | ||
\placeinitial | \placeinitial | ||
− | T{\tt voffset=5mm}\input knuth | + | T{\tt\bf voffset=5mm}~\input knuth |
\setupinitial[voffset=-5mm] | \setupinitial[voffset=-5mm] | ||
\placeinitial | \placeinitial | ||
− | T{\tt voffset=-5mm}\input knuth | + | T{\tt\bf voffset=-5mm}~\input knuth |
+ | |||
+ | |||
+ | \stoptext | ||
+ | |||
+ | </context></cd:example><cd:example title="Details about font"><context mode="mkiv" source="yes"> | ||
+ | \definepapersize[sheet][width=120mm,height=200mm] | ||
+ | \setuppapersize[sheet] | ||
+ | \setuppagenumbering[location=] | ||
+ | \setuplayout[width=100mm,backspace=15mm,topspace=0mm,header=0mm,headerdistance=0mm] | ||
+ | |||
+ | \starttext | ||
+ | |||
+ | Here is some text 1. | ||
+ | |||
+ | \setupinitial[color=darkred] | ||
+ | \placeinitial | ||
+ | \input knuth | ||
+ | |||
+ | \blank[2*big] | ||
+ | |||
+ | Here is some text 2. | ||
+ | |||
+ | \setupinitial[font=SansBold at 60pt] | ||
+ | \placeinitial | ||
+ | \input knuth | ||
+ | |||
\stoptext | \stoptext |
Revision as of 21:20, 12 December 2020
Contents
\setupinitial
Summary
Initials (also known as drop caps, dropped caps, or versals) can be made in ConTeXt using the \placeinitial command.
The command \setupinitial
is used to customize this decorative or ornate first letter(s) to prose at the start of chapters, sections, paragraphs, and so forth.
Settings
\setupinitial[...,...][...=...,...] | |
[...,...] | name |
n | number |
m | number |
before | command |
distance | dimension |
hoffset | dimension |
voffset | line dimension |
style | style command |
color | color |
font | font |
text | text |
location | margin text |
method | first last auto none |
Option | Explanation | ||
---|---|---|---|
n |
| ||
m |
| ||
before |
| ||
distance |
| ||
hoffset |
| ||
voffset |
| ||
style |
| ||
color |
| ||
font |
| ||
text |
| ||
location |
| ||
method |
|
Description
Because the space carved out for the initial is rectangular, initials work best with a font with rectangular ornaments around the letter.
Examples
The following example produces an awful-looking initial, but it illustrates how some of these parameters work.
\definepapersize[sheet][width=120mm,height=200mm] \setuppapersize[sheet] \setuppagenumbering[location=] \setuplayout[width=100mm,backspace=15mm,topspace=0mm,header=0mm,headerdistance=0mm] \starttext Here is some text 1. \setupinitial[color=darkred, distance=10mm, n=2, m=2, before={\blank[big]\hairline\blank[big]}] \placeinitial \input knuth \blank[2*big] Here is some text 2. \setupinitial[n=3, m=4] \placeinitial \input knuth \blank[2*big] Here is some text 3. \setupinitial[location=margin,n=3, m=1,distance=5mm] \placeinitial \input knuth \stoptext
Details about hoffset
\definepapersize[sheet][width=120mm,height=200mm] \setuppapersize[sheet] \setuppagenumbering[location=] \setuplayout[width=100mm,backspace=15mm,topspace=0mm,header=0mm,headerdistance=0mm] \starttext Here is some text 1. \setupinitial[color=darkred] \placeinitial \input knuth \blank[2*big] Here is some text 2. \setupinitial[hoffset=0mm] \placeinitial T{\tt\bf hoffset=0mm}~\input knuth \setupinitial[hoffset=5mm] \placeinitial T{\tt\bf hoffset=5mm}~\input knuth \setupinitial[hoffset=-5mm] \placeinitial T{\tt\bf hoffset=-5mm}~\input knuth \stoptext
Details about voffset
\definepapersize[sheet][width=120mm,height=200mm] \setuppapersize[sheet] \setuppagenumbering[location=] \setuplayout[width=100mm,backspace=15mm,topspace=0mm,header=0mm,headerdistance=0mm] \starttext Here is some text 1. \setupinitial[color=darkred] \placeinitial \input knuth \blank[2*big] Here is some text 2. \setupinitial[voffset=0mm] \placeinitial T{\tt\bf voffset=0mm}~\input knuth \setupinitial[voffset=5mm] \placeinitial T{\tt\bf voffset=5mm}~\input knuth \setupinitial[voffset=-5mm] \placeinitial T{\tt\bf voffset=-5mm}~\input knuth \stoptext
Details about font
\definepapersize[sheet][width=120mm,height=200mm] \setuppapersize[sheet] \setuppagenumbering[location=] \setuplayout[width=100mm,backspace=15mm,topspace=0mm,header=0mm,headerdistance=0mm] \starttext Here is some text 1. \setupinitial[color=darkred] \placeinitial \input knuth \blank[2*big] Here is some text 2. \setupinitial[font=SansBold at 60pt] \placeinitial \input knuth \stoptext
Notes
See also
- \defineinitial placeinitial
- typo-drp.mkiv
- \placeinitial placeinitial