# Text formatting guide for paper-based surveys

Source: PaperSurvey.io Blog
URL: https://www.papersurvey.io/blog/markdown-survey-formatting-paper-based-surveys

---

[PaperSurvey.io](https://www.papersurvey.io) supports a small subset of [markdown](https://en.wikipedia.org/wiki/Markdown) syntax for adjusting text formatting as well as some papersurvey.io specific commands. These may be beneficial for emphasizing certain words in the survey or changing the layout.

## Text formatting

### Color
To change color you just need to use `[color=color_code]text[/color]` shortcode. `color_code` is a HEX color code. You may use <a rel="nofollow" target="_blank" href="https://htmlcolorcodes.com/color-picker/">this color picker</a> to find a color you want to use.

You may also use `[color=primary]` and `[color=secondary]`, which will be "Heading/Divider color" and "Secondary color" accordingly configured in your survey settings.

        <b>EXAMPLE</b>
        <code>
        [color=ffbc06]Text in yellow[/color]<br />
        [color=3AE50C]Text in green[/color]<br />
        [color=FF0C00]Text in red[/color]<br />
        </code>

        <b>RESULT</b>
        <code>
        <span style="color:#ffbc06;">Text in yellow</span><br />
        <span style="color:#3AE50C;">Text in green</span><br />
        <span style="color:#FF0C00;">Text in red</span>
        </code>

### Highlight background
To change background color you just need to use `[highlight=color_code]text[/highlight]` shortcode. `color_code` is a HEX color code. You may use <a rel="nofollow" target="_blank" href="https://htmlcolorcodes.com/color-picker/">this color picker</a> to find a color you want to use.

You may also use `[highlight=primary]` and `[highlight=secondary]`, which will be "Heading/Divider color" and "Secondary color" accordingly configured in your survey settings.

        <b>EXAMPLE</b>
        <code>
        [highlight=ffbc06][color=black]Background in yellow, text in black[/color][/highlight]<br />
        [highlight=3AE50C][color=white]Background in black, text in white[/color][/highlight]<br />
        [highlight=FF0C00][color=yellow]Background in red, text in yellow[/color][/highlight]<br />
        </code>

        <b>RESULT</b>
        <code>
        <span style="background-color:#ffbc06;color: black;">Background in yellow, text in black</span><br />
        <span style="background-color:black; color: white;">Background in black, text in white</span><br />
        <span style="background-color:#FF0C00;color: yellow;">Background in red, text in yellow</span>
        </code>

### Bold
To make the text bolder you may wrap the text in two **asterisks**.

        <b>EXAMPLE</b>
        <code>
        Bold text with **asterisks**.
        </code>

        <b>RESULT</b>
        <code>
        Bold text with <b>asterisks</b>.
        </code>

### Italics
To make the text written in italics you may wrap the text in one *asterisk* or _underscore_:

        <b>EXAMPLE</b>
        <code>
            italicize text with *asterisks* or _underscores_.
        </code>

        <b>RESULT</b>
        <code>
            italicize text with <i>asterisks</i> or <i>underscores</i>
        </code>

### Strikethrough
To add strike-through you may wrap the text in two ~~tildes.~~

        <b>EXAMPLE</b>
        <code>
            Strikethrough text with ~~tildes.~~.
        </code>

        <b>RESULT</b>
        <code>
            Strikethrough text with <span style="text-decoration: line-through;">tildes</span>.
        </code>

### Underline
To add the underline below the text, use two __underscores__.

        <b>EXAMPLE</b>
        <code>
            Underline text with two __underscores__.
        </code>

        <b>RESULT</b>
        <code>
            Underline text with two <u>underscores</u>.
        </code>

### Headings
To add headings, start the line with one or more `#` characters followed by a space.

        <b>EXAMPLE</b>
        <code>
        # Heading 1<br />
        ## Heading 2<br />
        ### Heading 3
        </code>

        <b>RESULT</b>
        <code>
        <h1 style="margin:0">Heading 1</h1>
        <h2 style="margin:0">Heading 2</h2>
        <h3 style="margin:0">Heading 3</h3>
        </code>

### Unformatted text
In some cases you may want to unbold or remove italics from a block of text, you may do with a [unformatted] tag.

        <b>EXAMPLE</b>
        <code>
            **We see bolded text here but [unformatted]here[/unformatted] it isn't**
        </code>

        <b>RESULT</b>
        <code>
            <b>Bolded text here but</b> here <b>it isn't</b>
        </code>

## Font sizes
If you would like to change the font size in your text, you may use following short codes:

        <b>EXAMPLE</b>
        <code>
            [tiny]Text[/tiny]<br/>
            [small]Text[/small]<br/>
            [s]Text[/s]<br/>
            [normal]Text[/normal]<br/>
            [large]Text[/large]<br/>
            [larger]Text[/larger]<br/>
            [xl]Text[/xl]<br/>
            [xxl]Text[/xxl]
        </code>

        <b>RESULT</b>
        <code>
            Text
            Text
            Text
            Text
            Text
            Text
            Text
            Text
        </code>

## Text rotation
In some cases you would want to rotate the text to fit. You may use the following command to achieve it.

        <b>EXAMPLE</b>
        <code>
            [rotate=90]Text[/rotate]<br/>
            [rotate=60]Text[/rotate]<br/>
            [rotate=-90]Text[/rotate]<br/>
            [rotate=180]Text[/rotate]
        </code>

        <b>RESULT</b>
        <code style="flex-direction: row;display: flex;">
            Text
            Text
            Text
            Text
        </code>

## Lists
To display text as a list, just start the line with an asterisk. Currently, only one-level ordered and unordered lists are supported.

##### Lists only work in _Description_ type questions!

### Unordered

        <b>EXAMPLE</b>
        <code>
            * One <br />
            * Two  <br />
            * Three <br />
            *this is not in list*
        </code>

        <b>RESULT</b>
        <code>
            <ul>
                <li>One</li>
                <li>Two</li>
                <li>Three</li>
            </ul>
            <i>this is not in list</i>
        </code>

### Ordered

        <b>EXAMPLE</b>
        <code>
            1. One <br />
            2. Two <br />
            3. Three <br />
            1 this is not in list
        </code>

        <b>RESULT</b>
        <code>
            <ol>
                <li>One</li>
                <li>Two</li>
                <li>Three</li>
            </ol>
            this is not in list
        </code>

## Tables

You can create tables using the pipe (`|`) character to separate columns. Tables are supported only in _Description_ type questions.

### Basic Table

        <b>EXAMPLE</b>
        <code>
| Header 1 | Header 2 | Header 3 |<br/>
|----------|----------|----------|<br/>
| Cell 1   | Cell 2   | Cell 3   |<br/>
| Cell 4   | Cell 5   | Cell 6   |
        </code>

        <b>RESULT</b>
        <table style="border-collapse: collapse; border: 1px solid black;">
            <thead>
                <tr>
                    <th style="border: 1px solid black; padding: 5px;">Header 1</th>
                    <th style="border: 1px solid black; padding: 5px;">Header 2</th>
                    <th style="border: 1px solid black; padding: 5px;">Header 3</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td style="border: 1px solid black; padding: 5px;">Cell 1</td>
                    <td style="border: 1px solid black; padding: 5px;">Cell 2</td>
                    <td style="border: 1px solid black; padding: 5px;">Cell 3</td>
                </tr>
                <tr>
                    <td style="border: 1px solid black; padding: 5px;">Cell 4</td>
                    <td style="border: 1px solid black; padding: 5px;">Cell 5</td>
                    <td style="border: 1px solid black; padding: 5px;">Cell 6</td>
                </tr>
            </tbody>
        </table>

### Column Alignment
You can align columns by adding colons (`:`) to the separator row:
- `:---` for left alignment (default)
- `:---:` for center alignment
- `---:` for right alignment

        <b>EXAMPLE</b>
        <code>
| Left | Center | Right |<br/>
|:-----|:------:|------:|<br/>
| A    | B      | C     |<br/>
| 100  | 200    | 300   |
        </code>

        <b>RESULT</b>
        <table style="border-collapse: collapse; border: 1px solid black;">
            <thead>
                <tr>
                    <th style="border: 1px solid black; padding: 5px; text-align: left;">Left</th>
                    <th style="border: 1px solid black; padding: 5px; text-align: center;">Center</th>
                    <th style="border: 1px solid black; padding: 5px; text-align: right;">Right</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td style="border: 1px solid black; padding: 5px; text-align: left;">A</td>
                    <td style="border: 1px solid black; padding: 5px; text-align: center;">B</td>
                    <td style="border: 1px solid black; padding: 5px; text-align: right;">C</td>
                </tr>
                <tr>
                    <td style="border: 1px solid black; padding: 5px; text-align: left;">100</td>
                    <td style="border: 1px solid black; padding: 5px; text-align: center;">200</td>
                    <td style="border: 1px solid black; padding: 5px; text-align: right;">300</td>
                </tr>
            </tbody>
        </table>

### Example: Pricing Table

        <b>EXAMPLE</b>
        <code>
| Monthly Pages | Plans Needed | Monthly Cost | Annual Cost (~20% off) |<br/>
|--------------|--------------|--------------|------------------------|<br/>
| 10,000       | 1 plan       | $125         | $1,250                 |<br/>
| 20,000       | 2 plans      | $250         | $2,500                 |<br/>
| 30,000       | 3 plans      | $375         | $3,750                 |<br/>
| 50,000       | 5 plans      | $625         | $6,250                 |<br/>
| 100,000      | 10 plans     | $1,250       | $12,500                |
        </code>

        <b>RESULT</b>
        <table style="border-collapse: collapse; border: 1px solid black;">
            <thead>
                <tr>
                    <th style="border: 1px solid black; padding: 5px;">Monthly Pages</th>
                    <th style="border: 1px solid black; padding: 5px;">Plans Needed</th>
                    <th style="border: 1px solid black; padding: 5px;">Monthly Cost</th>
                    <th style="border: 1px solid black; padding: 5px;">Annual Cost (~20% off)</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td style="border: 1px solid black; padding: 5px;">10,000</td>
                    <td style="border: 1px solid black; padding: 5px;">1 plan</td>
                    <td style="border: 1px solid black; padding: 5px;">$125</td>
                    <td style="border: 1px solid black; padding: 5px;">$1,250</td>
                </tr>
                <tr>
                    <td style="border: 1px solid black; padding: 5px;">20,000</td>
                    <td style="border: 1px solid black; padding: 5px;">2 plans</td>
                    <td style="border: 1px solid black; padding: 5px;">$250</td>
                    <td style="border: 1px solid black; padding: 5px;">$2,500</td>
                </tr>
                <tr>
                    <td style="border: 1px solid black; padding: 5px;">30,000</td>
                    <td style="border: 1px solid black; padding: 5px;">3 plans</td>
                    <td style="border: 1px solid black; padding: 5px;">$375</td>
                    <td style="border: 1px solid black; padding: 5px;">$3,750</td>
                </tr>
                <tr>
                    <td style="border: 1px solid black; padding: 5px;">50,000</td>
                    <td style="border: 1px solid black; padding: 5px;">5 plans</td>
                    <td style="border: 1px solid black; padding: 5px;">$625</td>
                    <td style="border: 1px solid black; padding: 5px;">$6,250</td>
                </tr>
                <tr>
                    <td style="border: 1px solid black; padding: 5px;">100,000</td>
                    <td style="border: 1px solid black; padding: 5px;">10 plans</td>
                    <td style="border: 1px solid black; padding: 5px;">$1,250</td>
                    <td style="border: 1px solid black; padding: 5px;">$12,500</td>
                </tr>
            </tbody>
        </table>

##### Tables only work in _Description_ type questions!

## Spacings and alignment

### Centered text
You may align text to the center by using `[center]my text[/center]` tags.

        <b>EXAMPLE</b>
        <code>
            [center]my centered text[/center] <br/>
            [center]next centered line[/center]
        </code>

        <b>RESULT</b>
        <code>
            <p style="text-align:center;margin:0">my centered text</p>
            <p style="text-align:center;margin:0">next line</p>
        </code>

Please note that `[center]` tag may need to be placed on each line if you have line breaks.

### Right-aligned text
You may align text to the right by using `[right]my text[/right]` tags.

        <b>EXAMPLE</b>
        <code>
            [right]my right-aligned text[/right] <br/>
            [right]next right-aligned line[/right]
        </code>

        <b>RESULT</b>
        <code>
            <p style="text-align:right;margin:0">my right-aligned text</p>
            <p style="text-align:right;margin:0">next right-aligned line</p>
        </code>

Please note that `[right]` tag may need to be placed on each line if you have line breaks.

### Horizontal & Vertical spacing
You can use `[verticalspace=0.5]` and `[horizontalspace=0.5]` short codes to adjust the spacings. `0.5` is the length in centimeters (cm) which you can adjust. The length may also be negative if you would like to reduce the spacings instead. Please do not make space between the question name and text box very small - this could impact the recognition as question name could be recognized as text/number as well.

Also, `[smallspace]`, `[space]`, `[midspace]`, `[bigspace]` will add **0.1cm**, **0.5cm**, **1.5cm** and **3cm** horizontal spacing accordingly. You can also use shorter versions `[vspace=0.5]` and `[hspace=0.5]`

        <b>EXAMPLE</b>
        <code>
            My text [space] with [horizontalspace=2.5] is here.
        </code>

        <b>RESULT</b>
        <code>
            My text &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; with &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  is here.
        </code>

**Note:** `[smallspace]`, `[space]`, `[midspace]`, `[bigspace]` will be hidden in web surveys. Where `[verticalspace=0.5]`, `[horizontalspace=0.5]`, `[vspace=0.5]` and `[hspace=0.5]` short codes functions the same as in paper surveys.

### Align text to right
If you would like to align text to the right, just use `[fill]` tag before the start of the text.

        <b>EXAMPLE</b>
        <code>
            My left-aligned text [fill] My right-aligned text.
        </code>

        <b>RESULT</b>
        <code>
            My left-aligned text <span style="float:right">My right-aligned text.</span>
        </code>

### Fixed width or height box
For more advanced layouts you may set the height and width of the text block allowing to align text areas using `[width=3cm]3 cm (1.18in) width[/width]` or `[height=3cm]3 cm (1.18in) height[/height]` or both `[height=3cm][width=3cm]3 cm (1.18in) box[/width][/height]`.

`[height]` should always be used with the Prefill Forms dynamic variables to prevent dynamically added text from changing the survey layout.

`[width]` shortcode is particularly useful when aligning text with "Inline text" and "Inline checkboxes".

        <b>EXAMPLE</b>
        <code>[width=3cm]3 cm (1.18in) width[/width] [width=3cm]3 cm (1.18in) width[/width] [width=3cm]3 cm (1.18in) width[/width]</code>
        <code>[width=5cm][center]centered 5cm[/center][/width] [width=5cm][center]centered 5cm[/center][/width]</code>
        <code>
            [height=3cm][width=3cm][center]3cm x 3cm[/center][/height][height=3cm][width=3cm][center]3cm x 3cm[/center][/height]<br/><br/>
            [height=3cm][width=3cm][center]3cm x 3cm[/center][/height][height=3cm][width=3cm][center]3cm x 3cm[/center][/height]
        </code>

        <b>RESULT</b>
        <code>
            <span style="width: 3cm;display: inline-block;">3 cm (1.18in) width</span> <span style="width: 3cm;display: inline-block;">3 cm (1.18in) width</span> <span style="width: 3cm;display: inline-block;">3 cm (1.18in) width</span>
        </code>
        <code>
            <span style="width: 5cm;height: 3cm; display: inline-block;text-align: center;">centered 5cm</span> <span style="width: 5cm;display: inline-block;text-align: center;">centered 5cm</span>
        </code>
        <code>
            <span style="width:3cm;height: 3cm; display: inline-block;text-align: center;">3cm x 3cm</span>
            <span style="width:3cm;height: 3cm; display: inline-block;text-align: center;">3cm x 3cm</span><br/>
            <span style="width:3cm;height: 3cm; display: inline-block;text-align: center;">3cm x 3cm</span>
            <span style="width:3cm;height: 3cm; display: inline-block;text-align: center;">3cm x 3cm</span>
        </code>

### Page break
To move section down to the next page you could use `[pagebreak]` shortcode.  This shortcode may not work in 'Heading' type questions.
Alternatively, you may add a new question and select its type as "Page break".

        <b>EXAMPLE</b>
        <code>
            My first page
            [pagebreak]
            This text will appear in the next page
        </code>

        <b>RESULT</b>
        <code>
            My first page
            <br>
            <br>
            <br>
            <br>
            This text will appear in the next page
        </code>

### Line break
To make a small line break may just press the **[Enter] button** in your keyboard to add as many line breaks as you need. You may also use `[br]` or  `[newline]` short codes in your text to add a line break.

        <b>EXAMPLE</b>
        <code>
            My first paragraph [br] Another paragraph
        </code>

        <b>RESULT</b>
        <code>
            My first paragraph
            <br>
            Another paragraph
        </code>

### Large Line break
If you wish to make a large line break you may insert `[linebreak]` tag in your text.

        <b>EXAMPLE</b>
        <code>
            My first paragraph
            [linebreak]
            Another paragraph
        </code>

        <b>RESULT</b>
        <code>
            My paragraph
            <br>
            <br>
            <br>
            Another paragraph
        </code>

### Horizontal line
If you would like to add a horizontal line, just use `[hr]` in your text

        <b>EXAMPLE</b>
        <code>
            My first paragraph
            [hr]
            Another paragraph
        </code>

        <b>RESULT</b>
        <code>
            My paragraph
            <hr />
            Another paragraph
        </code>

### Line
If you would like to add a  line, just type six underscores `______` in your text. Line will be extended to automatically fit in paragraph.

        <b>EXAMPLE</b>
        <code>
            ______
        </code>

        <b>RESULT</b>
        <code>

        </code>

### Dotted line
If you would like to add a dotted line, just type six dots `......` in your text. Line will be extended to automatically fit in paragraph.

        <b>EXAMPLE</b>
        <code>
            ......
        </code>

        <b>RESULT</b>
        <code>

        </code>

### Pagination

There are several shortcodes for displaying page numbers.

`[currentpage]` - shows current page number.
`[lastpage]` - shows the last page.

For example, you may use the above shortcodes to get a dynamically changing text of "This is a page 1 of 5" ("This is a page [currentpage] of [lastpage]).

Additionally, if you only want to display certain text on a specific page only, you may use this shortcode: `[page=PAGE]My text[/page]`. Replace `PAGE` with the page number you want the 'My text' to de displayed.

### Other short-codes

Fixed paragraph height: `[height=3cm]my paragraph has max height of 3cm[/height]`. **NOTE**: This is extremely useful with Prefill Forms to prevent dynamically added text to change the survey layout.

Fixed paragraph width: `[width=3cm]my paragraph has max width of 3cm[/width]`. **NOTE**: This command is particularly useful when aligning text with "Inline text" and "Inline checkboxes".

This is a list of other short-codes that are available to use.

Unique identifier: `[id]`

Link to web survey: `[link]`

QR code to web survey: `[websurvey_qrcode height=2cm]`. **IMPORTANT**: DO NOT place this code at the top-left and bottom-right of the survey.

Smiles: `[sad]`, `[neutral]`, `[smile]`

Checked checkbox: `[check]`, `[multicheck]`, `[singlecheck]`

Filled checkbox: `[filled]`, `[multifilled]`, `[singlefilled]`

Corrected checkbox: `[correct]`

Math equations: `[equation]100+999[/equation]` `[equation]100-10[/equation]`

For multilingual surveys, if a letter is displayed as a square box, it means the font in use doesn't contain the glyph for that character. In these cases you could use `[latin]` and `[arabic]` shortcodes.
Arabic typesetting (Allows using Arabic script, where the primary language is e.g., English): `Sentence in English language [arabic]استطلاع رأي[/arabic]`
Latin typesetting (Allows using Latin script when the primary language is e.g., Arabic): `[latin]Sentence in English language[/latin]استطلاع رأي`

## Images
You may upload your images to be included in the paper survey. This feature is only available in  the __Enterprise__ plan.

However, you may try it out in your demo survey, by inserting the image of our logo: ```[img]logo[/img]```

<ul>
    <li>If you would like to <b>center the image</b>, additionally provide center parameter, (e.g. <span>[img width=5 height=3 center]logo[/img]</span>)</li>
    <li>If you would like to include a <b>full-width</b> image, do not provide any parameters, (e.g. <span>[img]logo[/img]</span>)</li>
    <li>If you would like to set image to <b>half page width</b>, set width parameter to half (e.g. <span>[img width=half]logo[/img]</span>)</li>
    <li>If you would like to set image to <b>third page width</b>, set width parameter to third (e.g. <span>[img width=third]logo[/img]</span>)</li>
</ul>

---

Need more? The complete PaperSurvey.io help center and blog is available as a single document at https://www.papersurvey.io/llms-full.txt.
