TeX-Live / texdoc

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

newcm finds README instead of newcm-doc.pdf #85

Closed kberry closed 2 years ago

kberry commented 2 years ago
texdoc -l newcm
1 /home/texlive/karl/Master/texmf-dist/doc/fonts/newcomputermodern/README      
   = Readme  
2 /home/texlive/karl/Master/texmf-dist/doc/fonts/newcomputermodern/newcm-unimath-symbols.pdf                                                                   
  = Math coverage and symbol comparison                                         
3 /home/texlive/karl/Master/texmf-dist/doc/fonts/newcomputermodern/newcm-doc.pdf                                                                               
  = Package documentation                                                       
4 /home/texlive/karl/Master/texmf-dist/doc/fonts/newcomputermodern/newcomputermodern-sample.pdf                                                                
  = Font samples 
  1. I expected newcm-doc.pdf to found in preference to the plain text README?

  2. I would have expected newcm-doc.pdf ("Package documentation") to be found in preference to "Math coverage...". I thought there was a single special case for the contents of docstring, namely preferring "Package documentation". If not, I think there should be.

texdoc newcomputermodern does find newcm-doc first.

This is with Texdoc 3.4.1 (2022-03-19), in current TL. Thanks.

wtsnjp commented 2 years ago

This happens because we intentionally introduced an alias pointing to the README and not the package documentation (see #61). I don't remember why. Perhaps the package documentation is new?

https://github.com/TeX-Live/texdoc/blob/bdeb5195af2495feeb6000a5098a50808fdb7ba6/texdoc.cnf#L469-L471

The reason for newcm-unimath-symbols.pdf comes earlier than the package documentation is also an alias. For normal cases without such an alias, package documentation is of course preferred. I'm removing the alias to fix the issue. Now we got:

$ texdoc -l newcm                                                                                                                                                                    !master
 1 /usr/local/texlive/2022/texmf-dist/doc/fonts/newcomputermodern/newcm-doc.pdf
   = Package documentation
 2 /usr/local/texlive/2022/texmf-dist/doc/fonts/newcomputermodern/newcm-unimath-symbols.pdf
   = Math coverage and symbol comparison
kberry commented 2 years ago

It seems newcm-doc.pdf did not exist before TL22, so yes, I guess that is what has changed.

The alias in #61 was supposed to make "newcm" and "newcomputermodern" be synonyms. It's too bad there was a side effect of preferring the README once the doc came along. So it goes.

Thanks for dealing. -k