Command/setuplanguage

Unofficial ConTeXt Wiki mirror

Last modified: 2025-01-10

Summary

The command \setuplanguage adjusts the settings for a language.

Settings

\setuplanguage[...][...=...,...]
[...] language default
default language
state start stop
date see \currentdate
time see \currenttime
patterns file
lefthyphenmin number
righthyphenmin number
lefthyphenchar number
righthyphenchar number
setups name
spacing broad packed
font auto name
bidi left right l2r r2l
text text
limittext text
hyphen text
compoundhyphen text
leftcompoundhyphen text
rightcompoundhyphen text
leftquote command
rightquote command
leftquotation command
rightquotation command
leftspeech command
rightspeech command
leftsentence command
middlespeech command
rightsentence command
midsentence command
leftsubsentence command
rightsubsentence command
factor yes no

Option Explanation
language an already defined language to be set up
patterns
The hyphenation patterns to use.
file If you enter XX as value, ConTeXt loads lang-XX.lua from either the local folder or the tex/context/patterns/mkiv directory
lefthyphenmin
Minimal number of characters for prefixes. Default: e.g. 2 for English, 3 for German; beware the latter is different from LaTeX (2) and prevents many possible hyphenations!
righthyphenmin
Minimal number of characters for sufffixes. Default: e.g. 3 for English, 3 for German; beware the latter is different from LaTeX (2) and prevents many possible hyphenations!
hyphen
hyphen character
leftquote
left single quotation mark (for \quote)
rightquote
right single quotation mark (for \quote)
leftquotation
left double quotation mark (for \quotation)
rightquotation
right double quotation mark (for \quotation)

Description

Examples

Example 1

\installlanguage
   [en]
   [spacing=broad,
    leftsentence=---,
    rightsentence=---,
    leftsubsentence=---,
    rightsubsentence=---,
    leftquote=\upperleftsinglesixquote,
    rightquote=\upperrightsingleninequote,
    leftquotation=\upperleftdoublesixquote,
    rightquotation=\upperrightdoubleninequote,
    date={month,\ ,day,{,\ },year},
    default=en,
    state=stop]

Suggestion for German with guillemets

\setbreakpoints[compound] % break at / and -
\setuplanguage[de][
  goodies={lang-de.llg}, % prevent wrong ligatures
  lefthyphenmin=2,
  righthyphenmin=2,
  leftquotation=»,
  rightquotation=«,
  leftquote=›,
  rightquote=‹,
]

German texts might benefit from setting a minimum word length for hyphenation (hyphenmin isn’t listed as an option for \setuplanguage).

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: