Difference between revisions of "Hyphenation"
m |
(add hyphenateddigits) |
||
Line 31: | Line 31: | ||
=== Mark hyphenated lines for review === | === Mark hyphenated lines for review === | ||
See the article on [[Reviewing hyphenation|reviewing hyphenation]]. | See the article on [[Reviewing hyphenation|reviewing hyphenation]]. | ||
+ | |||
+ | === Hyphenate numbers and other non-words === | ||
+ | Use {{cmd|hyphenateddigits}}; it works in text and math mode and is available since 2021-01-28 (i.e. not yet in the wiki at the time of writing). | ||
+ | |||
+ | <context source=yes> | ||
+ | \pi\ = \hyphenateddigits[\unknown]{3.141592653589793238462643383279502884197169399375105} \blank | ||
+ | \pi\ = \hyphenateddigits{3.141592653589793238462643383279502884197169399375105} \blank | ||
+ | x $\pi = \hyphenateddigits[\unknown]{3.141592653589793238462643383279502884197169399375105}$ \blank | ||
+ | x $\pi = \hyphenateddigits{3.141592653589793238462643383279502884197169399375105}$ \blank | ||
+ | </context> | ||
+ | |||
=== See also === | === See also === |
Revision as of 09:30, 29 January 2021
- For hyphens in compound words, see Compound words.
When a word extends beyond the end of a line, it can be broken in the middle and written on two lines, with a hyphen to indicate the breakoff. This is called hyphenation. ConTeXt has a great many facilities for dealing with hyphenation, both automatically and manually; they are gathered on this page.
Contents
Change the hyphenation language
Use \language[de]. NB: this will also alter the marks used for \quotation, etc.
Allow breaking at existing hyphens
To allow breaking at hyphens, slashes, etc., write \setbreakpoints[compound] at the start of your document.
Specify how to break a word
Write \hyphenation{po-ly-syl-lab-ic} at the start of your document. (This will not be remembered across documents.)
Use the \- command. poly\-syllabic
.
To never break a word, write \hyphenation{polysyllabic}.
Prevent hyphenation locally
There are two ways to prevent a word from being hyphenated: the traditional \hbox and the more natural command \unhyphenated.
\hbox{myfragileword} % old-fashioned \unhyphenated{myfragileword} % MkIV, since 2013-04-21
Tune the auto-hyphenation algorithm
Use the \setupalign parameters concerning justification and hyphenation.
Penalize consecutive hyphens
To penalize hyphens on consecutive lines, set \doublehyphendemerits. Its default value is 10000; to double that, write \doublehyphendemerits=20000
.
Mark hyphenated lines for review
See the article on reviewing hyphenation.
Hyphenate numbers and other non-words
Use \hyphenateddigits; it works in text and math mode and is available since 2021-01-28 (i.e. not yet in the wiki at the time of writing).
\pi\ = \hyphenateddigits[\unknown]{3.141592653589793238462643383279502884197169399375105} \blank \pi\ = \hyphenateddigits{3.141592653589793238462643383279502884197169399375105} \blank x $\pi = \hyphenateddigits[\unknown]{3.141592653589793238462643383279502884197169399375105}$ \blank x $\pi = \hyphenateddigits{3.141592653589793238462643383279502884197169399375105}$ \blank
See also
- Hyphenation
- \hyphenation to define the hyphenation of a specific word
- \startexceptions to define language-specific hyphenations
- \- to define an ad-hoc breakpoint
- \unhyphenated to prevent hyphenation
- \doublehyphendemerits to penalize hyphenation on consecutive lines
- \setupalign justification parameters to tweak the auto-hyphenation algorithm
- \definebreakpoints to initialize a breakpoint set
- \definebreakpoint to add to a breakpoint set
- \setbreakpoints to activate a breakpoint set
- \language to activate a language's settings, including hyphenation
- Wrapping