%%
%% LaTeX class file for IEICE ELetronics EXpress 
%%
%%
%% 2024/04/01 change: move hyperref form AtBeginDocument 
%% 2024/04/01 change: add code for new hyperref (after 2023/10) 
%% 2024/05/13 change: default option: submit (previously publish)
%% 2024/05/13 change: hide DOI and various dates when submit option is used
%% 2024/05/13 change: hyperref package is loaded when submit option is used

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{elex2024}[2024/05/13 v2.2 LaTeX class file for IEICE ELetronics EXpress]


%%%option

\newif\if@submit
\DeclareOption{submit}{\@submittrue}%%%% authors
\DeclareOption{publish}{\@submitfalse}%% for editors (for published version)


\ExecuteOptions{submit}
\ProcessOptions

\@twosidefalse 

\let\phantom@submit\@empty
\if@submit
\let\phantom@submit\phantom
\def\texorpdfstring#1{#1}
\fi

%%required packages

\RequirePackage{newtxtext}
\RequirePackage{newtxmath}
\RequirePackage{xparse}

\RequirePackage{graphicx}
\RequirePackage{xcolor}
\RequirePackage{amsmath}\allowdisplaybreaks
\RequirePackage{array}

\RequirePackage{varwidth}
\RequirePackage{lastpage}

\RequirePackage[compress,space]{cite}

\definecolor{elex}{cmyk}{.2, .2, .5, 0}


%%%
%%% font sizes
%%%

%%normal size 10pt / 12pt

\renewcommand\normalsize{%
   \@setfontsize\normalsize\@xpt\@xiipt
   \abovedisplayskip 8\p@ \@plus2\p@ \@minus4\p@
   \abovedisplayshortskip \z@ \@plus3\p@
   \belowdisplayshortskip 5\p@ \@plus2\p@ \@minus2\p@
   \belowdisplayskip \abovedisplayskip
   \let\@listi\@listI}
\normalsize

%% small 8pt / 10pt

\newcommand\small{%
   \@setfontsize\small\@viiipt{\@xpt}%
   \abovedisplayskip 7\p@ \@plus2\p@ \@minus3.5\p@
   \abovedisplayshortskip \z@ \@plus2\p@
   \belowdisplayshortskip 3\p@ \@plus2\p@ \@minus1\p@
   \def\@listi{\leftmargin\leftmargini
               \topsep \z@%4\p@ \@plus2\p@ \@minus2\p@
               \parsep \z@%2\p@ \@plus\p@ \@minus\p@
               \itemsep \parsep}%
   \belowdisplayskip \abovedisplayskip
}

%%footnote size 9pt / 10pt

\newcommand\footnotesize{%
   \@setfontsize\footnotesize{\@ixpt}{10.5}%{\@xpt}%
   \abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@
   \abovedisplayshortskip \z@ \@plus\p@
   \belowdisplayshortskip 3\p@ \@plus\p@ \@minus2\p@
   \def\@listi{\leftmargin\leftmargini
               \topsep \z@%3\p@ \@plus\p@ \@minus\p@
               \parsep \z@%2\p@ \@plus\p@ \@minus\p@
               \itemsep \parsep}%
   \belowdisplayskip \abovedisplayskip
}

%%for future use: these value is from size10.clo
\newcommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt}
\newcommand\tiny{\@setfontsize\tiny\@vpt\@vipt}
\newcommand\large{\@setfontsize\large\@xiipt{14}}
\newcommand\Large{\@setfontsize\Large\@xivpt{18}}
\newcommand\LARGE{\@setfontsize\LARGE\@xviipt{22}}
\newcommand\huge{\@setfontsize\huge\@xxpt{25}}
\newcommand\Huge{\@setfontsize\Huge\@xxvpt{30}}


%%%
%%% paper size, page body and its position
%%%
%%%  A4
\paperwidth210mm
\paperheight297mm

\newdimen\stockheight
\newdimen\stockwidth

\stockheight\paperheight
\stockwidth\paperwidth

\topskip = 8pt\relax


%%% width  = paperwidth  - 17.5mm - 15.5mm = 177mm
%%% height = paperheight - 24.5mm - 21  mm = 251.5mm
\textwidth  = \dimexpr \paperwidth  - 17.5mm - 15.5mm \relax
%\textheight = \dimexpr \paperheight - 24.5mm -   21mm \relax
\textheight = \dimexpr 59\baselineskip + \topskip\relax

%% space between left and right columns
\columnsep = 10mm\relax

%% horizontal position
\oddsidemargin  = 17.5mm\relax
\oddsidemargin  = \dimexpr \oddsidemargin - 1in \relax %%adjusting driver margin
\evensidemargin = \oddsidemargin \relax

%% vertical position
\headsep    = 7mm \relax
\headheight = 2mm \relax
\footskip   = 8mm \relax

\topmargin = 24mm\relax
\topmargin = \dimexpr \topmargin - \headsep - \headheight 
                                 - 1in \relax  %%adjusting driver margin










%%%
%%%set parameters (1)
%%%

\setlength\lineskip{1\p@}
\setlength\normallineskip{1\p@}
\renewcommand\baselinestretch{}

\@lowpenalty   51
\@medpenalty  151
\@highpenalty 301

\setcounter{topnumber}{5}
\renewcommand\topfraction{.8}

\setcounter{bottomnumber}{5}
\renewcommand\bottomfraction{.8}

\setcounter{totalnumber}{5}
\renewcommand\textfraction{.2}
\renewcommand\floatpagefraction{.8}

\setcounter{dbltopnumber}{5}
\renewcommand\dbltopfraction{.8}
\renewcommand\dblfloatpagefraction{.8}

\setlength\smallskipamount{3\p@ \@plus 1\p@ \@minus 1\p@}
\setlength\medskipamount{6\p@ \@plus 2\p@ \@minus 2\p@}
\setlength\bigskipamount{12\p@ \@plus 4\p@ \@minus 4\p@}

%%\setlength\footskip{30\p@}

\setlength\footnotesep{6pt}%{6.65\p@}
\setlength{\skip\footins}{10\p@ \@plus 5\p@ \@minus 5\p@}

\setlength\floatsep    {17\p@ \@plus 2\p@ \@minus 2\p@}
\setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
\setlength\intextsep   {17\p@ \@plus 2\p@ \@minus 2\p@}

\setlength\dblfloatsep    {17\p@ \@plus 2\p@ \@minus 2\p@}
\setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}

\setlength\@fptop{0\p@ \@plus 1fil}
\setlength\@fpsep{8\p@ \@plus 2fil}
\setlength\@fpbot{0\p@ \@plus 1fil}

\setlength\@dblfptop{0\p@ \@plus 1fil}
\setlength\@dblfpsep{8\p@ \@plus 2fil}
\setlength\@dblfpbot{0\p@ \@plus 1fil}

\setlength\partopsep{2\p@ \@plus 1\p@ \@minus 1\p@}



%%%
%%% pagestyle
%%%
\def\IEICEcopyright{%
   \lower\dimexpr5mm+3mm\relax\hbox{%
      \normalsize\normalfont
      Copyright\ \textcopyright\ \the\numexpr\@vol+2003\relax\ %
      The Institute of Electronics, Information and Communication Engineers%
   }%
}

\def\CClicense{%
\raisebox{-8mm}[\z@][\z@]{% 
    {%
       \scalebox{.6}{%
          \href{https://creativecommons.org/licenses/by-nc-nd/4.0/deed}%
               {\includegraphics{by-nc-nd-elex}}}~%
          \footnotesize
          \scalebox{.95}{This work is licensed under a Creative Commons Attribution NonCommercial, No Derivatives 4.0 License.}%
    }%
}%
}

\def\@SpecialSection{}%%!!

\def\ps@elex@titlepage{%
    \def\@oddfoot{\leavevmode\smash{\parbox[b]{\textwidth}{%
\centerline{\CClicense}\endgraf
\hfill\IEICEcopyright\hfill\llap{\fontsize{7.25pt}{\z@}\selectfont\thepage}}}}%
    \let\@evenfoot\@oddfoot
    \def\@oddhead{\protect\raisebox{\dimexpr-\paperheight-\topmargin+3mm+.75mm\relax}[\z@][\z@]
                                   {\rlap{\hskip\dimexpr-\oddsidemargin-1in-3mm\relax\includegraphics[scale=1]{logo2-elex}}%
                                   }%
                  \protect\raisebox{\dimexpr-\headsep-8mm+1mm+2mm\relax}[\z@][\z@]{\includegraphics{logo1-elex}%%!! 
                  }%
                  \hfill
                  \fontsize{7.25pt}{\z@}\selectfont
                        IEICE Electronics Express, Vol.\@vol, No.\@no, \pageref{FirstPage}--\pageref{LastPage}%
                  \llap{\raisebox{-12mm}[\z@][\z@]{\normalsize
                        \sffamily\bfseries
                        \@SpecialSection}}%%!!!!
                  }%
    \let\@evenhead\@oddhead
    \let\@mkboth\@gobble
    \let\sectionmar\@gobble
    \let\subsectionmark\@gobble%
}

\def\ps@elex{%
    \def\@oddfoot{\hfill\fontsize{7.25pt}{\z@}\selectfont\thepage}%
    \def\@oddhead{\protect\raisebox{\dimexpr-\paperheight-\topmargin+3mm+.75mm\relax}[\z@][\z@]
                                   {\rlap{\hskip\dimexpr-\oddsidemargin-1in-3mm\relax\includegraphics[scale=1]{logo2-elex}}%
                                   }%
                  \hfill\fontsize{7.25pt}{\z@}\selectfont
                        IEICE Electronics Express, Vol.\@vol, No.\@no, 1--\pageref{LastPage}}%
    \let\@mkboth\@gobble
    \let\sectionmar\@gobble
    \let\subsectionmark\@gobble%
}




%%%
%%% elex paper data
%%%



\ExplSyntaxOn

\def\vol#1{\edef\@vol{#1}
          \def\vol{\msg_error:nnn {elex} {multiple~used~error} {vol}}
          }
\def\no#1{\edef\@no{#1}
          \def\no{\msg_error:nnn {elex} {multiple~used~error} {no}}
          }






%%%<author>

\int_gzero_new:N \g_elex_author_int
\seq_new:N \g_elex_authorlist_seq

\cs_new:Nn \elex_put_authorlist:n {
    \seq_put_right:Nn \g_elex_authorlist_seq 
                  {g_elex_author#1_prop}
    }

\DeclareDocumentCommand\author{m m o d<>}{
   \int_gincr:N \g_elex_author_int
   \prop_new:c {g_elex_author \int_use:N\g_elex_author_int _prop}
   \prop_put:cnn {g_elex_author \int_use:N\g_elex_author_int _prop}
                 {name}
                 {#1}
   \prop_put:cnn {g_elex_author \int_use:N\g_elex_author_int _prop}
                 {affiliate}
                 {#2}
   \IfValueT{#3}{
      \prop_put:cnn {g_elex_author \int_use:N\g_elex_author_int _prop}
                    {email}
                    {#3}
      }
   \IfValueT{#4}{
      \prop_put:cnn {g_elex_author \int_use:N\g_elex_author_int _prop}
                    {ID}
                    {#4}
      }
   \exp_args:Nx \elex_put_authorlist:n {\int_use:N\g_elex_author_int}
}


%%%</author>

%%%<affiliate>
\int_gzero_new:N \g_elex_affiliate_int
\prop_new:N  \g_elex_affiliate_num_prop
\prop_new:N  \g_elex_affiliate_prop

\int_new:N   \g_elex_paffiliate_int
\int_gset:Nn \g_elex_paffiliate_int {100}
%\prop_new:N  \g_elex_paffliate_num_prop
%%\prop_new:N  \g_elex_paffliate_prop

\seq_new:N \g_elex_affiliate_defined_label_seq
\seq_new:N \g_elex_affiliate_used_label_seq

\msg_new:nnn {elex} {multiple~defined~affiliate~label} 
        {The\ label\ ``#1''\ for\ affiliation\ at\ line\ \msg_line_number:^^J
         is\ already\ defined.\ Please\ confirm.}





\cs_set:Nn \elex_define_affiliate:n{
   \cs_set:cpn {#1} ##1##2{
      \seq_if_in:NnTF \g_elex_affiliate_defined_label_seq {##1} {
         \msg_error:nnn {elex} {multiple~defined~affiliate~label} {##1} 
      }
      {  \int_gincr:c {g_elex_#1_int}
         \exp_args:Ncnx \prop_put:Nnn {g_elex_affiliate_num_prop}
            {##1} {\int_use:c {g_elex_#1_int} }
         \prop_gput:cnn {g_elex_affiliate_prop} {##1} {##2}
         \seq_gput_right:Nn \g_elex_affiliate_defined_label_seq {##1} 
      }
%%%%%%%%%%
%   \exp_args:NNx \int_set:Nn \l_tmpa_int { \use:c {g_elex_#1_int} } 
%   \exp_args:Nnx \setcounter{footnote}{\int_use:N \l_tmpa_int }
%  \ifnum\value{footnote}>100\relax 
%       \addtocounter{footnote}{-100}\relax
%       \def\thefootnote{\textasteriskcentered\the\c@footnote}
%   \else 
%      \def\thefootnote{\the\c@footnote}
%   \fi
%   \footnotetext{##2}
%%%%%%%%%%%%%%%
%      \prop_show:c {g_elex_affiliate_num_prop}
%      \prop_show:c {g_elex_affiliate_prop}
%      \prop_show:c {g_elex_#1_prop} 
%      \seq_show:N \g_elex_affiliate_defined_label_seq
   }
}

\elex_define_affiliate:n {affiliate}
\elex_define_affiliate:n {paffiliate}

%%%</affiliate>


%%%<received|accepted/publicized/copyedited>
\tl_new:N \l_elex_year_tl
\tl_new:N \l_elex_month_tl
\tl_new:N \l_elex_day_tl

\tl_new:N \g_elex_doi_tl
\tl_new:N \l_elex_received_tl
\tl_new:N \l_elex_accepted_tl
\tl_new:N \l_elex_publicized_tl
\tl_new:N \l_elex_copyedited_tl


\msg_new:nnn {elex} {dayerror} 
        {Please\ confirm\ your\ ``#1''\ day\ at\ line\ \msg_line_number:.^^J
         If\ it\ is\ uncertain,\ for\ example,\ input\ ``2100/01/01''.}

\msg_new:nnn {elex} {unsuitable~number} 
        {Please\ confirm\ the\ number\ at\ line\ \msg_line_number:.}

\cs_set:Nn \tl_append:NN { \tl_concat:NNN #1 #1 #2 }
\cs_generate_variant:Nn \tl_append:NN { c }


\cs_set:Nn \english_month_name:N{
   \int_case:nn { #1 }{
      {  1 } { January   }
      {  2 } { February  }
      {  3 } { March     }
      {  4 } { April     }
      {  5 } { May       }
      {  6 } { June      }
      {  7 } { July      }
      {  8 } { August    }
      {  9 } { September }
      { 10 } { October   }
      { 11 } { November  }
      { 12 } { December  }
   }
}

\cs_set:Nn \elex_define_date:n{
   \cs_set:cpn {#1} ##1{
      \tl_set:Nn \l_tmpa_tl{##1}
      \tl_replace_all:Nnn \l_tmpa_tl {/}{,}
      \exp_args:NNx \clist_set:Nn \l_tmpa_clist {\tl_use:N \l_tmpa_tl}
      \int_compare:nNnF {\clist_count:N \l_tmpa_clist} = {3}
             {\msg_error:nnn {elex} {dayerror} {#1}}
      \clist_pop:NN \l_tmpa_clist \l_elex_year_tl
      \clist_pop:NN \l_tmpa_clist \l_elex_month_tl
      \clist_pop:NN \l_tmpa_clist \l_elex_day_tl   
      \int_compare:nT {\l_elex_month_tl <10}
         { \int_set:Nn \l_tmpa_int {\tl_use:N \l_elex_month_tl}
           \tl_set:Nx \l_tmpa_tl {\int_use:N \l_tmpa_int}
           \tl_set:Nx \l_elex_month_tl {0 \l_tmpa_tl}
         }
      \int_compare:nT {\l_elex_day_tl <10}
         { \int_set:Nn \l_tmpa_int {\tl_use:N \l_elex_day_tl}
           \tl_set:Nx \l_tmpa_tl {\int_use:N \l_tmpa_int}
           \tl_set:Nx \l_elex_day_tl {0 \l_tmpa_tl}
         }
      \bool_if:nF
         {    \int_compare_p:n { \tl_use:N \l_elex_year_tl  >  2000} 
           && \int_compare_p:n { 1 <= \tl_use:N \l_elex_month_tl <= 12} 
           && \int_compare_p:n { 1 <= \tl_use:N \l_elex_day_tl   <= 31} 
         }
         { \msg_error:nn {elex}{unsuitable~number} }
      \tl_set:cx {l_elex_#1_tl} {\english_month_name:N \l_elex_month_tl}
      \tl_put_right:cn {l_elex_#1_tl} {~}
      \int_set:Nn \l_tmpa_int {\tl_use:N \l_elex_day_tl}%%remove zero padding
      \tl_set:Nx \l_tmpa_tl {\int_use:N \l_tmpa_int}
      \tl_append:cN {l_elex_#1_tl} \l_tmpa_tl
      \tl_put_right:cn {l_elex_#1_tl} {,~}
      \tl_append:cN  {l_elex_#1_tl} \l_elex_year_tl
%      \tl_show:c {l_elex_#1_tl}
      \@namedef{#1}{ \msg_error:nnn {elex} {multiple~used~error} {#1} }
   }
}

\elex_define_date:n {received}
\elex_define_date:n {accepted}
\elex_define_date:n {publicized}
\elex_define_date:n {copyedited}

%%%</received|accepted/publicized/copyedited>

%%%<title|maketitle|doi>
\msg_new:nnn {elex} {undefined~affiliate~label~use~used} 
             {The\ label\ ``#1''\ for\ affiliation\ is\ not\ defined.}


\cs_set:Npn \title #1{
   \tl_set:Nn \g_elex_title_tl{#1}
   \def\title{\msg_error:nnn {elex} {multiple~used~error} {title}}
}

\cs_set:Npn \doi #1{
   \tl_set:Nn \g_elex_doi_tl{#1}
   \def\doi{\msg_error:nnn {elex} {multiple~used~error} {doi}}
}

\tl_clear_new:N \l_commasp_or_empty_tl
\int_new:N \g_elex_email_num_int

\tl_const:Nn \l_endparen_tl {)}

\seq_new:N \g_elex_author_separator_seq

\cs_new:Nn \elex_extract_author:n {
   \seq_pop_left:NNTF \g_elex_author_separator_seq \l_tmpa_tl
      {\tl_use:N \l_tmpa_tl} {}
%%% name
   \prop_get:cnN {#1} {name} \l_tmpa_tl 
      \tl_use:N \l_tmpa_tl
%%%%ID
  \prop_if_in:cnT {#1} {ID} {
     \prop_get:cnN {#1} {ID} \l_tmpa_tl 
     \exp_args:NNx
     \clist_set:Nn \l_tmpa_clist {\tl_use:N \l_tmpa_tl}
     \clist_map_variable:NNn \l_tmpa_clist \l_var { 
        \exp_args:Nnx
        \regex_match:nnT {-} {\tl_use:N \l_var} {
        \,\orcid{\l_var}
        \clist_map_break: 
        }
     } 
   }  
%%% affiliate
   \textsuperscript{\normalfont
%%%%
      \prop_get:cnN {#1} {affiliate} \l_tmpa_tl
      \exp_args:NNx \clist_set:Nn \l_tmpa_clist {\tl_use:N \l_tmpa_tl}
      \clist_remove_duplicates:N \l_tmpa_clist
      \clist_map_inline:Nn \l_tmpa_clist {
         \seq_if_in:NnF \g_elex_affiliate_defined_label_seq {##1}
             {\msg_error:nnn {elex} {undefined~affiliate~label~use~used} {##1}}
         \seq_gput_right:Nn \g_elex_affiliate_used_label_seq {##1}
      }
      \group_begin: 
         \clist_map_inline:Nn \l_tmpa_clist{
               \prop_get:NnN \g_elex_affiliate_num_prop {##1} \l_tmpa_tl
               \tl_use:N  \l_commasp_or_empty_tl
               \tl_set:Nn \l_commasp_or_empty_tl {,~}
               \int_compare:nNnTF {\tl_use:N \l_tmpa_tl} > {100}
                   {\textasteriskcentered\int_eval:n {\tl_use:N \l_tmpa_tl - 100}  }
                   {\tl_use:N  \l_tmpa_tl}
         }
      \group_end:
   }%%%end of textsuperscript
%%   affiliate~\tl_use:N \l_tmpa_tl\\
%%% email
      \group_begin:
      \tl_set:Nn \l_commasp_or_empty_tl {,~}
      \prop_if_in:cnT {#1} {email} {
         \prop_get:cnN {#1} {email} \l_tmpa_tl
         \exp_args:NNx \clist_set:Nn \l_tmpa_clist {\tl_use:N \l_tmpa_tl}
            \clist_map_inline:Nn \l_tmpa_clist {
               \textsuperscript{
                  \normalfont
                  \tl_use:N  \l_commasp_or_empty_tl
                  \int_gincr:N \g_elex_email_num_int              
                  \int_to_alph:n {\g_elex_email_num_int}
                  \tl_use:N \l_endparen_tl    
               }
               %\exp_args:Nnx \setcounter{footnote}{\int_use:N \g_elex_email_num_int }
               %\group_begin:
               %   %%\let\@textsuperscript\vphantom
               %   \def\thefootnote{\textcolor{blue}{\alph{footnote})}}
               %   \let\@makefntext\@makefntext@affiliate@email
               %   \footnotetext{\textcolor{blue}{\tl_to_str:n {##1}}}
               %\group_end:
             }
         }
      \group_end:
%%%%
%  \group_begin:
%     \prop_if_in:cnT {#1} {email} {
%         \prop_get:cnN {#1} {email} \l_tmpa_tl
%         \exp_args:NNx \clist_set:Nn \l_tmpa_clist {\tl_use:N \l_tmpa_tl}
%         \clist_map_inline:Nn \l_tmpa_clist { \footnotetext[0]{\tl_to_str:n {##1} } }
%   }  
%  \group_end:
%%%%
%% ID
%   \prop_if_in:cnT {#1} {ID} {
%      \prop_get:cnN {#1} {ID} \l_tmpa_tl
%         ID~\tl_use:N\l_tmpa_tl\\
%      }
}


\cs_new:Nn \elex_footnote_affiliate:nn {
\group_begin:
   \prop_get:NnN \g_elex_affiliate_num_prop {#1} \l_tmpa_tl
   \int_set:Nn \l_tmpa_int  {\tl_use:N \l_tmpa_tl}
   \exp_args:Nnx \setcounter{footnote}{\int_use:N \l_tmpa_int }
  \ifnum\value{footnote}>100\relax 
       \addtocounter{footnote}{-100}\relax
       \def\thefootnote{\textasteriskcentered\the\c@footnote}
   \else 
      \def\thefootnote{\the\c@footnote}
   \fi
   \let\@makefntext\@makefntext@affiliate@email
   \footnotetext{#2}
\group_end:
}




\cs_new:Nn \elex_footnote_email:n {
   \group_begin:
      \tl_set:Nn \l_commasp_or_empty_tl {,~}
      \prop_if_in:cnT {#1} {email} {
         \prop_get:cnN {#1} {email} \l_tmpa_tl
         \exp_args:NNx \clist_set:Nn \l_tmpa_clist {\tl_use:N \l_tmpa_tl}
         \clist_map_inline:Nn \l_tmpa_clist {
            \int_gincr:N \g_elex_email_num_int       
            \exp_args:Nnx \setcounter{footnote}{\int_use:N \g_elex_email_num_int }
               \group_begin:
                  %%\let\@textsuperscript\vphantom
                  \def\thefootnote{\textcolor{blue}{\alph{footnote})}}
                  \let\@makefntext\@makefntext@affiliate@email
                  \regex_match:nnTF {^\*\s*} {##1}
                    {
                     \tl_set:Nn \l_tmpa_tl {##1}
                     \regex_replace_all:nnN {\*} {} \l_tmpa_tl
                     \footnotetext{\href{mailto: \tl_use:N \l_tmpa_tl}
                                        {\tl_to_str:N \l_tmpa_tl}~(corresponding~author)}  
                    }
                    {\footnotetext{\href{mailto: ##1}{\tl_to_str:n {##1}}}}

               \group_end:
         }
      }
   \group_end:
}






\clist_new:N \g_elex_breakauthor_clist

\cs_new:Npn \breakauthorline #1 {
   \clist_set:Nn \l_tmpa_clist {#1}
   \clist_map_inline:Nn \l_tmpa_clist
     { \clist_put_right:Nx \g_elex_breakauthor_clist { \int_eval:n{##1+1}}  }
}

\cs_new:Nn \elex_process_comma:n
          { \clist_if_in:NnTF \g_elex_breakauthor_clist {#1}
                { \seq_put_right:Nn \g_elex_author_separator_seq {,\newline} }
                { \seq_put_right:Nn \g_elex_author_separator_seq {,~} }
         }



\cs_if_exist:NT  \regex_match:nnT {
   \cs_generate_variant:Nn \regex_extract_once:nnNTF {nxNTF}
}


\seq_new:N \l_elex_tmpa_seq

\msg_new:nnn {elex}{wrong~doi}{
    doi~``#1''~is~wrong!^^J
    Please~confirm~it.}

\msg_new:nnn {elex}{wrong~jobname}{
    filename~``#1''~is~wrong!^^J
    Please~confirm~it.}

\msg_new:nnn {elex}{wrong~jobname~doi}{
    filename~or~doi~is~wrong!^^J
    Please~confirm~it.}



\cs_new:Nn \maketitle: {
   \int_compare:nNnTF {\g_elex_author_int} = {1} {} {}
   \int_compare:nNnTF {\g_elex_author_int} = {2} 
      { \clist_if_in:NnTF \g_elex_breakauthor_clist {2}
           {\seq_put_right:Nn \g_elex_author_separator_seq {\newline and~}}
           {\seq_put_right:Nn \g_elex_author_separator_seq {~and~}}
      }
      {%\int_step_inline:nnn {2} {\g_elex_author_int -1 } 
       %    { \clist_if_in:NnTF \g_elex_breakauthor_clist {##1}
       %         { \seq_put_right:Nn \g_elex_author_separator_seq {,\newline} }
       %         { \seq_put_right:Nn \g_elex_author_separator_seq {,~} }
       %    }
        \int_step_function:nnnN  {2} {1} { \g_elex_author_int -1 } \elex_process_comma:n
      \exp_args:NNx
      \clist_if_in:NnTF \g_elex_breakauthor_clist {\int_eval:n {\g_elex_author_int} }
        { \seq_put_right:Nn \g_elex_author_separator_seq {,\newline and~} }
        { \seq_put_right:Nn \g_elex_author_separator_seq {,~and~} }
      }
   \seq_put_left:Nn \g_elex_author_separator_seq {}
%%%%
   \twocolumn[\vskip8mm
              \fboxrule.5pt\fboxsep-\fboxrule
              \fbox{\vbox to\dimexpr 5mm-2\fboxrule\relax
                        {\hsize=\dimexpr \textwidth-0\fboxrule\relax
                         \@parboxrestore
                         \vss
                         \fontsize{11pt}{\z@}\usefont{T1}{phv}{m}{n}
                         \hskip3pt%%\exp_args:Nx\uppercase{\tl_use:N \g_elex_type_tl}\hfill
                                  \tl_use:N \g_elex_type_tl\hfill
                         \vss}
                   }
              \par\nointerlineskip\vskip1.75mm
              \group_begin:
                 \fontsize{16pt}{23pt}\bfseries
                 \tl_use:N \g_elex_title_tl
                 \par
              \group_end:
              \vskip5mm
              %\group_begin:
                 \vbox to18mm{%
                 \bfseries
                 \seq_map_function:NN \g_elex_authorlist_seq \elex_extract_author:n
              %\group_end:
              \vss}%\vskip15mm
              ]%%end of \twocolumn
   \prop_map_function:NN \g_elex_affiliate_prop \elex_footnote_affiliate:nn 
   \int_gzero:N \g_elex_email_num_int
   \seq_map_function:NN  \g_elex_authorlist_seq \elex_footnote_email:n 
%\prop_show:N \g_elex_affiliate_prop 
%%%%%
   \group_begin:
       %%\prop_show:N \g_elex_email_prop
      %%\let\thefootnote\@empty
      \let\@makefntext\@makefntext@paperdata
      \footnotetext{\rule{0pt}{3pt}}
      \footnotetext{\phantom@submit{DOI:~\tl_if_empty:NTF \g_elex_doi_tl 
                            {10.1587/elex.XX.XXXXXXXX}
                            {\tl_use:N \g_elex_doi_tl}} }
      \footnotetext{\phantom@submit{Received~\tl_if_empty:NTF \l_elex_received_tl 
                                {MM~DD,~YYYY}
                                {\tl_use:N \l_elex_received_tl}} }
      \footnotetext{\phantom@submit{Accepted~\tl_if_empty:NTF \l_elex_accepted_tl 
                                {MM~DD,~YYYY}
                                {\tl_use:N \l_elex_accepted_tl}} }
      \footnotetext{\phantom@submit{Publicized~\tl_if_empty:NTF \l_elex_publicized_tl 
                                {MM~DD,~YYYY}
                                {\tl_use:N \l_elex_publicized_tl}} }
      \footnotetext{\phantom@submit{Copyedited~\tl_if_empty:NTF \l_elex_copyedited_tl 
                                {MM~DD,~YYYY}
                                {\tl_use:N \l_elex_copyedited_tl}} }
   \group_end:
%%%%
%   \cs_if_exist:NT  \regex_match:nnTF
%   {\regex_extract_once:nxNTF { 10\.1587/elex\.(\d{2}\.\d{8}) }
%                              {\g_elex_doi_tl }
%                              \l_elex_tmpa_seq
%                        {\seq_get_right:NN \l_elex_tmpa_seq \l_tmpa_tl}
%                        {\msg_error:nnx{elex}{wrong~doi}{\g_elex_doi_tl}}
%    \regex_extract_once:nxNTF { (\d{4})_(\d{8}) }
%                              {\c_sys_jobname_str}
%                              \l_elex_tmpa_seq
%                        {\seq_get_right:NN \l_elex_tmpa_seq \l_tmpb_tl}
%                        {\msg_error:nnx{elex}{wrong~jobname}{\c_sys_jobname_str}}
%    \tl_put_left:Nx \l_tmpb_tl {\@vol.}
%    \tl_if_eq:NNF \l_tmpa_tl \l_tmpb_tl
%                  {\msg_error:nn {elex}{wrong~jobname~doi}}
%   }
}

\file_if_exist:nT{check.sty}{\RequirePackage{check}}

\msg_new:nnn {elex} {unsed~affiliate~label} 
        {The\ defined\ label\ ``#1''\ is\ not\ used.\ Please\ confirm.}


\msg_new:nnn {elex} {multiple~used~error} 
        {#1\ is\ already\ used.\ Please\ confirm.}


\def\maketitle{\maketitle:
               \seq_remove_duplicates:N \g_elex_affiliate_used_label_seq
               \seq_map_inline:Nn \g_elex_affiliate_defined_label_seq{
                  \seq_if_in:NnF \g_elex_affiliate_used_label_seq {##1} {
                     \msg_error:nnn {elex} {unsed~affiliate~label} {##1}
                  }
               }
               \thispagestyle{elex@titlepage}
               \label{FirstPage} 
               \setcounter{footnote}{\z@}%
               \def\maketitle{ \msg_error:nnn {elex} {multiple~used~error} {maketitle} }
              }
              
\seq_new:N \g_elex_type_seq
\seq_gput_right:Nn \g_elex_type_seq {REVIEW~PAPER}
\seq_gput_right:Nn \g_elex_type_seq {LETTER}
\seq_gput_right:Nn \g_elex_type_seq {From~Editor-in-Chief}


\tl_new:N \g_elex_type_tl

\msg_new:nnn {elex} {type~of~paper} 
        {The\ type\ of\ paper\ ``#1'' \ in\ you\ code\  at\ line\ \msg_line_number:\ is\ not\ defined.\
         Please\ select\ from^^J
         ~~REVIEW~PAPER^^J
         ~~LETTER^^J
         ~~From~Eitor-in-Chief.
         }


\cs_new:Npn \type #1{
   \seq_if_in:NnTF \g_elex_type_seq {#1} { \tl_set:Nn \g_elex_type_tl {#1} }
                                         { \msg_error:nnn {elex} {type~of~paper} {#1} }
}



%%%</title|maketitle|doi>

\ExplSyntaxOff

%%%
%%% list environments <stub>
%%%
\def\@listi{\leftmargin\leftmargini
            \parsep \z@%%4\p@ \@plus2\p@ \@minus\p@
            \topsep \z@%8\p@ \@plus2\p@ \@minus4\p@
            \itemsep\z@%4\p@ \@plus2\p@ \@minus\p@
            }
\let\@listI\@listi
\@listi
\def\@listii {\leftmargin\leftmarginii
              \labelwidth\leftmarginii
              \advance\labelwidth-\labelsep
              \topsep    4\p@ \@plus2\p@ \@minus\p@
              \parsep    2\p@ \@plus\p@  \@minus\p@
              \itemsep   \parsep}
\def\@listiii{\leftmargin\leftmarginiii
              \labelwidth\leftmarginiii
              \advance\labelwidth-\labelsep
              \topsep    2\p@ \@plus\p@\@minus\p@
              \parsep    \z@
              \partopsep \p@ \@plus\z@ \@minus\p@
              \itemsep   \topsep}
\def\@listiv {\leftmargin\leftmarginiv
              \labelwidth\leftmarginiv
              \advance\labelwidth-\labelsep}
\def\@listv  {\leftmargin\leftmarginv
              \labelwidth\leftmarginv
              \advance\labelwidth-\labelsep}
\def\@listvi {\leftmargin\leftmarginvi
              \labelwidth\leftmarginvi
              \advance\labelwidth-\labelsep}

\setlength\leftmargini  {2em}

\leftmargin  \leftmargini
\setlength\leftmarginii  {2.2em}
\setlength\leftmarginiii {1.87em}
\setlength\leftmarginiv  {1.7em}

\setlength\leftmarginv  {.5em}
\setlength\leftmarginvi {.5em}

\setlength  \labelsep  {.5em}
\setlength  \labelwidth{\leftmargini}
\addtolength\labelwidth{-\labelsep}

\@beginparpenalty -\@lowpenalty
\@endparpenalty   -\@lowpenalty
\@itempenalty     -\@lowpenalty

\renewcommand\theenumi{\@arabic\c@enumi}
\renewcommand\theenumii{\@alph\c@enumii}
\renewcommand\theenumiii{\@roman\c@enumiii}
\renewcommand\theenumiv{\@Alph\c@enumiv}

\newcommand\labelenumi{\theenumi.}
\newcommand\labelenumii{(\theenumii)}
\newcommand\labelenumiii{\theenumiii.}
\newcommand\labelenumiv{\theenumiv.}

\renewcommand\p@enumii{\theenumi}
\renewcommand\p@enumiii{\theenumi(\theenumii)}
\renewcommand\p@enumiv{\p@enumiii\theenumiii}

\newcommand\labelitemi{\textbullet}
\newcommand\labelitemii{\normalfont\bfseries \textendash}
\newcommand\labelitemiii{\textasteriskcentered}
\newcommand\labelitemiv{\textperiodcentered}

\newenvironment{description}
               {\list{}{\labelwidth\z@ \itemindent-\leftmargin
                        \let\makelabel\descriptionlabel}}
               {\endlist}
\newcommand*\descriptionlabel[1]{\hspace\labelsep
                                \normalfont\bfseries #1}


\newenvironment{verse}
               {\let\\\@centercr
                \list{}{\itemsep      \z@
                        \itemindent   -1.5em%
                        \listparindent\itemindent
                        \rightmargin  \leftmargin
                        \advance\leftmargin 1.5em}%
                \item\relax}
               {\endlist}
\newenvironment{quotation}
               {\list{}{\listparindent 1.5em%
                        \itemindent    \listparindent
                        \rightmargin   \leftmargin
                        \parsep        \z@ \@plus\p@}%
                \item\relax}
               {\endlist}
\newenvironment{quote}
               {\list{}{\rightmargin\leftmargin}%
                \item\relax}
               {\endlist}


\RequirePackage{enumitem}

\setlist[enumerate,1]{itemsep=\z@,parsep=\z@}
\setlist[enumerate,2]{itemsep=\z@,parsep=\z@}
\setlist[itemize,1]{itemsep=\z@,parsep=\z@}
\setlist[itemize,2]{itemsep=\z@,parsep=\z@}
\setlist[description,1]{itemsep=\z@,parsep=\z@}
\setlist[description,2]{itemsep=\z@,parsep=\z@}


%%%
%%% parameter settings (2)
%%%

\setlength\arraycolsep{5\p@}

\setlength\tabcolsep{6\p@}
\setlength\arrayrulewidth{.4\p@}

\setlength\doublerulesep{2\p@}

\setlength\tabbingsep{\labelsep}

\skip\@mpfootins = \skip\footins

\setlength\fboxsep{3\p@}
\setlength\fboxrule{.4\p@}

\renewcommand \theequation {\@arabic\c@equation}


%%%
%%% abstract
%%%
\def\abstract{%
   \small%%!! 8pt/10pt
   \everypar{\setbox\z@\lastbox
             %%\let\par\relax
             \textbf{Abstract}\everypar{}\quad}%
}

\def\endabstract{\@@par}

%%%
%%% keywords
%%%
\def\keywords{%
   \small%%!! 8pt/10pt
   \everypar{\setbox\z@\lastbox
             %%\let\par\relax
             \textbf{Keywords:}\everypar{}\ }%
}


\def\endkeywords{\@@par}

%%%
%%% classification
%%%
\def\classification{%
   \small%%!! 8pt/10pt
   \everypar{\setbox\z@\lastbox
             %%\let\par\relax
             \textbf{Classification:}\everypar{}\quad}%
}

\def\endclassification{\@@par}

%% abbrebiations for classification
\def\IO{Integrated optoelectronics (lasers and optoelectronic devices, silicon photonics, planar lightwave circuits, polymer optical circuits, etc.)}
\def\OH{Optical hardware (fiber optics, microwave photonics, optical interconnects, photonic signal processing, photonic integration and modules, optical sensing, etc.)}
\def\ET{Electromagnetic theory}
\def\MM{Microwave and millimeter-wave devices, circuits, and modules}
\def\TD{THz devices, circuits and modules}
\def\ED{Electron devices, circuits and modules (silicon, compound semiconductor, organic and novel materials)}
\def\IC{Integrated circuits (memory, logic, analog, RF, sensor)}
\def\PD{Power devices and circuits}
\def\MN{Micro- or nano-electromechanical systems}
\def\CMS{Circuits and modules for storage}
\def\SE{Superconducting electronics}
\def\EH{Energy harvesting devices, circuits and modules}
\def\CMED{Circuits and modules for electronic displays}
\def\CMEI{Circuits and modules for electronic instrumentation}
\def\DC{Devices, circuits and modules for IoT and biomedical applications}


%%%
%%% footnote
%%%
%\def\@textsuperscript#1{%
%  {\m@th\ensuremath{^{\mbox{\fontsize\sf@size\z@#1}}}}}
\def\@makefnmark{\hbox{\@textsuperscript{\normalfont\@thefnmark}}}

\renewcommand\footnoterule{%
  %%\kern-3\p@
  \hrule\@width50mm%%\columnwidth
  %%\kern2.6\p@
  \kern7pt
  }

\long\def\@makefntext#1{%
    \noindent
    \parindent2.5em
    \hangafter1
    \hangindent1.5em
    \def\par{{\@@par}}%
    \hb@xt@1.5em{\hss\@makefnmark~}#1}


\def\@makefntext@affiliate@email#1{%
    \parindent\z@
    \noindent
    \hangafter1
    \hangindent1.5em
    \hb@xt@1.5em{\hss\@makefnmark~}#1}



\def\@makefntext@paperdata#1{%
    \parindent\z@
    \noindent
    \fontsize{7pt}{\@ixpt}%
    \usefont{OT1}{phv}{b}{n}%
    #1}


%%%
%%% float env
%%%

\def\center@float{\topsep\z@
                  \partopsep\z@
                  \itemsep\z@
                  \parsep\z@
                  \trivlist\centering\item\relax}
\def\endcenter@float{\endtrivlist}

\def \@floatboxreset {%
        \reset@font
        \@setminipage
        \footnotesize
        \let\center\center@float
        \let\endcenter\endcenter@float
}


%%% figure
\newcommand\figurename{Fig.}
\newcounter{figure}
\renewcommand \thefigure {\@arabic\c@figure}
\def\fps@figure{tbp}
\def\ftype@figure{1}
\def\ext@figure{lof}

\def\fnum@figure{\figurename\nobreakspace\thefigure}
\newenvironment{figure}
               {\setlength\abovecaptionskip{3mm}%
                \setlength\belowcaptionskip{\z@}%
                \captionwidth\linewidth
                \@float{figure}}
               {\end@float}

\newenvironment{figure*}
               {\setlength\abovecaptionskip{3mm}%
                \setlength\belowcaptionskip{\z@}%
                \captionwidth.75\textwidth
                \@dblfloat{figure}}
               {\end@dblfloat}


%%% table
\newcommand\tablename{Table}
\newcounter{table}
\renewcommand\thetable{\@Roman\c@table}
\def\fps@table{tbp}
\def\ftype@table{2}
\def\ext@table{lot}

\def\fnum@table{\tablename\nobreakspace\thetable}
\newenvironment{table}
               {\setlength\abovecaptionskip{\z@}%
                \setlength\belowcaptionskip{2mm}%
                \captionwidth\linewidth
                \@float{table}}
               {\end@float}
\newenvironment{table*}
               {\setlength\abovecaptionskip{\z@}%
                \setlength\belowcaptionskip{2mm}%
                \captionwidth.75\textwidth
                \@dblfloat{table}}
               {\end@dblfloat}

%% caption
\newlength\abovecaptionskip
\newlength\belowcaptionskip
\setlength\abovecaptionskip{0\p@}
\setlength\belowcaptionskip{0\p@}

\newlength{\captionwidth}


\long\def\@makecaption#1#2{%
  \begingroup
  \par
  \nointerlineskip
  \vskip\abovecaptionskip
     \centering
     \small
     \begin{varwidth}{\captionwidth}%
        \textbf{#1}\hskip1em#2
     \end{varwidth}%
  \par
  \nointerlineskip
  \vskip\belowcaptionskip
  \endgroup
}


%%%
%%% section/subsection/subsubsection/paragraph/subparagraph
%%%
\setcounter{secnumdepth}{3}
\newcounter {section}
\newcounter {subsection}[section]
\newcounter {subsubsection}[subsection]

\newcounter {paragraph}[subsubsection]
\newcounter {subparagraph}[paragraph]

\renewcommand \thesection {\@arabic\c@section.}
\renewcommand\thesubsection   {\thesection\@arabic\c@subsection}
\renewcommand\thesubsubsection{\thesubsection.\@arabic\c@subsubsection}
\renewcommand\theparagraph    {\thesubsubsection.\@arabic\c@paragraph}
\renewcommand\thesubparagraph {\theparagraph.\@arabic\c@subparagraph}


\def\gyodori#1#2{% #2��#1 
  \setbox\@tempboxa=\hbox{Ay}%
  \@tempdimb=\ht\@tempboxa % h
  \@tempdimc=\dp\@tempboxa % d
  \setbox\@tempboxa=\vbox{#2}%
  \par
  \@tempdima=\dimexpr(#1\baselineskip - \baselineskip + \@tempdimb + \@tempdimc - \ht\@tempboxa - \dp\@tempboxa)/2\relax % s
%%%%
  \setbox\@tempboxa=\vbox{%
     \vspace{\dimexpr\@tempdima - \@tempdimb\relax}% H = 0
    \unvbox\@tempboxa
  }%
  \dp\@tempboxa=\dimexpr\ht\@tempboxa + \dp\@tempboxa\relax
%%%%%%%%%%%%%
  \ht\@tempboxa=0pt % H = 0
  \box\@tempboxa
  \nopagebreak
  \par
  \vspace{\dimexpr\@tempdima - \@tempdimc\relax}%
  \prevdepth=0pt
}%


\newcommand\section{\@startsection {section}{1}{\z@}%
                                   {-1sp}%
                                   {1sp}%
                                   {\normalfont\normalsize\bfseries\boldmath}}

\newcommand\subsection{\@startsection{subsection}{2}{\z@}%
                                     {-\baselineskip}%
                                     {1sp}%
                                     {\normalfont\normalsize\bfseries\boldmath}}

\newcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
                                     {-1sp}%
                                     {1sp}%
                                     {\normalfont\normalsize\bfseries\boldmath}}
\newcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
                                    {\z@}%
                                    {-1em}%
                                    {\normalfont\normalsize\bfseries\boldmath}}
\newcommand\subparagraph{\@startsection{subparagraph}{5}{\z@}%
                                       {\z@}%
                                       {-1em}%
                                       {\normalfont\normalsize\bfseries\boldmath}}

\def\@startsection#1#2#3#4#5#6{%
  \if@noskipsec \leavevmode \fi
  \par
  \@tempskipa #4\relax
  \@afterindenttrue
  \ifdim \@tempskipa <\z@
    \@tempskipa -\@tempskipa \@afterindentfalse
  \fi
  \if@nobreak
    \everypar{}%
  \else
    \addpenalty\@secpenalty\addvspace\@tempskipa
  \fi
  \@ifstar
    {\@ssect{#2}{#3}{#4}{#5}{#6}}%
    {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}


\def\@sect#1#2#3#4#5#6[#7]#8{%
  \ifnum #2>\c@secnumdepth
    \let\@svsec\@empty
  \else
    \refstepcounter{#1}%
    \protected@edef\@svsec{\@seccntformat{#1}\relax}%
  \fi
%%%%%
  \@tempskipa #5\relax
  \ifdim \@tempskipa>\z@
    % \ifnum#2=\@ne%% section
    %   \setbox\z@=\hbox{#6\@hangfrom{\hskip #3\relax\@svsec}#8}%
    %   \ifdim\wd\z@<\linewidth
    %      \@tempcnta3\relax
    %   \else
    %     \@tempcnta4\relax   
    %   \fi
    %   \gyodori{\@tempcnta}{#6\@hangfrom{\hskip #3\relax\@svsec}#8}%
    %   \nopagebreak
       \begingroup
          \ifnum#2=\@ne%% section
          \setbox\z@=\hbox{#6\@hangfrom{\hskip #3\relax\@svsec}#8}%
          \ifdim\wd\z@<\linewidth
             \@tempcnta3\relax
          \else
             \@tempcnta4\relax   
          \fi
          \gyodori{\@tempcnta}{#6\@hangfrom{\hskip #3\relax\@svsec}#8}%
          \@@par\nopagebreak
       \else
         #6{%
           \@hangfrom{\hskip #3\relax\@svsec}%
              \interlinepenalty \@M #8\@@par}%
       \fi
       \endgroup
       \csname #1mark\endcsname{#7}%
       \addcontentsline{toc}{#1}{%
          \ifnum #2>\c@secnumdepth \else
              \protect\numberline{\csname the#1\endcsname}%
          \fi
         #7}%
  \else%%%%
    \def\@svsechd{%
      #6{\hskip #3\relax
      \@svsec #8}%
      \csname #1mark\endcsname{#7}%
      \addcontentsline{toc}{#1}{%
        \ifnum #2>\c@secnumdepth \else
          \protect\numberline{\csname the#1\endcsname}%
        \fi
        #7}}%
  \fi
  \@xsect{#5}}
  
\def\@xsect#1{%
  \@tempskipa #1\relax
  \ifdim \@tempskipa>\z@
    \par \nobreak
    \vskip \@tempskipa
    \@afterheading
  \else
    \@nobreakfalse
    \global\@noskipsectrue
    \everypar{%
      \if@noskipsec
        \global\@noskipsecfalse
       {\setbox\z@\lastbox}%
        \clubpenalty \@clubpenalty
        \begingroup \@svsechd \endgroup
        \unskip
        \@tempskipa #1\relax
        \hskip -\@tempskipa
      \else
        \clubpenalty \@clubpenalty
        \everypar{}%
      \fi}%
  \fi
  \ignorespaces}
  
\def\@seccntformat#1{\csname the#1\endcsname\quad}

\def\@ssect#1#2#3#4#5#6{%
\ifnum#1=\@ne%%% section
   \setbox\z@=\hbox{#5\@hangfrom{\hskip #2\relax}#6}%
   \ifdim\wd\z@<\linewidth
      \@tempcnta3\relax
   \else
      \@tempcnta4\relax   
   \fi
   \gyodori{\@tempcnta}{#5\@hangfrom{\hskip #2\relax}#6}%
   \@@par\nopagebreak
\else%%otherwise
  \@tempskipa #4\relax
  \ifdim \@tempskipa>\z@
    \begingroup
      #5{%
        \@hangfrom{\hskip #2}%
          \interlinepenalty \@M #6\@@par}%
    \endgroup
  \else
    \def\@svsechd{#5{\hskip #2\relax #6}}%
  \fi
%%%%%%%%%
\fi
  \@xsect{#4}}


\def\@afterheading{%
  \@nobreaktrue
  \everypar{%
    \if@nobreak
      \@nobreakfalse
      \clubpenalty \@clubpenalty
      \if@afterindent \else
        {\setbox\z@\lastbox}%
      \fi
    \else
      \clubpenalty \@clubpenalty
      \everypar{}%
    \fi}}




%%%
%%% bibliography
%%%
\newdimen\bibindent
\setlength\bibindent{1.5em}


\newenvironment{thebibliography}[1]{%
   \par
   \small%
   \let\doi\bibdoi
   \pagebreak[2]%
   \gyodori{3}{\noindent\textbf{References}}%
   \par\nopagebreak
   \list{\@biblabel{\@arabic\c@enumiv}}%
      {\settowidth\labelwidth{\@biblabel{#1}}%
       \topsep\z@
       \parsep\z@
       \itemsep\z@
       \leftmargin\labelwidth
       \advance\leftmargin\labelsep
       \usecounter{enumiv}%
       \let\p@enumiv\@empty
       \renewcommand\theenumiv{\@arabic\c@enumiv}}%
       \sloppy
       \clubpenalty4000
       \@clubpenalty \clubpenalty
       \widowpenalty4000%
       \sfcode`\.\@m}
      {\def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}%
       \endlist}


%%%
%%% old font command
%%%

\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
\DeclareRobustCommand*\cal{\@fontswitch\relax\mathcal}
\DeclareRobustCommand*\mit{\@fontswitch\relax\mathnormal}


%%%
%%% for (upTeX
%%%
\newif\if@uplatex
\newif\if@platex
\@ifundefined{ucs}{}{\@uplatextrue}
\if@uplatex
   \DeclareFontShape{JY2}{mc}{m}{it}{<-> ssub * mc/m/n}{}
   \DeclareFontShape{JT2}{mc}{m}{it}{<-> ssub * mc/m/n}{}
\else
   \@ifundefined{tate}{}{\@platextrue}
   \if@platex
      \DeclareFontShape{JY1}{mc}{m}{it}{<-> ssub * mc/m/n}{}
      \DeclareFontShape{JT1}{mc}{m}{it}{<-> ssub * mc/m/n}{}
   \fi
\fi



%%%
%%% finalize 
%%%

\widowpenalty\z@
\@clubpenalty\z@

\twocolumn
\sloppy
\raggedbottom
%\flushbottom
\parskip\z@
\parindent1em

\hbadness4000\relax
\vbadness4000\relax

\columnseprule\z@


\pagestyle{elex}
\pagenumbering{arabic}

%%%
%%% hyperref
%%%
%\if@submit
%\def\href#1#2{\textcolor{blue}{#2}}
%\else
%\AtBeginDocument{%
   \RequirePackage[%
      hyperfootnotes=false,
      bookmarks=false,
      bookmarksnumbered=false,%
      pdftitle={},%
      pdfauthor={},%
      pdfsubject={},%
      pdfkeywords={},%
      implicit=false,
      breaklinks=true,
      colorlinks=true,
      linkcolor=blue,
      anchorcolor=blue,
      urlcolor=blue,
      bookmarks=false,
      pdfpagelabels=false
   ]{hyperref}
%}
%\fi

\def\bibdoi{\kernel@ifnextchar[{\@doi}{\@@doi}}
\def\@doi[#1]#2{(\href{https://doi.org/#1}{DOI:\ #2})}
\def\@@doi#1{(\href{https://doi.org/#1}{DOI:\ \detokenize{#1}})}




\AtBeginDvi{%
   \ifcsname @vol\endcsname\else\gdef\@vol{XX}\fi
   \ifcsname @no\endcsname\else\gdef\@no{YY}\fi
}


\predisplaypenalty100
\postdisplaypenalty100



\def\SpecialSection#1{\def\@SpecialSection{#1}}


\RequirePackage{tikz}
\usetikzlibrary{svg.path}


\definecolor{orcidlogocol}{HTML}{A6CE39}
\tikzset{
  orcidlogo/.pic={
    \fill[orcidlogocol] svg{M256,128c0,70.7-57.3,128-128,128C57.3,256,0,198.7,0,128C0,57.3,57.3,0,128,0C198.7,0,256,57.3,256,128z};
    \fill[white] svg{M86.3,186.2H70.9V79.1h15.4v48.4V186.2z}
                 svg{M108.9,79.1h41.6c39.6,0,57,28.3,57,53.6c0,27.5-21.5,53.6-56.8,53.6h-41.8V79.1z M124.3,172.4h24.5c34.9,0,42.9-26.5,42.9-39.7c0-21.5-13.7-39.7-43.7-39.7h-23.7V172.4z}
                 svg{M88.7,56.8c0,5.5-4.5,10.1-10.1,10.1c-5.6,0-10.1-4.6-10.1-10.1c0-5.6,4.5-10.1,10.1-10.1C84.2,46.7,88.7,51.3,88.7,56.8z};
  }
}

\newcommand{\@OrigHeightRecip}{0.00390625}

%% We will compute the current X height to make the logo the right height
\newlength{\@curXheight}

%    \end{macrocode}
%
% \begin{macro}{\orcidlink}
%    \begin{macrocode}
\DeclareRobustCommand\orcid[1]{%
\texorpdfstring{%
%%\setlength{\@curXheight}{\fontcharht\font`X}%
\@curXheight10pt%%%2\@curXheight%%!!
\href{https://orcid.org/#1}{%
\rlap{\textcolor{white}{\resizebox{\@curXheight}{\@curXheight}{A}}}%
\XeTeXLinkBox{\mbox{%
\begin{tikzpicture}[yscale=-\@OrigHeightRecip*\@curXheight,
xscale=\@OrigHeightRecip*\@curXheight,transform shape]
\pic{orcidlogo};
\end{tikzpicture}%
}}}}{}}

%%%for hyperref after 2023/10
\def\Hy@PageAnchorSlidesPlain{}%
\def\Hy@PageAnchorSlide{}%


\endinput

%%
%%End of file `elex.cls'.
%%