Skip to content

Conversation

HydroH
Copy link
Contributor

@HydroH HydroH commented Oct 6, 2023

Resolves #1979 .

@PgBiel
Copy link
Contributor

PgBiel commented Oct 6, 2023

Wow. That's much simpler than I expected.

Can you please add some tests with different inset values?

@laurmaedje
Copy link
Member

I wonder why I didn't do this in the first place... probably an oversight.

@PgBiel
Copy link
Contributor

PgBiel commented Oct 8, 2023

Just for completeness, can you also add a table in your tests which uses all 4 inset configuration keys?

Also, I believe it might be a good idea to add an example to the inset parameter's documentation (the docstring above the inset field), with two tables: one with a simple inset parameter (e.g. 10pt), and another with the 4 inset config keys.

@laurmaedje
Copy link
Member

@PgBiel Parameters can only have one example or at least both things would need to be part of one example. But that's one very long example.

@PgBiel
Copy link
Contributor

PgBiel commented Oct 8, 2023

@PgBiel Parameters can only have one example or at least both things would need to be part of one example. But that's one very long example.

Yeah I think it's fine to have a single example with both. They can be very short tables.

For instance:

#table(inset: 10pt)[Info 1][Info 2]

#table(inset: (left: 4pt, top: 10pt, bottom: 20pt, right: 2pt))[Cell 1][Cell 2]

@laurmaedje
Copy link
Member

#table(
  inset: 10pt,
  [Info 1],
  [Info 2],
)

#table(
  inset: (
    left: 4pt, 
    top: 10pt, 
    bottom: 20pt, 
    right: 2pt,
  ),
  [Cell 1], 
  [Cell 2],
)

will likely render more nicely because it's side by side. the left side will probably be a bit higher. whereas wide input that produces a high output will not look good.

@laurmaedje laurmaedje merged commit 7b61d72 into typst:main Oct 9, 2023
@laurmaedje
Copy link
Member

Thanks!

@HydroH HydroH deleted the hydroh/1979 branch January 16, 2024 04:00
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.

Dictionary inset in tables
3 participants