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

Allow printing long only #51

Open
jmigual opened this issue Jul 31, 2024 · 5 comments
Open

Allow printing long only #51

jmigual opened this issue Jul 31, 2024 · 5 comments
Labels
enhancement New feature or request
Milestone

Comments

@jmigual
Copy link

jmigual commented Jul 31, 2024

So, I usually like to write the long form only of a term in figures and places before it's "officially" introduced in the main text. E.g.,

#definition(gls("gosp", long:true))[We define the @gosp as the tuple ...]

#print-glossary(
  (
    (key: "gosp", short: "GOSP", long: "generic operation scheduling problem"),
  )
)

This should generate the text:

Definition 1 (generic operation scheduling problem): We define the generic operation 
scheduling problem (GOSP) as the tuple ...

TLDR: Can we have something similar to the \acrlong command in LaTeX glossaries?

@slashformotion
Copy link
Collaborator

slashformotion commented Aug 4, 2024

you can write this:

#import "@preview/glossarium:0.4.1": *
#show: make-glossary

#let acrlong(ref) = {
  gls(ref, long: true)
}

We define the #acrlong("gosp") as the tuple ...

#print-glossary(
  (
    (key: "gosp", short: "GOSP", long: "generic operation scheduling problem"),
  )
)

image

Let me know if that works for you.

@jmigual
Copy link
Author

jmigual commented Aug 4, 2024

Hey! Thanks for your reply, unfortunately, this doesn't work because this still inserts the "(GOSP)" at the end of the long command.

In the glossaries package of LaTeX the "acrlong" command always displays the long version without the short and it doesn't change the "first appearance" flag. So, if you type this in LaTeX:

\acrlong{gosp}

\gls{gosp}

You would get:

generic operation scheduling problem

generic operation scheduling problem (GOSP) 

This is the behavior I'm trying to recreate.

@jmigual
Copy link
Author

jmigual commented Aug 4, 2024

I think I can fix it myself and make a PR with the change

@slashformotion
Copy link
Collaborator

I believe you could use the gls-long function to achieve what you want to do but it it only available on the master branch for now

@jmigual
Copy link
Author

jmigual commented Aug 4, 2024

Yes! That's exactly what I was looking for. I guess I'll have to wait 😊

@quachpas quachpas added enhancement New feature or request and removed waiting for creator labels Oct 1, 2024
@quachpas quachpas added this to the 0.4.2 milestone Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants