Jinwen-XU / colorist

Write your articles or books in a colorful way
https://ctan.org/pkg/colorist
LaTeX Project Public License v1.3c
24 stars 2 forks source link

Index Support #2

Closed Teddy-van-Jerry closed 2 years ago

Teddy-van-Jerry commented 2 years ago

Hi, I am really fascinated by this beautiful template. Currently, I am writing a tutorial book with beaulivre. Since I am not familiar with expl3, so I am not sure how to use index (command \index{item}) in the document. So will there be native support for index? Personally I find it quite similar to the \DNF<> command. Thank you in advance!

Jinwen-XU commented 2 years ago

Hello @Teddy-van-Jerry , thank you for your nice words about the template :)

First please accept my apology for not having a comprehensive documentation, I don't really have much time on it for now, but you may expect one by summer.

And to your question, yes, and there already exists native support for index, if you are using the newest version (possibly the GitHub version, not yet uploaded to CTAN) of this template. Internally it uses the package imakeidx, you just need to use the command \index as usual with LaTeX, and a \printindex at the end of your document should be able to give you an index like this:

image

And by the way, the template is still at its early stage, so there might be changes to the appearance, hopefully this won't interfere much with your book.

Feel free to reply this message if you get any trouble with this :)

Teddy-van-Jerry commented 2 years ago

That is really wonderful! I am using the newest CTAN version since it is easier to use tlmgr to keep it updated. After doing a little search for the use of imakeidx, I am able to get it right as a whole. The only little problem is with the Chinese characters sorting. But since entries are mainly in English and there are only a few Chinese characters, I can use @ in the index to get them right in place.

Thanks again for your kind help!

Jinwen-XU commented 2 years ago

Well, currently, due to my limited knowledge with indexing, I have no idea but to use makeindex instead of more powerful programs like xindy, for I don't know how to make the external call automatic. Thus, without unicode support, even when I'm writing French I still have to use @ to make the sorting correct. Perhaps some time later I may replace the current approach when I figure out a better way. But then again, due to the existence of polyphonic characters in Chinese, sometimes the use of @ is unavoidable :)