egreg9″ post=67022
[quote=”egreg9″ post=66986]\ifx\protect\typeset@protect
Ciao
EnricoCiao Enrico, grazie.
Non ho capito, a me quel test risulta sempre falso. 😕
Come devo scrivere?
Uhm. Non va, in effetti. Temo che non ci sia molto da fare, al riguardo. Come saprai, i titoli delle sezioni sono usati anche per le testatine e l’indice, quindi è piuttosto difficile distinguere i significati di \ac. Piuttosto, lo neutralizzerei durante la composizione dell’indice e delle testatine.
Ciao
Enrico[/quote]
Aspetta un attimo, stavo leggendo i tuoi Appunti: 🙂 hai dimenticato un ‘@’?
Così sembra andare:
`\documentclass{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage{textcase,relsize,titlesec}
\makeatletter
\titleformat{\chapter}[hang]
{\normalfont\Large\sffamily}
{\normalfont\Large\scshape\sffamily\thechapter}
{\marginparsep}{\scshape\MakeTextUppercase}
\titleformat{\section}[hang]
{\normalfont\Large\sffamily}
{\normalfont\Large\scshape\sffamily\thesection}
{\marginparsep}{\scshape\MakeTextLowercase}
\let\old@l@chapter\l@chapter
\renewcommand\l@chapter[2]{\old@l@chapter{\scshape\MakeTextUppercase{#1}}{#2}}
\let\old@l@section\l@section
\renewcommand\l@section[2]{\old@l@section{\scshape\MakeTextLowercase{#1}}{#2}}
\newcommand\ac{%
\ifx\protect\@typeset@protect
\ifx\NoCaseChange\@firstofone
\expandafter\textsmaller
\else
\expandafter\@firstofone
\fi
\else
\expandafter\@firstofone
\fi}
\makeatother
\begin{document}
\tableofcontents
\chapter{Logica \ac{BAN}}
Questo capitolo presenta la logica \ac{BAN}…
\section{Particolarità \ac{BAN}}
Questo paragrafo…
\end{document}`
In un modo o nell’altro sei sempre tu a dare soluzioni 🙂 Grazie!
Ciao,
Antonio