Bé, ecco il mio luuuuuungo preambolo:
`
\documentclass[a4paper,%
11pt,%
openright,%
notoccite,% per far funzionare minitoc
tight,% per far funzionare minitoc
]{scrbook}
\hfuzz20pt % Don't report over-full v-boxes if over-edge is < 20pt
\setlength{\headheight}{20.4pt} % Per evitare lo warning quando uso fancy
\input{P_pacchetti}
\input{P_interlinea}
\input{P_fancy}
\input{P_comandi}
\input{P_teoremi}
\input{P_indici}
\graphicspath{{immaginiPDF/}{immaginiEPS/}}
%.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·
% ===== INIZIO DOCUMENTO =====
%.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·
\begin{document}
\end{document}
`
p_pacchetti
`
\usepackage{ifpdf}
\usepackage{srcltx}
%=================================================================
%------- Standard
%
\usepackage[italian]{babel} %,french
\usepackage[italian]{varioref} %[french]
\usepackage{version} % per usare \begin{comment}...\end{comment}
%=================================================================
%------- Layout, intestazioni, capilettera
%
\usepackage{lettrine} % Capilettera, al posto di \cappar
\usepackage{fancyhdr}
\usepackage{fancybox}
\usepackage{fncylab}
\usepackage{indentfirst} %
\usepackage[big,binding=1.3cm]{layaureo}
\usepackage{natbib} % Cross-reference package (Natural BiB)
\bibpunct{[}{]}{}{n}{}{}
\usepackage{appendix} %
\usepackage{titlesec} %
\titleformat{\chapter}[display]
{\bfseries\large\scshape}
{\filleft\sffamily\color{Brown}\MakeUppercase{\chaptertitlename} \Huge\thechapter}
{4ex}
{\titlerule[1pt]%
\vspace{1pt}%
\color{Brown}\titlerule
\vspace{2ex}%
\filcenter\huge\color{Brown}}
[\vspace{1pc}%
{\color{Brown}\titlerule}]
\titleformat{\section}[frame]
{\normalfont}
{\filright
%\footnotesize
\enspace \textsc{\color{Brown} Sezione} \thesection \filleft\enspace}
{10 pt}
{\color{Brown}\large\bfseries\sffamily\filright}
\titleformat{\subsection}[frame]
{\normalfont}
{\enspace\footnotesize
\thesubsection \filright\enspace}
{3 pt}
{\color{Brown}\bfseries\sffamily\filright}
\titleformat{\subsubsection}[block]
{\bf\itshape\large\color{Brown}}
{\thesubsubsection. }{.5em}{}
[\vspace{.1ex}%
{\color{Brown}\titlerule}]
\titleformat{\paragraph}[block]
{\bfseries\itshape\color{Brown}}
{\theparagraph.}{}{}
%=================================================================
%------- Grafica, colori, figure, tabelle, sottolineature...
%
\usepackage[dvips,final]{graphicx} %
\usepackage[dvipsnames]{xcolor} %usenames,
\usepackage{subfigure}
\usepackage[section]{placeins} % per usare FloatBarrier
\usepackage{longtable}
\usepackage[hang, bf]{caption}
\setlength{\captionmargin}{20pt}
\usepackage{tabls}
\usepackage[normalem]{ulem} % vedi latex4wp.pdf
%=================================================================
%------- Font
%
\usepackage[latin1]{inputenc} %
\usepackage[T1]{fontenc} %
\usepackage{lmodern,textcomp}
\usepackage{pifont} % per usare \ding
%Sostituite: \usepackage{times} con i 3 seguenti
\usepackage[sc,osf,noBBpl,slantedGreek]{mathpazo}
\usepackage[scaled=.92]{helvet} %
\usepackage{courier} %
%=================================================================
%------- Matematica
%
\usepackage[centertags]{amsmath} %
%\usepackage{amsthm} % non è compatibile con ntheorem ma da lui conglobato
\usepackage{amssymb} % lettere matematiche in grassetto
\usepackage{amsfonts} %
\usepackage{latexsym} % per alcune lettere greche ecc...
\usepackage{nicefrac} %
\usepackage{array} %
\newcolumntype{M}{>{$}c<{$}} % pag 288 "latex par la pratique"
\newcolumntype{S}{>{$}l<{$}} % pag 288 "latex par la pratique"
\usepackage{delarray} % evita di mettere \left e \right (richiede array)
\usepackage{braket} % per usare \[ \Set{...} \] Vedi Mathmode.pdf
\usepackage{cancel}
\usepackage[amsmath,thmmarks,amsthm,framed,thref,hyperref]{ntheorem}
\usepackage{cases}
%=================================================================
%------- Varie
%
\ifpdf \usepackage{pdfpages} \fi
\usepackage{lscape}
\usepackage[squaren,Gray,italian,textstyle,derivedinbase,cdot]{SIunits}
\usepackage{enumerate} %
\usepackage{mdwlist} % per usare \resume{enumerate} e \suspend{...}
\usepackage{framed}
\newcommand{\scat}[1]{%
\begin{minipage}{\textwidth}%
#1%
\end{minipage}%
}
\usepackage{listings}
\lstset{ %
numbers=left, %
numberstyle=\tiny, %
stepnumber=1, %
numbersep=10pt, %
language=Matlab, %
numberblanklines=false, %true, %
xleftmargin=10pt, %
xrightmargin=20pt, %
backgroundcolor=\color{Melon}, %
basicstyle=\ttfamily, %
%captionpos=b %
}
\renewcommand{\lstlistingname}{File}
\usepackage[pagebackref=true]{hyperref}
\hypersetup{ % Descrizione del pdf - da Acrobat premete CTRL-D
% l'opzione [pagebackref] permet d'avoir dans la bibliographie les pages dove sono cité les références
colorlinks=true,
linkcolor=red,
anchorcolor=black,
filecolor=magenta,
menucolor=red,
pagecolor=cyan,
urlcolor=blue,
hyperindex=true,
bookmarks=true,
bookmarksnumbered=true,
bookmarksopen=false,
bookmarkstype=toc,
pdfkeywords={Ecoulements diphasiques, multiphase flows, interface problems, real fluids},
pdfauthor={Gloria Faccanoni
pdftitle={PhD Thesis},
pdfsubject={Ecoulements diphasiques},
pdfpagemode=UseThumbs, %None, UseThumbs, UseOutlines, FullScreen
pdfstartview=FitH,
pdfcenterwindow=true,
pdfmenubar=true,
pdfpagelayout=TwoColumnRight
}
`
P_interlinea
`
% variare, con moderazione, alcuni dei parametri che intervengono nel calcolo svolto da
% TEX al fine di decidere se attuare o meno l’interruzione di riga. Axel Reichert ha
% suggerito la seguente soluzione sul gruppo di discussione de.comp.text.tex:
\tolerance 1414%
\hbadness 1414%
\emergencystretch 1.5em%
\hfuzz 0.3pt%
\widowpenalty=10000%
\clubpenalty=10000%
\vfuzz%
\hfuzz%
%—————————————————————-
\newcommand{\InterlineaTesto}{\linespread{1.5}}
\newcommand{\InterlineaMatlab}{\linespread{0.8}}
\InterlineaTesto
`
P_fancy
`
\pagestyle{fancy} %
\renewcommand{\chaptermark}[1]{ % Lower Case Chapter marker style
\markboth{\chaptername\ \thechapter.\ #1}{}} %
\renewcommand{\sectionmark}[1]{ % Lower case Section marker style
\markright{\thesection.\ #1}} %
\fancyhead{} % cancella tutti i campi
% Fancy In basso
\fancyfoot[CE]{} % Centro Pari
\fancyfoot[CO]{} % Centro Dispari
\fancyfoot[LO]{} % Sinistra Dispari
\fancyfoot[RE]{} % Destra Pari
\fancyfoot[LE]{\vskip 0.3cm \bfseries\thepage} % Sinistra Pari
\fancyfoot[RO]{\vskip 0.3cm \bfseries\thepage} % Destra Dispari
% Fancy In alto
\fancyhead[RO]{\fancyplain{}{ \slshape \leftmark}} % Destra Dispari
\fancyhead[LE]{\fancyplain{}{ \slshape \rightmark}} % Sinistra Pari
\fancyhead[RE]{\fancyplain{}{}} % Destra Pari
\fancyhead[LO]{\fancyplain{}{}} % Sinistra Dispari
\fancyhead[CO]{\fancyplain{}{}} % Centro Dispari
\fancyhead[CE]{\fancyplain{}{}} % Centro Pari
\renewcommand{\footrulewidth}{0.0pt} % spessore linea in basso
\renewcommand{\headrulewidth}{0.01pt} % spessore linea in alto
`
P_comandi
`
\newcounter{entoure} % Libro “latex par la pratique”
\setcounter{entoure}{0}
\newenvironment{cerchiati}{%
\begin{list}{\large \textcircled{%
\small\arabic{entoure}}}{%
\usecounter{entoure}%
\setlength{\labelsep}{1em}%
\setlength{\leftmargin}{2em}%
\setlength{\labelwidth}{1.5em}%
\setlength{\listparindent}{0cm}}}%
{\end{list}}
`
P_teoremi
`
% Prendo le def dei modelli dal ntheorem.sty e cambio il posto in cui numero viene messo
\makeatletter
\newtheoremstyle{plain1}%
{\item[\hskip\labelsep \theorem@headerfont ##2\ ##1\theorem@separator]\nopagebreak}%
{\item[\hskip\labelsep \theorem@headerfont ##2\ ##1\ (##3)\theorem@separator]\nopagebreak}
%
\newtheoremstyle{break1}%
{\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont
##2\ ##1\theorem@separator}\hbox{\strut}}}]\nopagebreak}%
{\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont
##2\ ##1\ (##3)\theorem@separator}\hbox{\strut}}}]\nopagebreak}
%
\newtheoremstyle{changebreak1}%
{\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont
##1\ ##2\theorem@separator}\hbox{\strut}}}]\nopagebreak}%
{\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont
##1\ ##2\ (##3)\theorem@separator}\hbox{\strut}}}]\nopagebreak}
%
\newtheoremstyle{change1}%
{\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\theorem@separator]\nopagebreak}%
{\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\ (##3)\theorem@separator]\nopagebreak}
%
\newtheoremstyle{margin1}%
{\item[\theorem@headerfont \llap{##1}\hskip\labelsep ##2\theorem@separator]\nopagebreak}%
{\item[\theorem@headerfont \llap{##1}\hskip\labelsep ##2\ (##3)\theorem@separator]\nopagebreak}
%
\newtheoremstyle{marginbreak1}%
{\item[\rlap{\vbox{\hbox{\theorem@headerfont
\llap{##1}\hskip\labelsep\relax ##2\theorem@separator}\hbox{\strut}}}]\nopagebreak}
{\item[\rlap{\vbox{\hbox{\theorem@headerfont
\llap{##1}\hskip\labelsep\relax ##2\
(##3)\theorem@separator}\hbox{\strut}}}]\nopagebreak}
%
\makeatother
% Finalmente definisco i teoremi ecc… con i vari stili
=======================================================================
%==== Teoremi, Proposizioni, Lemmi, Corollari
\theoremstyle{changebreak1} %
\theoremheaderfont{\bfseries\color{BrickRed}\scshape \large} %
\theorembodyfont{\slshape} %
\theoremsymbol{\ensuremath{\diamondsuit}}
\theoremseparator{:} %
%\theoremnumbering{arabic}
\newtheorem{thm}{Teorema}
\newtheorem{prop}{Proposizione}[chapter]
\newtheorem{lem}[thm]{Lemma}
\newtheorem{cor}[thm]{Corollario}
%=======================================================================
%==== Esempi
\theoremstyle{break1} %
\theoremheaderfont{\bfseries\color{BrickRed}\scshape } %
\theorembodyfont{\upshape} %
\theoremsymbol{\ensuremath{\heartsuit}}
\theoremseparator{} %
%\theoremnumbering{arabic}
\newtheorem{esem}{Esempio}
%=======================================================================
%==== Definizioni
\theoremstyle{plain1} %
\theoremheaderfont{\bfseries\color{BrickRed}\scshape } %
\theorembodyfont{\slshape} %
\theoremsymbol{\ensuremath{\clubsuit}}
\theoremseparator{.} %
%\theoremnumbering{arabic}
\newtheorem{defn}[thm]{Definizione}
%=======================================================================
%==== Ipotesi
\theoremstyle{marginbreak1} %
\theoremheaderfont{\bfseries\color{BrickRed}\scshape } %
\theorembodyfont{\slshape} %
\theoremsymbol{\ensuremath{\clubsuit}}
\theoremseparator{.} %
%\theoremnumbering{arabic}
\newtheorem{hyp}{Hp}[chapter]
\newtheorem{h}{Hp}[chapter]
%=======================================================================
%==== Osservazioni
\theoremstyle{change1} %
\theoremheaderfont{\bfseries\color{BrickRed}\scshape } %
\theorembodyfont{\upshape} %
\theoremsymbol{\ensuremath{\spadesuit}}
\theoremseparator{.} %
\newtheorem{oss}{Osservazione}[chapter]
%=======================================================================
%==== Osservazioni
\theoremstyle{nonumberbreak}%
\theoremheaderfont{\color{BrickRed}\scshape } %
\theorembodyfont{\upshape} %
\theoremsymbol{\ensuremath{\Box}}
\theoremseparator{.} %
\newtheorem{Proof}{Dimostrazione}
`
P_indici
`
\usepackage[undotted]{minitoc}
\setcounter{secnumdepth}{2} % fino a che livello le sezioni saranno numerate
%
\setcounter{tocdepth}{2} % profondità indice globale
\setcounter{minitocdepth}{3}
%
\setlength{\mtcindent}{10pt} % indentation of minitocs, default
\renewcommand{\mtcfont}{\small\rm} % font for minitocs, default
\renewcommand{\mtcSSSfont}{\small\bf} % font for minitocs, sections, default
\renewcommand{\mtcSPfont}{\small\sf} % font for minitocs, subsections
\mtcselectlanguage{italian} %
`