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

PDFMaker: 画像IDにスペースが含まれていたらエラーにする #1393

Closed
kmuto opened this issue Aug 31, 2019 · 4 comments
Closed

Comments

@kmuto
Copy link
Owner

kmuto commented Aug 31, 2019

TeXシステムでは空白ファイル名はいろいろなトラブルになる(ほかのビルダではHTML含めて問題ない)。

image_image, indepimage, imgtable, icon でIDに空白がある場合はエラーにしておくのが安全そう。

がんばればエスケープしてうんぬん、もできるかもしれないが、競合したときの処理など手間が多い。

@kmuto
Copy link
Owner Author

kmuto commented Sep 1, 2019

画像のスペースだけならなんとかなるが、ほかはわりと大変だった。そもそもチェックが難しい。

  • reファイルのファイル名。ほかのビルダはエラーにならないが、LaTeXは\labelに使っているので%{}あたりはまずい。絵文字も危険そう
  • 本issueのとおり画像ファイル名。ほかのビルダはエラーにならないが、LaTeXは\includegraphicsではスペースおよび%{}、ほかにもまずいのはたくさんありそう。\labelも作るのでreファイル名同様。
  • 表や式、リストなどのIDも\label化されるのでreファイル名同様。
  • bibitemも\labelあり。

ほかにも危ない箇所がいろいろありそう。

@takahashim
Copy link
Collaborator

IDの空白文字は全builderでエラーにしてもいいんではないかと思います…。

@kmuto
Copy link
Owner Author

kmuto commented Sep 1, 2019

  • ASCII範囲文字でTeX的にエラーになるのはスペースと#%\~{}
  • シェル呼び出しで困るかもしれないので!"*'/|[]^$ とバックティックも禁止したい

@kmuto
Copy link
Owner Author

kmuto commented Sep 1, 2019

現状だと個別ビルダの個々のメソッド(tableとかlistとか)で対処しなければならず無駄なので、@takahashim さん計画のindexbuilderの導入後に対応するのがよさそうです。reファイル名のほうはcatalog.rbでかな。

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