<!-- chapterName "Essential concepts" -->

<!-- sectionName "The structure of a document." -->

<para>When designing a document in RML, the main concept to grasp is the difference between the static elements on the page, and 'flowables'.</para>

<para>The component parts that make up a document, ie. text, pictures, or primitives (like lines, rectangles and circles) can be either static or flowable, depending on whereabouts in the RML document they are described.</para>

<para>A static element is fixed into position on a page.  You specify the x and y coordinates and the element appears at that position.</para>

<para>With flowables, however, you specify the position of a 'frame', which can be thought of as a box which contains flowable elements.  The elements then flow into the frame until that frame is full.  Then they start filling up the next frame.  So the frames are static elements, but what the frames contain is 'flowable'.</para>

<para>The other main element of a document is the styling: the fonts, line weights and colours, etc..</para>

<para>These three elements are defined in the three main sections of a basic RML document like this:</para>

<codesnippet language="xml" style="code"><![CDATA[
<template>
    this section contains the STATIC elements of the document, and the layout of the
    frames on each page.
</template>
<stylesheet>
    this section contains the STYLE information for formatting text and tables.
</stylesheet>
<story>
    this section contains the FLOWABLE elements of the document.  This is
    usually where most of the text goes.  This content will flow into
    the frames specified in the <template> section.
</story>
]]></codesnippet>

<para>As an example of the above concepts, imagine the front page of a newspaper.  In terms of RML, the masthead (eg. "The Times") would be a static, fixed element - it's always the same text in the same place.  There might be a solid line under the top banner, along with the price and the date, all of which would be fixed position elements.  Most of the centre of the page would then be divided into frames containing text in various styles: headlines, subsection headings, and plain text.  The text of these stories would 'fill up' each of these frames from top to bottom, in a series of paragraphs.  Finally there might be an advert in a fixed position at the bottom of the page.  </para>

<para>So, the &lt;template&gt; section would contain details about the masthead and the position of the frames, the &lt;stylesheet&gt; section would define the fonts used for headlines and body text, and the actual text of the news would be in the &lt;story&gt; section.  The news would flow from top to bottom, left to right, into each frame on the page.</para>

<para>This is a simplified version of the truth, and there are exceptions to all this, but that comes later...</para>

<!-- sectionName "Common Conventions in RML" -->


<para>1. Colours can be specified in three ways in RML: as html-style 'named' colours (eg. "red"); as rgb values (eg. "#004A8D") or as CMYK (eg. "#ff99001f")</para>

<para>2. X &amp; Y co-ordinates generally refer to the bottom left corner of an element.</para>

<para>3. Measurements default to points, but can be millimetres(mm), centimetres(cm), or inches(in).  They can be mixed and matched as you like eg(x="5" y="10mm" height="2cm" width="1in").</para>
