% \iffalse meta-comment
% 
% File: linguistix-greek.dtx
% 
% ----------------------------------------------------------
% The LaTeX bundle LinguisTiX v0.9b
% Copyright © 2025, 2026 निरंजन
% 
% This program is free software: you can redistribute it
% and/or modify it under the terms of the GNU General Public
% License as published by the Free Software Foundation,
% either version 3 of the License, or (at your option) any
% later version.
% 
% This program is distributed in the hope that it will be
% useful, but WITHOUT ANY WARRANTY; without even the implied
% warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
% PURPOSE. See the GNU General Public License for more
% details.
% 
% You should have received a copy of the GNU General Public
% License along with this program. If not, see
% <https://www.gnu.org/licenses/>.
% ----------------------------------------------------------
% 
% \fi
% \iffalse
%<*driver>
\documentclass{l3doc}
\usepackage{linguistix}
\usepackage{xcolor}
\usepackage{fontawesome5}
\usepackage[verbose=silent]{microtype}
\usepackage{cleveref}
\usepackage{hyperxmp}

\makeatletter
\def\@xobeysp{\hphantom{X}}%
\makeatother

\linguistix{old style one}
\loadlanguages{british,greek,marathi}

\setquotestyle{british}

\colorlet{lngxredcolor}{red!50!black}
\colorlet{lngxgreencolor}{green!50!black}
\colorlet{lngxbluecolor}{blue!50!black}

\urlstyle{tt}

\hypersetup{%
  unicode,%
  colorlinks,%
  linkcolor              = {lngxredcolor},
  citecolor              = {lngxgreencolor},
  urlcolor               = {lngxbluecolor},
  pdftitle               = {linguistix-greek},%
  pdfauthor              = {निरंजन},%
  pdfsubject             = {%
    Ελληνικά (Greek) with LinguisTiX.%
  },%
  pdfcreator             = {निरंजन},%
  pdfkeywords            = {Linguistics, LaTeX},%
  pdfcopyright           = {%
    The LaTeX bundle LinguisTiX\textLF
    Copyright © 2025, 2026 निरंजन\textLF
    This program is free software: you can redistribute it
    and/or modify it under the terms of the GNU General
    Public License as published by the Free Software
    Foundation, either version 3 of the License, or (at your
    option) any later version.%
  },%
  pdflicenseurl          = {gnu.org/licenses/gpl-3.0.html}%
}%

\colorlet{lngxpurplecolor}{blue!50!red}

\ExplSyntaxOn
\msg_redirect_name:nnn { l3doc }
                       { foreign-internal }
                       { none }
\ExplSyntaxOff

\makeatletter
\NewDocumentCommand \supportfootnote { +m } {%
  \begingroup
  \def\thefootnote{}%
  \let\@makefntext\relax
  \def\Hy@Warning##1{}%
  \footnotetext{%
    \hspace*{-\parindent}%
    #1%
  }%
  \endgroup
}
\makeatother

\begin{document}
\DocInput{\jobname.dtx}
\end{document}
%</driver>
% \fi
% \title{Ελληνικά\,--\,\lngxgreeklogo}
% \author{निरंजन}
% \date{^^A
%   \today\ (v0.9b)\\[1ex]^^A
%   {^^A
%     \small\faIcon{home}\quad
%     \url{^^A
%       https://ctan.org/pkg/linguistix^^A
%     }\\[0.5ex]^^A
%     \small\faIcon{git-alt}\quad
%     \url{^^A
%       https://puszcza.gnu.org.ua/projects/linguistix^^A
%     }\\[0.5ex]^^A
%     \small\faIcon[regular]{comments}\quad
%     \url{^^A
%       https://matrix.to/\#/\#linguistix:matrix.org^^A
%     }^^A
%   }^^A
% }
% 
% \maketitle
%
% \supportfootnote{^^A
%   The \lngxpkg\ bundle
%
%   \noindent
%   Copyright © 2025, 2026 निरंजन
%
%   This program is free software: you can redistribute it
%   and/or modify it under the terms of the \textsc{gnu}
%   General Public License as published by the Free Software
%   Foundation, either version 3 of the License, or (at your
%   option) any later version.
%
%   This program is distributed in the hope that it will be
%   useful, but \emph{\textbf{without any warranty}};
%   without even the implied warranty of
%   \emph{\textbf{merchantability}} or \emph{\textbf{fitness
%   for a particular purpose}}. See the \textsc{gnu} General
%   Public License for more details.
%
%   You should have received a copy of the \textsc{gnu}
%   General Public License along with this program. If not,
%   see \url{https://www.gnu.org/licenses/}.^^A
% }
%
%   \begin{implementation}
% \noindent I initialise the package with basic information.
%    \begin{macrocode}
%<*greek>
\ProvidesExplPackage{linguistix-greek}
                    {2026-04-27}
                    {v0.9b}
                    {Ελληνικά (Greek)}
%    \end{macrocode}
% First, I add the |onchar| parameter that loads the Greek
% fonts with the respective Unicode automatically. This is
% used with the \cs{babelprovide} command.
%    \begin{macrocode}

\babelprovide [ onchar   = { ids~ fonts } ] { greek }
%    \end{macrocode}
% The \pkg{babel} package defines |\extrasxxxx| commands for
% languages where the additional code that should go with a
% particular language (|xxxx| in this case) is set. The
% |\addto| command is used for appending to the same. I
% start with defining additional macros for Greek.
%    \begin{macrocode}

\addto { \extrasgreek } {
%    \end{macrocode}
% I have added the command for using the socket for native
% numbering. It will pickup its value from the current
% assignment of the plugs and produce the results
% accordingly.
%    \begin{macrocode}
  \socket_use:n { lngx / native-numbering }
%    \end{macrocode}
% The default \LaTeX\ produces Latin numerals, roman (small
% and capital both) alphabets and a-z alphabets with
% enumerate at different levels of nesting. In Greek,
% although Latin numerals are fine, the letters are
% irrelevant. Thus I renew all of the concerned commands
% and change them to print Greek counters.
%    \begin{macrocode}
  \cs_set:Npn \theenumii {
    \localecounter { lower.modern } { enumii }
  }
  \cs_set:Npn \theenumiv {
    \localecounter { upper.modern } { enumiv }
  }
%    \end{macrocode}
% The \pkg{expex} package has an independent mechanism of
% defining and using counters. In order to get Greek labels,
% I use the |greek| style provided by the \pkg{expex}
% package by default. Note that this change will go with the
% \cs{lngx_misc_reset:} command. Refer to |linguistix.pdf|
% for more information on this.
%    \begin{macrocode}
  \IfPackageLoadedT { expex } {
    \lingset {
      labeltype                = { greek }
    }
  }
}
%    \end{macrocode}
% If Greek is the main language of the document, the default
% New Computer Modern fonts suffice, but if it is not the
% main language, we need to use the macros that set the
% ‘other’ (non-main) fonts. The fonts are the same, but the
% key-value interface is not available, so the code is
% slightly verbose.
%    \begin{macrocode}
\lngx_other_main_font:nnn { greek } {
  NFSSFamily               = { Ελληνικά_main },
  \bool_if:NT \g_lngx_old_style_bool {
    Numbers                  = { OldStyle },
  }
  \bool_if:NT \g_lngx_old_style_one_bool {
    CharacterVariant         = { 6 },
  },
  Renderer                 = { HarfBuzz }
} { NewCM10-Book.otf }
\lngx_other_sans_font:nnn { greek } {
  NFSSFamily               = { Ελληνικά_sans },
  \bool_if:NT \g_lngx_old_style_bool {
    Numbers                  = { OldStyle },
  }
  \bool_if:NT \g_lngx_old_style_one_bool {
    CharacterVariant         = { 6 }
  },
  Renderer                 = { HarfBuzz }
} { NewCMSans10-Book.otf }
\lngx_other_mono_font:nnn { greek } {
  NFSSFamily               = { Ελληνικά_mono },
  Renderer                 = { HarfBuzz }
} { NewCMMono10-Book.otf }
%</greek>
%    \end{macrocode}
% \end{implementation}
% \selectlanguage{british}
% \Finale
