::
c_iannone” post=117211Buongiorno.
Dovrei redarre un testo normativo strutturato come segue:
• Capo I
◦ Sezione I
▪ Art. 1
▪ Art. 2
▪ Art. 3
◦ Sezione II
▪ Art. 4
▪ Art. 5
▪ Art. 6
• Capo II
◦ Sezione I
▪ Art. 7
▪ Art. 8
Volevo usare, rispettivamente chapter, section e subsection appositamente formattate
Esiste un modo affinché la numerazione automatica di subsection sia consecutiva e non si azzeri quando cambia il livello superiore.
Spero di essere stato sufficientemente chiaro.
Ovviamente, sono aperto a soluzioni completamente diverse da quella prospettata.
Grazie a tutti
Ciao c_iannone.
Un po’ di tempo fa avevo fatto così:
`\newcount\arti
\let\oldsubsection\subsection
\renewcommand\subsection[1]{%
\advance\arti by 1\relax\oldsubsection{#1}
}
\renewcommand\thepart {\Ordinalef{part}}
\makeatletter
\renewcommand\thechapter {\@arabic\c@chapter}
\renewcommand\thesection {\@arabic\c@section}
\renewcommand{\thesubsection}{\@arabic\the\arti}
\makeatother
\titlelabel{\thetitle\quad}
% Parte
\titleformat{\part}[display]
{\centering\LARGE\bfseries}
{\filcenter Parte \thepart{}}
{2mm}{\LARGE}[]
% Titolo
\titleformat{\chapter}[hang]
{\centering\Large\bfseries}
{\filcenter Titolo \thechapter{}\hspace{2mm}—}
{2mm}{\Large}[]
% Capo
\titleformat{\section}[hang]
{\centering\Large\bfseries}
{\filcenter Capo \thesection{} —}
{2mm}{\Large}[]
% articoli
\titleformat{\subsection}[hang]
{\bfseries}
{\indent Articolo \thesubsection{} —}
{1.5mm}{}
\makeatletter
\renewcommand\labelenumii{\theenumii)}
\renewcommand\p@enumii{}
\makeatother
% Parte
\titlecontents{part}[3.8ex]
{\vspace*{3ex}\Large\textbf{Parte \contentslabel{4ex}}}
{}
{\bfseries}
{\titlerule*[1ex]{.}\contentspage}
% Titolo
\titlecontents{chapter}[3.8ex]
{\vspace*{2.5ex}\Large\textbf{Titolo \contentslabel{0.25ex}}}
{\hspace{2.8ex}}
{\bfseries}
{\titlerule*[1ex]{.}\contentspage}[\vspace*{2ex}]
% Capo
\titlecontents{section}[3.8ex]
{\vspace*{3.5ex}\large\textbf{Capo \contentslabel{0.25ex}}}
{\hspace{2.8ex}}
{}
{\titlerule*[1ex]{.}\contentspage}[\vspace*{1ex}]
% Articolo
\titlecontents{subsection}[10.2ex]
{\filright\large Art. \contentslabel{0ex}}
{\hspace{3.8ex}}
{}
{\titlerule*[1ex]{.}\contentspage}
\titlespacing{\section}{0pt}{50pt}{20pt}
\titlespacing{\subsection}{0pt}{20pt}{10pt}`
con i pacchetti:
`\usepackage{titlesec}
\usepackage{titletoc}
\usepackage{itnumpar}`
Ovvio che è un codice forse scritto male ma dovrebbe funzionare.
Poi nel testo inserivo i riferimenti agli articoli e dei commi e lettere e non direttamente il numero. Così se ti cambia l’ordine di questi elementi oppure ne aggiungi di nuovi la numerazione è ricalcolata da latex in automatico.
Oggi farei diversamente, perché proverei una soluzione più pratica per l’etichettatura di articoli/commi/lettere, probabilmente con qualche codice Lua in LuaLaTeX.
Saluti.
R.
Ps. non ho compilato il codice quindi ci potrebbero essere delle rifiniture da fare.