Difference between revisions of "Second Step"

From Wiki
Jump to navigation Jump to search
m (now utf-8 works again)
(fix regime name)
Line 5: Line 5:
 
<texcode>
 
<texcode>
 
% the first line can hold texexec's command line options
 
% the first line can hold texexec's command line options
\enableregime [utf-8] % choose input encoding: (in LuaTeX and XeTeX, UTF-8 is on by default, thus not needed)
+
\enableregime [utf] % choose input encoding: (in LuaTeX and XeTeX, UTF-8 is on by default, thus not needed)
 
\mainlanguage [de] % language mode: changes typesetting rules, quote signs etc.
 
\mainlanguage [de] % language mode: changes typesetting rules, quote signs etc.
  

Revision as of 11:27, 27 August 2008

< Main Page | First Document | Next Steps >

Here's a slightly more complex example:

% the first line can hold texexec's command line options
\enableregime	[utf]		% choose input encoding: (in LuaTeX and XeTeX, UTF-8 is on by default, thus not needed)
\mainlanguage	[de]		% language mode: changes typesetting rules, quote signs etc.

\starttext

Rotkäppchen:
\quotation{Aber Großmutter, warum hast du so große Augen?}

Der böse Wolf:
\quotation{Damit ich dich besser {\em sehen} kann!}

\stoptext

looks like:

  • regime is the input encoding, i.e. what you type, so that you can use accented characters (like umlauts in the example) directly. Old encodings are supported, but use UTF-8 whenever possible. In XeTeX and LuaTeX that's the default already, so you don't need that line any more. (More on that topic in Encodings and Regimes.)
  • language is the language of your text. Besides \mainlanguage there's also \language to switch temporarily. Try your internet top level domain code as language code (de = german, fr = french, it = italian etc., see Language Codes).
  • quotation: use logical markup instead of specified signs! You get single quotes with \quote. You can use \startquotation ... \stopquotation for longer (indented) quotes.
  • em: again, logical markup! say "\emphasized" instead of bold or italics. Remember, it's a switch, not a command! (Not \em{foo}, but {\em foo}.)

Now you can start with your own document, let's see what your Next Steps can be...