Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tudaexercise template #8

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

FussballAndy
Copy link

@FussballAndy FussballAndy commented Nov 12, 2024

tudaexercise typst template

Missing features

  • Proper coloring, change title text color based on accent color etc.
  • Add colorback option to make title not have color background
  • Add documentation

Optionals

  • Darkmode. Similar to Rubens Latex template

@FussballAndy
Copy link
Author

Ignore the commit history had some problems with git, we should just squash merge this PR

templates/tudaexercise/template/tudaexercise.typ Outdated Show resolved Hide resolved
templates/tudaexercise/template/tudaexercise.typ Outdated Show resolved Hide resolved
templates/tudaexercise/template/tudaexercise.typ Outdated Show resolved Hide resolved
// For now hardcoded value - should be half title rule height. Maybe change to state in the future however that will add a lot of computation complexity
#let tuda_section_line_height = 0.6pt

#let tuda-section-lines(above, below, body) = {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be merged with tud-heading-with-lines in headings.typ, it is currently not used by the thesis template. But you can also keep it separate for now if you want.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put the section functions into headings.typ. For now I also left tud-heading-with-lines as I am not sure if we should leave it for future use or not.

templates/tudaexercise/template/tudaexercise.typ Outdated Show resolved Hide resolved
templates/tudaexercise/template/tudaexercise.typ Outdated Show resolved Hide resolved
@JeyRunner
Copy link
Owner

Nice, it looks good.
I added some review comments.

@FussballAndy
Copy link
Author

Most review points should be fixed now. I also added a few more utilities for coloring and working with dicts/default values.
One thing I am unsure about is whether we should give the user more customization options for coloring, so letting the user also be able to overwrite the background/text color from within the template. I am also thinking about adding a more general design state in which all design options like colors get stored. This will mostly just be used for the sections but will also give the user a way to access the colors used by the template.

@JeyRunner
Copy link
Owner

Looks pretty nice 👍
Regarding the customization options, you can add custom background/text colouring if you want, but I am not sure if it is really required. I would generally go for: simpler = better. But if it is simple to implement its fine I guess.
In general, I would avoid using state if it is not needed. But your use case of giving the user access to computed colours makes sense (e.g. to make figures that match the accent colour). I would propose to make this design state just one way so that the user can't accidentally mess up the design by overwriting the state (and this way we effectively don't have state as long as the user does not read it). So essentially passing all computed colours to the sub-functions by value, but also writing the colours to the separate design state (but never read from it). What do you think?

Btw, you can also add your name to the typst.toml, so that you will be displayed as an author on the Universe website too.

@FussballAndy FussballAndy marked this pull request as ready for review November 16, 2024 19:39
@FussballAndy
Copy link
Author

This should be mostly it. Though I am unsure if we should use the same README.md for both templates. Especially hence the images in these READMEs will also break in the typst packages repository. But also because (at least the current README) is rather specific to the thesis template.

@FussballAndy FussballAndy changed the title WIP: Add tudaexercise template Add tudaexercise template Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants