Zettlr LogoZettlr Documentation
Setup
Troubleshooting
FAQ
  • About Zettlr
  • Download Zettlr
  • GitHub
  • English
  • Español
  • Deutsch
  • Français
  • Italiano
  • 日本語
  • Português
  • Русский
Setup
Troubleshooting
FAQ
  • About Zettlr
  • Download Zettlr
  • GitHub
  • English
  • Español
  • Deutsch
  • Français
  • Italiano
  • 日本語
  • Português
  • Русский
  • Welcome
  • Getting started

    • Setup
    • Migrating from Obsidian
    • Migrating to a New Computer
    • Installing LaTeX
    • A Note on Security
    • Get involved
    • Troubleshooting
  • First Time Users

    • First Steps
    • Workspaces
    • Creating Files and Folders
    • Writing Markdown
    • Importing Word- and other Documents into Zettlr
    • Exporting Files
  • Interface

    • File Manager
      • Workspaces and Root Files
      • Choosing Which Files To Display
      • File Manager Appearance (Modes)
      • The File List
      • Properties
      • Filtering
      • Global Search
      • Projects
    • Split View
      • Document Tab Bar
      • Markdown Editor
      • Code Editor
      • Image Viewer
      • PDF Viewer
    • Sidebar
      • Table of Contents
      • References
      • Related Files
      • Other Files
  • Writing

    • Main Editor
      • Introduction to Markdown
      • Appearance
      • Search
      • Autocomplete
      • Citations
      • Cross-References
      • Working With Comments
      • Status Bar
      • Table Editor
      • Text Transforms
      • Snippets
    • Zettlr Markdown
      • Basic Syntax
      • Inline Extensions
      • Footnotes
      • Tables
      • Citations and CrossRef
      • Attribute Syntax
      • Bracketed Spans and Fenced Divs
      • Admonitions
      • YAML Front Matter
    • Language & Style
      • Spellchecking
      • LanguageTool
      • Markdown Syntax
      • Autocorrect and Magic Quotes
      • Readability
    • Scientific & Technical
      • Math
      • Code Blocks
      • Mermaid Diagrams
      • Pomodoro Timer
      • Writing Statistics
    • Exporting
      • Exporting Workflow
      • Defaults Files (Profiles)
      • Selecting the PDF Engine
      • Assets Manager
      • Custom Templates and Reference Documents
      • Custom Commands
      • Printing and Previewing
      • Lua Filters
    • PKMS & Zettelkasten
      • The Zettelkasten method
      • Graph View
      • Tag Manager
  • Guides
    • Custom CSS
    • Reference Manager Integration
    • Setting up LanguageTool locally
    • Presentations
    • Submitting to a Journal using a LaTeX Template
    • Zettlr as a Portable App
  • Reference
    • Keyboard Shortcuts
    • Settings
    • Frequently Asked Questions

Bracketed Spans and Fenced Divs

Bracketed Spans and Fenced Divs

Another feature that is unique to Pandoc and Zettlr is the ability to surround ranges of text and entire blocks with custom containers. These syntax extensions allow you to customize your documents to an incredible degree.

Important

Like citations and cross-references, this feature is not supported with many other tools, at least not without external plugins or some additional configuration effort.

Problem Statement

To understand what bracketed spans and fenced divs are, it is crucial to understand the problem these syntactical elements attempt to solve.

Markdown as a language has been devised to separate writing from the typesetting process. The basic idea is that you should write your texts first, and take care of any layout considerations only after your texts are done. Therefore, it purposefully does not allow you to micromanage how elements are styled; their colors, borders, and other design elements.

However, sometimes you do wish to include elements with a specific style, or you need to apply a style for which there is no corresponding element. You may, for example, have noticed that Markdown does not include a native element to underline text.

You could, of course, fall back to using raw HTML elements to achieve the look you desire. But this has the drawback that it prevents you from exporting the same document to, say, Word or PDF, without losing all HTML elements.

This is the case for which Pandoc has introduced bracketed spans and fenced divs. These are inline and block elements that allow you to assign styles, identifiers, and other information to ranges of text or entire blocks.

Tip

Bracketed spans and fenced divs only make sense in conjunction with the attribute syntax, which you should consult as well.

Bracketed Spans

Bracketed spans allow you to assign attributes to specific ranges of text. You create a bracketed span by surrounding the wanted text with square brackets, immediately followed by a set of attributes in curly brackets.

A good example is the underlining feature:

[This text will be underlined]{.underline}

You only need to use bracketed spans if there is no specific element you wish to target (such as an image, or a link).

Fenced Divs

Sometimes, you want to assign a set of attributes to a paragraph (which does not support attributes itself), or even to multiple blocks at once. For this you can use a fenced div. A fenced div is demarcated with a series of colons (like fenced code blocks), and optionally a set of attributes.

For example, to center a paragraph of text, you can use the following:

::: {align=center}
This text will be centered.
:::

A special example is the reference block that is automatically created by citeproc when you export your document. By default, the reference list is attached to the end of the document. However, sometimes you may want to include information after the list of references. To do so, you can tell citeproc to use a specific container to place its references in.

If there is a container with the identifier #refs in your document, citeproc will place the bibliography inside this container, rather than adding it at the end. This allows you to, say, add an appendix after your list of references:

# References

::: {#refs}
:::

# Appendix A

…

You can also nest fenced divs just like any other block element. This way, you can, for example, create a two-column layout for a beamer presentation:

::: {.columns .onlytextwidth align=center}
:::: {.column width=45%}

Left Column

::::
:::: {.column width=45%}

Right Column

::::
:::
Edit on GitHub
Last update: 9/20/26, 5:56 PM
Contributors: Hendrik Erz
Prev
Attribute Syntax
Next
Admonitions
© 2017-2026 by Zettlr and Contributors