Difference between revisions of "Command Syntax"

From Wiki
Jump to navigation Jump to search
m
m (still far from finished)
Line 1: Line 1:
 
'''WARNING: this page has to be finished first, than reviewed! Don't rely on actual information.'''
 
'''WARNING: this page has to be finished first, than reviewed! Don't rely on actual information.'''
  
<!-- == Commands ==
+
== Command ==
  
As in TeX all commands start with backslash: [[cmd:showsetups|\showsetups]]
+
Command consists of:
 +
<!-- table -->
 +
{|
 +
|-
 +
| <code>\</code> || leading backslash
 +
|-
 +
| <code>name</code> || command name
 +
|-
 +
| <code>{ }</code> || scope or range of the command (if applicable)
 +
|-
 +
| <code>[ ]</code> || setups (if applicable)
 +
|-
 +
| <code>$$ $$</code> || math input (if applicable)
 +
|-
 +
|}
 +
 
 +
<pre>\placeformula[...]{...}$$...$$</pre>
 +
 
 +
 
 +
== Find definition ==
  
Some commands are paired: [[cmd:starttext|\starttext]] ... [[cmd:stopttext|\stoptext]] -->
+
There are several places where you can search for command definitions:
  
== Arguments ==
+
* [http://www.pragma-ade.com/general/qrcs/setup-en.pdf| setup-en.pdf] (and appropriate language variants) most up-to-date ConTeXt command reference (is this generated from [[source:cont-en.xml| cont-en.xml]]?)
 +
* [[manual:cont-eni.pdf|ConTeXt manual]]
 +
* [http://texshow.contextgarden.net/ texshow-web] on-line command reference (is this generated from [[source:cont-en.xml| cont-en.xml]]?)
 +
* [http://levana.de/emacs| etexshow] emacs browser for ConTeXt commands (is this generated from [http://texshow.contextgarden.net/ texshow-web]?)
 +
* xml description in [[source:cont-en.xml| cont-en.xml]] (and appropriate language variants) (typed manually or generated from sources?)
  
* without argument: [[cmd:hairline|\hairline]]
+
In these sources there is different '''referencing of arguments''' to thier possible values and fifferent '''typographic conventions'''.
* with mandatory argument: [[cmd:overbar|\overbar{...}]]
 
* with optional argument: [[cmd:note|\note[''ref'']]]
 
* with ??? argument: [[cmd:moveongrid|\moveongrid''[...]'']]
 
* and thier combinations: [[cmd:chapter|\chapter''[ref,...]''{...}]] or [[cmd:date|\date''[...,.=.,...]''[...]]]
 
  
== Pairing ==
+
== Referencing of arguments ==
Numbers (manuals), background colors (texshow), font colors  (emacs help) in arguments '''don't''' have any special meaning, they just pair the argument with its desription below.
 
  
Exapmle: [[cmd:setupheadertexts|\setupheadertexts]]
+
Example: [[cmd:setupheadertexts|\setupheadertexts]]
  
 
*in the manual:
 
*in the manual:
Line 36: Line 54:
 
   <span style='color: #6495ED'>.3. <text> <section> date <mark> pagenumber</span>
 
   <span style='color: #6495ED'>.3. <text> <section> date <mark> pagenumber</span>
  
== Notation, typographic convention ==
+
== Typographic conventions ==
  
You can find command definitions in  
+
As you can see in in previous examples, command references have different typographic conventions.  
* printed manuals,  
 
* texshow,
 
* emacs ConTeXt help,
 
* xml description in [[source:cont-en.xml| cont-en.xml]] (and appropriate language variants).
 
  
Following table shows their notation. (add examples)
+
Following table explains the meaning of values and shows their notation in different sources.
  
 
{| border="1"
 
{| border="1"
 
|-
 
|-
|  ||  manuals || texshow || emacs || xml description
+
|| meaning ||  [http://www.pragma-ade.com/general/qrcs/setup-en.pdf | setup-en.pdf] || [[manual:cont-eni.pdf|ConTeXt manual]] || [http://texshow.contextgarden.net/ texshow-web] || [http://levana.de/emacs| etexshow] || [[source:cont-en.xml | cont-en.xml]]
 
|-
 
|-
|arguments || x || x || x || x
+
| default    || x || x || x || x || x || x
 
|-
 
|-
|mandatory || x || x || x || x
+
| predefined || x || x || x || x || x || x
 
|-
 
|-
|optional  || x || x || x || x
+
| user input || x || x || x || x || x || x
 
|-
 
|-
|???       || x || x || x || x
+
| text       || x || x || x || x || x || x
 
|-
 
|-
|argument values || x || x || x || x
+
| number || x || x || x || x || x || x
 
|-
 
|-
|key-value pair  || x || x || x || x
 
 
|-
 
|-
|user input      || x || x || x || x
+
| reference || x || x || x || x || x || x
 
|-
 
|-
|list of        || x || x || x || x
+
| identifier|| x || x || x || x || x || x
 
|-
 
|-
|default         || x || x || x || x
+
| key=value pair  || x || x || x || x || x || x
 +
|-
 +
| triplet      || x || x || x || x || x || x
 +
|-
 +
| list of         || x || x || x || x || x || x
 +
|-
 +
| command        || x || x || x || x || x || x
 +
|-
 +
|-
 +
| ...,...,... || x || x || x || x || x || x
 +
|-
 +
| || x || x || x || x || x || x
 +
|-
 +
|-
 +
| || x || x || x || x || x || x
 +
|-
 +
| || x || x || x || x || x || x
 
|-
 
|-
 
|}
 
|}
 +
 +
== Other notes ==
 +
 +
* In LaTeX optional arguments come before mandatory arguments. This is not true in ConTeXt. Optional argument can be at any position.
 +
  \definetextvariable
 +
* If <code>key=value</code> pair is missing the value, than the key is assigned the default value.
 +
  <code>location=</code>
 +
 +
  
 
== Contexgarden wiki ==
 
== Contexgarden wiki ==

Revision as of 10:28, 31 July 2006

WARNING: this page has to be finished first, than reviewed! Don't rely on actual information.

Command

Command consists of:

\ leading backslash
name command name
{ } scope or range of the command (if applicable)
[ ] setups (if applicable)
$$ $$ math input (if applicable)
\placeformula[...]{...}$$...$$


Find definition

There are several places where you can search for command definitions:

In these sources there is different referencing of arguments to thier possible values and fifferent typographic conventions.

Referencing of arguments

Example: \setupheadertexts

  • in the manual:
 \setupheadertexts[.1.][.2.][.3.]
 .1. text margin edge
 .2. text section date mark pagenumber
 .3. text section date mark pagenumber
  • in the texshow
 \setupheadertexts[.1.][.2.][.3.]
 .1. text margin edge
 .2. text section date mark pagenumber
 .3. text section date mark pagenumber
  • in the emacs help
  \setupheadertexts[.1.][.2.][.3.]
  .1. <text> margin edge
  .2. <text> <section> date  pagenumber
  .3. <text> <section> date  pagenumber

Typographic conventions

As you can see in in previous examples, command references have different typographic conventions.

Following table explains the meaning of values and shows their notation in different sources.

meaning setup-en.pdf] ConTeXt manual texshow-web etexshow] cont-en.xml
default x x x x x x
predefined x x x x x x
user input x x x x x x
text x x x x x x
number x x x x x x
reference x x x x x x
identifier x x x x x x
key=value pair x x x x x x
triplet x x x x x x
list of x x x x x x
command x x x x x x
...,...,... x x x x x x
x x x x x x
x x x x x x
x x x x x x

Other notes

  • In LaTeX optional arguments come before mandatory arguments. This is not true in ConTeXt. Optional argument can be at any position.
 \definetextvariable
  • If key=value pair is missing the value, than the key is assigned the default value.
 location=


Contexgarden wiki

While writing to this wiki you can refer to the user commands with

[[cmd:goto|\goto]]

which displays as \goto and the link brings you to the command definition in texshow-web.

Missing commands, descriptions and examples

add Category