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

*.sty内での他*.sty読み込み #1056

Closed
yuw opened this issue Jun 27, 2018 · 2 comments
Closed

*.sty内での他*.sty読み込み #1056

yuw opened this issue Jun 27, 2018 · 2 comments

Comments

@yuw
Copy link

yuw commented Jun 27, 2018

デフォルトで書き出されるLaTeXのスタイルファイル中で\usepackageが使われていますが,*.sty内で\usepackageはLaTeX的に変なので,\RequirePackageを使う方がよいと思います.
例えばreview-base.styの冒頭では次のような具合です:

\RequirePackage{ifthen}
\ifthenelse{\equal{\review@texcompiler}{uplatex}}{%
\RequirePackage[deluxe,uplatex]{otf}%
}{%
\RequirePackage[deluxe]{otf}%
}

対象は次のファイル達になると思います:

  • review-base.sty
  • review-style.sty
  • reviewmacro.sty

(すぐに問題があるわけではなかったりしますが)

@takahashim
Copy link
Collaborator

指摘ありがとうございます! これって単純に置換してしまっても問題ないでしょうか? (tex.stackexchangeで検索したところでは\ RequirePackage \documentclassの前に書けるところが違ってあとは同様、みたいな雰囲気でしたが)

@yuw
Copy link
Author

yuw commented Jun 27, 2018

これって単純に置換してしまっても問題ないでしょうか?

問題ないです.
\usepackageの使用自体は各ファイルの使用方法から汎用性はほとんど考えなくてよい(手動で\documentclassより前に書くなんてことはまずない)と思うので,現状ママでも問題ありませんが,一般のスタイルファイルやクラスファイルでは\RequirePackageを使うので,特に理由が無ければ揃えておくのがよいと思います.

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