I would like quotation marks at the start of a paragraph/block to overhang into the left margin. I have #set text(overhang: true), but it doesn’t seem to affect quotation marks. I looked at the documentation for show rules, but I couldn’t find a query for something like “the first character of a paragraph” (so I could have an if/else inside the show rule for "“"), and I can’t rely on the x position because some of these blocks are indented. I also tried defining my own function to do it manually:
That nudges the quotation mark left, but then there’s an awkward space between it and the following character. I would prefer to do it automatically, but I really only care about a couple larger formatted quotes so doing a manual workaround wouldn’t be the end of the world.
#show par: it => {
if not it.body.has("children") or it.body.children.first().func() != smartquote {
return it
}
context {
let len = measure("\"").width
let fields = it.fields()
let fli = fields.remove("first-line-indent")
let body = fields.remove("body")
if fli.amount == -len {
return it
}
par(
..fields,
first-line-indent: (
amount: -len,
all: true,
),
body
)
}
}
Measuring quote in a string is wrong, considering the quotes are being added in markup mode, and therefore being converted to smart quotes, which almost definitely use different Unicode characters, which probably will have different width: