<commit_before>\NeedsTeXFormat{LaTeX2e}%
\RequirePackage{keyval}%
\RequirePackage{ifluatex}%
\ProvidesPackage{cu-kruk}[2018/03/01 v0.1 support for kruk music notations]%
%
%% 'autocolormarks' and noautocolormarks options
\newif\ifcu@autocolormarks
\ifluatex
  \cu@autocolormarkstrue
\else
  \cu@autocolormarksfalse
\fi

\DeclareOption{autocolormarks}{
  \cu@autocolormarkstrue
  \ifluatex\relax\else\message{WARNING: autocolormarks option may not work correctly with this TeX engine. See documentation for more details.}\fi
}
\DeclareOption{noautocolormarks}{
  \cu@autocolormarksfalse
}

\ProcessOptions\relax

\let\cuKrukFont\relax %% to be defined by the user
%
\newlength{\cuKrukSylSpace}  %% spacing around kruk syllable
\newlength{\cuKrukTopMargin} %% top margin ensures that lines are nicely separated
\newlength{\cuKrukSylRuleHeight}  %% how thick placeholder rule is
\newlength{\cuKrukRaise} %% distance between text and kruk baselines
%
\setlength{\cuKrukSylSpace}{0.2em}
\setlength{\cuKrukTopMargin}{0.3em}
\setlength{\cuKrukSylRuleHeight}{0.08em}
\setlength{\cuKrukRaise}{1em}

\define@key{cuKruk}{krukFont}{\def\cuKrukFont{#1}}%
\define@key{cuKruk}{sylSpace}{\setlength{\cuKrukSylSpace}{#1}}%
\define@key{cuKruk}{topMargin}{\setlength{\cuKrukTopMargin}{#1}}%
\define@key{cuKruk}{sylRuleHeight}{\setlength{\cuKrukSylRuleHeight}{#1}}%
\define@key{cuKruk}{krukRaise}{\setlength{\cuKrukRaise}{#1}}%

\newcommand{\cuKruk}[3][]{%
  \bgroup
  \setkeys{cuKruk}{#1}%
  \cu@@Kruk{#2}{#3}%
  \egroup
}%
\def\cu@@Kruk#1#2{{%
  \edef\cu@tmp{\csname \detokenize{#2}cu@@@\endcsname}%
  \setbox1=\hbox{{\cuKrukFont#1}}%
  \dimen0=\ht1\advance\dimen0 by \cuKrukTopMargin\ht1=\dimen0%
  \if\relax\detokenize{#2}\relax
    \setbox2=\hbox{\vrule height \cuKrukSylRuleHeight width \wd1}%
  \else
    \ifx\cu@tmp\cu@Tilda
      \setbox2=\hbox{\vrule height \cuKrukSylRuleHeight width \wd1}%
    \else
      \setbox2=\hbox{#2}%
    \fi
  \fi
  \ifdim\wd1>\wd2%
    \setbox2=\hbox to \wd1{\hss\box2\hss}%
  \fi
  %\discretionary{}{}{}%
  \hskip\cuKrukSylSpace\penalty5000\hbox to \wd2{%
  \hskip0.5\wd2\hskip-0.5\wd1\raise\cuKrukRaise\copy1\kern-0.5\wd2\kern-0.5\wd1\copy2\hss
  }\penalty10000\hskip\cuKrukSylSpace
}}%
%
\newlength{\cuSupRaise} %% controls extra vertical space between Sup and Base
\setlength{\cuSupRaise}{0ex}
\define@key{cuSup}{raise}{\setlength{\cuSupRaise}{#1}}%

\newcommand{\cuSup}[3][]{%
  \bgroup
  \setkeys{cuSup}{#1}%
  \cu@@Sup{#2}{#3}%
  \egroup
}%
\def\cu@@Sup#1#2{{%
  \leavevmode
  \setbox1=\hbox{#1}%
  \setbox2=\hbox{#2}%
  \dimen0=\ht2%
  \message{\the\dimen0}%
  \advance\dimen0 by \cuSupRaise<commit_msg>additionally raise superscript grou by its depth. Makes difference for letters that extend below the baseline, like "y", "g"<commit_after>\NeedsTeXFormat{LaTeX2e}%
\RequirePackage{keyval}%
\RequirePackage{ifluatex}%
\ProvidesPackage{cu-kruk}[2018/03/01 v0.1 support for kruk music notations]%
%
%% 'autocolormarks' and noautocolormarks options
\newif\ifcu@autocolormarks
\ifluatex
  \cu@autocolormarkstrue
\else
  \cu@autocolormarksfalse
\fi

\DeclareOption{autocolormarks}{
  \cu@autocolormarkstrue
  \ifluatex\relax\else\message{WARNING: autocolormarks option may not work correctly with this TeX engine. See documentation for more details.}\fi
}
\DeclareOption{noautocolormarks}{
  \cu@autocolormarksfalse
}

\ProcessOptions\relax

\let\cuKrukFont\relax %% to be defined by the user
%
\newlength{\cuKrukSylSpace}  %% spacing around kruk syllable
\newlength{\cuKrukTopMargin} %% top margin ensures that lines are nicely separated
\newlength{\cuKrukSylRuleHeight}  %% how thick placeholder rule is
\newlength{\cuKrukRaise} %% distance between text and kruk baselines
%
\setlength{\cuKrukSylSpace}{0.2em}
\setlength{\cuKrukTopMargin}{0.3em}
\setlength{\cuKrukSylRuleHeight}{0.08em}
\setlength{\cuKrukRaise}{1em}

\define@key{cuKruk}{krukFont}{\def\cuKrukFont{#1}}%
\define@key{cuKruk}{sylSpace}{\setlength{\cuKrukSylSpace}{#1}}%
\define@key{cuKruk}{topMargin}{\setlength{\cuKrukTopMargin}{#1}}%
\define@key{cuKruk}{sylRuleHeight}{\setlength{\cuKrukSylRuleHeight}{#1}}%
\define@key{cuKruk}{krukRaise}{\setlength{\cuKrukRaise}{#1}}%

\newcommand{\cuKruk}[3][]{%
  \bgroup
  \setkeys{cuKruk}{#1}%
  \cu@@Kruk{#2}{#3}%
  \egroup
}%
\def\cu@@Kruk#1#2{{%
  \edef\cu@tmp{\csname \detokenize{#2}cu@@@\endcsname}%
  \setbox1=\hbox{{\cuKrukFont#1}}%
  \dimen0=\ht1\advance\dimen0 by \cuKrukTopMargin\ht1=\dimen0%
  \if\relax\detokenize{#2}\relax
    \setbox2=\hbox{\vrule height \cuKrukSylRuleHeight width \wd1}%
  \else
    \ifx\cu@tmp\cu@Tilda
      \setbox2=\hbox{\vrule height \cuKrukSylRuleHeight width \wd1}%
    \else
      \setbox2=\hbox{#2}%
    \fi
  \fi
  \ifdim\wd1>\wd2%
    \setbox2=\hbox to \wd1{\hss\box2\hss}%
  \fi
  %\discretionary{}{}{}%
  \hskip\cuKrukSylSpace\penalty5000\hbox to \wd2{%
  \hskip0.5\wd2\hskip-0.5\wd1\raise\cuKrukRaise\copy1\kern-0.5\wd2\kern-0.5\wd1\copy2\hss
  }\penalty10000\hskip\cuKrukSylSpace
}}%
%
\newlength{\cuSupRaise} %% controls extra vertical space between Sup and Base
\setlength{\cuSupRaise}{0ex}
\define@key{cuSup}{raise}{\setlength{\cuSupRaise}{#1}}%

\newcommand{\cuSup}[3][]{%
  \bgroup
  \setkeys{cuSup}{#1}%
  \cu@@Sup{#2}{#3}%
  \egroup
}%
\def\cu@@Sup#1#2{{%
  \leavevmode
  \setbox1=\hbox{#1}%
  \setbox2=\hbox{#2}%
  \dimen0=\ht2%
  \advance\dimen0 by \dp1%
  \message{\the\dimen0}%
  \advance\dimen0 by \cuSupRaise
{'fraction_non_alphanumeric': 0.17765839199703595, 'fraction_numerical': 0.03371619118191923, 'mean_word_length': 4.89410480349345, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1395280', 'n_tokens_mistral': 2429, 'n_tokens_neox': 2290, 'n_words': 318}