Theorem patch with cleveref and amsthm loaded

クローズ
#413 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
44/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
latex
領域
tooling

調査の方向性

hyperref.dtx の 11129–11135 行にある refstepcounter パッチから始め、次に cleveref が amsthm とともに cref@thmnoarg および cref@thmoptarg を通じて @thm をどのように再定義しているかを追跡します。オプション引数の場合を含め、両方の経路に theorem パッチをどのように適用すべきかを判断し、このパッケージの組み合わせの動作を issue #336 および latex2e #1779 の懸念事項に照らして検証します。

索引モデルが issue の本文から書いたものです。

説明

The theorem patch does the following:
https://github.com/latex3/hyperref/blob/d2eb2fae09eee648f81659613a37e3e45566e479/hyperref.dtx#L11129-L11135

If cleveref is loaded, it hooks some spacing stuff in there. I guess it's because cleveref with amsthm loaded redefines things with

  \let\cref@thmnoarg\@thm%
  \def\@thm{\@ifnextchar[{\cref@thmoptarg}{\cref@thmnoarg}}%]

Or maybe there's another reason I don't understand.

Anyway, what I'm confused about is the \refstepcounter patch in \@thm. If cleveref is loaded, then this patch isn't being done at all, but why not?
Patching \@thm no longer works, but patching \cref@thmnoarg seems like it does.

For completeness, \cref@thmoptarg should probably also be patched then, but that would probably also require a variant of \Hy@theorem@refstepcounter with an optional argument, like \cref@thmoptarg wants to use it.

I guess this might be related to #336 and https://github.com/latex3/latex2e/issues/1779. And perhaps amsthm should just be improved like https://github.com/latex3/latex2e/pull/1301, instead of piling more patches on top of each other for this package combination.

主要言語
TeX
スター
210
フォーク
41
平均マージ
4日 16時間
マージ済み PR(30日)
4

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

latex3/hyperref のほかの issue

latex3/hyperref の issue をすべて見る

似ている issue

DevTools の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。