Difference between revisions of "Command/setupalign"

From Wiki
Jump to navigation Jump to search
m (cleaned up)
m (explain fullhz)
(23 intermediate revisions by 6 users not shown)
Line 4: Line 4:
 
}}
 
}}
  
== [[Help:Reference|Syntax]] ==
+
== [[Help:Reference|Syntax]] (autogenerated) ==
<table cellspacing="4" cellpadding="2" class="cmd">
+
<syntax>setupalign</syntax>
  <tr>
 
    <td colspan="2" class="cmd">\setupalign<span class="first" >[...]</span></td>
 
  </tr>
 
  <tr valign="top" class="first">
 
    <td class="cmd">[...]</td>
 
    <td>width left right middle inner outer wide broad height bottom line reset hanging nothanging hyphenated nothyphenated </td>
 
  </tr>
 
</table>
 
  
 +
__TOC__
  
== Description ==  
+
== Description of keys ==  
  
 +
=== Horizontal alignment ===
 +
{|
 +
|-
 +
| <code>normal</code> *or* <code>width</code> *or* <code>yes</code>
 +
| justified alignment
 +
|-
 +
|<code>middle</code>
 +
|centered lines
 +
|-
 +
|<code>flushleft</code> *or* <code>no</code> *or* <code>right</code>
 +
|left-aligned (The <code>right</code> is from 'ragged-right'. Don't use it.)
 +
|-
 +
|<code>flushright</code> *or* <code>left</code>
 +
|right-aligned (Again, better to not use <code>left</code>.)
 +
|-
 +
|<code>inner</code>
 +
|Flush to inner margin.
 +
|-
 +
|<code>outer</code>
 +
|Flush to outer margin.
 +
|-
 +
|<code>disable</code>
 +
|Used only for oneliners. Equivalent to flushleft, but something called <code>\parfillskip</code> is set to zero.
 +
|-
 +
|<code>last</code>
 +
|Justified, with last line centered.
 +
|}
  
 +
=== How wide do we let the lines get? ===
 +
{|
 +
|-
 +
| <code>wide</code>
 +
| Lets <code>ragged-right</code>, <code>ragged-left</code>, and <code>middle</code> lines be wider. (Makes them be wider?)
 +
|-
 +
| <code>broad</code>
 +
| Similar? Used in tables.
 +
|}
 +
 +
=== Where would we like the bottom line to end up? ===
 +
{|
 +
|-
 +
| <code>bottom</code>
 +
| Ragged-ish bottom (the room for variation is but a single lineheight, of course).
 +
|-
 +
| <code>height</code>
 +
| Fill the height: press the last line's baseline against the lower boundary.
 +
|-
 +
| <code>line</code>
 +
| Let the last line's descenders touch the lower boundary.
 +
|}
 +
 +
=== Vertical alignment within boxes, e.g. <code>\framed</code> or table cells ===
 +
{|
 +
|-
 +
| <code>high</code>
 +
| Align to top
 +
|-
 +
| <code>low</code>
 +
| Align to bottom
 +
|-
 +
| <code>lohi</code>
 +
| Vertically centered
 +
|}
 +
 +
=== Predefined combinations ===
 +
{|
 +
|-
 +
| <code>table</code>
 +
| Equivalent to <code>flushleft,broad,high</code>
 +
|-
 +
| <code>reset</code>
 +
| Equivalent to <code>normal</code>.
 +
|-
 +
| <code>center</code>
 +
| Equivalent to <code>middle,broad</code>.
 +
|}
 +
 +
 +
=== Typesetting direction --- which direction do you write in? ===
 +
{|
 +
|-
 +
| <code>lefttoright</code> *or* <code>l2r</code>
 +
| "Hello, world."
 +
|-
 +
| <code>righttoleft</code> *or* <code>r2l</code>
 +
| ".dlrow ,olleH"
 +
|}
 +
 +
=== Nicer justification and microtypography ===
 +
{|
 +
|-
 +
| <code>hanging</code>
 +
| Enable hanging punctuation ('protrusion')
 +
|-
 +
| <code>nothanging</code>
 +
| Disable hanging punctuation
 +
|-
 +
| <code>hz</code>
 +
| Enable slight stretching of characters ('font expansion').
 +
|-
 +
| <code>fullhz</code>
 +
| Enable not only stretching of characters but also additional kerning.
 +
|-
 +
| <code>nohz</code>
 +
| Disable font expansion.
 +
|-
 +
| <code>hyphenated</code>
 +
| Allow hyphenation.
 +
|-
 +
| <code>nothyphenated</code>
 +
| Prevent hyphenation.
 +
|-
 +
| <code>lesshyphenation</code>
 +
| Less hyphenation. Not sure whether this is relative/additive, or absolute.
 +
|-
 +
| <code>morehyphenation</code>
 +
| More hyphenation. Not sure whether this is relative/additive, or absolute.
 +
|-
 +
| <code>tolerant</code>
 +
| Allow looser final paragraphs (more hyphenations, more stretching) to avoid
 +
overfull hboxes.
 +
|-
 +
| <code>verytolerant</code>
 +
| Allow even more loose paragraphs.
 +
|-
 +
| <code>stretch</code>
 +
| Allow spaces to be stretched extra far. Can be combined with (very)tolerant, and usually is.
 +
|}
  
 
== Example ==
 
== Example ==
<!-- Please fill in an example if you can -->
+
<context mode=mkiv source=yes>
 +
\setuppapersize[A6]
 +
\setupalign[nothyphenated,justified,hanging]
 +
\setupwhitespace[line]
 +
 
 +
\input tufte
 +
 
 +
\setupalign[hyphenated,morehyphenation,flushleft]
 +
\input tufte
 +
</context>
  
 
== See also ==
 
== See also ==
<!-- something like [[cmd:goto|\goto]] -->
+
* {{cmd|startalignment}} to locally change the alignment
 +
* [[Hyphenation]] for more on hyphenation
 +
* {{cmd|setupspacing}} for setting up the spacing between words
  
[[Category:Reference/en|setupalign]]
+
== Help from ConTeXt-Mailinglist/Forum ==
 +
All issues with:
 +
{{Forum|{{SUBPAGENAME}}}}

Revision as of 19:32, 12 July 2022

\setupalign

Syntax (autogenerated)

\setupalign[...,...]
[...,...]broad wide bottom height line high low lohi flushright flushleft middle yes no width normal reset inner outer flushinner flushouter left right center disable last end paragraph lefttoright righttoleft l2r r2l table lesshyphenation morehyphenation hanging hangingboth nothanging hz fullhz nohz hyphenated nothyphenated tolerant verytolerant stretch extremestretch final 1*final 2*final 3*final 4*final more 1*more 2*more


Description of keys

Horizontal alignment

normal *or* width *or* yes justified alignment
middle centered lines
flushleft *or* no *or* right left-aligned (The right is from 'ragged-right'. Don't use it.)
flushright *or* left right-aligned (Again, better to not use left.)
inner Flush to inner margin.
outer Flush to outer margin.
disable Used only for oneliners. Equivalent to flushleft, but something called \parfillskip is set to zero.
last Justified, with last line centered.

How wide do we let the lines get?

wide Lets ragged-right, ragged-left, and middle lines be wider. (Makes them be wider?)
broad Similar? Used in tables.

Where would we like the bottom line to end up?

bottom Ragged-ish bottom (the room for variation is but a single lineheight, of course).
height Fill the height: press the last line's baseline against the lower boundary.
line Let the last line's descenders touch the lower boundary.

Vertical alignment within boxes, e.g. \framed or table cells

high Align to top
low Align to bottom
lohi Vertically centered

Predefined combinations

table Equivalent to flushleft,broad,high
reset Equivalent to normal.
center Equivalent to middle,broad.


Typesetting direction --- which direction do you write in?

lefttoright *or* l2r "Hello, world."
righttoleft *or* r2l ".dlrow ,olleH"

Nicer justification and microtypography

hanging Enable hanging punctuation ('protrusion')
nothanging Disable hanging punctuation
hz Enable slight stretching of characters ('font expansion').
fullhz Enable not only stretching of characters but also additional kerning.
nohz Disable font expansion.
hyphenated Allow hyphenation.
nothyphenated Prevent hyphenation.
lesshyphenation Less hyphenation. Not sure whether this is relative/additive, or absolute.
morehyphenation More hyphenation. Not sure whether this is relative/additive, or absolute.
tolerant Allow looser final paragraphs (more hyphenations, more stretching) to avoid

overfull hboxes.

verytolerant Allow even more loose paragraphs.
stretch Allow spaces to be stretched extra far. Can be combined with (very)tolerant, and usually is.

Example

\setuppapersize[A6]
\setupalign[nothyphenated,justified,hanging]
\setupwhitespace[line]

\input tufte

\setupalign[hyphenated,morehyphenation,flushleft]
\input tufte

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: