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

パイプ(|)を索引登録すると|hyperindexformat|となってしまう #1611

Closed
uchan-nos opened this issue Dec 10, 2020 · 4 comments

Comments

@uchan-nos
Copy link

次のようなreviewファイルを作ってPDFをビルドすると、索引が予期しない文字列になります。

= パイプを索引にするとバグる

@<idx>{|}というような感じで索引登録すると、索引が@<code>{|hyperindexformat|}となる。

実際のPDF出力はこんな感じになります。

予期せぬ索引出力

config.ymlの中の索引の設定は次の通りです。

pdfmaker:
  makeindex: true
  makeindex_options: "-f -r -I utf8"
  makeindex_mecab: false

現象を確認したreviewのバージョンは4.0.0です。

$ review version
4.0.0-master

ソースコード一式とビルド済みPDFをパックしたtarを添付しておきます。

pipe-index.tar.gz

@kmuto
Copy link
Owner

kmuto commented Dec 10, 2020

報告ありがとうございます。

mendex的にほかにもエスケープが必要ないろいろと危ない文字がありそう。
makeindex_commandが /.*mendex.*/だったらmendexエスケープをする方向で考えます(互換性を壊しそうなのでオプション増やさないとかも…)。

@kmuto
Copy link
Owner

kmuto commented Dec 10, 2020

エスケープしてるけどそれがおかしいんだな

@kmuto
Copy link
Owner

kmuto commented Dec 12, 2020

@<idx>{記号} で検証

コンパイル時点の問題

  • { はrunaway argumentエラー
  • } はToo many }'sエラー

結果の問題

  • ||hyperindexformat|になる

@kmuto
Copy link
Owner

kmuto commented Dec 12, 2020

TeXとhyperrefのパンドラの箱を開けてしまった感があります…。本質的な解決には至っていないですが、
ひとまずissueの問題だけの回避策であれば、

index.dicなどの適当な辞書ファイルをプロジェクトフィルダに作り、中身を

|	|

(間はタブ)

としておいて、config.ymlで

  makeindex_dic: index.dic

としておけば、|についてはTeXのhyperrefパッケージによって壊されない全角文字が読みに使われて、ソートも問題ありません(全角でもちゃんと記号側にソートされます)。
ただ{}とかは根本的にまだ動かないですし、ユーザ側でつまらない設定が必要なのは釈然としないので、Re:VIEWコア側で手当てできるものかもう少し粘ってみます。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants