Ecco qui l’esempio..
Prima il mio file tex:
`
\documentclass [12pt,a4paper,twoside,disablefront]{suftesi}
%———————-Definition of usefull packages
\usepackage[italian,english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{amsfonts}
\usepackage{fancyhdr}
\usepackage{color}
\usepackage{lastpage}
\usepackage{longtable}
\usepackage{amsmath}
\usepackage{texdraw}
\usepackage{makeidx}
\usepackage{epigraph}
\usepackage{natbib}
\usepackage{verbatim}
\usepackage{multicol}
\usepackage{float}
\usepackage{listings}
\usepackage{textcomp}
\usepackage{alltt}
\usepackage{ifpdf}
\usepackage{subfig}
\usepackage{geometry}
\usepackage{emptypage}
\renewcommand\lfoot[2][]{}
\renewcommand\cfoot[2][]{}
\renewcommand\rfoot[2][]{}
\renewcommand\lhead[2][]{}
\renewcommand\chead[2][]{}
\renewcommand\rhead[2][]{}
%\usepackage{doxygen}
%———————-Magia
\providecommand{\csletcs}[2]{%
\expandafter\let\csname#1\expandafter\endcsname\csname#2\endcsname}
\newcommand{\equivUC}[3][\def]{%
\expandafter#1\csname#2\expandafter\endcsname\expandafter{%
\csname#3\endcsname}}
\newcommand{\UPCASElang}[1]{
\uppercase{\def\temp{#1}}
\csletcs{l@\temp}{l@#1}
\equivUC{date\temp}{date#1}
\equivUC{captions\temp}{captions#1}
\equivUC{extras\temp}{extras#1}
\equivUC{noextras\temp}{noextras#1}
\equivUC[\edef]{\temp hyphenmins}{#1hyphenmins}
}
\UPCASElang{english}
\UPCASElang{italian}
\ifpdf
\usepackage[pdftex,
pagebackref=true,
colorlinks=true,
citecolor=blue,
linkcolor=black,
unicode
]{hyperref}
\else
\usepackage[ps2pdf,
pagebackref=true,
colorlinks=true,
citecolor=blue,
linkcolor=black,
unicode
]{hyperref}
\usepackage{pspicture}
\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%SONO QUELLI CHE HO AGGIUNTO “A NASO”..
\lstset{language=C++,inputencoding=utf8,basicstyle=\footnotesize,breaklines=true,breakatwhitespace=true,tabsize=8,numbers=left }
\renewcommand{\footrulewidth}{0.4pt}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%———————-Set Toc Counter
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}
\newenvironment{abstract}
{\cleardoublepage\thispagestyle{empty}\vspace*{\fill}
\begin{center}\bfseries\abstractname\end{center}}
{\par\vfill}
% parte di fancyhdr
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\chaptermark}[1]{\markboth{#1}{#1}}
\fancypagestyle{fncymain}{%
\renewcommand{\headrulewidth}{0.4pt}%
\fancyhf{}%
\fancyhead[LE]{\bfseries\chaptername\ \thechapter}%
\fancyhead[RO]{\bfseries\nouppercase{\leftmark}}%
\fancyfoot[LE,RO]{\thepage}}
\fancypagestyle{fncyfront}{%
\renewcommand{\headrulewidth}{0.4pt}%
\fancyhf{}%
\fancyhead[LE]{\bfseries\nouppercase{\leftmark}}%
\fancyhead[RO]{\bfseries\nouppercase{\leftmark}}%
\fancyfoot[LE,RO]{\thepage}}
%———————-Commands to avoid head/footnote at the end of each chapter
\fancypagestyle{plain}{\fancyhf{}%
\fancyfoot[C]{\thepage}%
\renewcommand\headrulewidth{0pt}%
\renewcommand\footrulewidth{0pt}}
\makeatletter
\def\cleardoublepage{\clearpage\if@twoside
\ifodd\c@page
\else\hbox{}\thispagestyle{empty}\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother
%———————-Definition of new commands
\newcommand{\fncyblank}{\fancyhf{}}
\newcommand{\vtk}{\textit{VTK}}
\newcommand{\vmtk}{\textit{VMTK}}
\newcommand{\vmtkgui}{\textit{VMTKGui}}
\newcommand{\virtualvalvestent}{\textit{VirtualValveStent}}
\newcommand{\ct}{\textit{CT}}
\newcommand{\dicom}{\textit{DICOM}}
\newcommand{\mr}{\textit{MR}}
\newcommand{\cfd}{\textit{CFD}}
\newcommand{\gui}{\textit{GUI}}
\newcommand{\lss}{\textit{LSS}}
\newcommand{\fe}{\textit{FE}}
\newcommand{\python}{\textit{Python}}
%———————-Beginning Document
\begin{document}
%———————-frontmatter
\pagestyle{fncyfront}
\frontmatter
%———————-Mainmatter
\pagestyle{fncymain}
\mainmatter
\pagenumbering{arabic}
\appendix
In this chapter we list all the files needed to run the tool we have developed. This is a very technical appendix and it is addressed to people who want to develop and study what there is under the hood.
\section{vmtkgui.py}
This is the “main'' file and it contains all the links between the different files.
\lstinputlisting{vmtkgui.py}
%———————-Backmatter
\end{document}
`
e qui il file Python.
`
## Function used to load a DICOM file
# @param self The object pointer
# @param widget gdk widget
def call_dicom_path (self, widget):
print “Trying to load the DICOM file”
# planeWidgetX.InteractionOff()
# planeWidgetY.InteractionOff()
# planeWidgetZ.InteractionOff()
# interactorStyle.EnabledOn()
## This is the command we need in order to smooth the surface.
# @param self The object pointer
# @param widget gdk widget
def call_viewimg (self, widget):
self.vmtkinterface.imageviewer()
## This is the command we need in order to smooth the surface.
# @param self The object pointer
# @param widget gdk widget
def call_viewsurf (self, widget):
self.vmtkinterface.surfaceviewer()
## This is the command we need in order to smooth the surface.
# @param self The object pointer
# @param widget gdk widget
def call_viewmesh (self, widget):
print “Il bottone funziona!”
self.vmtkinterface.meshviewer()
`
Noto che “segna gli spazi” quando c’è una frase tra virgolette. Idee??