%%
%% This is file `attinormativi.cls',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% attinormativi.dtx  (with options: `class')
%% 
%% attinormativi.cls
%% ------------------------------------------------------------------
%% LaTeX class for Italian normative acts.
%% Classe LaTeX per la composizione di atti normativi italiani.
%% 
%% Version 1.2  --  2026/05/25
%% 
%% Copyright (C) 2026 Federico Gallo <gallofede75@gmail.com>
%% 
%% This work may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.3c of this license
%% or (at your option) any later version.
%% The latest version of this license is at:
%%   https://www.latex-project.org/lppl.txt
%% This work has the LPPL maintenance status `maintained'.
%% The Current Maintainer of this work is Federico Gallo.
%% 
%% This file is generated from attinormativi.dtx.
%% Do NOT edit this file directly; edit attinormativi.dtx instead.
%% ------------------------------------------------------------------
%% 


\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{attinormativi}[2026/05/25 v1.2 Classe per atti normativi italiani]

\def\ANclassversion{v1.2 (2026/05/25)}


\newif\ifAN@bozza
\AN@bozzafalse
\newif\ifANbozza
\ANbozzafalse
\DeclareOption{bozza}{\AN@bozzatrue\ANbozzatrue}

\newif\ifAN@accessible
\AN@accessiblefalse
\newif\ifANaccessible
\ANaccessiblefalse
\DeclareOption{accessible}{\AN@accessibletrue\ANaccessibletrue}

\newif\ifAN@sansserif
\AN@sansseriffalse
\DeclareOption{sansserif}{\AN@sansseriftrue}
\DeclareOption{sanserif}{\AN@sansseriftrue}  % alias tollerante (un solo 's')
\DeclareOption{serif}{}

\newif\ifAN@duplex
\AN@duplexfalse
\DeclareOption{duplex} {\AN@duplextrue}
\DeclareOption{simplex}{\AN@duplexfalse}
\DeclareOption{twoside}{\AN@duplextrue}
\DeclareOption{oneside}{\AN@duplexfalse}

\def\AN@margin@left  {35mm}
\def\AN@margin@right {30mm}
\def\AN@margin@top   {25mm}
\def\AN@margin@bottom{25mm}

\def\AN@str@left  {left}
\def\AN@str@right {right}
\def\AN@str@top   {top}
\def\AN@str@bottom{bottom}

\def\AN@parseMarginOption#1=#2\relax{%
  \def\AN@optkey{#1}%
  \def\AN@optval{#2}%
  \ifx\AN@optval\empty
    \PassOptionsToClass{\AN@currentopt}{book}%
  \else
    \ifx\AN@optkey\AN@str@left   \edef\AN@margin@left  {\AN@optval}\else
    \ifx\AN@optkey\AN@str@right  \edef\AN@margin@right {\AN@optval}\else
    \ifx\AN@optkey\AN@str@top    \edef\AN@margin@top   {\AN@optval}\else
    \ifx\AN@optkey\AN@str@bottom \edef\AN@margin@bottom{\AN@optval}\else
      \PassOptionsToClass{\AN@currentopt}{book}%
    \fi\fi\fi\fi
  \fi
}

\DeclareOption*{%
  \edef\AN@currentopt{\CurrentOption}%
  \expandafter\AN@parseMarginOption\AN@currentopt=\relax\relax
}

\ProcessOptions\relax

\ifAN@duplex
  \LoadClass[twoside,openright]{book}
\else
  \LoadClass[oneside,openany]{book}
\fi

\RequirePackage{iftex}


\ifPDFTeX
  \RequirePackage[utf8]{inputenc}
  \RequirePackage[T1]{fontenc}
  \ifAN@sansserif
    \RequirePackage{tgheros}
    \RequirePackage{tgcursor}
    \renewcommand{\familydefault}{\sfdefault}
  \else
    \RequirePackage{tgtermes}
    \RequirePackage[scale=0.92]{tgheros}
    \RequirePackage{tgcursor}
  \fi
\else
  \RequirePackage{fontspec}
  \ifAN@sansserif
    \setmainfont{TeX Gyre Heros}
    \setsansfont{TeX Gyre Heros}
    \setmonofont{TeX Gyre Cursor}
  \else
    \setmainfont{TeX Gyre Termes}
    \setsansfont[Scale=0.92]{TeX Gyre Heros}
    \setmonofont{TeX Gyre Cursor}
  \fi
\fi


\RequirePackage{geometry}
\ifAN@duplex
  \geometry{
    a4paper,
    twoside,
    top    = \AN@margin@top,
    bottom = \AN@margin@bottom,
    inner  = \AN@margin@left,
    outer  = \AN@margin@right
  }
\else
  \geometry{
    a4paper,
    top    = \AN@margin@top,
    bottom = \AN@margin@bottom,
    left   = \AN@margin@left,
    right  = \AN@margin@right
  }
\fi


\RequirePackage[italian]{babel}
\RequirePackage{microtype}


\RequirePackage{xcolor}

\@ifpackagelater{LaTeX}{2020/10/01}{}{%
  \RequirePackage{xparse}%
}

\RequirePackage{titlesec}
\RequirePackage{chngcntr}
\RequirePackage{enumitem}
\RequirePackage{hyperref}

\ifAN@accessible
  % Controllo 1: motore LuaLaTeX
  \ifLuaTeX\else
    \ClassWarning{attinormativi}{%
      L'opzione `accessible' richiede LuaLaTeX.\MessageBreak
      Con il motore corrente il tagging PDF/UA non verra' attivato.%
    }%
    \AN@accessiblefalse
    \ANaccessiblefalse
  \fi
\fi

\ifAN@accessible
  % Controllo 2: DocumentMetadata dichiarato
  \@ifundefined{document@metadata}{%
    \ClassWarning{attinormativi}{%
      L'opzione `accessible' richiede \string\DocumentMetadata\space
      prima di \string\documentclass.\MessageBreak
      Aggiungere nel file .tex, prima di \string\documentclass:\MessageBreak
      \space\space\string\DocumentMetadata\string{pdfstandard=UA-1,
      lang=it-IT\string}\MessageBreak
      Il tagging PDF/UA non verra' attivato.%
    }%
    \AN@accessiblefalse
    \ANaccessiblefalse
  }{}%
\fi

\ifAN@accessible
  \RequirePackage{tagpdf}%
\fi

\AtBeginDocument{\emergencystretch=2em}

\setcounter{secnumdepth}{6}
\setcounter{tocdepth}{3}

\hypersetup{
  colorlinks = true,
  linkcolor  = black,
  citecolor  = black,
  urlcolor   = black,
  pdfborder  = {0 0 0}
}

\newcounter{ANnotaredaz}

\NewDocumentCommand{\notaredaz}{+m}{%
  \ifAN@bozza
    \refstepcounter{ANnotaredaz}%
    \par\smallskip
    \noindent
    \ifAN@accessible
      \tagmcbegin{tag=Artifact}%
    \fi
    \fbox{%
      \begin{minipage}{0.96\linewidth}
        \small
        \textbf{Nota redazionale \theANnotaredaz.} #1
      \end{minipage}%
    }%
    \ifAN@accessible
      \tagmcend
    \fi
    \par\smallskip
  \fi
}

\NewDocumentCommand{\notaredazinline}{+m}{%
  \ifAN@bozza
    \ifAN@accessible
      \tagmcbegin{tag=Artifact}%
    \fi
    \textcolor{red}{[\textbf{Nota redazionale:} #1]}%
    \ifAN@accessible
      \tagmcend
    \fi
  \fi
}

\NewDocumentCommand{\bozzainfo}{}{%
  \ifAN@bozza
    \ifAN@accessible
      \tagmcbegin{tag=Artifact}%
    \fi
    \begin{center}
      \fbox{%
        \begin{minipage}{0.85\linewidth}
          \centering
          \textbf{VERSIONE DI BOZZA}\\
          Documento compilato il \today.\\
          Le note redazionali sono visibili solo in modalit\`a bozza.
        \end{minipage}%
      }
    \end{center}
    \ifAN@accessible
      \tagmcend
    \fi
    \newpage
  \fi
}

\newcommand*{\ANLibroName}{Libro}
\newcommand*{\ANTitoloName}{Titolo}
\newcommand*{\ANCapoName}{Capo}
\newcommand*{\ANSezioneName}{Sezione}
\newcommand*{\ANArticoloName}{Articolo}
\newcommand*{\ANCommaName}{Comma}

\addto\captionsitalian{%
  \renewcommand*{\partname}{\ANLibroName}%
  \renewcommand*{\chaptername}{\ANTitoloName}%
}

\newcommand*{\ANtipoatto}{}
\newcommand*{\ANnumeroatto}{}
\newcommand*{\ANdataatto}{}
\newcommand*{\ANautoritaatto}{}
\newcommand*{\ANtitoloatto}{}
\newcommand*{\ANoggettoatto}{}

\NewDocumentCommand{\tipoatto}    {m}{\renewcommand*{\ANtipoatto}{#1}}
\NewDocumentCommand{\numeroatto}  {m}{\renewcommand*{\ANnumeroatto}{#1}}
\NewDocumentCommand{\dataatto}    {m}{\renewcommand*{\ANdataatto}{#1}}
\NewDocumentCommand{\autoritaatto}{m}{\renewcommand*{\ANautoritaatto}{#1}}
\NewDocumentCommand{\titoloatto}  {m}{\renewcommand*{\ANtitoloatto}{#1}}
\NewDocumentCommand{\oggettoatto} {m}{\renewcommand*{\ANoggettoatto}{#1}}

\NewDocumentCommand{\frontespizioatto}{}{%
  \begin{titlepage}
  \centering
  \vspace*{2cm}
  \ifx\ANautoritaatto\empty\else
    \ifAN@accessible
      \tagstructbegin{tag=P}%
      {\Large \ANautoritaatto\par}%
      \tagstructend
    \else
      {\Large \ANautoritaatto\par}%
    \fi
    \vspace{2cm}%
  \fi
  \ifx\ANtipoatto\empty\else
    \ifAN@accessible
      \tagstructbegin{tag=P}%
      {\huge\bfseries \ANtipoatto\par}%
      \tagstructend
    \else
      {\huge\bfseries \ANtipoatto\par}%
    \fi
    \vspace{0.5cm}%
  \fi
  \ifx\ANnumeroatto\empty\else
    \ifAN@accessible
      \tagstructbegin{tag=P}%
      {\Large n.~\ANnumeroatto\par}%
      \tagstructend
    \else
      {\Large n.~\ANnumeroatto\par}%
    \fi
    \vspace{0.5cm}%
  \fi
  \ifx\ANdataatto\empty\else
    \ifAN@accessible
      \tagstructbegin{tag=P}%
      {\large \ANdataatto\par}%
      \tagstructend
    \else
      {\large \ANdataatto\par}%
    \fi
    \vspace{2cm}%
  \fi
  \ifx\ANtitoloatto\empty\else
    \ifAN@accessible
      % Il titolo ufficiale dell'atto riceve ruolo Title in PDF/UA
      \tagstructbegin{tag=Title}%
      {\LARGE\bfseries \ANtitoloatto\par}%
      \tagstructend
    \else
      {\LARGE\bfseries \ANtitoloatto\par}%
    \fi
    \vspace{1.5cm}%
  \fi
  \ifx\ANoggettoatto\empty\else
    \begin{minipage}{0.82\textwidth}
      \centering
      \ifAN@accessible
        \tagstructbegin{tag=P}%
        {\large \ANoggettoatto}%
        \tagstructend
      \else
        {\large \ANoggettoatto}%
      \fi
    \end{minipage}%
  \fi
  \vfill
  \end{titlepage}
}

\let\maketitle\frontespizioatto

\renewcommand*{\thepart}{\Roman{part}}
\renewcommand*{\thechapter}{\Roman{chapter}}
\renewcommand*{\thesection}{\Roman{section}}
\renewcommand*{\thesubsection}{\Roman{subsection}}

\counterwithout{subsubsection}{subsection}
\renewcommand*{\thesubsubsection}{\arabic{subsubsection}}

\counterwithin*{paragraph}{subsubsection}
\renewcommand*{\theparagraph}{\arabic{paragraph}}

\newcounter{articoloecomma}
\renewcommand*{\thearticoloecomma}{art.~\thesubsubsection, c.~\theparagraph}

\titleformat{\part}[display]
  {\normalfont\Huge\bfseries\centering}
  {\ANLibroName~\thepart}{1ex}{}

\titleformat{\chapter}[display]
  {\normalfont\huge\bfseries\centering}
  {\ANTitoloName~\thechapter}{1ex}{}

\titleformat{\section}[display]
  {\normalfont\Large\bfseries\centering}
  {\ANCapoName~\thesection}{1ex}{}

\titleformat{\subsection}[display]
  {\normalfont\large\bfseries\centering}
  {\ANSezioneName~\thesubsection}{1ex}{}

\titleformat{\subsubsection}[display]
  {\normalfont\normalsize\bfseries\centering}
  {\ANArticoloName~\thesubsubsection}{0.5ex}{\itshape}

\titleformat{\paragraph}[runin]
  {\normalfont\normalsize}
  {\theparagraph.}{0pt}{}

\titlespacing*{\part}         {0pt}{0pt}{4ex}
\titlespacing*{\chapter}      {0pt}{2ex plus 1ex minus .2ex}{3ex}
\titlespacing*{\section}      {0pt}{2.5ex plus 1ex minus .2ex}{1.5ex}
\titlespacing*{\subsection}   {0pt}{2ex plus 1ex minus .2ex}{1ex}
\titlespacing*{\subsubsection}{0pt}{2ex plus 1ex minus .2ex}{1ex}
\titlespacing*{\paragraph}    {0pt}{0.6ex plus .2ex minus .1ex}{0.75em}

\AtBeginDocument{%
  \ifAN@accessible
    \tagpdfsetup{%
      add-new-tag = {part/H1},%
      add-new-tag = {chapter/H2},%
      add-new-tag = {section/H3},%
      add-new-tag = {subsection/H4},%
      add-new-tag = {subsubsection/H5},%
    }%
  \fi
}

\newcommand*{\artref}[1]{art.~\ref{#1}}
\newcommand*{\commaref}[1]{comma~\ref{#1}}
\newcommand*{\artcommaref}[1]{\ref{a+c:#1}}
\newcommand*{\articoloeref}[1]{articolo~\ref{#1}}
\newcommand*{\commaeref}[1]{comma~\ref{#1}}
\newcommand*{\artcomma}[2]{art.~\ref{#1}, comma~\ref{#2}}
\newcommand*{\articolocomma}[2]{articolo~\ref{#1}, comma~\ref{#2}}

\AtBeginDocument{%
  \@ifpackageloaded{cleveref}{%
    \crefname  {part}          {libro}      {libri}
    \Crefname  {part}          {Libro}      {Libri}
    \crefname  {chapter}       {titolo}     {titoli}
    \Crefname  {chapter}       {Titolo}     {Titoli}
    \crefname  {section}       {capo}       {capi}
    \Crefname  {section}       {Capo}       {Capi}
    \crefname  {subsection}    {sezione}    {sezioni}
    \Crefname  {subsection}    {Sezione}    {Sezioni}
    \crefname  {subsubsection} {articolo}   {articoli}
    \Crefname  {subsubsection} {Articolo}   {Articoli}
    \crefname  {paragraph}     {comma}      {commi}
    \Crefname  {paragraph}     {Comma}      {Commi}
    \crefname  {articoloecomma}{comma}      {commi}
    \Crefname  {articoloecomma}{Comma}      {Commi}
    \crefname  {ANdefinizione} {definizione}{definizioni}
    \Crefname  {ANdefinizione} {Definizione}{Definizioni}
    \crefname  {ANallegato}    {allegato}   {allegati}
    \Crefname  {ANallegato}    {Allegato}   {Allegati}
  }{}%
}
\NewDocumentCommand{\AN@emit}{m m m m m}{%
  \IfNoValueTF{#3}
    {%
      #1{#4}%
      \IfNoValueF{#5}{\label{#5}}%
    }
    {%
      \begingroup
        % Salva il valore del contatore PRIMA dell'incremento automatico
        % che il comando strutturale eseguirà globalmente.
        % Il ripristino finale riporta il contatore a questo valore,
        % garantendo la corretta progressione automatica successiva.
        \edef\AN@saved@counter{\the\value{#2}}%
        \expandafter\renewcommand\csname the#2\endcsname{#3}%
        #1{#4}%
        \IfNoValueF{#5}{\label{#5}}%
        \setcounter{#2}{\AN@saved@counter}%
      \endgroup
    }%
}

\NewDocumentCommand{\libro}  {o m o}{\AN@emit{\part}       {part}       {#1}{#2}{#3}}
\NewDocumentCommand{\titolo} {o m o}{\AN@emit{\chapter}    {chapter}    {#1}{#2}{#3}}
\NewDocumentCommand{\capo}   {o m o}{\AN@emit{\section}    {section}    {#1}{#2}{#3}}
\NewDocumentCommand{\sezione}{o m o}{\AN@emit{\subsection} {subsection} {#1}{#2}{#3}}

\NewDocumentCommand{\articolo}{o m o}{%
  \AN@emit{\subsubsection}{subsubsection}{#1}{#2}{#3}%
  \IfNoValueTF{#1}
    {\ANaddarticleindex{\thesubsubsection}{#2}}
    {\ANaddarticleindex{#1}{#2}}%
}

\NewDocumentCommand{\comma}{o +m o}{%
  \IfNoValueTF{#1}
    {%
      \ifAN@accessible
        \paragraph{}%
        \tagstructbegin{tag=P}%
        #2%
        \tagstructend
        \par
      \else
        \paragraph{}#2\par
      \fi
      \IfNoValueF{#3}{%
        \label{#3}%
        \refstepcounter{articoloecomma}%
        \label{a+c:#3}%
      }%
    }
    {%
      \begingroup
        \edef\AN@saved@para{\the\value{paragraph}}%
        \renewcommand*{\theparagraph}{#1}%
        \ifAN@accessible
          \paragraph{}%
          \tagstructbegin{tag=P}%
          #2%
          \tagstructend
          \par
        \else
          \paragraph{}#2\par
        \fi
        \IfNoValueF{#3}{%
          \label{#3}%
          \refstepcounter{articoloecomma}%
          \label{a+c:#3}%
        }%
        \setcounter{paragraph}{\AN@saved@para}%
      \endgroup
    }%
}

\newlist{lettere}{enumerate}{1}
\setlist[lettere]{
  label      = \alph*),
  ref        = \alph*),
  leftmargin = 2.5em,
  itemsep    = 0.2ex,
  topsep     = 0.5ex
}

\newlist{numeri}{enumerate}{1}
\setlist[numeri]{
  label      = \arabic*),
  ref        = \arabic*),
  leftmargin = 2.5em,
  itemsep    = 0.2ex,
  topsep     = 0.5ex
}

\AtBeginDocument{%
  \ifAN@accessible
    \@ifpackageloaded{tagpdf}{%
      \SetEnumitemValue{list-type}{lettere}{OL}%
      \SetEnumitemValue{list-type}{numeri} {OL}%
    }{}%
  \fi
}

\newcounter{ANdefinizione}
\renewcommand*{\theANdefinizione}{\alph{ANdefinizione}}
\newcommand*{\ANDefinizioneName}{Definizione}

\NewDocumentCommand{\indicedefinizioni}{}{%
  \chapter*{Indice delle definizioni}%
  \markboth{Indice delle definizioni}{Indice delle definizioni}%
  \addcontentsline{toc}{chapter}{Indice delle definizioni}%
  \ifAN@accessible
    \tagstructbegin{tag=TOC}%
    \@starttoc{dfn}%
    \tagstructend
  \else
    \@starttoc{dfn}%
  \fi
}

\newcommand*{\l@ANdefinizione}{\@dottedtocline{1}{0pt}{0em}}
\newcommand*{\ANadddefinitionindex}[1]{\addcontentsline{dfn}{ANdefinizione}{#1}}

\NewDocumentEnvironment{definizioni}{}
  {%
    \ifAN@accessible
      \tagstructbegin{tag=DL}%
    \fi
    \begin{list}{}{%
      \setlength{\leftmargin}{2.5em}%
      \setlength{\labelwidth}{2em}%
      \setlength{\labelsep}{0.75em}%
      \setlength{\itemsep}{0.4ex}%
      \setlength{\topsep}{0.6ex}%
    }%
    \setcounter{ANdefinizione}{0}%
  }
  {%
    \end{list}%
    \ifAN@accessible
      \tagstructend
    \fi
  }

\NewDocumentCommand{\definizione}{m +m o}{%
  \refstepcounter{ANdefinizione}%
  \protected@edef\@currentlabelname{#1}%
  \ifAN@accessible
    \item[%
      \tagstructbegin{tag=DT}%
      \textbf{\theANdefinizione)}%
      \tagstructend
    ]%
    \tagstructbegin{tag=DD}%
    \textbf{#1}: #2%
    \tagstructend
  \else
    \item[\textbf{\theANdefinizione)}]\textbf{#1}: #2%
  \fi
  \ANadddefinitionindex{#1}%
  \IfNoValueF{#3}{\label{#3}}%
}

\newcommand*{\definizioneref}[1]{\emph{\nameref{#1}}}
\newcommand*{\defref}[1]{\definizioneref{#1}}

\NewDocumentEnvironment{preambolo}{+b}
  {%
    \ifAN@accessible\tagstructbegin{tag=Sect}\fi
    \chapter*{Preambolo}%
    \addcontentsline{toc}{chapter}{Preambolo}%
    #1%
  }
  {\ifAN@accessible\tagstructend\fi}

\NewDocumentEnvironment{relazione}{+b}
  {%
    \ifAN@accessible\tagstructbegin{tag=Sect}\fi
    \chapter*{Relazione illustrativa}%
    \addcontentsline{toc}{chapter}{Relazione illustrativa}%
    #1%
  }
  {\ifAN@accessible\tagstructend\fi}

\NewDocumentCommand{\AN@articoloFisso}{m m +m m}{%
  \IfNoValueTF{#2}
    {%
      \IfNoValueTF{#4}{\articolo{#1}}{\articolo{#1}[#4]}%
    }
    {%
      \IfNoValueTF{#4}{\articolo[#2]{#1}}{\articolo[#2]{#1}[#4]}%
    }%
  \comma{#3}%
}

\NewDocumentCommand{\entrataInVigore} {o +m o}{\AN@articoloFisso{Entrata in vigore}{#1}{#2}{#3}}
\NewDocumentCommand{\abrogazioni}     {o +m o}{\AN@articoloFisso{Abrogazioni}{#1}{#2}{#3}}
\NewDocumentCommand{\normatransitoria}{o +m o}{\AN@articoloFisso{Norma transitoria}{#1}{#2}{#3}}

\newcounter{ANallegato}
\renewcommand*{\theANallegato}{\Alph{ANallegato}}
\newcommand*{\ANAllegatoName}{Allegato}
\newcommand*{\allegatoref}[1]{\ANAllegatoName~\ref{#1}}

\NewDocumentCommand{\indiceallegati}{}{%
  \chapter*{Indice degli allegati}%
  \markboth{Indice degli allegati}{Indice degli allegati}%
  \addcontentsline{toc}{chapter}{Indice degli allegati}%
  \ifAN@accessible
    \tagstructbegin{tag=TOC}%
    \@starttoc{alg}%
    \tagstructend
  \else
    \@starttoc{alg}%
  \fi
}

\newcommand*{\l@ANallegato}{\@dottedtocline{1}{0pt}{10.5em}}

\newcommand*{\ANaddattachmentindex}[2]{%
  \addcontentsline{alg}{ANallegato}{\protect\numberline{\ANAllegatoName~#1}#2}%
}

\NewDocumentCommand{\ANallegatoheading}{m m o}{%
  \clearpage\phantomsection
  \ifAN@accessible
    \tagstructbegin{tag=Sect}%
    \tagstructbegin{tag=Caption}%
    \chapter*{\ANAllegatoName~#1\\[0.5ex]\large #2}%
    \tagstructend
  \else
    \chapter*{\ANAllegatoName~#1\\[0.5ex]\large #2}%
  \fi
  \markboth{\ANAllegatoName~#1}{#2}%
  \addcontentsline{toc}{chapter}{\ANAllegatoName~#1 -- #2}%
  \ANaddattachmentindex{#1}{#2}%
  \IfNoValueF{#3}{\label{#3}}%
  \vspace{1em}%
}

\NewDocumentCommand{\allegato}{o m o}{%
  \IfNoValueTF{#1}
    {%
      \refstepcounter{ANallegato}%
      \IfNoValueTF{#3}
        {\ANallegatoheading{\theANallegato}{#2}}
        {\ANallegatoheading{\theANallegato}{#2}[#3]}%
    }
    {%
      \begingroup
        \renewcommand*{\theANallegato}{#1}%
        \refstepcounter{ANallegato}%
        \IfNoValueTF{#3}
          {\ANallegatoheading{#1}{#2}}
          {\ANallegatoheading{#1}{#2}[#3]}%
      \endgroup
    }%
  \ifAN@accessible\tagstructend\fi
}

\NewDocumentCommand{\indicearticoli}{}{%
  \chapter*{Indice degli articoli}%
  \markboth{Indice degli articoli}{Indice degli articoli}%
  \addcontentsline{toc}{chapter}{Indice degli articoli}%
  \ifAN@accessible
    \tagstructbegin{tag=TOC}%
    \@starttoc{art}%
    \tagstructend
  \else
    \@starttoc{art}%
  \fi
}

\newcommand*{\l@ANarticolo}{\@dottedtocline{1}{0pt}{8.5em}}

\newcommand*{\ANaddarticleindex}[2]{%
  \addcontentsline{art}{ANarticolo}{\protect\numberline{\ANArticoloName~#1}#2}%
}

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