9999years / latex-changelog

LaTeX package for typesetting changelogs
https://ctan.org/pkg/changelog
LaTeX Project Public License v1.3c
9 stars 3 forks source link

Default Changelog Style changed from 2.4.0 to 2.5.0 #13

Closed HappyMeCoder closed 2 months ago

HappyMeCoder commented 2 months ago

I have changed my texlive installation from 2022 to 2024 and there was also an update from changelog from v2.4.0 to v2.5.0. Since than the default style how it looks like has changed and is completely different now. Same minimum example code was compiled.

v2.4.0
changelog_2_4_0

v2.5.0
changelog_2_5_0

Example Code: I don't know why the code is not wrapped. I copy the example tex file i have used to the ZIP file

\documentclass{scrreprt}
\usepackage{changelog}
%
\begin{document}
\tableofcontents
\chapter{History}   
\section*{Version 0.1}
%
\begin{changelog}
    \begin{version}[date=04.10.2018]
    \added
        \item First edition before first review
    \end{version}
\end{changelog}
%
\end{document} 

ChangelogTest_2_4_0.pdf ChangelogTest_2_5_0.pdf ChangelogTest.zip

9999years commented 2 months ago

Fixed in #14, I've submitted the new version (2.5.1) to CTAN, it should be published there in a few days. Not sure when it'll reach your TeX distribution.

9999years commented 2 months ago

In the meantime, pasting this snippet after \usepackage{changelog} in your preamble (before \begin{document} should apply the fix:

\usepackage{etoolbox}
\ExplSyntaxOn
\cs_set:Npn \changelog__display_version
    {
        \tl_if_empty:NTF \g__changelog_version_tl
        {
            \tl_if_empty:NTF \g__changelog_date_tl
            {
                \GetTranslation{changelog-Unreleased}
                \tl_set:Nn \g__changelog_date_tl { \today }
            }
            {
                \tl_use:N \g__changelog_date_tl
            }
        }
        {
            \tl_use:N \g__changelog_version_tl
        }
    }

\patchcmd \changelog__short_version_item
    { \tl_use:N \g__changelog_version_tl } % Find this.
    { \changelog__display_version } % Replace with this.
    { } % Execute this on success.
    { } % Execute this on failure.

\cs_set:Npn \changelog__short_version_author_date
    {
        \mode_leave_vertical:
        \tl_use:N \g__changelog_author_tl
        \tl_if_empty:NF \g__changelog_date_tl
        {
            \tl_if_empty:NF \g__changelog_version_tl
            {
                \tl_if_empty:NF \g__changelog_author_tl
                { ~ }
                (\tl_use:N \g__changelog_date_tl)
            }
        }
    }

\cs_set:Npn \changelog__short_version_define_date { }
\ExplSyntaxOff