1. Home
  2. Docs
  3. Writing in Beat
  4. Advanced Syntax
  5. Macros

Macros

You can define macros to automate some parts of your screenplay. There are four types of macros: textdateserial and panel.

Macros are defined using curly brackets: {{macroType macroName = value}}.

NOTE: The macro gets printed out immediately when it’s first encountered. If you want to define the values first and use the macros later, you can put the first definitions in an omitted block (/* */) at the beginning of your screenplay.

Text Macro

Text macros print out a simple text value.

INT. MY HOME – {{city = Helsinki}} We see the silhouette of {{city}} in the distance through a window.

Date Macro

The easiest way to include the output date in your document. {{date}} prints out the current date in ISO format unless you explicitly provide a custom format. For example:

Draft date: {{date d.M.Y}}

Result:

Draft date:

Serial Macro

If you need a number that increments every time it is encountered, you can define a serial macro using {{ serial yourVariable = 1 }}

{{serial yourVariable = 1}}, {{yourVariable}}, {{yourVariable}}

Result:

1, 2, 3

Use .sub modifier to add sub-serials:

PAGE {{serial num = 1}} Panel {{num.sub}} Panel {{num.sub}} PAGE {{num}} Panel {{num.sub}} Panel {{num.sub}}

Result:

PAGE 1 Panel 1 Panel 2 PAGE 3 Panel 1 Panel 2

Panel

{{panel}} is a global serial number for comic book panels which automatically gets back to zero after a top-level section. It’s very similar to {{serial}} but it’s an automatic and global singular value, so you can’t have multiple panel variables.

.PANEL {{panel}} .PANEL {{panel}} # New section .PANEL {{panel}}

Result:

PANEL 1 PANEL 2 New Section PANEL 1

Reference Macros

Note: This is still an experimental feature.

When writing highly researched scripts, you can use reference macros: {{ref This is your reference}}. No equation symbols needed, just type in ref followed by the actual reference.

The references won’t be listed by default, but instead you need to add a shortcode macro anywhere at the document to list out all references: {{references}}.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. In neque erat, posuere eu libero in, iaculis lacinia sem. Proin vitae euismod lectus, in tincidunt urna. {{ref Åberg, Alfons (1926) God natt, Alfons Åberg. Stockholm: Rabén & Sjögren.}} **References** {{references}}

Result:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. In neque erat, posuere eu libero in, iaculis lacinia sem. Proin vitae euismod lectus, in tincidunt urna. [1] References [1] Åberg, Alfons (1926) God natt, Alfons Åberg. Stockholm: Rabén & Sjögren.

WARNING: For now, the actual list of references might not get updated correctly in preview, because it is built incrementally based on user changes, not dynamic changes to output content. When you print out the screenplay, you will see the full list.