Typst Brand Logo: Thoughts on Placement #13591
Replies: 1 comment 2 replies
-
|
I’d be happy to consider proposals for the defaults. I admit I didn’t think any one default would work, so I made Typst logo positioning (almost) completely customizable. The settings use css conventions (even though they are currently only for Typst) and they are documented here https://quarto.org/docs/output-formats/typst.html#logo-position I moved this section in the last release because what it documents isn't really a brand.yml feature for Typst; it’s a more complex Typst feature which happens to support brand. In particular, I think But you need It would be good to warn if these are misused! Please let me know if you have any trouble with the logo positioning options, or suggestions. I think they were not too discoverable and have been underused. I considered allowing inset but it would probably have to be inset-typst or something like that, since we’re all in on CSS as our lingua franca for the foreseeable future. (Not that we won’t be happy if Typst wins the web someday!) I like the idea of allowing height instead of width or in addition. I didn’t get around to it at the time but I think it’s not hard to do. I also like the idea for different places for the logo. Background seemed more general to me, like a watermark, but I’d consider a PR if you see a way to make this more general. I’m not sure about the key |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I was teaching a Quarto workshop yesterday. One of the demos was using an implementation of Princeton's brand guidelines for generic PDFs (with
format: typst).By default, it looks a little silly, due to the size of the logo:
That's fine, as it can be configured by setting
width: 2emor otherwise.This is currently set in the page partial:
Note that I can't figure out how to edit location or inset, while each of path, alt, and width can be set.
For example this:
Creates this line:
This gives me three related questions:
Is location intended to be hard-coded? If so, then the choice of background seems odd. Namely, if it's intended to be in the top left, then it would make sense to use
header:instead. Then, rather than setting a width, a reasonable defaultheight: 90%could be set, which would auto scale any logos to the heading margin and the size could be adjusted by rescaling the height parameter.If not, would it be possible to make
insetconfigurable and consider still usingheightrather than (or in conjunction with) width? This makes it easier to align margins as setting things like: 1.5 margin and 0.5 inset => I have 1.0 of space left in the margin for my logo.Again, if not, I can see why you might want to configure
widthif you want a side logo, by setting e.g.location: horizon + leftand a similar math of 1.0 margin - 0.5 inset => 0.5 for a logo.Given how the brand is currently implemented, I would think that either something is being accidentally gobbled up during processing or this is intended as a
headerrather than thebackground.If a height parameter is added, then
width: autowould make for a good default that doesn't stretch logos, so that they can be resized without distorting relative proportions.As one last related thought from working with this, it might also make sense to generalize with
logo.type:which could bebackground,header, orfooter, which would allow for both sensible defaults (e.g.,type: header, height: 90%, location: horizon + left) which will place it very close to where it is, but with a bit of space above and below + auto resize to different margins. Then if someone wants a background or footer, it can be specified. Notably, this can also avoid eating up control over the background, if you want to be able to do things likeset page(background: rotate(45deg, text(128pt, fill: rgb("80000033"))[*DRAFT*])while also having a logo.Sorry for dumping so many comments at once, just sharing my thought process of what I would have expected the behavior to be and what I think more a general behavior could be without sacrificing control.
Beta Was this translation helpful? Give feedback.
All reactions