<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%%
%% `huaz.sty'
%%
%% Automatic Hungarian definite articles
%%
%% Copyright 2022-2024 by Tibor TÃ³mÃ¡cs
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is Tibor TÃ³mÃ¡cs.
%% 
\NeedsTeXFormat{LaTeX2e}[2021/10/10]
\ProvidesPackage{huaz}[2024/05/05 v2.1 Automatic Hungarian definite articles]

\RequirePackage{xstring,refcount,iftex}

\newif\ifhuaz@must@z@\huaz@must@z@false
\newif\ifhuaz@must@oneunit@\huaz@must@oneunit@false
\newif\ifhuaz@temp@if@\huaz@temp@if@false
\newif\ifhuaz@show@\huaz@show@true

\newcounter{huaz@temp@count}
\newcounter{huaz@temp@count@}

%=================================================
%
% utf8:
% \huaz@list@A = Ã¶,Ã¼,Ã³,Å‘,Ãº,Ã©,Ã¡,Å±,Ã­,Ã–,Ãœ,Ã“,Å,Ãš,Ã‰,Ã,Å°,Ã,Ã„,Ã€,Ãƒ,Ã‚,Ä‚,Ã…,Ä„,Ã†,Ã¤,Ã&nbsp;,Ã£,Ã¢,Äƒ,Ã¥,Ä…,Ã¦,
%                Ã‹,Ãˆ,ÃŠ,Äš,Ä˜,Ã«,Ã¨,Ãª,Ä›,Ä™,Ã,Ã,ÃŒ,ÃŽ,Ã¯,Ã¬,Ã®,Ã’,Ã•,Ã”,Ã˜,OE,Ã²,Ãµ,Ã´,Ã¸,Ã™,Ã›,Å®,Ã¹,Ã»,Å¯
% \huaz@list@S = Ä¹,Å,Ä¼,Äº,Å‚,Å…,Åƒ,Ã‘,Å‡,ÅŠ,Å„,Ã±,Åˆ,Å‹,Å–,Å”,Å˜,Å—,Å•,Å™,Åž,È˜,Åš,Å&nbsp;,ÅŸ,È™,Å›,Å¡,Å¸,Ã,Ã¿,Ã½
%
% latin2:
% \huaz@list@A = Ä„,Ä…,Ã,Ã‚,Ä‚,Ã„,Ã‰,Ä˜,Ã‹,Äš,Ã,ÃŽ,Ã“,Ã”,Å,Ã–,Å®,Ãš,Å°,Ãœ,Ã¡,Ã¢,Äƒ,Ã¤,Ã©,Ä™,Ã«,Ä›,Ã­
% \huaz@list@S = Ä½,Åš,Å&nbsp;,Åž,Å›,Å¡,ÅŸ,Å”,Ä¹,Åƒ,Å‡,Å˜,Ã,Äº
%
%=================================================

\ifpdftex% latex, pdflatex
  \def\huaz@utfviii{utf8}
  \ifx\inputencodingname\huaz@utfviii
    \def\huaz@list@A{%
      ^^c3^^b6,^^c3^^bc,^^c3^^b3,^^c5^^91,^^c3^^ba,^^c3^^a9,^^c3^^a1,^^c5^^b1,^^c3^^ad,%
      ^^c3^^96,^^c3^^9c,^^c3^^93,^^c5^^90,^^c3^^9a,^^c3^^89,^^c3^^81,^^c5^^b0,^^c3^^8d,%
      ^^c3^^84,^^c3^^80,^^c3^^83,^^c3^^82,^^c4^^82,^^c3^^85,^^c4^^84,^^c3^^86,^^c3^^a4,%
      ^^c3^^a0,^^c3^^a3,^^c3^^a2,^^c4^^83,^^c3^^a5,^^c4^^85,^^c3^^a6,^^c3^^8b,^^c3^^88,%
      ^^c3^^8a,^^c4^^9a,^^c4^^98,^^c3^^ab,^^c3^^a8,^^c3^^aa,^^c4^^9b,^^c4^^99,^^c3^^8f,%
      ^^c3^^8d,^^c3^^8c,^^c3^^8e,^^c3^^af,^^c3^^ac,^^c3^^ae,^^c3^^92,^^c3^^95,^^c3^^94,%
      ^^c3^^98,^^4f^^45,^^c3^^b2,^^c3^^b5,^^c3^^b4,^^c3^^b8,^^c3^^99,^^c3^^9b,^^c5^^ae,%
      ^^c3^^b9,^^c3^^bb,^^c5^^af}
    \def\huaz@list@S{%
      ^^c4^^b9,^^c5^^81,^^c4^^bc,^^c4^^ba,^^c5^^82,^^c5^^85,^^c5^^83,^^c3^^91,^^c5^^87,%
      ^^c5^^8a,^^c5^^84,^^c3^^b1,^^c5^^88,^^c5^^8b,^^c5^^96,^^c5^^94,^^c5^^98,^^c5^^97,%
      ^^c5^^95,^^c5^^99,^^c5^^9e,^^c8^^98,^^c5^^9a,^^c5^^a0,^^c5^^9f,^^c8^^99,^^c5^^9b,%
      ^^c5^^a1,^^c5^^b8,^^c3^^9d,^^c3^^bf,^^c3^^bd}
    \huaz@must@oneunit@false
  \fi
  \def\huaz@latinii{latin2}
  \ifx\inputencodingname\huaz@latinii
    \def\huaz@list@A{%
      ^^a1,^^b1,^^c1,^^c2,^^c3,^^c4,^^c9,^^ca,^^cb,^^cc,^^cd,^^ce,^^d3,^^d4,^^d5,^^d6,%
      ^^d9,^^da,^^db,^^dc,^^e1,^^e2,^^e3,^^e4,^^e5,^^e9,^^ea,^^eb,^^ec,^^ed,^^ee,^^f3,%
      ^^f4,^^f5,^^f6,^^f9,^^fa,^^fb,^^fc}
    \def\huaz@list@S{%
      ^^a3,^^a5,^^a6,^^a9,^^aa,^^b3,^^b6,^^b9,^^ba,^^c0,^^c5,^^d1,^^d2,^^d8,^^dd,^^df,%
      ^^e0,^^f1,^^f2,^^f8,^^fd}
    \huaz@must@oneunit@true
  \fi
  \ifdefined\huaz@list@A\else\PackageError{huaz}{You should use utf8 or latin2 inputenc}{}\fi
\else% xelatex lualatex
  \def\huaz@list@A{%
    ^^^^00f6,^^^^00fc,^^^^00f3,^^^^0151,^^^^00fa,^^^^00e9,^^^^00e1,^^^^0171,^^^^00ed,%
    ^^^^00d6,^^^^00dc,^^^^00d3,^^^^0150,^^^^00da,^^^^00c9,^^^^00c1,^^^^0170,^^^^00cd,%
    ^^^^00c4,^^^^00c0,^^^^00c3,^^^^00c2,^^^^0102,^^^^00c5,^^^^0104,^^^^00c6,^^^^00e4,%
    ^^^^00e0,^^^^00e3,^^^^00e2,^^^^0103,^^^^00e5,^^^^0105,^^^^00e6,^^^^00cb,^^^^00c8,%
    ^^^^00ca,^^^^011a,^^^^0118,^^^^00eb,^^^^00e8,^^^^00ea,^^^^011b,^^^^0119,^^^^00cf,%
    ^^^^00cd,^^^^00cc,^^^^00ce,^^^^00ef,^^^^00ec,^^^^00ee,^^^^00d2,^^^^00d5,^^^^00d4,%
    ^^^^00d8,^^^^004f,^^^^0045,^^^^00f2,^^^^00f5,^^^^00f4,^^^^00f8,^^^^00d9,^^^^00db,%
    ^^^^016e,^^^^00f9,^^^^00fb,^^^^016f}
  \def\huaz@list@S{%
    ^^^^0139,^^^^0141,^^^^013c,^^^^013a,^^^^0142,^^^^0145,^^^^0143,^^^^00d1,^^^^0147,%
    ^^^^014a,^^^^0144,^^^^00f1,^^^^0148,^^^^014b,^^^^0156,^^^^0154,^^^^0158,^^^^0157,%
    ^^^^0155,^^^^0159,^^^^015e,^^^^0218,^^^^015a,^^^^0160,^^^^015f,^^^^0219,^^^^015b,%
    ^^^^0161,^^^^0178,^^^^00dd,^^^^00ff,^^^^00fd}
  \huaz@must@oneunit@true
\fi

%=================================================
%
% \NewHook{huaz}
%
%=================================================

\NewHook{huaz}

\AddToHook{huaz}{%
  %
  % Accent commands are considered as one unit
  \let\"\relax\let\'\relax\let\`\relax\let\~\relax% \def\'{} ==&gt; \az*{\'{X}}=\az*{X}=\az*{10}=a is not correct
  \let\^\relax\let\=\relax\let\.\relax%
  \let\b\relax\let\B\relax\let\c\relax\let\d\relax%
  \let\H\relax\let\k\relax\let\r\relax\let\u\relax\let\v\relax%
  %
  % Redefining letter commands
  \def\AA{a}\def\aa{a}\def\AE{a}\def\ae{a}%
  \def\IJ{a}\def\ij{a}\def\i{a}% \def\i{i} ==&gt; \az*{\i x}=\az*{ix}=\az*{9}=a is not correct
  \def\O{a}\def\o{a}\def\OE{a}\def\oe{a}%
  \def\l{s}\def\NG{s}\def\ng{s}\def\SS{s}\def\ss{s}%
  %
  % Redefinition of punctuation commands to period
  \def\&amp;{.}\def\#{.}\def\%{.}\def\_{.}%
  %
  % Redefinition of space commands to normal space
  \def\,{ }\def\:{ }\def\;{ }\def\enspace{ }\def\enskip{ }\def\quad{ }\def\qquad{ }%
  %
  % Ignore commands
  \def\usefont#1#2#3#4{}%
  \def\fontsize#1#2{}%
  \def\fontencoding#1{}%
  \def\fontfamily#1{}%
  \def\fontseries#1{}%
  \def\fontshape#1{}%
  \def\selectfont{}%
  \def\textrm{}\def\rmfamily{}%
  \def\textsf{}\def\sffamily{}%
  \def\texttt{}\def\ttfamily{}%
  \def\textnormal{}\def\normalfont{}%
  \def\textbf{}\def\bfseries{}%
  \def\textmd{}\def\mdseries{}%
  \def\textit{}\def\itshape{}%
  \def\textsl{}\def\slshape{}%
  \def\textsc{}\def\scshape{}%
  \def\textup{}\def\upshape{}%
  \def\textulc{}\def\ulcshape{}%
  \def\textsw{}\def\swshape{}%
  \def\textssc{}\def\sscshape{}%
  \def\emph{}\def\em{}%
  \def\underline{}%
  \def\tiny{}\def\scriptsize{}\def\footnotesize{}\def\small{}\def\normalsize{}%
  \def\large{}\def\Large{}\def\LARGE{}\def\huge{}\def\Huge{}%
  \def\uppercase{}\def\lowercase{}\def\MakeUppercase{}\def\MakeLowercase{}%
  \def\textcolor#1#{\@gobble}% \textcolor[...]{...}{text} and \textcolor{...}{text} --&gt; text
  \def\color#1#{\@gobble}% \color[...]{...}text and \color{...}text --&gt; text
  \def\href#1#{\@gobble}% \href{URL}{text} --&gt; text
  \def\mbox{}\def\fbox{}\def\hbox{}%
  \def\makebox#1#{}% \makebox{text} and \makebox[opt]{text} --&gt; text
  \def\framebox#1#{}% \framebox{text} and \framebox[opt]{text} --&gt; text
  \def\textqq{}%
  \def\enquote#1#{}% \enquote{text} and \enquote*{text} --&gt; text
  \def\told{}%
  \def\num#1#{}% (siunitx package) \num[...]{1000000} --&gt; 1000000
  \def\negthinspace{}\def\!{}%
  %
  % Expandable cross-references commands
  \def\ref#1#{\getrefnumber}% \ref{...} and \ref*{...} --&gt; \getrefnumber{...}
  \def\pageref#1#{\getpagerefnumber}% \pageref{...} and \pageref*{...} --&gt; \getpagerefnumber{...}
  \def\eqref#1#{\getrefnumber}% \eqref{...} (amsmath) and \eqref*{...} (!!) --&gt; \getrefnumber{...}
  \def\refeq#1#{\getrefnumber}% \refeq{...} (mathtools) and \refeq*{...} (!!) --&gt; \getrefnumber{...}
  \def\cite{\huaz@cite}%
  \def\citeauthor{\huaz@citeauthor}%
  \def\textcite{\huaz@citeauthor}%
  \def\citeyear{\huaz@citeyear}%
  }

%=================================================
%
% \huazignorecmd[option]{\command}
%    option: 0,1,...,9
%
% \huazignorecmd{\foo} = \AddToHook{huaz}{\def\foo{}}
%    ignored: \foo
%    for example: \huazignorecmd{\rmfamily}
%                 \rmfamily text --&gt; text
%
% \huazignorecmd[0]{\foo} = \AddToHook{huaz}{\def\foo#1#{}}
%    ignored: \foo, \foo*, \foo[...], \foo*[...]
%    for example: \huazignorecmd{\textrm}
%                 \textrm{text} --&gt; text
%                 \huazignorecmd{\makebox}
%                 \makebox[5cm]{text} --&gt; text
%
% \huazignorecmd[1]{\foo} = \AddToHook{huaz}{\def\foo#1#{\@gobble}}
%    ignored: \foo{...}, \foo[...]{...}, \foo*[...]{...}
%    for example: \huazignorecmd{\textcolor}
%                 \textcolor[RGB]{0,255,0}{text} --&gt; text
%
% \huazignorecmd[2]{\foo} = \AddToHook{huaz}{\def\foo#1#{\huaz@gobble@ii}}
%    ignored: \foo{...}{...}, \foo[...]{...}{...}, \foo*[...]{...}{...}
%    for example: \huazignorecmd{\fontsize}
%                 \fontsize{12pt}{12pt}text --&gt; text
%
%=================================================

\newcommand{\huaz@gobble@ii}[2]{}
\newcommand{\huaz@gobble@iii}[3]{}
\newcommand{\huaz@gobble@iv}[4]{}
\newcommand{\huaz@gobble@v}[5]{}
\newcommand{\huaz@gobble@vi}[6]{}
\newcommand{\huaz@gobble@vii}[7]{}
\newcommand{\huaz@gobble@viii}[8]{}
\newcommand{\huaz@gobble@ix}[9]{}

\def\huaz@check@opt#1{%
  \def\huaz@opt{#1}%
  \huaz@temp@if@false%
  \@for\huaz@list:={,0,1,2,3,4,5,6,7,8,9,10}%
  \do{\IfStrEq{\huaz@opt}{\huaz@list}{\huaz@temp@if@true}{}}%
  \IfStrEq{\huaz@opt}{}{\def\huaz@opt{10}}{}%
  \ifhuaz@temp@if@\else
    \def\huaz@opt{10}%
    \PackageWarning{huaz}{Valid options for \string\huazignorecmd: 0,1,...,9. The '[#1]' has been removed.}\fi}

\NewDocumentCommand{\huazignorecmd}{&gt;{\TrimSpaces}O{10}m}{%
  \huaz@check@opt{#1}%
  \ifcase\huaz@opt%
  \AddToHook{huaz}{\def#2##1##{}}\or
  \AddToHook{huaz}{\def#2##1##{\@gobble}}\or
  \AddToHook{huaz}{\def#2##1##{\huaz@gobble@ii}}\or
  \AddToHook{huaz}{\def#2##1##{\huaz@gobble@iii}}\or
  \AddToHook{huaz}{\def#2##1##{\huaz@gobble@iv}}\or
  \AddToHook{huaz}{\def#2##1##{\huaz@gobble@v}}\or
  \AddToHook{huaz}{\def#2##1##{\huaz@gobble@vi}}\or
  \AddToHook{huaz}{\def#2##1##{\huaz@gobble@vii}}\or
  \AddToHook{huaz}{\def#2##1##{\huaz@gobble@viii}}\or
  \AddToHook{huaz}{\def#2##1##{\huaz@gobble@ix}}\or
  \AddToHook{huaz}{\def#2{}}\fi}

%=================================================
%
% \huazrefcmd{\foo} = \AddToHook{huaz}{\def\foo#1#{\getrefnumber}}
%      --&gt; \foo{...}, \foo[...]{...}, \foo*[...]{...} --&gt; \getrefnumber{...}
%
% \huazpagerefcmd{\foo} = \AddToHook{huaz}{\def\foo#1#{\getpagerefnumber}}
%      --&gt; \foo{...}, \foo[...]{...}, \foo*[...]{...} --&gt; \getpagerefnumber{...}
%
% \huazdefcmd{...} = \AddToHook{huaz}{...}
%=================================================

\NewDocumentCommand{\huazrefcmd}{m}{\AddToHook{huaz}{\def#1##1##{\getrefnumber}}}
\NewDocumentCommand{\huazpagerefcmd}{m}{\AddToHook{huaz}{\def#1##1##{\getpagerefnumber}}}
\NewDocumentCommand{\huazdefcmd}{m}{\AddToHook{huaz}{#1}}

%=================================================
%
% \huaz@z{&lt;...&gt;} --&gt; "z", if the definite article of &lt;...&gt; is "az"
% E.g. \huaz@z{asztal} --&gt; "z" ("az asztal")
%      \huaz@z{szÃ©k}   --&gt; ""  ("a szÃ©k")
%
%=================================================

\NewDocumentCommand{\huaz@z}{m}{%
  \begingroup%
  \exploregroups%
  \UseHook{huaz}%
  \huaz@must@z@false%
  %
  % 1. unit: e,u,i,o,a,E,U,I,O,A,5
  %
  \StrChar{#1}{1}[\huaz@temp]%
  \@for\huaz@list:={e,u,i,o,a,E,U,I,O,A,5}%
  \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@must@z@true}{}}%
  %
  % 1. unit: accent command
  % 2. unit: e,u,i,o,a,E,U,I,O,A
  % "\'A" "\'{A}"
  %
  \ifhuaz@must@z@\else%
    \huaz@temp@if@false%
    \StrChar{#1}{1}[\huaz@temp]%
    \@for\huaz@list:={\",\',\`,\~,\^,\=,\.,\b,\B,\c,\d,\H,\k,\r,\u,\v}%
    \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@temp@if@true}{}}%
    \ifhuaz@temp@if@%
      \StrChar{#1}{2}[\huaz@temp]%
      \@for\huaz@list:={e,u,i,o,a,E,U,I,O,A}%
      \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@must@z@true}{}}%
    \fi%
  \fi%
  %
  % 1. unit: \",\',\`,\~,\^,\=,\.
  % 2. unit: space(s)
  % 3. unit: e,u,i,o,a,E,U,I,O,A
  % "\' A", "\'  A", "\' {A}"
  %
  \ifhuaz@must@z@\else%
    \huaz@temp@if@false%
    \StrChar{#1}{1}[\huaz@temp]%
    \@for\huaz@list:={\",\',\`,\~,\^,\=,\.}%
    \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@temp@if@true}{}}%
    \ifhuaz@temp@if@%
      \huaz@temp@if@false%
      \StrChar{#1}{2}[\huaz@temp]%
      \IfStrEq{\huaz@temp}{ }{\huaz@temp@if@true}{}%
    \fi%
    \ifhuaz@temp@if@%
      \StrChar{#1}{3}[\huaz@temp]%
      \@for\huaz@list:={e,u,i,o,a,E,U,I,O,A}%
      \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@must@z@true}{}}%
    \fi%
  \fi%
  %
  % 1. unit: \huaz@list@A
  %
  \ifhuaz@must@z@\else%
    \ifhuaz@must@oneunit@\StrLeft{#1}{1}[\huaz@tempa]\else\StrLeft{#1}{2}[\huaz@tempa]\fi% in pdflatex(utf8) Å is two units; in pdflatex(latin2)/xelatex/lualatex Å is one unit
    \@for\huaz@list:=\huaz@list@A%
    \do{\StrLeft{\huaz@list}{2}[\huaz@tempb]%
        \IfStrEq{\huaz@tempa}{\huaz@tempb}{\huaz@must@z@true}{}}%
  \fi%
  %
  % 1. unit: f,l,m,n,s,r,x,y,F,L,M,N,S,R,X,Y,\huaz@list@S(one unit)
  % 2. unit: punctuation
  % "M-10"
  %
  \ifhuaz@must@z@\else%
    \huaz@temp@if@false%
    \StrChar{#1}{2}[\huaz@temp]%
    \@for\huaz@list:={;,`,',",+,!,/,=,(,),&lt;,&gt;,@,.,?,:,-,*,0,1,2,3,4,5,6,7,8,9,{,},{ },{},\unskip,\kern}% \kern, \unskip for active characters
    \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@temp@if@true}{}}%
    \ifhuaz@temp@if@%
      \StrChar{#1}{1}[\huaz@temp]%
      \@for\huaz@list:={f,l,m,n,s,r,x,y,F,L,M,N,S,R,X,Y}%
      \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@must@z@true}{}}%
      \ifhuaz@must@oneunit@%
        \ifhuaz@must@z@\else%
          \@for\huaz@list:=\huaz@list@S% in pdflatex(latin2)/xelatex/lualatex Å&nbsp; is one unit
          \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@must@z@true}{}}%
        \fi%
      \fi%
    \fi%
  \fi%
  %
  % 1. unit: accent command
  % 2. unit: f,l,m,n,r,x,y,F,L,M,N,S,R,X,Y
  % 3. unit: punctuation
  % "\^Y."
  %
  \ifhuaz@must@z@\else%
    \huaz@temp@if@false%
    \StrChar{#1}{3}[\huaz@temp]%
    \@for\huaz@list:={;,`,',",+,!,/,=,(,),&lt;,&gt;,@,.,?,:,-,*,0,1,2,3,4,5,6,7,8,9,{,},{ },{},\unskip,\kern}% \kern, \unskip for active characters
    \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@temp@if@true}{}}%
    \ifhuaz@temp@if@%
      \huaz@temp@if@false%
      \StrChar{#1}{2}[\huaz@temp]%
      \@for\huaz@list:={f,l,m,n,s,r,x,y,F,L,M,N,S,R,X,Y}%
      \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@temp@if@true}{}}%
    \fi%
    \ifhuaz@temp@if@%
      \StrChar{#1}{1}[\huaz@temp]%
      \@for\huaz@list:={\",\',\`,\~,\^,\=,\.,\b,\B,\c,\d,\H,\k,\r,\u,\v}%
      \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@must@z@true}{}}%
    \fi%
  \fi%
  %
  % 1. unit: \",\',\`,\~,\^,\=,\.
  % 2. unit: space(s)
  % 3. unit: f,l,m,n,r,x,y,F,L,M,N,S,R,X,Y
  % 4. unit: punctuation
  % "\^ Y."
  %
  \ifhuaz@must@z@\else%
    \huaz@temp@if@false%
    \StrChar{#1}{4}[\huaz@temp]%
    \@for\huaz@list:={;,`,',",+,!,/,=,(,),&lt;,&gt;,@,.,?,:,-,*,0,1,2,3,4,5,6,7,8,9,{,},{ },{},\unskip,\kern}% \kern, \unskip for active characters
    \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@temp@if@true}{}}%
    \ifhuaz@temp@if@%
      \huaz@temp@if@false%
      \StrChar{#1}{3}[\huaz@temp]%
      \@for\huaz@list:={f,l,m,n,s,r,x,y,F,L,M,N,S,R,X,Y}%
      \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@temp@if@true}{}}%
    \fi%
    \ifhuaz@temp@if@%
      \huaz@temp@if@false%
      \StrChar{#1}{2}[\huaz@temp]%
      \IfStrEq{\huaz@temp}{ }{\huaz@temp@if@true}{}%
    \fi%
    \ifhuaz@temp@if@%
      \StrChar{#1}{1}[\huaz@temp]%
      \@for\huaz@list:={\",\',\`,\~,\^,\=,\.}%
      \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@must@z@true}{}}%
    \fi%
  \fi%
  %
  % 1-2. units: ly,Ly,LY,ny,Ny,NY,sz,Sz,SZ,\huaz@list@S(two units)
  % 3. unit: punctuation
  % "NY" "SZ-2"
  %
  \ifhuaz@must@z@\else%
    \huaz@temp@if@false%
    \StrChar{#1}{3}[\huaz@temp]%
    \@for\huaz@list:={;,`,',",+,!,/,=,(,),&lt;,&gt;,@,.,?,:,-,*,0,1,2,3,4,5,6,7,8,9,{,},{ },{},\unskip,\kern}% \kern, \unskip for active characters
    \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@temp@if@true}{}}%
    \ifhuaz@temp@if@%
      \StrLeft{#1}{2}[\huaz@temp]%
      \@for\huaz@list:={ly,Ly,LY,ny,Ny,NY,sz,Sz,SZ}%
      \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@must@z@true}{}}%
      \ifhuaz@must@oneunit@\else%
        \ifhuaz@must@z@\else%
          \@for\huaz@list:=\huaz@list@S% in pdflatex(utf8) Å&nbsp; is two units
          \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@must@z@true}{}}%
        \fi%
      \fi%
    \fi%
  \fi%
  %
  % 1. unit: 1
  % 2. unit: not digit
  % "1H"
  %
  \ifhuaz@must@z@\else%
    \StrChar{#1}{1}[\huaz@temp]%
    \IfStrEq{\huaz@temp}{1}{%
      \StrChar{#1}{2}[\huaz@temp]%
      \IfInteger{\huaz@temp}{}{\huaz@must@z@true}%
    }{}%
  \fi%
  %
  % 1000,...,1999
  % 5. unit: not digit
  % "1000. sor" --&gt; ezredik sor
  %
  \ifhuaz@must@z@\else%
    \StrLen{#1}[\huaz@temp]%
    \setcounter{huaz@temp@count}{\huaz@temp}%
    \ifnum\value{huaz@temp@count}&gt;3%
      \StrChar{#1}{1}[\huaz@temp]%
      \IfStrEq{\huaz@temp}{1}{%
        \StrLeft{#1}{4}[\huaz@temp]%
        \IfInteger{\huaz@temp}{%
          \StrChar{#1}{5}[\huaz@temp]%
          \IfInteger{\huaz@temp}{}{\huaz@must@z@true}%
        }{}%
      }{}%
    \fi%
  \fi%
  %
  % 1000000,...,1999999
  % 8. unit: not digit
  % "1000000 ember" --&gt; egymilliÃ³ ember
  %
  \ifhuaz@must@z@\else%
    \StrLen{#1}[\huaz@temp]%
    \setcounter{huaz@temp@count}{\huaz@temp}%
    \ifnum\value{huaz@temp@count}&gt;6%
      \StrChar{#1}{1}[\huaz@temp]%
      \IfStrEq{\huaz@temp}{1}{%
        \StrLeft{#1}{7}[\huaz@temp]%
        \IfInteger{\huaz@temp}{%
          \StrChar{#1}{8}[\huaz@temp]%
          \IfInteger{\huaz@temp}{}{\huaz@must@z@true}%
        }{}%
      }{}%
    \fi%
  \fi%
  %
  % 1000000000,...,1999999999
  % 11. unit: not digit
  % "1000000000 ember" --&gt; egymilliÃ¡rd ember
  %
  \ifhuaz@must@z@\else%
    \StrLen{#1}[\huaz@temp]%
    \setcounter{huaz@temp@count}{\huaz@temp}%
    \ifnum\value{huaz@temp@count}&gt;9%
      \StrChar{#1}{1}[\huaz@temp]%
      \IfStrEq{\huaz@temp}{1}{%
        \StrLeft{#1}{10}[\huaz@temp]%
        \IfInteger{\huaz@temp}{%
          \StrChar{#1}{11}[\huaz@temp]%
          \IfInteger{\huaz@temp}{}{\huaz@must@z@true}%
        }{}%
      }{}%
    \fi%
  \fi%
  %
  \gdef\huaz@save{}%
  \ifhuaz@must@z@\gdef\huaz@save{z}\ifhuaz@show@ z\fi\fi%
  \endgroup}

%=================================================
%
% \huaz@romantoarabic{&lt;...&gt;}
% If &lt;...&gt; is a roman number, then it will be converted to arabic.
% If &lt;...&gt; is not a roman number, then the result is -1.
% If &lt;...&gt; is empty, then the result is 0.
% E.g. \huaz@\romantoarabic{xiv}  --&gt; "14"
%      \huaz@\romantoarabic{aaaa} --&gt; "-1"
%      \huaz@\romantoarabic{}     --&gt; "0"
%
%=================================================

\ExplSyntaxOn
\NewExpandableDocumentCommand{\huaz@romantoarabic}{m}
 {
  \int_from_roman:f { #1 }
 }
\cs_generate_variant:Nn \int_from_roman:n { f }
\ExplSyntaxOff

%=================================================
%
% \huaz@collect@roman{&lt;...&gt;}
% Collecting the characters i,v,x,l,c,d,m,I,V,X,L,C,D,M from the beginning of &lt;...&gt;
%   "XIII"   --&gt; result string is "XIII"
%   "xiii.x" --&gt; result string is "xiii"
%   "x ii.x" --&gt; result string is "x"
%   "VB"     --&gt; result string is "V"
%   "XIV6"   --&gt; result string is "XIV"
%   "aXIII"  --&gt; result string is ""
% If the result string = &lt;...&gt;, then \huaz@collect@roman@result := result string
%   \huaz@collect@roman{XIII}\huaz@collect@roman@result   --&gt; "XIII"
% If the result string is not empty and the first character after it is a punctuation mark or space in &lt;...&gt; , then \huaz@collect@roman@result := result string
%   \huaz@collect@roman{xiii.x}\huaz@collect@roman@result --&gt; "xiii"
%   \huaz@collect@roman{x ii.x}\huaz@collect@roman@result --&gt; "x"
% If the result string is not empty and the first character after it is a letter or digit in &lt;...&gt; , then \huaz@collect@roman@result := ""
%   \huaz@collect@roman{VB}\huaz@collect@roman@result     --&gt; ""
%   \huaz@collect@roman{XIV6}\huaz@collect@roman@result   --&gt; ""
% If the result string is empty then \huaz@collect@roman@result := ""
%   \huaz@collect@roman{aXIII}\huaz@collect@roman@result  --&gt; ""
%
%=================================================

\NewDocumentCommand{\huaz@collect@roman}{m}{%
  \begingroup%
  \exploregroups%
  \UseHook{huaz}%
  \StrLen{#1}[\huaz@temp]%
  \setcounter{huaz@temp@count}{\huaz@temp}%
  \setcounter{huaz@temp@count@}{1}%
  \gdef\huaz@collect@roman@result{}%
  \loop%
    \StrChar{#1}{\thehuaz@temp@count@}[\huaz@temp]%
    \IfSubStr{ivxlcdmIVXLCDM}{\huaz@temp}
      {\expandafter\g@addto@macro\expandafter\huaz@collect@roman@result\expandafter{\huaz@temp}}
      {\setcounter{huaz@temp@count@}{\value{huaz@temp@count}}}%
    \ifnum\value{huaz@temp@count@}&lt;\value{huaz@temp@count}\stepcounter{huaz@temp@count@}%
  \repeat%
  \IfStrEq{\huaz@collect@roman@result}{}{}{%
    \huaz@temp@if@false%
    \StrBehind{#1}{\huaz@collect@roman@result}[\huaz@tempa]%
    \StrChar{\huaz@tempa}{1}[\huaz@tempb]%
    \@for\huaz@list:={;,`,',",+,!,/,=,(,),&lt;,&gt;,@,.,?,:,-,*,{,},{ },{},\unskip,\kern}% \kern, \unskip for active characters
    \do{\IfStrEq{\huaz@tempb}{\huaz@list}{\huaz@temp@if@true}{}}%
    \ifhuaz@temp@if@\else\gdef\huaz@collect@roman@result{}\fi}%
  \endgroup}

%=================================================
%
% \aznotshow
%
%=================================================

\def\aznotshow{\huaz@show@false}

%=================================================
%
% \azseparator
%
%=================================================

\def\azseparator#1{\def\huaz@sep{#1}}
\def\huaz@sep{~}

%=================================================
%
% \huaz@text
%
%=================================================

\NewDocumentCommand{\huaz@text}{st{=}m}{%
  \huaz@collect@roman{#3}%
  \huaz@temp@if@true%
  \edef\huaz@temp{\huaz@romantoarabic{\huaz@collect@roman@result}}%
  \IfStrEq{\huaz@temp}{0}{\huaz@temp@if@false}{}%
  \IfStrEq{\huaz@temp}{-1}{\huaz@temp@if@false}{}%
  \IfBooleanTF{#2}{\huaz@z{#3}}{%
    \ifhuaz@temp@if@%
      \huaz@z{\huaz@romantoarabic{\huaz@collect@roman@result}}%
    \else%
      \huaz@z{#3}%
    \fi}%
  \IfBooleanF{#1}{\ifhuaz@show@\huaz@sep{#3}\fi}%
  \huaz@show@true}

%=================================================
%
% \az \Az \azv \Azv \azsaved
%
%=================================================

\DeclareDocumentCommand{\az}{s&gt;{\TrimSpaces}m}{%
  \ifhuaz@show@ a\fi
  \IfBooleanTF{#1}{\huaz@text*{#2}}{\huaz@text{#2}}%
  \IfBlankT{#2}{\PackageWarning{huaz}{Argument of \string\az\space is empty}\textup{(?)}}%
  \xdef\azsaved{a\huaz@save}}

\DeclareDocumentCommand{\Az}{s&gt;{\TrimSpaces}m}{%
  \ifhuaz@show@ A\fi
  \IfBooleanTF{#1}{\huaz@text*{#2}}{\huaz@text{#2}}%
  \IfBlankT{#2}{\PackageWarning{huaz}{Argument of \string\Az\space is empty}\textup{(?)}}%
  \xdef\azsaved{A\huaz@save}}

\DeclareDocumentCommand{\azv}{s&gt;{\TrimSpaces}m}{%
  \ifhuaz@show@ a\fi
  \IfBooleanTF{#1}{\huaz@text*={#2}}{\huaz@text={#2}}%
  \IfBlankT{#2}{\PackageWarning{huaz}{Argument of \string\azv\space is empty}\textup{(?)}}%
  \xdef\azsaved{a\huaz@save}}

\DeclareDocumentCommand{\Azv}{s&gt;{\TrimSpaces}m}{%
  \ifhuaz@show@ A\fi
  \IfBooleanTF{#1}{\huaz@text*={#2}}{\huaz@text={#2}}%
  \IfBlankT{#2}{\PackageWarning{huaz}{Argument of \string\Azv\space is empty}\textup{(?)}}%
  \xdef\azsaved{A\huaz@save}}

%=================================================
%
% \aref \Aref \avref \Avref
%
%=================================================

\DeclareDocumentCommand{\aref}{sm}{\IfBooleanTF{#1}{\az{\ref*{#2}}}{\az{\ref{#2}}}}
\DeclareDocumentCommand{\Aref}{sm}{\IfBooleanTF{#1}{\Az{\ref*{#2}}}{\Az{\ref{#2}}}}
\DeclareDocumentCommand{\avref}{sm}{\IfBooleanTF{#1}{\azv{\ref*{#2}}}{\azv{\ref{#2}}}}
\DeclareDocumentCommand{\Avref}{sm}{\IfBooleanTF{#1}{\Azv{\ref*{#2}}}{\Azv{\ref{#2}}}}

%=================================================
%
% \apageref \Apageref \avpageref \Avpageref
%
%=================================================

\DeclareDocumentCommand{\apageref}{sm}{\IfBooleanTF{#1}{\az{\pageref*{#2}}}{\az{\pageref{#2}}}}
\DeclareDocumentCommand{\Apageref}{sm}{\IfBooleanTF{#1}{\Az{\pageref*{#2}}}{\Az{\pageref{#2}}}}
\DeclareDocumentCommand{\avpageref}{sm}{\IfBooleanTF{#1}{\azv{\pageref*{#2}}}{\azv{\pageref{#2}}}}
\DeclareDocumentCommand{\Avpageref}{sm}{\IfBooleanTF{#1}{\Azv{\pageref*{#2}}}{\Azv{\pageref{#2}}}}

%=================================================
%
% \aeqref \Aeqref \aveqref \Aveqref
%
%=================================================

\DeclareDocumentCommand{\aeqref}{m}{\az{\eqref{#1}}}
\DeclareDocumentCommand{\Aeqref}{m}{\Az{\eqref{#1}}}
\DeclareDocumentCommand{\aveqref}{m}{\azv{\eqref{#1}}}
\DeclareDocumentCommand{\Aveqref}{m}{\Azv{\eqref{#1}}}

%=================================================
%
% \arefeq \Arefeq \avrefeq \Avrefeq
%
%=================================================

\DeclareDocumentCommand{\arefeq}{m}{\az{\refeq{#1}}}
\DeclareDocumentCommand{\Arefeq}{m}{\Az{\refeq{#1}}}
\DeclareDocumentCommand{\avrefeq}{m}{\azv{\refeq{#1}}}
\DeclareDocumentCommand{\Avrefeq}{m}{\Azv{\refeq{#1}}}

%=================================================
%
% \acite \Acite \avcite \Avcite
%
%=================================================

\DeclareDocumentCommand{\acite}{om}{\IfNoValueTF{#1}{\az{\cite{#2}}}{\az{\cite[#1]{#2}}}}
\DeclareDocumentCommand{\Acite}{om}{\IfNoValueTF{#1}{\Az{\cite{#2}}}{\Az{\cite[#1]{#2}}}}
\DeclareDocumentCommand{\avcite}{om}{\IfNoValueTF{#1}{\azv{\cite{#2}}}{\azv{\cite[#1]{#2}}}}
\DeclareDocumentCommand{\Avcite}{om}{\IfNoValueTF{#1}{\Azv{\cite{#2}}}{\Azv{\cite[#1]{#2}}}}

%=================================================
%
% \huaz@cite
%
%=================================================

\def\huaz@cite@#1#{\huaz@citelist}
\def\huaz@cite{\huaz@cite@\relax}
\def\huaz@citelist#1{\huaz@@citelist#1,\relax,}
\def\huaz@@citelist#1,{\ifx#1\relax\else\@nameuse{huaz@bib@#1},\expandafter\huaz@@citelist\fi}%

\AddToHook{begindocument/before}{
  %
  \def\huaz@bibparam{}
  %
  \@ifpackageloaded{natbib}{
    \ifNAT@numbers\def\huaz@bibparam#1#2#3{#1}\else\def\huaz@bibparam#1#2#3{#3}\fi}{}
  %
  \@ifpackageloaded{babel}{
    \let\huaz@old@bbl@bibcite\bbl@bibcite
    \def\bbl@bibcite#1#2{\global\@namedef{huaz@bib@#1}{\huaz@bibparam#2}\huaz@old@bbl@bibcite{#1}{#2}}}{}
  %
  \@ifpackageloaded{hyperref}{
    \let\huaz@old@Hy@bibcite\Hy@bibcite
    \def\Hy@bibcite#1#2{\global\@namedef{huaz@bib@#1}{\huaz@bibparam#2}\huaz@old@Hy@bibcite{#1}{#2}}}{}
  %
  \let\huaz@old@bibcite\bibcite
  \def\bibcite#1#2{\global\@namedef{huaz@bib@#1}{\huaz@bibparam#2}\huaz@old@bibcite{#1}{#2}}
  %
  \@ifpackageloaded{biblatex}{
    \settoggle{blx@labelalpha}{true}
    \def\huaz@biblatexlabel{}
    \ifx\blx@opt@eldt@style\@empty\ifx\blx@opt@eldt@citestyle\@empty\def\huaz@biblatexlabel{\strfield{labelnumber}}\fi\fi
    \def\huaz@temp{numeric}
    \ifx\blx@opt@eldt@style\huaz@temp\def\huaz@biblatexlabel{\csfield{labelnumber}}\fi
    \ifx\blx@opt@eldt@citestyle\huaz@temp\def\huaz@biblatexlabel{\csfield{labelnumber}}\fi
    \def\huaz@temp{numeric-verb}
    \ifx\blx@opt@eldt@style\huaz@temp\def\huaz@biblatexlabel{\csfield{labelnumber}}\fi
    \ifx\blx@opt@eldt@citestyle\huaz@temp\def\huaz@biblatexlabel{\csfield{labelnumber}}\fi
    \def\huaz@temp{alphabetic}
    \ifx\blx@opt@eldt@style\huaz@temp\def\huaz@biblatexlabel{\strfield{labelalpha}}\fi
    \ifx\blx@opt@eldt@citestyle\huaz@temp\def\huaz@biblatexlabel{\strfield{labelalpha}}\fi
    \def\huaz@temp{alphabetic-verb}
    \ifx\blx@opt@eldt@style\huaz@temp\def\huaz@biblatexlabel{\strfield{labelalpha}}\fi
    \ifx\blx@opt@eldt@citestyle\huaz@temp\def\huaz@biblatexlabel{\strfield{labelalpha}}\fi
    \def\huaz@temp{authoryear}
    \ifx\blx@opt@eldt@style\huaz@temp\def\huaz@biblatexlabel{\strfield{labelalpha}}\fi
    \ifx\blx@opt@eldt@citestyle\huaz@temp\def\huaz@biblatexlabel{\strfield{labelalpha}}\fi
    \ifx\huaz@biblatexlabel\@empty\else
      \AtEveryBibitem{\protected@write\@auxout{}{\string\global\string\@namedef{huaz@bib@\strfield{entrykey}}{\huaz@biblatexlabel}}}
    \fi}{}}

%=================================================
%
% \huaz@citeauthor
%
%=================================================

\def\huaz@citeauthor@#1#{\huaz@citeauthorlist}
\def\huaz@citeauthor{\huaz@citeauthor@\relax}
\def\huaz@citeauthorlist#1{\huaz@@citeauthorlist#1,\relax,}
\def\huaz@@citeauthorlist#1,{\ifx#1\relax\else\@nameuse{huaz@bibalpha@#1},\expandafter\huaz@@citeauthorlist\fi}

\AddToHook{begindocument/before}{
  \@ifpackageloaded{biblatex}{
    \AtEveryBibitem{\protected@write\@auxout{}{\string\global\string\@namedef{huaz@bibalpha@\strfield{entrykey}}{\strfield{labelalpha}}}}
  }{}}

%=================================================
%
% \huaz@citeyear
%
%=================================================

\def\huaz@citeyear@#1#{\huaz@citeyearlist}
\def\huaz@citeyear{\huaz@citeyear@\relax}
\def\huaz@citeyearlist#1{\huaz@@citeyearlist#1,\relax,}
\def\huaz@@citeyearlist#1,{\ifx#1\relax\else\@nameuse{huaz@bibyear@#1},\expandafter\huaz@@citeyearlist\fi}

\AddToHook{begindocument/before}{
  \@ifpackageloaded{biblatex}{
    \AtEveryBibitem{\protected@write\@auxout{}{\string\global\string\@namedef{huaz@bibyear@\strfield{entrykey}}{\strfield{year}}}}
  }{}}

%=================================================
%
% end
%
%=================================================

\endinput</pre></body></html>