Skip to content

Fix figure caption show rule#40

Merged
tingerrr merged 2 commits intotingerrr:mainfrom
Andrew15-5:fix-caption
Sep 27, 2025
Merged

Fix figure caption show rule#40
tingerrr merged 2 commits intotingerrr:mainfrom
Andrew15-5:fix-caption

Conversation

@Andrew15-5
Copy link
Contributor

@Andrew15-5 Andrew15-5 commented Sep 27, 2025

As was noticed in https://forum.typst.app/t/how-to-avoid-numbering-subfigure-captions-when-using-legal-numbering/6149, par show rule applies to figure captions (in super). Which is not the case when subpar is not used. After a quick figure caption show rule search the issue is obvious: the block wrapper is missing. Adding it, fixes the problem.

Do I need to add a test for this? I guess also par-based show rule. Or like #show par: set text(green).

You can also do

#{
          show figure.caption: it => {
            show: block
            num
            [ ]
            it.body
          }
}

But I guess it's an advanced and confusing version.

@Andrew15-5
Copy link
Contributor Author

It fails without fix. I also made it compile-only. Also, you don't have .gitignore for out directory, so the repository has a bunch of those, even though they don't serve any tt run purpose.

@tingerrr
Copy link
Owner

I would prefer an ephemeral test, but this will do just fine. Thanks!

Regarding the .gitignore, that's probably an issue in how currently sets up tests, I'm working on fixing this in Tytanic itself. But adding the correct .gitignore would be great anyway.

@tingerrr tingerrr merged commit 803c28e into tingerrr:main Sep 27, 2025
3 checks passed
@Andrew15-5 Andrew15-5 deleted the fix-caption branch September 27, 2025 18:19
@Andrew15-5
Copy link
Contributor Author

Actually, the ignore issue is not that bad: #41.

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