Difference between revisions of "Second Step"

From Wiki
Jump to navigation Jump to search
(new)
 
({{Getting started navbox}})
(14 intermediate revisions by 5 users not shown)
Line 1: Line 1:
Here's a slightly more complex sample:
+
< [[Main Page]] | [[First Document]] | [[Next Steps]] >
  
<pre>
+
Here's a slightly more complex example:
% the first line can hold texexec's command line options
+
 
\enableregime [il1] % choose input encoding: il1 is "ISO Latin 1" (ISO 8859-1)
+
<context source="yes" text="looks like:">
 +
\enableregime [utf-8] % 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.
 +
\setupbodyfontenvironment[default][em=italic] % ConTeXt's default \em is slanted, but italic is better
 +
 
\starttext
 
\starttext
 
Rotkäppchen:
 
Rotkäppchen:
Line 13: Line 17:
  
 
\stoptext
 
\stoptext
</pre>
+
</context>
 +
 
 +
* '''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 <cmd>mainlanguage</cmd> there's also <cmd>language</cmd> 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 <cmd>quote</cmd>. You can use <cmd>startquotation</cmd> ... <cmd>stopquotation</cmd> for longer (indented) quotes.
 +
* '''em''': again, logical markup! say "<cmd>em</cmd>phasized" instead of bold or italics. Remember, it's a switch, not a command! (Not <tt>\em{foo}</tt>, but <tt>{\em foo}</tt>.)
 +
 
 +
Now you can start with your own document, let's see what your [[Next Steps]] can be...
  
* '''regime''' is the input encoding, i.e. what you type, so that you can use accented characters (like umlauts in the example) directly. It depends on your language, your OS and the capabilities of your editor. Try "utf8" if your editor can process Unicode!
+
{{Getting started navbox}}
* '''language''' is the language of your text. Besides <tt>\mainlanguage</tt> there's also <tt>\language</tt> to switch temporarily.
 
* '''quotation''': use logical markup instead of specified signs! You get single quotes with <tt>\quote</tt>. Use <tt>\startquotation ... \stopquotation</tt> for longer quotes.
 
* '''em''': again, logical markup! say "<tt>em</tt>phasized" instead of bold or italics. Remember, it's a switch, not a command! (Not <tt>\em{bla}</tt>, but <tt>{\em bla}.)
 

Revision as of 11:05, 26 November 2012

< Main Page | First Document | Next Steps >

Here's a slightly more complex example:

\enableregime	[utf-8]		% 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.
\setupbodyfontenvironment[default][em=italic] % ConTeXt's default \em is slanted, but italic is better

\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...

Template:Getting started navbox