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

intellisence for entries in glossary #4472

Open
LeoJhonSong opened this issue Nov 27, 2024 · 2 comments
Open

intellisence for entries in glossary #4472

LeoJhonSong opened this issue Nov 27, 2024 · 2 comments
Labels
enhancement Issue suggests an enhancement feature request Feature request

Comments

@LeoJhonSong
Copy link

Could we have intellisence for commands like \gls{} automatically completed with glossary entries stored in a .bib file, just like intellisence for commands like \cite{}?

Thank you vert much for the powerful extension!

A demo is given below👇
main.tex >

\documentclass{article}
\usepackage{glossaries-extra}
\GlsXtrLoadResources[
    src={symbols.bib},
]

\begin{document}
\gls{fs}, \gls{theta}
\end{document}

symbols.bib >

@symbol{fs,
  name        = {\ensuremath{f_s}},
  description = {sample rate}
},
@symbol{theta,
  name        = {\ensuremath{\theta}},
  description = {horizontal angle}
}
@jlelong jlelong added enhancement Issue suggests an enhancement feature request Feature request labels Nov 27, 2024
@jlelong
Copy link
Collaborator

jlelong commented Nov 27, 2024

Thanks for your feature request.

Actually, this is not an intellisense issue as we already have auto-completion for many glossary commands, such as \gls. The problem is that the extension does not use the \GlsXtrLoadResources instruction to load the glossary related data. So implementing this feature request requires

  1. First, to parse

    \GlsXtrLoadResources[
         src={symbols.bib},
    ]

    to resolve the path of symbols.bib

  2. Then, to parse the content of symbols.bib to populate our glossary database.

I have just checked that our bib parser can parse the symbols.bib file given as an example.

@LeoJhonSong Do you have a reference document (or link) listing the keywords we can expect in @symbol entries? Are there other entries to consider? The more complete is the information, the easier and more efficient is the feature development.

@LeoJhonSong
Copy link
Author

LeoJhonSong commented Dec 2, 2024

@jlelong really sorry for the late reply. Thank you for the feature in advance!

The demo above is the fourth method to make a glossary in the manual for glossaries. This is a modern method requires to define entries in a .bib file and requires bib2gls.

Do you have a reference document (or link) listing the keywords we can expect in @symbol entries?

If you use bib2gls (see §11) then most of the glossary entry keys can be used as analogous fields in the bib file.
...
For example, the sort key (which is recommended with xindy where the name contains symbols) should not be used in the bib file. Instead, use the sort-field resource option or the system of sort fallbacks to choose the most appropriate field to obtain the sort value (see Gallery: Sorting). The group and location keys are also considered internal fields and are only applicable with the “unsrt” family of commands.

☝️As mentioned in the manual for glossaries, keywords (or entry keys) we could expect in the entry are listed here😄

Are there other entries to consider?

Possible entries could be found in section 4.5 (Standard Entry Types) to 4.10 (Compound Entry Sets) of bib2gls User Manual. For me, entries listed in section 4.5 and 4.6 could be enough to play with!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issue suggests an enhancement feature request Feature request
Projects
None yet
Development

No branches or pull requests

2 participants