Add postcard and postcard small templates
This commit is contained in:
parent
b4ec250ce1
commit
1d1c0d6139
12
cards_lettersheet.typ
Normal file
12
cards_lettersheet.typ
Normal file
|
@ -0,0 +1,12 @@
|
|||
#{
|
||||
set page("us-letter", margin: 0em)
|
||||
|
||||
import "common.typ"
|
||||
|
||||
let options = json("options.json")
|
||||
let cards = options.cards
|
||||
let args = options.args
|
||||
|
||||
common.card_sheets(6in, 4in, 1in/16, args, cards)
|
||||
|
||||
}
|
12
cards_small_lettersheet.typ
Normal file
12
cards_small_lettersheet.typ
Normal file
|
@ -0,0 +1,12 @@
|
|||
#{
|
||||
set page("us-letter", margin: 0em)
|
||||
|
||||
import "common.typ"
|
||||
|
||||
let options = json("options.json")
|
||||
let cards = options.cards
|
||||
let args = options.args
|
||||
|
||||
common.card_sheets(149mm, 99mm, 1in/16, args, cards)
|
||||
|
||||
}
|
40
common.typ
40
common.typ
|
@ -70,8 +70,8 @@
|
|||
dx: 1in/8,
|
||||
dy: 1in/8,
|
||||
block(
|
||||
width - 2.75in,
|
||||
height - 0.25in,
|
||||
width: width - 2in - 7in/8,
|
||||
height: height - 0.25in,
|
||||
breakable: false,
|
||||
content_fn(card)
|
||||
)
|
||||
|
@ -80,7 +80,7 @@
|
|||
// Stamp placement guide
|
||||
place(
|
||||
top + right,
|
||||
dx: -0.75in,
|
||||
dx: -0.25in,
|
||||
dy: 0.25in,
|
||||
image("nixowos.png", width: 0.5in)
|
||||
)
|
||||
|
@ -88,7 +88,7 @@
|
|||
// Address block
|
||||
place(
|
||||
horizon + right,
|
||||
dx: -2in - 5in/8,
|
||||
dx: -1in/8,
|
||||
address_block(2.5in, 1in, card)
|
||||
)
|
||||
}
|
||||
|
@ -101,3 +101,35 @@
|
|||
postcard_content(width, height, content_fn, card)
|
||||
)
|
||||
}
|
||||
|
||||
#let postcard_square(width, height, margin, content_fn, card) = {
|
||||
rect(
|
||||
width: width + margin * 2,
|
||||
height: height + margin * 2,
|
||||
inset: margin,
|
||||
postcard_block(width, height, content_fn, card)
|
||||
)
|
||||
}
|
||||
|
||||
#let card_sheets(width, height, margin, args, cards) = {
|
||||
let content_fn = if args.no_content {
|
||||
_ => []
|
||||
} else {
|
||||
import "content/content.typ"
|
||||
content.content
|
||||
}
|
||||
|
||||
for (idx, card) in cards.enumerate() {
|
||||
let row = calc.rem(idx + args.skip, 2)
|
||||
if idx != 0 and row == 0 {
|
||||
pagebreak()
|
||||
}
|
||||
|
||||
place(
|
||||
top + left,
|
||||
dx: 50% - width / 2 - margin,
|
||||
dy: 25% - height / 2 - margin + 50% * row,
|
||||
postcard_square(width, height, margin, content_fn, card)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue