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

複数の原稿ファイルでセクション番号が連続しない #129

Open
MurakamiShinyu opened this issue Aug 26, 2024 · 1 comment

Comments

@MurakamiShinyu
Copy link
Member

Vivliostyle Base Theme で、セクション番号は "1.1.1" の形式になるように設定されています:

https://github.com/vivliostyle/themes/blob/main/packages/%40vivliostyle/theme-base/css/partial/section.css#L16-L20

単一の原稿ファイルならばこれでよいですが、複数の原稿ファイルを結合する場合に、各ファイルでカウンターがリセットされるので、トップレベルのセクション(たいてい「章」をあらわす)の番号がぜんぶ "1" になってしまいます。

考えられる回避策は、次のように各原稿ファイルでセクション番号のカウンターの値をセットすることです。

2番目の原稿ファイルで

<style>
h1 {
  counter-set: vs-counter-sections 2;
}
</style>

3番目の原稿ファイルで

<style>
h1 {
  counter-set: vs-counter-sections 3;
}
</style>

もっとよい方法があるとよいですが……

@spring-raining
Copy link
Member

暫定的な対策として、 以下のようなCSS変数を使ってカウンターをセットするCSS変数を追加しました 18ed51a

:root {
  --vs-section--root-counter-sections: 2;
}

将来的に、ドキュメント数に応じてこのCSS変数を付与するvivliostyle-cliのオプションを追加することで対応しようと思います。

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