Code Review
add tag
निरंजन
Hello all, I have pushed an experimental version of package `gfdl` yesterday. This package aims to aid users in using the GFDL in LaTeX documents. My code can be accessed from [here](https://git.gnu.org.ua/gfdl-tex.git/tree). One can issue the following command to clone it anonymously:

```bash
git clone http://git.gnu.org.ua/gfdl-tex.git
```

and the following to clone it with ssh:

```bash
git clone ssh://git.gnu.org.ua/gfdl-tex.git
```

I would like to get reviews on the following points:

1. Is the code optimal? Can something be optimized?
1. Is the user-documentation explanatory of what my package can do? Any typographic/grammatical/conceptual/formational errors can be reported.
1. Is the code-documentation explanatory of what my code can do? Is there anything that needs to be improved?
1. The `.sty` file loads a file named `gfdl-tex-1p3.tex`. It is actually a modified version of the official LaTeX-file shared by the FSF which can be found on [the license page](https://www.gnu.org/licenses/fdl-1.3.tex) itself. I personally do feel that there are certain typographical problems which I don't know how to resolve. E.g., try the following code (you may use `l3build install` before trying the code).

    ```
    \documentclass{article}
    \usepackage{gfdl}
    \copyrightholders{Jane \& John}
    \copyrightableyears{2020, 2021, 2022}

    \begin{document}
    Hello world.
    \end{document}
    ```

    If we look at p. 6 of the resultant PDF, a section title is stranded at the end of a page. I don't like this, but I also don't want to make it class/environment-specific. This package should produce identical results class-independently. The only thing that is allowed to change is the margins. Nothing else.
    
    The original file by FSF has centered section-titles. Being a big time lover of standard LaTeX styles, I hate this, but I am afraid that using standard \sectioning commands could lead to problems when I change the class. I am also going to talk with FSF people and ask them if they are okay with left-aligned titles, but if they don't agree (which has a higher chance) I will just stick to what they suggest. 
    
    Which benefits of a standard LaTeX document am I missing on by not using the typical commands of LaTeX for class-independence? How to have them without actually using LaTeX commands?
1. Any miscellaneous remarks which doesn't fit in any of the items in the list given above.

---

For everyone's convenience I am adding the .sty file here:

```
\ProvidesPackage{gfdl}[2022/12/15 v0
For using the GFDL in LaTeX.]
\RequirePackage{float}
\RequirePackage{expkv-def,expkv-opt}
\newif\ifgfdl@copyrightholdersgiven
\gfdl@copyrightholdersgivenfalse
\newif\ifgfdl@copyrightableyearsgiven
\gfdl@copyrightableyearsgivenfalse
\newif\ifgfdl@copyrightedmaterialdesc
\gfdl@copyrightedmaterialdescfalse
\newif\ifgfdl@licensetextnotprinted
\gfdl@licensetextnotprintedtrue
\newif\ifgfdl@noticenotprinted
\gfdl@noticenotprintedtrue
\ekvdefinekeys{gfdl}{
  invbool     manual     = {\ifgfdl@printgfdl},
  bool        (C)        = {\ifgfdl@bracketedcopyright},
  choice      version    = {%
    1.1                  = {\def\gfdl@version{1p1}},%
    1.2                  = {\def\gfdl@version{1p2}},%
    1.3                  = {\def\gfdl@version{1p3}}%
  },
  initial     version    = {1.3}
}
\ekvoProcessLocalOptions{gfdl}
\ifgfdl@bracketedcopyright
  \def\gfdl@copyrightsymbol{(C)}%
\else
  \let\gfdl@copyrightsymbol\textcopyright
\fi
\NewDocumentCommand{ \copyrightdescription }{ m }{%
  \def\@copyrightedmaterialdesc{#1}%
  \gfdl@copyrightedmaterialdesctrue
}
\NewDocumentCommand{ \copyrightableyears }{ m }{%
  \def\@copyrightableyears{#1}%
  \gfdl@copyrightableyearsgiventrue
}
\NewDocumentCommand{ \copyrightholders }{ m }{%
  \def\@copyrightholders{#1}%
  \gfdl@copyrightholdersgiventrue
}
\AddToHook{begindocument/before}{%
  \ifgfdl@copyrightableyearsgiven
  \else
    \def\@copyrightableyears{\textbf{??}}%
    \PackageWarningNoLine{gfdl}{%
      Copyright-able years not given. I can't print the
      \MessageBreak
      copyright notice without them. To give me this
      \MessageBreak
      information use the \string\copyrightableyears\space
      command.\MessageBreak Using `??' as a placeholder%
    }%
  \fi
  \ifgfdl@copyrightholdersgiven
  \else
    \def\@copyrightholders{\textbf{??}}%
    \PackageWarningNoLine{gfdl}{%
      Copyright-holders not given. I can't print the
      \MessageBreak
      copyright notice without them. To give me this
      \MessageBreak
      information use the \string\copyrightholders\space
      command.\MessageBreak Using `??' as a placeholder%
    }%
  \fi
  \@ifpackageloaded{csquotes}{}{%
    \RequirePackage{csquotes}%
  }%
  \@ifpackageloaded{hyperref}{}{%
    \RequirePackage{hyperref}%
  }%
  \@ifpackageloaded{hyperxmp}{}{%
    \RequirePackage{hyperxmp}%
  }%
  \hypersetup{%
    pdfcopyright  = {%
      \ifgfdl@copyrightedmaterialdesc
        \@copyrightedmaterialdesc
        \textLF
      \fi
      Copyright
      \gfdl@copyrightsymbol\
      \@copyrightableyears\
      \@copyrightholders\textLF
      Permission is granted to copy, distribute and/or
      modify this document under the terms of the GNU Free
      Documentation License, Version 1.3 or any later
      version published by the Free Software Foundation;
      with no Invariant Sections, no Front-Cover Texts, and
      no Back-Cover Texts. A copy of the license is included
      in the section entitled “GNU Free Documentation
      License”.%
    },%
    pdflicenseurl = {%
      https://www.gnu.org/licenses/fdl-1.3.txt%
    }%
  }%
}
\newfloat{gfdl@float}{b}{delme}
\NewDocumentCommand{ \printgfdlnotice }{  }{%
  \begin{gfdl@float}[b!]
    \hrule\medskip
    \ifgfdl@copyrightedmaterialdesc
      \@copyrightedmaterialdesc\par
    \fi
    Copyright
    \gfdl@copyrightsymbol\
    \@copyrightableyears\
    \@copyrightholders

    Permission is granted to copy, distribute and/or modify
    this document under the terms of the GNU Free
    Documentation License, Version 1.3 or any later version
    published by the Free Software Foundation; with no
    Invariant Sections, no Front-Cover Texts, and no
    Back-Cover Texts. A copy of the license is included in
    the section entitled \enquote{%
      GNU Free Documentation License%
    }.%
  \end{gfdl@float}%
  \gfdl@noticenotprintedfalse
}
\AddToHook{begindocument/end}{%
  \ifgfdl@printgfdl
    \printgfdlnotice
  \fi
}
\NewDocumentCommand{ \printgfdltext }{  }{%
  \input{gfdl-tex-\gfdl@version.tex}%
  \gfdl@licensetextnotprintedfalse
}
\AddToHook{enddocument}{%
  \ifgfdl@printgfdl
    \newpage
    \phantomsection
    \addcontentsline{toc}{section}{%
      GNU Free Documentation License%
    }%
    \printgfdltext
  \fi
  \ifgfdl@noticenotprinted
    \PackageError{gfdl}{%
      You didn't print the copyright notice%
    }{%
      You are in the `manual' mode of the GFDL package and
      hence you\MessageBreak are supposed to print the
      copyright notice at a suitable place\MessageBreak of
      your choice, but you haven't printed it at all. This
      violates\MessageBreak the requirement of the GFDL. To
      print it use:\MessageBreak
      \space\space\string\printgfdlnotice.%
    }%
  \fi
  \ifgfdl@licensetextnotprinted
    \PackageError{gfdl}{%
      You didn't print the license text%
    }%
    {%
      You are in the `manual' mode of the GFDL package and hence you%
      \MessageBreak
      are supposed to print the full license text at a suitable place%
      \MessageBreak
      of your choice, but you haven't printed it at all. This violates%
      \MessageBreak
      the requirement of the GFDL. To print it use:%
      \MessageBreak
      \space\space\string\printgfdltext.%
    }%
  \fi
}
\endinput
```

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.