m

markly

@preview

Typst package for bleed, cut and registration marks

v0.4.0
MIT

Package Information

Last Updated
Minimum Typst Version
0.14.0
Categories
layout

1. Get the package

Download the package using the TPIX CLI:

tpix get @preview/markly:0.4.0

2. Import in your Typst file

Add this to your .typ file:

#import "@preview/markly:0.4.0": *

Version History

0.4.00.14.0
c91f3e6ff3c1...
0.3.00.13.0
4c339656d14d...
0.2.00.12.0
fddd2ab1d7c0...

This is a Typst package to add cut, bleed, and registration marks to documents.

It's likely that some future version of Typst will obsolete this package. Until that time, it's nice to have a way to achieve this functionality with the current version.

Demo

Markly Demo

...can be generated with:

#import "@preview/markly:0.4.0"

#let markly-context = markly.setup(
  stock-width:6in,
  stock-height:4in,

  bleed: 12pt,
  content-width: 4in,
  content-height:3in,
)

#show: markly.page-setup.with(markly-context)

// Here the local title template uses markly's to-bleed
#let title(body, inset-y:12pt) = {
  markly.to-bleed(text(white, size:2.5em, body), markly-context)
}

#title[Bannar]

- Content

For a more detailed example, see main.typ and main.pdf.

Notes

Margins

Markly defaults to a mode of operation where content you add is offset from the cut lines kinda like page.margin. This margin is controlled by margin-width and margin-height which default to .2in. In this mode you can add a background color for a title all the way to the bleed lines using to-bleed without affecting these margins.

If you want full control of the content and will manage the margins inside the content you add, set margin-width and margin-height to -bleed like this:

#let bleed = 9pt
#let markly-context = markly.setup(
  content-width:7in,
  content-height:5in,

  bleed:bleed,

  margin-width:-bleed,
  margin-height:-bleed,
)

With this code, the cursor will start the top left of the bleed box.

Limitations

Since this is a bit difficult to do there are some limitations to using this package. Here are a few examples:

  • inside/outside margins don't work on pages
  • The background field of the page can't be used unless there is a wrapper function so that marks is called also.

Usage

Setup

Use setup to create a "context", a dictionary with parameters that is passed to other markly methods.

The stock width and height is your actual paper size.

Parameter Default Value
stock-width 8.5in
stock-height 11in

The content width and height will be the size of the paper after cutting along the cut marks (black).

Parameter Default Value
content-width 6in
content-height 4in

The margin width and height are the amounts between the edge of the cut line and the start of the content. NOTE: total width consumed by margins equals 2 * margin-width since it's used on both sides of the content. Same for height.

Parameter Default Value
margin-width 6in
margin-height 4in

bleed is the distance between the cut line and bleed line, or the over-print amount that can occur because we have extra paper past the cut line.

Parameter Default Value
bleed 9pt

Three parameters control which marks are drawn

Parameter Default Value
bleed-marks true
cut-marks true
registration-marks true
#let markly-context = markly.setup(
  // stock-width:8.5in,
  // stock-height:11in,

  content-width:7in,
  content-height:5in,

  // bleed:9pt,

  // margin-width:.2in,
  // margin-height:.2in,

  // bleed-marks:true,
  // cut-marks:true,
  // registration-marks:true,
)

// Configure the page to draw marks
#show: markly.page-setup.with(markly-context)

content...

Use to-bleed, to-bleed-left, or to-bleed-right to paint a background to the bleed marks.

Use img-to-bleed to stretch an image horizontally and vertically to the bleed marks. The position of the "cursor" is not updated (like in the case of a background image) since it uses the place function.

Design

Cetz is used to draw the marks on the page's background.