wtsnjp / platexcheat

A pLaTeX cheat sheet

Home Page:https://wtsnjp.com/pdf/platexsheet.pdf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

texdoc 対策

wtsnjp opened this issue · comments

現在,標準的な TeX Live 環境で

$ texdoc platexcheat

を叩くと,本来であれば文書本体(platexsheet.pdf)が表示されて欲しいわけですが,実際にはサンプル文書(platexsample.pdf)が優先的に表示されてしまいます.

texdoc -d オプションによって,上記キーワードで texdoc による検索をかけた際のスコア情報を見ると,両者はいずれも 4 ポイントと同率であり,あとは恐らくアルファベット順で platexsample.pdf が優先されるものと思われます.

texdoc debug-score: ----------
texdoc debug-score: Start scoring /usr/local/texlive/2017/texmf-dist/doc/latex/platexcheat/LICENSE
texdoc debug-score: Name used: platexcheat/license
texdoc debug-score: Start heuristic scoring with pattern: platexcheat
texdoc debug-score: New heuristic score: 1. Reason: subword match
texdoc debug-score: New heuristic score: 0.1. Reason: bad extension
texdoc debug-score: New heuristic score: 1.6. Reason: directory bonus
texdoc debug-score: Final heuristic score: 1.6
texdoc debug-score: Max pattern score: 1.6
texdoc debug-score: Adjust by -10 from global pattern 'license'
texdoc debug-score: Final score: -8.4
texdoc debug-score: ----------
texdoc debug-score: Start scoring /usr/local/texlive/2017/texmf-dist/doc/latex/platexcheat/platexsample.pdf
texdoc debug-score: Name used: platexcheat/platexsample.pdf
texdoc debug-score: Start heuristic scoring with pattern: platexcheat
texdoc debug-score: New heuristic score: 1. Reason: subword match
texdoc debug-score: New heuristic score: 2.5. Reason: directory bonus
texdoc debug-score: Final heuristic score: 2.5
texdoc debug-score: Max pattern score: 2.5
texdoc debug-score: Catalogue details bonus: +1.5
texdoc debug-score: Final score: 4
texdoc debug-score: ----------
texdoc debug-score: Start scoring /usr/local/texlive/2017/texmf-dist/doc/latex/platexcheat/README.md
texdoc debug-score: Name used: platexcheat/readme.md
texdoc debug-score: Start heuristic scoring with pattern: platexcheat
texdoc debug-score: New heuristic score: 1. Reason: subword match
texdoc debug-score: New heuristic score: 0.1. Reason: bad basename
texdoc debug-score: New heuristic score: 1.6. Reason: directory bonus
texdoc debug-score: Final heuristic score: 1.6
texdoc debug-score: Max pattern score: 1.6
texdoc debug-score: Catalogue "readme" bonus: +0.1
texdoc debug-score: Adjust by 0.1 from global pattern 'readme'
texdoc debug-score: Final score: 1.8
texdoc debug-score: ----------
texdoc debug-score: Start scoring /usr/local/texlive/2017/texmf-dist/doc/latex/platexcheat/platexsheet.pdf
texdoc debug-score: Name used: platexcheat/platexsheet.pdf
texdoc debug-score: Start heuristic scoring with pattern: platexcheat
texdoc debug-score: New heuristic score: 1. Reason: subword match
texdoc debug-score: New heuristic score: 2.5. Reason: directory bonus
texdoc debug-score: Final heuristic score: 2.5
texdoc debug-score: Max pattern score: 2.5
texdoc debug-score: Catalogue details bonus: +1.5
texdoc debug-score: Final score: 4

最も確実な改善策は現在 platexsheet.pdf としている本体文書のファイル名を platexcheat.pdf に変更することですが,現在の仕様は本パッケージの元ネタである latexcheat パッケージに合わせたものであるため,変えることを好みません.

一方,platexsample.pdf は本質的に本パッケージのオリジナルであるため,こちらのファイル名変更には抵抗感が少ないことから,これを sample.pdf 等に変える案もあります.ただし,この変更を行った場合,実際に platexcheat.pdf が選択されるかは未検証です(これは単純にデバッグしにくいため).