# Elementname: `Layout`

## Description

This command is the root element in the Layout instructions.

Allowed attributes: name, version

Child elements: DefineColor, DefineFontfamily, DefineTextformat, Hyphenation, LoadFontfile, Options, PDFOptions, Pageformat, Pagetype, Record, SetGrid, SetVariable, Stylesheet

Parent elements: (none)

### Attributes

name (text, optional)

  A name for the layout. Optional, without any influence on the layout itself.

version (number, optional)

  Minimum publisher version required. If major or minor version differ, give a warning. Format: 1.6.12 (revision number can be left out).

## Example

This is a complete example for a layout ruleset:

    <?xml version="1.0"?>
    <Layout
      xmlns:sd="urn:speedata:2009/publisher/functions/en"
      xmlns="urn:speedata.de:2009/publisher/en">
      <Options
        show-grid="yes"
        show-gridallocation="no"
      />

      <LoadFontfile name="Helvetica Fett" filename="texgyreheros-bold.otf" />

    <DefineFontfamily
        name="title"
        fontsize="12"
        leading="16">
        <Regular fontface="Helvetica Fett" />
      </DefineFontfamily>

      <Pageformat width="150mm" height="200mm" />
      <SetGrid width="4mm" height="14pt" />

      <DefineTextformat name="text" alignment="justified" />

      <Pagetype name="recto" test="sd:odd(sd:current-page())">
        <Margin left="2cm" right="1cm" top="1cm" bottom="1cm" />
      </Pagetype>

      <Pagetype name="verso" test="sd:even(sd:current-page())">
        <Margin left="1cm" right="2cm" top="1cm" bottom="1cm" />
      </Pagetype>

      <Record element="product">
        <SetVariable variable="column" select="2" />
        <PlaceObject column="1">
          <Textblock width="14" fontface="title">
            <Paragraph>
              <Value select="@name"/>
            </Paragraph>
          </Textblock>
        </PlaceObject>
        <ProcessNode select="productimage"/>
        <NewPage/>
      </Record>

      <Record element="productimage">
        <NextRow rows="2"/>
        <PlaceObject column="1">
          <Image width="10" file="{string(.)}"/>
        </PlaceObject>
      </Record>

    </Layout>

## See also

Include

# Commands

- A
- Action
- AddToList
- AtPageCreation
- AtPageShipout
- Attribute
- B
- Barcode
- Bold
- BoldItalic
- Bookmark
- Box
- Br
- Case
- Circle
- Color
- Column
- Columns
- Contents
- Copy-of
- DefineColor
- DefineFontfamily
- DefineTextformat
- Element
- EmptyLine
- Fontface
- ForAll
- Frame
- Grid
- Group
- HSpace
- Hyphenation
- I
- Image
- Include
- InsertPages
- Italic
- Layout
- Li
- LoadDataset
- LoadFontfile
- Loop
- Makeindex
- Margin
- Mark
- Message
- NewPage
- NextFrame
- NextRow
- NoBreak
- Ol
- Options
- Otherwise
- Output
- Overlay
- PDFOptions
- Pageformat
- Pagetype
- Paragraph
- PlaceObject
- Position
- PositioningArea
- PositioningFrame
- ProcessNode
- Record
- Regular
- Rule
- SaveDataset
- SavePages
- Sequence
- SetGrid
- SetVariable
- SortSequence
- Stylesheet
- Sub
- Sup
- Switch
- Table
- Tablefoot
- Tablehead
- Tablerule
- Td
- Text
- Textblock
- Tr
- Transformation
- U
- URL
- Ul
- Until
- VSpace
- Value
- While

Version: 2.6.1 | Start page | Command reference | Other language: German