Consider the following MWE (say test.tex
), to be compiled with:
pdflatex test
texindy -M test.xdy test.idx
pdflatex test
where the changes are listed thanks to a (slightly) customized index (I don't need the \RecordChanges
, \PrintChanges
, \changes
machinery provided by the doc
package).
\documentclass{article}
\usepackage[xindy,nonewpage]{imakeidx}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.xdy}
(markup-index :open "~n
\begin{theindex}
\small
\providecommand*\lettergroupDefault[1]{}
\providecommand*\lettergroup[1]{}
~n"
:close "~n~n\end{theindex}~n"
:tree)
\end{filecontents*}
\makeindex[title=Change History,columns=1,options=-M \jobname.xdy]
\newcommand\changes[2]{\index{#1!#2}}
\newcommand\PrintChanges{\printindex}
\begin{document}
\changes{v1.0}{First public version}%
\changes{v2.0}{Second public version (much better)}%
%
This is a nice document but its next version will be much better.
%
\PrintChanges
\end{document}
That's nice but the last changes are in last position and that wouldn't be very handy if the change history would become lengthy, especially for an assiduous reader who regularly wants to check the last changes.
Hence, what would be nice would be a change history (and therefore here an index) in the reverse order. (Notice that this request is valid for change history as provided by doc
package as well.)
Update
Thanks to egreg's suggestion, I tried to make use of define-sort-rule-orientations
command for which manual says:
This command must precede all sort-rule commands in an index style.
OK, let's try to do so. Running texindy
with the -d script
option let us see that, in fact, running:
texindy -d script test.idx
in fact runs:
xindy -d script -L general -C latin -M tex/inputenc/latin -M texindy -M page-ranges -M word-order -I latex test.idx
But, even reduced to its minimum:
xindy -d script test.idx
running xindy
loads the module latin9-lang.xdy
, containing:
(require "lang/general/latin9.xdy")
(define-sort-rule-orientations (forward backward forward forward))
(use-rule-set :run 0
:rule-set ("xy-alphabetize" "xy-ignore-special"))
(use-rule-set :run 1
:rule-set ("xy-resolve-diacritics" "xy-ignore-special"))
(use-rule-set :run 2
:rule-set ("xy-resolve-case" "xy-ignore-special"))
(use-rule-set :run 3
:rule-set ("xy-resolve-special"))
Hence, it's seems impossible to specify another define-sort-rule-orientations
before all sort-rule.
Hence, the question remains: how get an (xindy) index in the reverse order?
define-sort-rule-orientations
is what you need.