From 41e5903c68eb2297c11c50cf4afef582a893dc5d Mon Sep 17 00:00:00 2001 From: Gustav Eek Date: Wed, 21 Aug 2024 20:18:53 +0200 Subject: [PATCH] [tex] Adopt commentary for automatic compilation preparatory padding --- tex/guitarsections.sty | 77 +++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 38 deletions(-) diff --git a/tex/guitarsections.sty b/tex/guitarsections.sty index 327708e..4d7d773 100644 --- a/tex/guitarsections.sty +++ b/tex/guitarsections.sty @@ -1,37 +1,42 @@ -%% This is an extension of Martin Väth's *guitar* package with high -%% level environments for song sectioning: chorus, verse and +%% This is an extension of Martin Väth's {\em guitar} package with +%% high level environments for song sectioning: chorus, verse and %% bridge, etc. -%% Author: Gustav Eek +%% Author: Gustav Eek \url{gustav.eek@fripost.org} %% Licence: GNU GPL v3 -%% This is a LaTeX3 package (LaTeX3 is actually LaTeX continued on top -%% of LaTeX2e). See [Introduction to LaTeX3 -%% ideas](http://texdoc.net/pkg/expl3) for throughout details. +%% This is a \LaTeX3 package (\LaTeX3 is actually \LaTeX continued on +%% top of \LaTeX2e). See ``Introduction to \LaTeX3 +%% ideas''\footnote{\url{http://texdoc.net/pkg/expl3}} for throughout +%% details. %% The inspiration is the ChordPro format as well as Ultimate Guitar's -%% sectioning in their text format and Wikipedia's "Song structure", -%% "Verse–chorus form". Pre-defined song sections: +%% sectioning in their text format and Wikipedia's ``Song structure'', +%% ``Verse–chorus form''. Pre-defined song sections: %% -%% * Introduction, intro, -%% * Verse, verse, -%% * Bridge, bridge, -%% * Pre-chorus prech, -%% * Chorus or refrain, chorus, -%% * Post-chorus postch, -%% * Conclusion or outro, outro, -%% * Elision, elison, -%% * Instrumental solo, instr, -%% * Ad lib, ad-lib, -%% * Break, break, +%% \begin{itemize} +%% \item Introduction, intro, +%% \item Verse, verse, +%% \item Bridge, bridge, +%% \item Pre-chorus prech, +%% \item Chorus or refrain, chorus, +%% \item Post-chorus postch, +%% \item Conclusion or outro, outro, +%% \item Elision, elison, +%% \item Instrumental solo, instr, +%% \item Ad lib, ad-lib, +%% \item Break, break, +%% \end{itemize} + +%%% Package metadata \NeedsTeXFormat{LaTeX2e} -\ProvidesExplPackage{ - guitarsections}{ - 2024-08-08}{0.2}{ - An extension of Martin Väth's {\em guitar} package with high level - environments for sections: chorus, verse and bridge. The inspiration +\ProvidesExplPackage{% + guitarsections}{% + 2024-08-08}{0.2}{% + An extension of Martin Väth's {\em guitar} package with high level% + environments for sections: chorus, verse and bridge. The inspiration% is the ChordPro format.} \RequirePackage{guitar}[v1.6] \RequirePackage{xparse} @@ -45,7 +50,7 @@ \setlength{\labelsep}{2.5ex} \setlength{\labelrule}{2pt} -%% Style declaration commands, implemented with LaTeX3 property lists +%%% Style declaration commands, implemented with \LaTeX3 property lists \NewDocumentCommand\guitarLabelDelim{}{:~} @@ -53,16 +58,12 @@ \RequirePackage{xcolor} \colorlet{gtr@default@sty}{darkgray} - -%% - \def\gtr@default@stylabel{} % empty by default \NewDocumentCommand\guitarFont{}{\sffamily\itshape\small} \NewDocumentCommand\guitarFontChords{}{\guitarFont\color{gtr@let@heavy-red}} \NewDocumentCommand\guitarFontRespMusic{}{\guitarFont\color{gtr@let@heavy-purple}} \NewDocumentCommand\guitarFontRespStruct{}{\guitarFont\color{gtr@let@heavy-blue}} - \tl_new:N \gtr_key %% temporary variable \tl_new:N \gtr_val %% temporary variable \prop_new:N \gtr_stycolors %% data structure @@ -104,8 +105,7 @@ \IfValueT{#1}{\guitarLabelDelim#1}% } - -%% Define guitar section environment commands +%%% Define guitar section environment commands \RequirePackage{rotating} \setlength\fboxsep{-\fboxrule} @@ -157,14 +157,15 @@ }% } -%% Provide annotation commands +%%% Provide annotation commands + \newlength\gtr_annotfill \NewDocumentCommand\guitarAnnot{m m}{% \mbox{}\hfill\mbox{}{\guitarFont\gtr_color{#1}\hspace{1ex}#2\hspace{1ex}}\mbox{}% } -%% Provide a horrizontal pragraph ruler +%%% Provide a horrizontal pragraph ruler \NewDocumentCommand\guitarRule{o m}{% \begin{flushleft}% @@ -172,7 +173,7 @@ \end{flushleft}% } -%% Define the color pallet for pre-configured sections +%%% Define the color pallet for pre-configured sections \colorlet{blackgray}{black!75!darkgray} \colorlet{turquoisegreen}{cyan!25!green} @@ -210,7 +211,7 @@ \colorlet{gtr@sty@music}{gtr@let@heavy-purple} \colorlet{gtr@sty@structure}{gtr@let@heavy-blue} -%% Finally define the actual pre-configured sections +%%% Finally define the actual pre-configured sections \guitarSectionStyle[gtr@sty@intro]{Intro} \guitarSectionStyle[gtr@sty@verse]{Verse} @@ -224,14 +225,14 @@ \guitarSectionStyle[gtr@sty@adlib]{Ad lib} \guitarSectionStyle[gtr@sty@outro]{Outro} -%% Defnide other pre-configured annotations and other styles +%%% Defnide other pre-configured annotations and other styles \guitarStyle[gtr@sty@chords]{chords} \guitarStyle[gtr@sty@music]{music} \guitarStyle[gtr@sty@structure]{structure} -%% Utility commands. Activation commands are for client usage. These -%% will not be modified internally +%%% Utility commands. Activation commands are for client usage. These +%%% will not be modified internally \NewDocumentCommand\guitarActivate{m}{% \tl_set:Nx \gtr_key {\tl_lower_case:n {#1}}% -- 2.39.2