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

alignment #80

Open
internettechnik opened this issue Oct 28, 2024 · 4 comments
Open

alignment #80

internettechnik opened this issue Oct 28, 2024 · 4 comments

Comments

@internettechnik
Copy link

unfortunately, the alignment seems to be centered now (0.5.1) which differs from 0.5.0 and cannot be changed / set with set text align directive.

@quachpas
Copy link
Collaborator

I wouldn't be able to guess what changed. Could you isolate your code for an example? It works on 0.5.0?

@quachpas
Copy link
Collaborator

quachpas commented Nov 7, 2024

@internettechnik ?

@RBW1999
Copy link

RBW1999 commented Nov 9, 2024

Issue

I myb had the same "issue". I didn't check between version, but I also had same weird styling when importing the package.

My issue was user related. The styles that I had applied before were the cause of the bad alignment.

image

The "Cause"

I guess glossarium uses figures and captions under the hood to link and display the entries in the glossar. So your individual styling of figures and captions will take effect on the glossar. As I understand it, this functionality of leaving the styling to the user is intendet ( #60 )

Sadly I wasnt able to reproduce a isolated example in my given time. But I can present and explain my fix.

Solution for my Issue

image

[
    #set figure(placement: none)
    #show figure: set block(width: 100%)
    #show figure.caption: c =>[
      #align(left, [#c.body])
    ]
  
    #heading([Glossar]) 
    #glossarium.print-glossary(glossar-list)
 ]
  1. I wrapped the styling and the glossar with a content block [ ] so that the style adjustment only affects the glossar.
  2. Setting the figure placement to none keeps the entries from floating to the top or bottom of the page (#set figure(placement: none))
  3. As discussed in this typst-issue-1498 the caption placement depents on the size of the figure. I therefore set the width #show figure: set block(width: 100%)
  4. After setting the width to 100% the align comment works as intendet:
#show figure.caption: c =>[
      #align(left, [#c.body])
    ]

@quachpas
Copy link
Collaborator

If you are styling figure.caption of all kinds, it will affect glossary entries, as they are indeed figure elements.
Glad you got it working!

@quachpas quachpas pinned this issue Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants