ho-tex / oberdiek

Updating the oberdiek bundle
Other
16 stars 6 forks source link

Wrong level for change history in case of class with chapters #11

Closed dbitouze closed 7 years ago

dbitouze commented 7 years ago

The following MWE points out that, in case of class with chapters, the "Change history" is a section instead of a chapter.

\documentclass{report}
\usepackage{hypdoc}
\RecordChanges
\begin{document}
\tableofcontents
\chapter{Foo}
\changes{v1}{2016/09/30}{Initial version}
\PrintChanges
\end{document}
davidcarlisle commented 7 years ago

I think this is "by design" or at least hypdoc is just following doc here.

doc sets up the heading in \glossary@prologue at the section level and just documents that that needs to be changed if necessary. You might hoe that it would use \chapter or \section depending on some automatic test, but it doesn't (even if \chapter was defined you may like this at section level under some \chapter{Appendix} or some such, so it isn't clear what the automatic test should be.

I think this works as you intend:

\documentclass{report}
\makeatletter
\def\glossary@prologue{\chapter*{{Change History}}%
                 \markboth{{Change History}}{{Change History}}}%

\makeatother
\usepackage{hypdoc}
\RecordChanges
\begin{document}
\tableofcontents
\chapter{Foo}
\changes{v1}{2016/09/30}{Initial version}
\PrintChanges
\end{document}
dbitouze commented 7 years ago

IMHO, at least for standard class, the best would be to make it be a chapter in case of \chapter does exist, a section otherwise. But maybe this wouldn't work for more complex classes, such as memoir. Thanks.