- Questo topic ha 2 risposte, 2 partecipanti ed è stato aggiornato l'ultima volta 16 anni, 3 mesi fa da .
-
Topic
-
Ciao a tutti,sfacciatamente chiedo aiuto per una classe scritta da me. Non so dove sbattere la testa perché sono agli sgoccioli per la consegna del testo e non riesco vedere dove potrebbe stare l’errore.
Le caratteristche della classe sono:
a) l’aereo che scorre con le pagine, passando dalla sinistra alla destra in modo continuo
b) la pagina dove inizia una nuova parte del documento non è contata e stampata nell’indice
c) le intestazioni del capitolo
d) il frontespizio disegnato da me ed inseribile con il comando \frontespizio
Evoco il vostro aiuto!!Ecco le domande:
1) Quando uso l’opzione twoside, stranamente la prima pagina del capitolo viene stampata sulla pagina pari se cade su quest’ultima. Come mai?
2) nel caso della pagina pari prima della pagina di inizio capito, come faccio a tenere il piè di pagina e la testatina?
3) dopo il frontespizio come posso mettere una pagina interamente vuota?
Qui ci sono i file della classe, metre di veguito vi riporto il neanche tanto lungo codice.
Grazie in Anticipo chi potrà aiutarmi.
`
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{michele}[2010/01/02 v. 0.1]
\DeclareOption{twocolumn}{\OptionNotUsed}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
\ProcessOptions\relax
\LoadClass[a4paper]{report}\RequirePackage{tikz}
\usetikzlibrary{calc}\RequirePackage{geometry}
% DIMENSIONI ORIZZONTALI
% La somma dei margini deve essere 21cm
\newcommand{\marginesinistro}{2cm}
\newcommand{\larghezzatesto}{17cm}
\newcommand{\marginedestro}{2cm}% DIMENSIONI VERTICALI
\newcommand{\sotto}{3cm}
\newcommand{\sopra}{2cm}
\newcommand{\sottopiede}{1cm}
\newcommand{\piede}{2cm}% deve essere \sotto-1cm\geometry{
left = \marginesinistro,
width = \larghezzatesto,
top = \sopra,
bottom = \sotto,
footskip = \piede,
headheight = 3.5cm,
a4paper}%———- DEFINIZIONE \thelastpage
\newcommand*{\memsetcounter}[2]{\setcounter{#1}{#2}}
\AtBeginDocument{\immediate\write\@mainaux{%
\string\providecommand*{\string\memsetcounter}[2]{}}}\newcounter{sheetsequence}
\setcounter{sheetsequence}{1}
\renewcommand{\thesheetsequence}{\@arabic\c@sheetsequence}
\g@addto@macro{\@outputpage}{\stepcounter{sheetsequence}}\newcounter{lastsheet}
\setcounter{lastsheet}{0}
\newcounter{lastpage}
\setcounter{lastpage}{0}\newcommand{\dol@stsheet}{%
\if@filesw
\addtocounter{sheetsequence}{-1}%
\immediate\write\@auxout%
{\string\memsetcounter{lastsheet}{\the\c@sheetsequence}}%
\stepcounter{sheetsequence}%
\fi}
\newcommand{\dol@stpage}{%
\if@filesw
\addtocounter{page}{-1}%
\immediate\write\@auxout%
{\string\memsetcounter{lastpage}{\the\c@page}}%
\stepcounter{page}%
\fi}
\AtBeginDocument{\AtEndDocument{\clearpage\dol@stsheet\dol@stpage}}%———- DEFINIZIONI NOME PROF ED ESAME
\newcommand{\esame}[1]{\def\@esame{#1}}
\newcommand{\titolo}[1]{\def\@titolo{#1}}
\newcommand{\AnnoAccademico}[2]{\def\@AnnoAccademico{#1~-~#2}}\def\@primostudente{}
\def\@secondostudente{}
\def\@terzostudente{}
\def\@quartostudente{}
\newcommand{\primostudente}[1]{\def\@primostudente{#1}}
\newcommand{\secondostudente}[1]{\def\@secondostudente{#1}}
\newcommand{\terzostudente}[1]{\def\@terzostudente{#1}}
\newcommand{\quartostudente}[1]{\def\@quartostudente{#1}}
\newcommand{\autori}[4]{\primostudente{#1}\secondostudente{#2}\terzostudente{#3}\quartostudente{#4}}\def\@primoprofessore{}
\def\@secondoprofessore{}
\def\@terzoprofessore{}
\def\@quartoprofessore{}
\newcommand{\primoprofessore}[1]{\def\@primoprofessore{#1}}
\newcommand{\secondoprofessore}[1]{\def\@secondoprofessore{#1}}
\newcommand{\terzoprofessore}[1]{\def\@terzoprofessore{#1}}
\newcommand{\quartoprofessore}[1]{\def\@quartoprofessore{#1}}
\newcommand{\professori}[4]{\primoprofessore{#1}\secondoprofessore{#2}\terzoprofessore{#3}\quartoprofessore{#4}}%———- DEFINIZIONE FRONTESPIZIO
\newcommand\frontespizio{%
\thispagestyle{empty}
\setcounter{page}{0}%\z@
\begin{center}
\begin{tikzpicture}[remember picture]
\coordinate (O0) at (current page.north);
\coordinate (O) at ($(O0.south)-(0,3.3cm)$);
\node[anchor=north,inner sep=0pt] at (O){\includegraphics[height=3cm,keepaspectratio]{figure/classe/cherubino.pdf}};\coordinate (O1) at ($(O.south)-(0,3.3cm)$);
\node[anchor=north,inner sep=0pt] at (O1){\Large UNIVERSIT\`A DEGLI STUDI DI PISA};\coordinate (O2) at ($(O1.south)-(0,.9cm)$);
\draw($(O2)-(3,0)$)–($(O2)+(3,0)$);\coordinate (O3) at ($(O2.south)-(0,.3cm)$);
\node[anchor=north,inner sep=0pt] at (O3){Facoltà di Ingegneria};\coordinate (O4) at ($(O3.south)-(0,1cm)$);
\node[anchor=north,inner sep=0pt] at (O4){\includegraphics[height=1.2cm,keepaspectratio]{figure/classe/dia.pdf}};\coordinate (O5) at ($(O4.south)-(0,1.5cm)$);
\node[anchor=north,inner sep=0pt] at (O5){\normalsize Corso di Laurea in Ingegneria Aerospaziale};\coordinate (O6) at ($(O5.south)-(0,.6cm)$);
\node[anchor=north,inner sep=0pt] at (O6){\Large Esame di \@esame};\coordinate (O7) at ($(O6.south)-(0,1cm)$);
\node[anchor=north,inner sep=0pt] at (O7){\large \bf \@titolo};\coordinate (O8) at ($(O7.south)-(0,2cm)$);
\node[anchor=north,inner sep=0pt] at (O8){\includegraphics[width=\textwidth, keepaspectratio]{figure/classe/copertina.pdf}};\coordinate (O9) at ($(O8.south)-(0,7cm)$);
\node[anchor=north,inner sep=0pt] at (O9){
\begin{tabular}{p{\widthof{\@secondoprofessore}} p{7cm} p{\widthof{\@primostudente}}}
& & \\
\textbf{Professori:} & & \textbf{Studenti:} \\
& & \\
\@primoprofessore & & \@primostudente \\
& & \\
\@secondoprofessore & & \@secondostudente \\
& & \\
\@terzoprofessore & & \@terzostudente \\
& & \\
\@quartoprofessore & & \@quartostudente \\
& & \\
\end{tabular}};\coordinate (anno) at ($(current page.south)+(0,2cm)$);
\begin{scope}
\draw($(anno)-(3,0)$)–($(anno)+(3,0)$);
\node[anchor=north] at (anno){Anno Accademico \@AnnoAccademico};
\end{scope}
\end{tikzpicture}
\end{center}}%———- DEFINIZIONE INTESTAZIONE CAPITOLO
\def\@makechapterhead#1{%
\parindent \z@
{\Huge\bfseries \@chapapp\space \thechapter}\hfill
\vskip 6pt
\hrule
\vskip 6pt
\pgfdeclarelayer{background}
\pgfsetlayers{background,main}
\parindent \z@
\begin{tikzpicture}[execute at end picture=%
{
\begin{pgfonlayer}{background}
\path[fill=black,draw]
(current bounding box.south west) rectangle
(current bounding box.north east);
\end{pgfonlayer}
}]
\node[anchor=south west,text width=.65*\larghezzatesto,align=flush left] at (0,0){\textcolor{white}{\Huge\bfseries #1}};
\node[anchor=south east] at (\larghezzatesto,0){\includegraphics[width=.3\textwidth,keepaspectratio]{figure/classe/a-300_capitolo.pdf}};
\end{tikzpicture}
\vskip 6pt
}%———- DEFINIZIONE LAYOUT VARIE PAGINE
%- pagine normali
\if@twoside
\def\ps@headings{%
\def\@oddfoot{
{\slshape\rightmark}
\hfill
\begin{tikzpicture}[remember picture,overlay]
\coordinate (SE) at (current page.south east);
%\draw (SE)circle(1mm);
\fill ($(SE)+(-\marginedestro,0)$)rectangle++(-1cm,{\sottopiede+.5cm});
\node[inner sep=0pt,anchor=south] at ($(SE)+({-\marginedestro-.5cm},\sottopiede)$){\textbf{\textcolor{white}{\thepage}}};
\end{tikzpicture}
}\def\@evenfoot{
\begin{tikzpicture}[remember picture,overlay]
\coordinate (SW) at (current page.south west);
%\draw (SW)circle(1mm);
\fill ($(SW)+(\marginedestro,0)$)rectangle++(1cm,{\sottopiede+.5cm});
\node[inner sep=0pt,anchor=south] at ($(SW)+({\marginedestro+.5cm},\sottopiede)$){\textbf{\textcolor{white}{\thepage}}};
\end{tikzpicture}
\hfill
{\slshape\leftmark}
}\def\@evenhead{\ifnum\thelastpage=0
\else
\ifnum\thelastpage=1
\else
\tikzpicture[overlay]
\clip (0,0)rectangle++(\larghezzatesto,1);
\pgfmathparse{(2*\larghezzatesto-3cm)/(\thelastpage-1)*(\thepage)};
\draw (\pgfmathresult pt,9.373pt)–(0,9.373pt);%
\node at (\pgfmathresult pt,0)[above=12pt,right,inner sep=0pt]{\includegraphics{figure/classe/a-300_testatina.pdf}};
\endtikzpicture
\fi
\fi}%\def\@oddhead{\ifnum\thelastpage=0
\else
\ifnum\thelastpage=1
\else
\tikzpicture[overlay]
\clip (0,0)rectangle++(\larghezzatesto,1);
\pgfmathparse{-\larghezzatesto+(2*\larghezzatesto-3cm)/(\thelastpage-1)*(\thepage-1)};
\draw (\pgfmathresult pt,9.373pt)–(0,9.373pt);%
\node at (\pgfmathresult pt,0)[above=12pt,right,inner sep=0pt]{\includegraphics{figure/classe/a-300_testatina.pdf}};
\endtikzpicture
\fi
\fi}%
\let\@mkboth\markboth
\def\chaptermark##1{%
\markboth {%\MakeUppercase{%
\ifnum \c@secnumdepth >\m@ne
\@chapapp\ \thechapter~–~##1\ % il ##1 stava sotto prima di tutte le parentesi
% \@chapapp\ \thechapter. \ %
\fi}{}}%
\def\sectionmark##1{%
\markright {%\MakeUppercase{%
\ifnum \c@secnumdepth >\z@
\thesection. \ %
\fi
##1}}}
\else
\def\ps@headings{%
\def\@oddfoot{{\slshape\rightmark}
\hfill
\begin{tikzpicture}[remember picture,overlay]
\coordinate (SE) at (current page.south east);
%\draw (SE)circle(1mm);
\fill ($(SE)+(-\marginedestro,0)$)rectangle++(-1cm,{\sottopiede+.5cm});
\node[inner sep=0pt,anchor=south] at ($(SE)+({-\marginedestro-.5cm},\sottopiede)$){\textbf{\textcolor{white}{\thepage}}};
\end{tikzpicture}}
\def\@oddhead{\ifnum\thelastpage=0
\else
\ifnum\thelastpage=1
\else
\tikzpicture[overlay]
\pgfmathparse{(\larghezzatesto-3cm)/(\thelastpage-1)*(\thepage-1)};
\draw (\pgfmathresult pt,9.373pt)–(0,9.373pt);%
\node at (\pgfmathresult pt,0)[above=12pt,right,inner sep=0pt]{\includegraphics{figure/classe/a-300_testatina.pdf}};%
\endtikzpicture
\fi
\fi}%
\let\@mkboth\markboth
\def\chaptermark##1{%
\markright {\MakeUppercase{%
\ifnum \c@secnumdepth >\m@ne
CAP. \thechapter~–~##1\ % il ##1 stava sotto prima di tutte le parentesi
% \@chapapp\ \thechapter. \ %
\fi
}}}}
\fi% DEFINIZIONE DI \ps@capitolo
\def\ps@capitolo{%
\def\@oddfoot{
\begin{tikzpicture}[remember picture,overlay]
\coordinate (SE) at (current page.south east);
\fill ($(SE)+(-\marginedestro,0)$)rectangle++(-1cm,{\sottopiede+.5cm});
\node[inner sep=0pt,anchor=south] at ($(SE)+({-\marginedestro-.5cm},\sottopiede)$){\textbf{\textcolor{white}{\thepage}}};
\end{tikzpicture}}
}\def\ps@introduzione{%
\def\@oddfoot{Introduzione\hfill
\begin{tikzpicture}[remember picture,overlay]
\coordinate (SE) at (current page.south east);
\fill ($(SE)+(-\marginedestro,0)$)rectangle++(-1cm,{\sottopiede+.5cm});
\node[inner sep=0pt,anchor=south] at ($(SE)+({-\marginedestro-.5cm},\sottopiede)$){\textbf{\textcolor{white}{\thepage}}};
\end{tikzpicture}}
\def\@evenfoot{
\begin{tikzpicture}[remember picture,overlay]
\coordinate (SW) at (current page.south west);
%\draw (SW)circle(1mm);
\fill ($(SW)+(\marginedestro,0)$)rectangle++(1cm,{\sottopiede+.5cm});
\node[inner sep=0pt,anchor=south] at ($(SW)+({\marginedestro+.5cm},\sottopiede)$){\textbf{\textcolor{white}{\thepage}}};
\end{tikzpicture}
\hfill
{\slshape\leftmark}
}}\def\ps@indice{%
\def\@oddfoot{Indice\hfill
\begin{tikzpicture}[remember picture,overlay]
\coordinate (SE) at (current page.south east);
\fill ($(SE)+(-\marginedestro,0)$)rectangle++(-1cm,{\sottopiede+.5cm});
\node[inner sep=0pt,anchor=south] at ($(SE)+({-\marginedestro-.5cm},\sottopiede)$){\textbf{\textcolor{white}{\thepage}}};
\end{tikzpicture}}
\def\@evenfoot{
\begin{tikzpicture}[remember picture,overlay]
\coordinate (SW) at (current page.south west);
%\draw (SW)circle(1mm);
\fill ($(SW)+(\marginedestro,0)$)rectangle++(1cm,{\sottopiede+.5cm});
\node[inner sep=0pt,anchor=south] at ($(SW)+({\marginedestro+.5cm},\sottopiede)$){\textbf{\textcolor{white}{\thepage}}};
\end{tikzpicture}
\hfill
{\slshape\leftmark}
}}%———- COMANDI PER INIZIO RELAZIONE
\newcommand\indice{\pagenumbering{roman}\pagestyle{indice}%\addtocounter{page}{-1}%
\tableofcontents}\newcommand\introduzione{\chapter*{Introduzione}%
\addcontentsline{toc}{chapter}{Introduzione}%
\pagestyle{introduzione}}\newcommand\appendici{\part*{Appendici}%
\addcontentsline{toc}{part}{Appendici}%
\appendix}%———- RIDEFINIZIONE DEL COMANDO \part
\renewcommand\part{%
\if@openright
\cleardoublepage
\else
\clearpage
\fi
\thispagestyle{empty}
\addtocounter{page}{-1}
\@tempswafalse
\null\vfil
\secdef\@part\@spart}%———- RIDEFINIZIONE DI \l@part – NON METTE IL NUMERO DI PAGINA NELL'INDICE
\renewcommand*{\l@part}[2]{% non mette i numeri alle parti nell'indice
\par\addvspace{\topsep}
\setlength\@tempdima{2.3em}%
\noindent\textbf{#1}\par}%———- RIDEFINIZIONE DI \chapter
\renewcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
\thispagestyle{capitolo}% solo numero pagina
\global\@topnum\z@ %NB. \z@ sta per 0pt definizione di \@topnum per tutti i gruppi
\@afterindentfalse
\secdef\@chapter\@schapter}%———- RIDEFINIZIONE DELLA PRIMA PAGINA DELL'INDICE
\renewcommand\tableofcontents{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\parindent \z@
\mbox{}\hfill
\vskip 6pt
\hrule
\vskip 6pt
\pgfdeclarelayer{background}
\pgfsetlayers{background,main}
\parindent \z@
\begin{tikzpicture}[execute at end picture=%
{
\begin{pgfonlayer}{background}
\path[fill=black,draw]
(current bounding box.south west) rectangle
(current bounding box.north east);
\end{pgfonlayer}
}]
\node[anchor=south west,text width=.65*\larghezzatesto,align=flush left] at (0,0){\textcolor{white}{\Huge\bfseries Indice}};
\node[anchor=south east] at (\larghezzatesto,0){\includegraphics[width=.3\textwidth,keepaspectratio]{figure/classe/a-300_capitolo.pdf}};
\end{tikzpicture}
\vskip 6pt
\@starttoc{toc}%
\if@restonecol\twocolumn\fi
}
%———-
%———-
%———-\endinput
`
- Devi essere connesso per rispondere a questo topic.