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

wrap-it:0.1.0 #357

Merged
merged 1 commit into from
Jan 26, 2024
Merged

wrap-it:0.1.0 #357

merged 1 commit into from
Jan 26, 2024

Conversation

ntjess
Copy link
Contributor

@ntjess ntjess commented Jan 26, 2024

I am submitting

  • a new package
  • an update for a package

Description: Stand-in for wrapping figures around text while we await official support

I have read and followed the submission guidelines and, in particular, I

  • selected a name that isn't the most obvious or canonical name for what the package does
  • added a typst.toml file with all required keys
  • added a README.md with documentation for my package
  • have chosen a license and added a LICENSE file or linked one in my README.md
  • tested my package locally on my system and it worked
  • excluded PDFs or README images, if any, but not the LICENSE

Copy link
Member

@laurmaedje laurmaedje left a comment

Choose a reason for hiding this comment

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

Really cool stuff.

In this image

there is this bit of space after "corpore". Is that because a paragraph ends there in Typst's view even though it's technically not the end of the paragraph? If yes, perhaps adding a linebreak(justify: true) there would help.

packages/preview/wrap-it/0.1.0/typst.toml Outdated Show resolved Hide resolved
packages/preview/wrap-it/0.1.0/typst.toml Outdated Show resolved Hide resolved
@ntjess
Copy link
Contributor Author

ntjess commented Jan 26, 2024

perhaps adding a linebreak(justify: true) there would help

Thanks for the suggestion. This does work, but I don't want to enable it unconditionally since text may not be justified. I was under the impression that par(linebreaks: auto) would handle this circumstance, but that fix doesn't work here. Is there a current method to know whether the environment is justified?

If not, in your opinion is it worth adding a justify argument to inform wrap-content whether things are justified?

@laurmaedje
Copy link
Member

Is there a current method to know whether the environment is justified?

No, I don't think that's possible at the moment. Well, with extreme hackery there might be some way to observe a layout difference on some well-known content with measure...

If not, in your opinion is it worth adding a justify argument to inform wrap-content whether things are justified?

I think it might be useful, but that's totally up to you.

@ntjess
Copy link
Contributor Author

ntjess commented Jan 26, 2024

observe a layout difference on some well-known content

I was playing around with this exact idea -- place a label at the end of a text run and observe the average ending position. But there's no way to get an answer without placing the content in the document, which isn't ideal. So I think I'll call this a fundamental limitation for now, and propose manual user linebreaks if this is their situation. If enough people complain about the need, I'll add it in 0.1.1

I have a similar rational for a inset parameter, rather than requiring the user to box their own figures.

@laurmaedje laurmaedje merged commit 7cfa877 into typst:main Jan 26, 2024
1 check passed
@laurmaedje
Copy link
Member

Sounds good. Thanks for the cool package!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new A new package submission.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants