TeX-Live / texdoc

Find and view documentation in TeX Live
https://tug.org/texdoc/
GNU General Public License v3.0
47 stars 7 forks source link

Allowing multiple results for fuzzy search? #88

Open kberry opened 1 year ago

kberry commented 1 year ago

texdoc -l unifonttable prefers texmf-dist/doc/latex/fonttable/fonttable.pdf. That is somewhat understandable, but unicodefonttable.pdf doesn't appear anywhere in the list, which seems surprising. Maybe "uni" somehow needs to imply looking for "unicode"? There are several packages named unicode* ...

This is with the texdoc in current TeX Live, Texdoc 3.4.1 (2022-03-19), though I doubt it matters.

wtsnjp commented 1 year ago

I'm afraid Texdoc does not have a direct solution for that. We can add aliases for each uni* package, but it won't be a fundamental solution.

We need either feature extension:

  1. query preprocessing to replace some well-known abbreviations to the expanded version, such as uni -> unicode.
  2. allowing multiple results for fuzzy search to match several package names by a fuzzy query; currently, the fuzzy search feature is used to find only one best package name close to a query. This is fine for the view mode (since only the best document matters), but it is not enough when considering the list mode.

I would rather take the second option. Maintaining the list of abbreviations just for these cases will be another burden.