summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/feupphdteses
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/feupphdteses
Initial commit
Diffstat (limited to 'macros/latex/contrib/feupphdteses')
-rw-r--r--macros/latex/contrib/feupphdteses/Abbs.tex10
-rw-r--r--macros/latex/contrib/feupphdteses/Abstract.tex12
-rw-r--r--macros/latex/contrib/feupphdteses/Acknow.tex7
-rw-r--r--macros/latex/contrib/feupphdteses/Appendix.tex42
-rw-r--r--macros/latex/contrib/feupphdteses/Chapter2.tex95
-rw-r--r--macros/latex/contrib/feupphdteses/Chapter3.tex20
-rw-r--r--macros/latex/contrib/feupphdteses/Conclusions.tex4
-rw-r--r--macros/latex/contrib/feupphdteses/Dedicatory.tex7
-rw-r--r--macros/latex/contrib/feupphdteses/Figures/uporto-feup.pdfbin0 -> 12740 bytes
-rw-r--r--macros/latex/contrib/feupphdteses/IEEEtranN.bst2716
-rw-r--r--macros/latex/contrib/feupphdteses/IEEEtranSN.bst2857
-rw-r--r--macros/latex/contrib/feupphdteses/Intro.tex246
-rw-r--r--macros/latex/contrib/feupphdteses/Publications.tex9
-rw-r--r--macros/latex/contrib/feupphdteses/Quote.tex10
-rw-r--r--macros/latex/contrib/feupphdteses/README102
-rw-r--r--macros/latex/contrib/feupphdteses/References.bib61
-rw-r--r--macros/latex/contrib/feupphdteses/Resumo.tex12
-rw-r--r--macros/latex/contrib/feupphdteses/Template_EN.pdfbin0 -> 223680 bytes
-rw-r--r--macros/latex/contrib/feupphdteses/Template_EN.tcp12
-rw-r--r--macros/latex/contrib/feupphdteses/Template_EN.tex140
-rw-r--r--macros/latex/contrib/feupphdteses/Template_EN.tps116
-rw-r--r--macros/latex/contrib/feupphdteses/feupphdteses.sty695
-rw-r--r--macros/latex/contrib/feupphdteses/mymacros.tex11
23 files changed, 7184 insertions, 0 deletions
diff --git a/macros/latex/contrib/feupphdteses/Abbs.tex b/macros/latex/contrib/feupphdteses/Abbs.tex
new file mode 100644
index 0000000000..b1fd75d31e
--- /dev/null
+++ b/macros/latex/contrib/feupphdteses/Abbs.tex
@@ -0,0 +1,10 @@
+\thispagestyle{empty}
+
+\chapter*{List of Abbreviations}
+\chaptermark{List of Abbreviations}
+
+\begin{flushleft}
+ \begin{longtable}{l p{0.8\linewidth}}
+ FEUP & \hspace{5mm} Faculdade de Engenharia da Universidade do Porto\\[1mm]
+ \end{longtable}
+\end{flushleft}
diff --git a/macros/latex/contrib/feupphdteses/Abstract.tex b/macros/latex/contrib/feupphdteses/Abstract.tex
new file mode 100644
index 0000000000..fb5fe33021
--- /dev/null
+++ b/macros/latex/contrib/feupphdteses/Abstract.tex
@@ -0,0 +1,12 @@
+\thispagestyle{empty}
+
+\chapter*{Abstract}
+
+
+\vspace*{10mm}
+
+The abstract
+
+\vspace*{15mm}
+
+\textbf{Keywords:} Keyword1. Keyword2. Keyword3. \ No newline at end of file
diff --git a/macros/latex/contrib/feupphdteses/Acknow.tex b/macros/latex/contrib/feupphdteses/Acknow.tex
new file mode 100644
index 0000000000..82eadd15a5
--- /dev/null
+++ b/macros/latex/contrib/feupphdteses/Acknow.tex
@@ -0,0 +1,7 @@
+\chapter*{Acknowledgments}
+%\addcontentsline{toc}{chapter}{Agradecimentos}
+
+I'm sure there is more than one person you feel like thanking.
+
+\vspace{10mm}
+\flushleft{Name of the Author}
diff --git a/macros/latex/contrib/feupphdteses/Appendix.tex b/macros/latex/contrib/feupphdteses/Appendix.tex
new file mode 100644
index 0000000000..a82e25502b
--- /dev/null
+++ b/macros/latex/contrib/feupphdteses/Appendix.tex
@@ -0,0 +1,42 @@
+\chapter{Appendix A title}\label{chap:AppA}
+\clearemptydoublepage
+
+\section*{Sub Section}
+
+%For code, use:
+%\lstinputlisting[language=Matlab]{./Code/filename.m}
+%see http://www.ctan.org/pkg/listings for more information about inserting code (the feupphdteses style already loads it).
+
+%For including papers:
+
+%\includepdf[pages=-]{filename.pdf}
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec pellentesque elit et turpis iaculis blandit. Nulla posuere ornare pulvinar. Aenean at turpis sem. Nam adipiscing porta imperdiet. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse posuere mi quis risus sagittis aliquam pulvinar orci vestibulum. Nullam sollicitudin adipiscing velit, quis lobortis metus interdum eu. Cras quis elit nulla. Etiam accumsan, enim nec tincidunt aliquet, libero augue fringilla ipsum, at scelerisque tortor est sit amet justo. Vestibulum dictum, dui et dignissim facilisis, ipsum mauris condimentum quam, non mollis diam erat in risus. Morbi faucibus, velit sed porttitor adipiscing, dui magna iaculis mi, non feugiat quam justo nec odio. In eleifend, arcu id pellentesque venenatis, arcu turpis adipiscing leo, quis cursus metus nibh ac risus.
+
+In felis purus, porttitor eu facilisis ut, tincidunt eu risus. Quisque dictum scelerisque elementum. Fusce volutpat erat quis felis commodo adipiscing. Aenean cursus ligula ac metus accumsan commodo vitae vitae lacus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc quis nunc diam. Vestibulum vehicula, justo ut eleifend lobortis, libero orci tempor erat, quis ultricies lectus nunc nec nunc. Suspendisse tortor ligula, ornare eget accumsan et, semper a ante.
+
+Nulla a purus ut elit luctus laoreet ac sed turpis. Proin diam urna, luctus sed sagittis nec, pulvinar non magna. Aliquam hendrerit, sem non malesuada accumsan, nisl nulla commodo turpis, non semper lorem mi in quam. Aenean dolor nulla, eleifend et lacinia ut, ultricies ut ante. Suspendisse potenti. Vestibulum porta blandit adipiscing. Curabitur nunc orci, euismod ut vehicula sit amet, molestie vitae lorem. Nunc quis commodo tellus. Suspendisse tristique metus vitae lectus luctus ac venenatis lectus pretium. Curabitur sed tellus mi. Nam nisi purus, sagittis vitae lobortis quis, porta eu libero. Cras elit mi, interdum a venenatis vitae, vulputate non erat.
+
+Sed aliquet mauris eu metus pulvinar hendrerit. Sed ac nisl id odio iaculis laoreet. Proin nisl orci, gravida at mollis vel, pulvinar eu arcu. Praesent volutpat commodo magna, et euismod nisi pellentesque sit amet. Proin felis orci, dignissim in sollicitudin sit amet, mattis sed arcu. Nam quam magna, imperdiet ut tincidunt sed, fringilla sed ante. Vivamus bibendum ornare nibh, sit amet mattis tellus luctus non.
+
+In tempor varius adipiscing. Sed pulvinar massa non lorem gravida volutpat. Vivamus eu vehicula leo. Ut tempus risus eu sem gravida suscipit nec ac augue. Aliquam sit amet quam diam. Sed eget urna neque, vel bibendum ante. Phasellus porta pretium porttitor. Mauris pharetra libero id tortor dignissim cursus. Proin at ligula sed lacus sodales sagittis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam mauris sapien, interdum at dapibus vel, commodo sit amet turpis. Sed dictum, mauris non consectetur iaculis, arcu turpis lobortis enim, ut bibendum metus magna id orci. Pellentesque vel purus odio, a euismod velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin non risus tellus. Proin interdum, mauris quis scelerisque consectetur, erat quam venenatis ante, eu consectetur sem nulla nec ante.
+
+
+\clearemptydoublepage
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\chapter{Appendix B Title}\label{chap:AppB}
+\clearemptydoublepage
+
+\section*{Sub Section 2}
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec pellentesque elit et turpis iaculis blandit. Nulla posuere ornare pulvinar. Aenean at turpis sem. Nam adipiscing porta imperdiet. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse posuere mi quis risus sagittis aliquam pulvinar orci vestibulum. Nullam sollicitudin adipiscing velit, quis lobortis metus interdum eu. Cras quis elit nulla. Etiam accumsan, enim nec tincidunt aliquet, libero augue fringilla ipsum, at scelerisque tortor est sit amet justo. Vestibulum dictum, dui et dignissim facilisis, ipsum mauris condimentum quam, non mollis diam erat in risus. Morbi faucibus, velit sed porttitor adipiscing, dui magna iaculis mi, non feugiat quam justo nec odio. In eleifend, arcu id pellentesque venenatis, arcu turpis adipiscing leo, quis cursus metus nibh ac risus.
+
+In felis purus, porttitor eu facilisis ut, tincidunt eu risus. Quisque dictum scelerisque elementum. Fusce volutpat erat quis felis commodo adipiscing. Aenean cursus ligula ac metus accumsan commodo vitae vitae lacus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc quis nunc diam. Vestibulum vehicula, justo ut eleifend lobortis, libero orci tempor erat, quis ultricies lectus nunc nec nunc. Suspendisse tortor ligula, ornare eget accumsan et, semper a ante.
+
+Nulla a purus ut elit luctus laoreet ac sed turpis. Proin diam urna, luctus sed sagittis nec, pulvinar non magna. Aliquam hendrerit, sem non malesuada accumsan, nisl nulla commodo turpis, non semper lorem mi in quam. Aenean dolor nulla, eleifend et lacinia ut, ultricies ut ante. Suspendisse potenti. Vestibulum porta blandit adipiscing. Curabitur nunc orci, euismod ut vehicula sit amet, molestie vitae lorem. Nunc quis commodo tellus. Suspendisse tristique metus vitae lectus luctus ac venenatis lectus pretium. Curabitur sed tellus mi. Nam nisi purus, sagittis vitae lobortis quis, porta eu libero. Cras elit mi, interdum a venenatis vitae, vulputate non erat.
+
+Sed aliquet mauris eu metus pulvinar hendrerit. Sed ac nisl id odio iaculis laoreet. Proin nisl orci, gravida at mollis vel, pulvinar eu arcu. Praesent volutpat commodo magna, et euismod nisi pellentesque sit amet. Proin felis orci, dignissim in sollicitudin sit amet, mattis sed arcu. Nam quam magna, imperdiet ut tincidunt sed, fringilla sed ante. Vivamus bibendum ornare nibh, sit amet mattis tellus luctus non.
+
+\clearemptydoublepage
diff --git a/macros/latex/contrib/feupphdteses/Chapter2.tex b/macros/latex/contrib/feupphdteses/Chapter2.tex
new file mode 100644
index 0000000000..558b621461
--- /dev/null
+++ b/macros/latex/contrib/feupphdteses/Chapter2.tex
@@ -0,0 +1,95 @@
+\chapter{Chapter Title}
+\label{chap:Chapter2}
+
+\section{List of packages loaded by \emph{feupphdteses.sty}}
+
+{\tiny
+\begin{verbatim}
+\RequirePackage[T1]{fontenc}
+\RequirePpackage[utf8]{inputenc}
+\RequirePackage[english]{babel}
+\RequirePackage[outer=25mm,inner=35mm,vmargin=20mm,includehead,includefoot,headheight=15pt]{geometry} % Geometry package
+\RequirePackage{xcolor} % Different Colors
+\RequirePackage{mathptmx} % Font:Times
+\RequirePackage[scaled]{couriers} % Font: Courier
+\RequirePackage[scaled]{helvet} % Font: Helvetica
+\RequirePackage{graphicx} % Graphics
+\RequirePackage{grffile} % larger range of file names (dots and spaces)
+\RequirePackage{amsmath} % Math and equations
+\RequirePackage{tikz} % To make graphics
+\RequirePackage{pgfplots} % To import figures from Matlab
+\RequirePackage{url} % To handle URLs
+\RequirePackage{setspace} % Controls line spacing
+\RequirePackage{makeidx} % Index
+\RequirePackage[tableposition=top,figureposition=bottom]{caption} % Tables' captions
+\RequirePackage{multirow} % Tables with multiple rows
+\RequirePackage{eurosym} % Currency: Euro
+\RequirePackage{array} % Needed for 'tabularx'
+\RequirePackage{tabularx} % Tables' width can be set
+\RequirePackage{tabulary} % Columns' width can be set to length
+\RequirePackage{longtable} % Tables can break into two pages
+\RequirePackage[pagewise,switch*]{lineno} % Line numbers
+\RequirePackage{siunitx} % SI units
+\RequirePackage{float} % To be able to use the 'Here' specification
+\RequirePackage{subcaption} % Subcaptions in subfigures
+\RequirePackage{adjustbox} % Alignment of cells in tables
+\RequirePackage[inline]{enumitem} % Itemize, enumerate, lists, etc.
+\RequirePackage[section]{placeins} % To prevent floats going over different sections
+\RequirePackage{booktabs} % To use toprule, midrule, bottomrule
+\RequirePackage{pgfgantt} % Create Gantt diagrams
+\RequirePackage{pdflscape} % Landscape mode
+\RequirePackage{pdfpages} % To include .pdf (papers) at the end as appendix
+\RequirePackage{listings} % To include code
+\RequirePackage[pdfpagelabels,bookmarks,hyperindex,hyperfigures]{hyperref} % Hyper References
+\RequirePackage{bookmark}
+\RequirePackage{fancyhdr}
+\end{verbatim}
+}
+
+\section{Loaded package by options}
+
+{\tiny
+\begin{verbatim}
+\RequirePackage[hyperpageref]{backref}
+\end{verbatim}
+}
+
+
+\section{This is a section}
+
+This is how a section would look like~\citep{espinoza2012inverse}. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec pellentesque elit et turpis iaculis blandit. Nulla posuere ornare pulvinar. Aenean at turpis sem. Nam adipiscing porta imperdiet. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse posuere mi quis risus sagittis aliquam pulvinar orci vestibulum. Nullam sollicitudin adipiscing velit, quis lobortis metus interdum eu. Cras quis elit nulla. Etiam accumsan, enim nec tincidunt aliquet, libero augue fringilla ipsum, at scelerisque tortor est sit amet justo. Vestibulum dictum, dui et dignissim facilisis, ipsum mauris condimentum quam, non mollis diam erat in risus. Morbi faucibus, velit sed porttitor adipiscing, dui magna iaculis mi, non feugiat quam justo nec odio. In eleifend, arcu id pellentesque venenatis, arcu turpis adipiscing leo, quis cursus metus nibh ac risus.
+
+In felis purus, porttitor eu facilisis ut, tincidunt eu risus. Quisque dictum scelerisque elementum. Fusce volutpat erat quis felis commodo adipiscing. Aenean cursus ligula ac metus accumsan commodo vitae vitae lacus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc quis nunc diam. Vestibulum vehicula, justo ut eleifend lobortis, libero orci tempor erat, quis ultricies lectus nunc nec nunc. Suspendisse tortor ligula, ornare eget accumsan et, semper a ante.
+
+Nulla a purus ut elit luctus laoreet ac sed turpis. Proin diam urna, luctus sed sagittis nec, pulvinar non magna. Aliquam hendrerit, sem non malesuada accumsan, nisl nulla commodo turpis, non semper lorem mi in quam. Aenean dolor nulla, eleifend et lacinia ut, ultricies ut ante. Suspendisse potenti. Vestibulum porta blandit adipiscing. Curabitur nunc orci, sit amet, molestie vitae lorem. Nunc quis commodo tellus. Suspendisse tristique metus vitae lectus luctus ac venenatis lectus pretium. Curabitur sed tellus mi. Nam nisi purus, sagittis vitae lobortis quis, porta eu libero. Cras elit mi, interdum a venenatis vitae, vulputate non erat~\citet{espinoza2012optimization}.
+
+Here is an equation:
+
+\begin{eqnarray}
+CIF_1: \hspace*{5mm}F_0^j(a) &=& \frac{1}{2\pi \iota} \oint_{\gamma} \frac{F_0^j(z)}{z - a} dz\\
+CIF_2: \hspace*{5mm}F_1^j(a) &=& \frac{1}{2\pi \iota} \oint_{\gamma} \frac{F_0^j(x)}{x - a} dx \label{eq:cif}
+\end{eqnarray}
+
+
+
+\subsection{This is a subsection}
+
+This is how a subsection would look like. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec pellentesque elit et turpis iaculis blandit. Nulla posuere ornare pulvinar. Aenean at turpis sem. Nam adipiscing porta imperdiet. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse posuere mi quis risus sagittis aliquam pulvinar orci vestibulum. Nullam sollicitudin adipiscing velit, quis lobortis metus interdum eu. Cras quis elit nulla. Etiam accumsan, enim nec tincidunt aliquet, libero augue fringilla ipsum, at scelerisque tortor est sit amet justo. Vestibulum dictum, dui et dignissim facilisis, ipsum mauris condimentum quam, non mollis diam erat in risus. Morbi faucibus, velit sed porttitor adipiscing, dui magna iaculis mi, non feugiat quam justo nec odio. In eleifend, arcu id pellentesque venenatis, arcu turpis adipiscing leo, quis cursus metus nibh ac risus.
+
+Sed aliquet mauris eu metus pulvinar hendrerit. Sed ac nisl id odio iaculis laoreet. Proin nisl orci, gravida at mollis vel, pulvinar eu arcu. Praesent volutpat commodo magna, et euismod nisi pellentesque sit amet. Proin felis orci, dignissim in sollicitudin sit amet, mattis sed arcu. Nam quam magna, imperdiet ut tincidunt sed, fringilla sed ante. Vivamus bibendum ornare nibh, sit amet mattis tellus luctus non.
+
+In tempor varius adipiscing. Sed pulvinar massa non lorem gravida volutpat. Vivamus eu vehicula leo. Ut tempus risus eu sem gravida suscipit nec ac augue. Aliquam sit amet quam diam. Sed eget urna neque, vel bibendum ante. Phasellus porta pretium porttitor. Mauris pharetra libero id tortor dignissim cursus. Proin at ligula sed lacus sodales sagittis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam mauris sapien, interdum at dapibus vel, commodo sit amet turpis. Sed dictum, mauris non consectetur iaculis, arcu turpis lobortis enim, ut bibendum metus magna id orci. Pellentesque vel purus odio, a euismod velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin non risus tellus. Proin interdum, mauris quis scelerisque consectetur, erat quam venenatis ante, eu consectetur sem nulla nec ante \index{Lorem Ipsum}.
+
+Sed aliquet mauris eu metus pulvinar hendrerit. Sed ac nisl id odio iaculis laoreet. Proin nisl orci, gravida at mollis vel, pulvinar eu arcu. Praesent volutpat commodo magna, et euismod nisi pellentesque sit amet. Proin felis orci, dignissim in sollicitudin sit amet, mattis sed arcu. Nam quam magna, imperdiet ut tincidunt sed, fringilla sed ante. Vivamus bibendum ornare nibh, sit amet mattis tellus luctus non.
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer accumsan imperdiet ante eget pretium. Duis hendrerit sem gravida mi sodales sit amet iaculis elit euismod. Maecenas fermentum semper quam id consectetur. Suspendisse potenti. Cras luctus bibendum placerat. Aliquam at leo lectus. Proin diam nibh, iaculis vitae rutrum vitae, elementum eget orci. Donec ac ullamcorper sapien. Praesent cursus, elit eget auctor faucibus, sapien justo interdum tellus, sit amet tincidunt nibh sapien et orci. Donec adipiscing feugiat elit, tristique mollis neque convallis non. Quisque non erat in purus porta commodo vitae eleifend diam. Donec dui quam, sagittis a varius aliquam, facilisis vel nisi. Fusce cursus nisi sed tortor commodo fringilla. Nam elementum pulvinar aliquet. Vivamus lectus orci, viverra ac porta in, commodo nec turpis.
+
+Maecenas ut sapien a massa consequat blandit volutpat vel arcu. Mauris eros orci, bibendum et congue eu, ultricies vitae neque. In convallis lorem ac nisi auctor tincidunt. Pellentesque ac erat tellus, ac luctus quam. Aenean bibendum, mi nec tempus sagittis, justo diam commodo mauris, vel fringilla sem sem non elit. Morbi feugiat dui malesuada turpis fringilla congue. Integer magna leo, fermentum vitae placerat non, aliquet non sapien. Suspendisse potenti.
+
+Etiam sollicitudin dui id massa aliquet fringilla. Aenean diam magna, condimentum sed pulvinar vel, sagittis eget urna. Phasellus imperdiet pulvinar arcu, commodo suscipit nunc posuere a. Maecenas laoreet, odio id tincidunt imperdiet, leo lorem tincidunt turpis, a egestas eros augue sed augue. Proin eget nulla non felis consectetur rhoncus. Aenean blandit feugiat feugiat. Aenean congue tempor dui eget varius. Etiam lectus nisl, lacinia quis dictum vitae, euismod in neque. Etiam sollicitudin venenatis molestie. Nulla sed lacinia odio. Sed ac orci leo, pulvinar blandit eros. Donec ac tristique erat.
+
+Integer nulla ligula, elementum eu iaculis vel, gravida sit amet odio. Sed dictum diam sit amet lacus egestas ornare. Donec scelerisque neque ut dolor hendrerit venenatis tristique purus bibendum. Integer porta dignissim est, quis eleifend est interdum id. Donec libero metus, consectetur et fringilla at, auctor ac odio. Nullam enim dolor, placerat vitae eleifend eu, pretium sed metus. Aenean eget felis nec neque sodales imperdiet. Ut mattis risus ultrices sem eleifend ut adipiscing diam bibendum. Sed bibendum metus eget orci interdum volutpat. Donec et sapien eget turpis luctus tincidunt. Quisque eget sapien non felis egestas cursus at ut magna. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur dapibus interdum neque, ut dapibus justo suscipit a. Donec consequat feugiat vestibulum. Curabitur id ipsum iaculis est vehicula aliquet at quis nisi.
+
+Proin bibendum velit in est luctus sit amet tristique libero feugiat. Praesent porttitor placerat turpis, id mattis tellus vehicula vitae. Suspendisse lacinia laoreet iaculis. Maecenas cursus viverra tortor in lobortis. Aenean et nulla id nisl dapibus venenatis. Aenean at sem ac dui pretium blandit. Praesent sagittis neque vitae mauris tempor eleifend. Mauris rutrum fermentum ultrices.
+
+
diff --git a/macros/latex/contrib/feupphdteses/Chapter3.tex b/macros/latex/contrib/feupphdteses/Chapter3.tex
new file mode 100644
index 0000000000..dba775775b
--- /dev/null
+++ b/macros/latex/contrib/feupphdteses/Chapter3.tex
@@ -0,0 +1,20 @@
+\chapter{Chapter Title}
+\label{chap:Chapter3}
+
+\section{This is a section}
+
+This is how a section would look like \index{Looks}.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec pellentesque elit et turpis iaculis blandit. Nulla posuere ornare pulvinar. Aenean at turpis sem. Nam adipiscing porta imperdiet. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse posuere mi quis risus sagittis aliquam pulvinar orci vestibulum. Nullam sollicitudin adipiscing velit, quis lobortis metus interdum eu. Cras quis elit nulla. Etiam accumsan, enim nec tincidunt aliquet, libero augue fringilla ipsum, at scelerisque tortor est sit amet justo. Vestibulum dictum, dui et dignissim facilisis, ipsum mauris condimentum quam, non mollis diam erat in risus. Morbi faucibus, velit sed porttitor adipiscing, dui magna iaculis mi, non feugiat quam justo nec odio. In eleifend, arcu id pellentesque venenatis, arcu turpis adipiscing leo, quis cursus metus nibh ac risus.
+
+In felis purus, porttitor eu facilisis ut, tincidunt eu risus. Quisque dictum scelerisque elementum. Fusce volutpat erat quis felis commodo adipiscing. Aenean cursus ligula ac metus accumsan commodo vitae vitae lacus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc quis nunc diam. Vestibulum vehicula, justo ut eleifend lobortis, libero orci tempor erat, quis ultricies lectus nunc nec nunc. Suspendisse tortor ligula, ornare eget accumsan et, semper a ante.
+
+Nulla a purus ut elit luctus laoreet ac sed turpis. Proin diam urna, luctus sed sagittis nec, pulvinar non magna. Aliquam hendrerit, sem non malesuada accumsan, nisl nulla commodo turpis, non semper lorem mi in quam. Aenean dolor nulla, eleifend et lacinia ut, ultricies ut ante. Suspendisse potenti. Vestibulum porta blandit adipiscing. Curabitur nunc orci, euismod ut vehicula sit amet, molestie vitae lorem. Nunc quis commodo tellus. Suspendisse tristique metus vitae lectus luctus ac venenatis lectus pretium. Curabitur sed tellus mi. Nam nisi purus, sagittis vitae lobortis quis, porta eu libero. Cras elit mi, interdum a venenatis vitae, vulputate non erat.
+
+
+
+\subsection{This is a subsection}
+
+This is how a subsection would look like. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec pellentesque elit et turpis iaculis blandit. Nulla posuere ornare pulvinar. Aenean at turpis sem. Nam adipiscing porta imperdiet. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse posuere mi quis risus sagittis aliquam pulvinar orci vestibulum. Nullam sollicitudin adipiscing velit, quis lobortis metus interdum eu. Cras quis elit nulla. Etiam accumsan, enim nec tincidunt aliquet, libero augue fringilla ipsum, at scelerisque tortor est sit amet justo. Vestibulum dictum, dui et dignissim facilisis, ipsum mauris condimentum quam, non mollis diam erat in risus. Morbi faucibus, velit sed porttitor adipiscing, dui magna iaculis mi, non feugiat quam justo nec odio. In eleifend, arcu id pellentesque venenatis, arcu turpis adipiscing leo, quis cursus metus nibh ac risus.
+
+Sed aliquet mauris eu metus pulvinar hendrerit. Sed ac nisl id odio iaculis laoreet. Proin nisl orci, gravida at mollis vel, pulvinar eu arcu. Praesent volutpat commodo magna, et euismod nisi pellentesque sit amet. Proin felis orci, dignissim in sollicitudin sit amet, mattis sed arcu. Nam quam magna, imperdiet ut tincidunt sed, fringilla sed ante. Vivamus bibendum ornare nibh, sit amet mattis tellus luctus non.
+
+In tempor varius adipiscing. Sed pulvinar massa non lorem gravida volutpat. Vivamus eu vehicula leo. Ut tempus risus eu sem gravida suscipit nec ac augue. Aliquam sit amet quam diam. Sed eget urna neque, vel bibendum ante. Phasellus porta pretium porttitor. Mauris pharetra libero id tortor dignissim cursus. Proin at ligula sed lacus sodales sagittis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam mauris sapien, interdum at dapibus vel, commodo sit amet turpis. Sed dictum, mauris non consectetur iaculis, arcu turpis lobortis enim, ut bibendum metus magna id orci. Pellentesque vel purus odio, a euismod velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin non risus tellus. Proin interdum, mauris quis scelerisque consectetur, erat quam venenatis ante, eu consectetur sem nulla nec ante.
diff --git a/macros/latex/contrib/feupphdteses/Conclusions.tex b/macros/latex/contrib/feupphdteses/Conclusions.tex
new file mode 100644
index 0000000000..755c13fd04
--- /dev/null
+++ b/macros/latex/contrib/feupphdteses/Conclusions.tex
@@ -0,0 +1,4 @@
+\chapter{Conclusions and Future Work}
+\label{chap:Conc}
+
+Lorem ipsum.
diff --git a/macros/latex/contrib/feupphdteses/Dedicatory.tex b/macros/latex/contrib/feupphdteses/Dedicatory.tex
new file mode 100644
index 0000000000..d5be0b5f05
--- /dev/null
+++ b/macros/latex/contrib/feupphdteses/Dedicatory.tex
@@ -0,0 +1,7 @@
+\thispagestyle{empty}
+
+\vspace*{150mm}
+\begin{flushright}
+ \textit{To whom you wish to dedicate this thesis to.}
+\end{flushright}
+
diff --git a/macros/latex/contrib/feupphdteses/Figures/uporto-feup.pdf b/macros/latex/contrib/feupphdteses/Figures/uporto-feup.pdf
new file mode 100644
index 0000000000..0c09c9b390
--- /dev/null
+++ b/macros/latex/contrib/feupphdteses/Figures/uporto-feup.pdf
Binary files differ
diff --git a/macros/latex/contrib/feupphdteses/IEEEtranN.bst b/macros/latex/contrib/feupphdteses/IEEEtranN.bst
new file mode 100644
index 0000000000..f0469ed381
--- /dev/null
+++ b/macros/latex/contrib/feupphdteses/IEEEtranN.bst
@@ -0,0 +1,2716 @@
+%%
+%% IEEEtranN.bst
+%% BibTeX Bibliography Style file
+%% Natbib version of IEEEtran.bst
+%% *** Not for normal IEEE work ***
+%% Version 1.13 (2008/09/30)
+%%
+%% Copyright (c) 2003-2008 Michael Shell
+%%
+%% Original starting code base and algorithms obtained from the output of
+%% Patrick W. Daly's makebst package as well as from prior versions of
+%% IEEE BibTeX styles:
+%%
+%% 1. Howard Trickey and Oren Patashnik's ieeetr.bst (1985/1988)
+%% 2. Silvano Balemi and Richard H. Roy's IEEEbib.bst (1993)
+%%
+%% Added sorting and natbib code is from Patrick W Daly's unsrtnat.bst
+%%
+%%
+%% Support sites:
+%% http://www.michaelshell.org/tex/ieeetran/
+%% http://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/
+%% and/or
+%% http://www.ieee.org/
+%%
+%% For use with BibTeX version 0.99a or later
+%%
+%% This is a natbib compatible citation style.
+%%
+%%*************************************************************************
+%% Legal Notice:
+%% This code is offered as-is without any warranty either expressed or
+%% implied; without even the implied warranty of MERCHANTABILITY or
+%% FITNESS FOR A PARTICULAR PURPOSE!
+%% User assumes all risk.
+%% In no event shall IEEE or any contributor to this code be liable for
+%% any damages or losses, including, but not limited to, incidental,
+%% consequential, or any other damages, resulting from the use or misuse
+%% of any information contained here.
+%%
+%% All comments are the opinions of their respective authors and are not
+%% necessarily endorsed by the IEEE.
+%%
+%% This work is distributed under the LaTeX Project Public License (LPPL)
+%% ( http://www.latex-project.org/ ) version 1.3, and may be freely used,
+%% distributed and modified. A copy of the LPPL, version 1.3, is included
+%% in the base LaTeX documentation of all distributions of LaTeX released
+%% 2003/12/01 or later.
+%% Retain all contribution notices and credits.
+%% ** Modified files should be clearly indicated as such, including **
+%% ** renaming them and changing author support contact information. **
+%%
+%% File list of work: IEEEabrv.bib, IEEEfull.bib, IEEEexample.bib,
+%% IEEEtran.bst, IEEEtranS.bst, IEEEtranSA.bst,
+%% IEEEtranN.bst, IEEEtranSN.bst, IEEEtran_bst_HOWTO.pdf
+%%*************************************************************************
+%
+%
+% Changelog:
+%
+% 1.12 (2007/01/11) Initial release
+%
+% 1.13 (2008/09/30)
+% 1. Fixed bug with edition number to ordinal conversion. Thanks to
+% Michael Roland for reporting this and correcting the algorithm.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% DEFAULTS FOR THE CONTROLS OF THE BST STYLE %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% These are the defaults for the user adjustable controls. The values used
+% here can be overridden by the user via IEEEtranBSTCTL entry type.
+
+% NOTE: The recommended LaTeX command to invoke a control entry type is:
+%
+%\makeatletter
+%\def\bstctlcite{\@ifnextchar[{\@bstctlcite}{\@bstctlcite[@auxout]}}
+%\def\@bstctlcite[#1]#2{\@bsphack
+% \@for\@citeb:=#2\do{%
+% \edef\@citeb{\expandafter\@firstofone\@citeb}%
+% \if@filesw\immediate\write\csname #1\endcsname{\string\citation{\@citeb}}\fi}%
+% \@esphack}
+%\makeatother
+%
+% It is called at the start of the document, before the first \cite, like:
+% \bstctlcite{IEEEexample:BSTcontrol}
+%
+% IEEEtran.cls V1.6 and later does provide this command.
+
+
+
+% #0 turns off the display of the number for articles.
+% #1 enables
+FUNCTION {default.is.use.number.for.article} { #1 }
+
+
+% #0 turns off the display of the paper and type fields in @inproceedings.
+% #1 enables
+FUNCTION {default.is.use.paper} { #1 }
+
+
+% #0 turns off the forced use of "et al."
+% #1 enables
+FUNCTION {default.is.forced.et.al} { #0 }
+
+% The maximum number of names that can be present beyond which an "et al."
+% usage is forced. Be sure that num.names.shown.with.forced.et.al (below)
+% is not greater than this value!
+% Note: There are many instances of references in IEEE journals which have
+% a very large number of authors as well as instances in which "et al." is
+% used profusely.
+FUNCTION {default.max.num.names.before.forced.et.al} { #10 }
+
+% The number of names that will be shown with a forced "et al.".
+% Must be less than or equal to max.num.names.before.forced.et.al
+FUNCTION {default.num.names.shown.with.forced.et.al} { #1 }
+
+
+% #0 turns off the alternate interword spacing for entries with URLs.
+% #1 enables
+FUNCTION {default.is.use.alt.interword.spacing} { #1 }
+
+% If alternate interword spacing for entries with URLs is enabled, this is
+% the interword spacing stretch factor that will be used. For example, the
+% default "4" here means that the interword spacing in entries with URLs can
+% stretch to four times normal. Does not have to be an integer. Note that
+% the value specified here can be overridden by the user in their LaTeX
+% code via a command such as:
+% "\providecommand\BIBentryALTinterwordstretchfactor{1.5}" in addition to
+% that via the IEEEtranBSTCTL entry type.
+FUNCTION {default.ALTinterwordstretchfactor} { "4" }
+
+
+% #0 turns off the "dashification" of repeated (i.e., identical to those
+% of the previous entry) names. IEEE normally does this.
+% #1 enables
+FUNCTION {default.is.dash.repeated.names} { #1 }
+
+
+% The default name format control string.
+FUNCTION {default.name.format.string}{ "{f.~}{vv~}{ll}{, jj}" }
+
+
+% The default LaTeX font command for the names.
+FUNCTION {default.name.latex.cmd}{ "" }
+
+
+% The default URL prefix.
+FUNCTION {default.name.url.prefix}{ "[Online]. Available:" }
+
+
+% Other controls that cannot be accessed via IEEEtranBSTCTL entry type.
+
+% #0 turns off the terminal startup banner/completed message so as to
+% operate more quietly.
+% #1 enables
+FUNCTION {is.print.banners.to.terminal} { #1 }
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% FILE VERSION AND BANNER %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+FUNCTION{bst.file.version} { "1.13" }
+FUNCTION{bst.file.date} { "2008/09/30" }
+FUNCTION{bst.file.website} { "http://www.michaelshell.org/tex/ieeetran/bibtex/" }
+
+FUNCTION {banner.message}
+{ is.print.banners.to.terminal
+ { "-- IEEEtranN.bst version" " " * bst.file.version *
+ " (" * bst.file.date * ") " * "by Michael Shell." *
+ top$
+ "-- " bst.file.website *
+ top$
+ "-- See the " quote$ * "IEEEtran_bst_HOWTO.pdf" * quote$ * " manual for usage information." *
+ top$
+ "** Natbib version - not for normal IEEE work."
+ top$
+ }
+ { skip$ }
+ if$
+}
+
+FUNCTION {completed.message}
+{ is.print.banners.to.terminal
+ { ""
+ top$
+ "Done."
+ top$
+ }
+ { skip$ }
+ if$
+}
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%
+%% STRING CONSTANTS %%
+%%%%%%%%%%%%%%%%%%%%%%
+
+FUNCTION {bbl.and}{ "and" }
+FUNCTION {bbl.etal}{ "et~al." }
+FUNCTION {bbl.editors}{ "eds." }
+FUNCTION {bbl.editor}{ "ed." }
+FUNCTION {bbl.edition}{ "ed." }
+FUNCTION {bbl.volume}{ "vol." }
+FUNCTION {bbl.of}{ "of" }
+FUNCTION {bbl.number}{ "no." }
+FUNCTION {bbl.in}{ "in" }
+FUNCTION {bbl.pages}{ "pp." }
+FUNCTION {bbl.page}{ "p." }
+FUNCTION {bbl.chapter}{ "ch." }
+FUNCTION {bbl.paper}{ "paper" }
+FUNCTION {bbl.part}{ "pt." }
+FUNCTION {bbl.patent}{ "Patent" }
+FUNCTION {bbl.patentUS}{ "U.S." }
+FUNCTION {bbl.revision}{ "Rev." }
+FUNCTION {bbl.series}{ "ser." }
+FUNCTION {bbl.standard}{ "Std." }
+FUNCTION {bbl.techrep}{ "Tech. Rep." }
+FUNCTION {bbl.mthesis}{ "Master's thesis" }
+FUNCTION {bbl.phdthesis}{ "Ph.D. dissertation" }
+FUNCTION {bbl.st}{ "st" }
+FUNCTION {bbl.nd}{ "nd" }
+FUNCTION {bbl.rd}{ "rd" }
+FUNCTION {bbl.th}{ "th" }
+
+
+% This is the LaTeX spacer that is used when a larger than normal space
+% is called for (such as just before the address:publisher).
+FUNCTION {large.space} { "\hskip 1em plus 0.5em minus 0.4em\relax " }
+
+% The LaTeX code for dashes that are used to represent repeated names.
+% Note: Some older IEEE journals used something like
+% "\rule{0.275in}{0.5pt}\," which is fairly thick and runs right along
+% the baseline. However, IEEE now uses a thinner, above baseline,
+% six dash long sequence.
+FUNCTION {repeated.name.dashes} { "------" }
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% PREDEFINED STRING MACROS %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+MACRO {jan} {"Jan."}
+MACRO {feb} {"Feb."}
+MACRO {mar} {"Mar."}
+MACRO {apr} {"Apr."}
+MACRO {may} {"May"}
+MACRO {jun} {"Jun."}
+MACRO {jul} {"Jul."}
+MACRO {aug} {"Aug."}
+MACRO {sep} {"Sep."}
+MACRO {oct} {"Oct."}
+MACRO {nov} {"Nov."}
+MACRO {dec} {"Dec."}
+
+
+
+%%%%%%%%%%%%%%%%%%
+%% ENTRY FIELDS %%
+%%%%%%%%%%%%%%%%%%
+
+ENTRY
+ { address
+ assignee
+ author
+ booktitle
+ chapter
+ day
+ dayfiled
+ edition
+ editor
+ howpublished
+ institution
+ intype
+ journal
+ key
+ language
+ month
+ monthfiled
+ nationality
+ note
+ number
+ organization
+ pages
+ paper
+ publisher
+ school
+ series
+ revision
+ title
+ type
+ url
+ volume
+ year
+ yearfiled
+ CTLuse_article_number
+ CTLuse_paper
+ CTLuse_forced_etal
+ CTLmax_names_forced_etal
+ CTLnames_show_etal
+ CTLuse_alt_spacing
+ CTLalt_stretch_factor
+ CTLdash_repeated_names
+ CTLname_format_string
+ CTLname_latex_cmd
+ CTLname_url_prefix
+ }
+ {}
+ { label extra.label sort.label short.list}
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%
+%% INTEGER VARIABLES %%
+%%%%%%%%%%%%%%%%%%%%%%%
+
+INTEGERS { prev.status.punct this.status.punct punct.std
+ punct.no punct.comma punct.period
+ prev.status.space this.status.space space.std
+ space.no space.normal space.large
+ prev.status.quote this.status.quote quote.std
+ quote.no quote.close
+ prev.status.nline this.status.nline nline.std
+ nline.no nline.newblock
+ status.cap cap.std
+ cap.no cap.yes}
+
+INTEGERS { longest.label.width multiresult nameptr namesleft number.label numnames }
+
+INTEGERS { is.use.number.for.article
+ is.use.paper
+ is.forced.et.al
+ max.num.names.before.forced.et.al
+ num.names.shown.with.forced.et.al
+ is.use.alt.interword.spacing
+ is.dash.repeated.names}
+
+
+%%%%%%%%%%%%%%%%%%%%%%
+%% STRING VARIABLES %%
+%%%%%%%%%%%%%%%%%%%%%%
+
+STRINGS { bibinfo
+ longest.label
+ oldname
+ s
+ t
+ ALTinterwordstretchfactor
+ name.format.string
+ name.latex.cmd
+ name.url.prefix}
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%
+%% LOW LEVEL FUNCTIONS %%
+%%%%%%%%%%%%%%%%%%%%%%%%%
+
+FUNCTION {initialize.controls}
+{ default.is.use.number.for.article 'is.use.number.for.article :=
+ default.is.use.paper 'is.use.paper :=
+ default.is.forced.et.al 'is.forced.et.al :=
+ default.max.num.names.before.forced.et.al 'max.num.names.before.forced.et.al :=
+ default.num.names.shown.with.forced.et.al 'num.names.shown.with.forced.et.al :=
+ default.is.use.alt.interword.spacing 'is.use.alt.interword.spacing :=
+ default.is.dash.repeated.names 'is.dash.repeated.names :=
+ default.ALTinterwordstretchfactor 'ALTinterwordstretchfactor :=
+ default.name.format.string 'name.format.string :=
+ default.name.latex.cmd 'name.latex.cmd :=
+ default.name.url.prefix 'name.url.prefix :=
+}
+
+
+% This IEEEtran.bst features a very powerful and flexible mechanism for
+% controlling the capitalization, punctuation, spacing, quotation, and
+% newlines of the formatted entry fields. (Note: IEEEtran.bst does not need
+% or use the newline/newblock feature, but it has been implemented for
+% possible future use.) The output states of IEEEtran.bst consist of
+% multiple independent attributes and, as such, can be thought of as being
+% vectors, rather than the simple scalar values ("before.all",
+% "mid.sentence", etc.) used in most other .bst files.
+%
+% The more flexible and complex design used here was motivated in part by
+% IEEE's rather unusual bibliography style. For example, IEEE ends the
+% previous field item with a period and large space prior to the publisher
+% address; the @electronic entry types use periods as inter-item punctuation
+% rather than the commas used by the other entry types; and URLs are never
+% followed by periods even though they are the last item in the entry.
+% Although it is possible to accommodate these features with the conventional
+% output state system, the seemingly endless exceptions make for convoluted,
+% unreliable and difficult to maintain code.
+%
+% IEEEtran.bst's output state system can be easily understood via a simple
+% illustration of two most recently formatted entry fields (on the stack):
+%
+% CURRENT_ITEM
+% "PREVIOUS_ITEM
+%
+% which, in this example, is to eventually appear in the bibliography as:
+%
+% "PREVIOUS_ITEM," CURRENT_ITEM
+%
+% It is the job of the output routine to take the previous item off of the
+% stack (while leaving the current item at the top of the stack), apply its
+% trailing punctuation (including closing quote marks) and spacing, and then
+% to write the result to BibTeX's output buffer:
+%
+% "PREVIOUS_ITEM,"
+%
+% Punctuation (and spacing) between items is often determined by both of the
+% items rather than just the first one. The presence of quotation marks
+% further complicates the situation because, in standard English, trailing
+% punctuation marks are supposed to be contained within the quotes.
+%
+% IEEEtran.bst maintains two output state (aka "status") vectors which
+% correspond to the previous and current (aka "this") items. Each vector
+% consists of several independent attributes which track punctuation,
+% spacing, quotation, and newlines. Capitalization status is handled by a
+% separate scalar because the format routines, not the output routine,
+% handle capitalization and, therefore, there is no need to maintain the
+% capitalization attribute for both the "previous" and "this" items.
+%
+% When a format routine adds a new item, it copies the current output status
+% vector to the previous output status vector and (usually) resets the
+% current (this) output status vector to a "standard status" vector. Using a
+% "standard status" vector in this way allows us to redefine what we mean by
+% "standard status" at the start of each entry handler and reuse the same
+% format routines under the various inter-item separation schemes. For
+% example, the standard status vector for the @book entry type may use
+% commas for item separators, while the @electronic type may use periods,
+% yet both entry handlers exploit many of the exact same format routines.
+%
+% Because format routines have write access to the output status vector of
+% the previous item, they can override the punctuation choices of the
+% previous format routine! Therefore, it becomes trivial to implement rules
+% such as "Always use a period and a large space before the publisher." By
+% pushing the generation of the closing quote mark to the output routine, we
+% avoid all the problems caused by having to close a quote before having all
+% the information required to determine what the punctuation should be.
+%
+% The IEEEtran.bst output state system can easily be expanded if needed.
+% For instance, it is easy to add a "space.tie" attribute value if the
+% bibliography rules mandate that two items have to be joined with an
+% unbreakable space.
+
+FUNCTION {initialize.status.constants}
+{ #0 'punct.no :=
+ #1 'punct.comma :=
+ #2 'punct.period :=
+ #0 'space.no :=
+ #1 'space.normal :=
+ #2 'space.large :=
+ #0 'quote.no :=
+ #1 'quote.close :=
+ #0 'cap.no :=
+ #1 'cap.yes :=
+ #0 'nline.no :=
+ #1 'nline.newblock :=
+}
+
+FUNCTION {std.status.using.comma}
+{ punct.comma 'punct.std :=
+ space.normal 'space.std :=
+ quote.no 'quote.std :=
+ nline.no 'nline.std :=
+ cap.no 'cap.std :=
+}
+
+FUNCTION {std.status.using.period}
+{ punct.period 'punct.std :=
+ space.normal 'space.std :=
+ quote.no 'quote.std :=
+ nline.no 'nline.std :=
+ cap.yes 'cap.std :=
+}
+
+FUNCTION {initialize.prev.this.status}
+{ punct.no 'prev.status.punct :=
+ space.no 'prev.status.space :=
+ quote.no 'prev.status.quote :=
+ nline.no 'prev.status.nline :=
+ punct.no 'this.status.punct :=
+ space.no 'this.status.space :=
+ quote.no 'this.status.quote :=
+ nline.no 'this.status.nline :=
+ cap.yes 'status.cap :=
+}
+
+FUNCTION {this.status.std}
+{ punct.std 'this.status.punct :=
+ space.std 'this.status.space :=
+ quote.std 'this.status.quote :=
+ nline.std 'this.status.nline :=
+}
+
+FUNCTION {cap.status.std}{ cap.std 'status.cap := }
+
+FUNCTION {this.to.prev.status}
+{ this.status.punct 'prev.status.punct :=
+ this.status.space 'prev.status.space :=
+ this.status.quote 'prev.status.quote :=
+ this.status.nline 'prev.status.nline :=
+}
+
+
+FUNCTION {not}
+{ { #0 }
+ { #1 }
+ if$
+}
+
+FUNCTION {and}
+{ { skip$ }
+ { pop$ #0 }
+ if$
+}
+
+FUNCTION {or}
+{ { pop$ #1 }
+ { skip$ }
+ if$
+}
+
+
+% convert the strings "yes" or "no" to #1 or #0 respectively
+FUNCTION {yes.no.to.int}
+{ "l" change.case$ duplicate$
+ "yes" =
+ { pop$ #1 }
+ { duplicate$ "no" =
+ { pop$ #0 }
+ { "unknown boolean " quote$ * swap$ * quote$ *
+ " in " * cite$ * warning$
+ #0
+ }
+ if$
+ }
+ if$
+}
+
+
+% pushes true if the single char string on the stack is in the
+% range of "0" to "9"
+FUNCTION {is.num}
+{ chr.to.int$
+ duplicate$ "0" chr.to.int$ < not
+ swap$ "9" chr.to.int$ > not and
+}
+
+% multiplies the integer on the stack by a factor of 10
+FUNCTION {bump.int.mag}
+{ #0 'multiresult :=
+ { duplicate$ #0 > }
+ { #1 -
+ multiresult #10 +
+ 'multiresult :=
+ }
+ while$
+pop$
+multiresult
+}
+
+% converts a single character string on the stack to an integer
+FUNCTION {char.to.integer}
+{ duplicate$
+ is.num
+ { chr.to.int$ "0" chr.to.int$ - }
+ {"noninteger character " quote$ * swap$ * quote$ *
+ " in integer field of " * cite$ * warning$
+ #0
+ }
+ if$
+}
+
+% converts a string on the stack to an integer
+FUNCTION {string.to.integer}
+{ duplicate$ text.length$ 'namesleft :=
+ #1 'nameptr :=
+ #0 'numnames :=
+ { nameptr namesleft > not }
+ { duplicate$ nameptr #1 substring$
+ char.to.integer numnames bump.int.mag +
+ 'numnames :=
+ nameptr #1 +
+ 'nameptr :=
+ }
+ while$
+pop$
+numnames
+}
+
+
+
+
+% The output routines write out the *next* to the top (previous) item on the
+% stack, adding punctuation and such as needed. Since IEEEtran.bst maintains
+% the output status for the top two items on the stack, these output
+% routines have to consider the previous output status (which corresponds to
+% the item that is being output). Full independent control of punctuation,
+% closing quote marks, spacing, and newblock is provided.
+%
+% "output.nonnull" does not check for the presence of a previous empty
+% item.
+%
+% "output" does check for the presence of a previous empty item and will
+% remove an empty item rather than outputing it.
+%
+% "output.warn" is like "output", but will issue a warning if it detects
+% an empty item.
+
+FUNCTION {output.nonnull}
+{ swap$
+ prev.status.punct punct.comma =
+ { "," * }
+ { skip$ }
+ if$
+ prev.status.punct punct.period =
+ { add.period$ }
+ { skip$ }
+ if$
+ prev.status.quote quote.close =
+ { "''" * }
+ { skip$ }
+ if$
+ prev.status.space space.normal =
+ { " " * }
+ { skip$ }
+ if$
+ prev.status.space space.large =
+ { large.space * }
+ { skip$ }
+ if$
+ write$
+ prev.status.nline nline.newblock =
+ { newline$ "\newblock " write$ }
+ { skip$ }
+ if$
+}
+
+FUNCTION {output}
+{ duplicate$ empty$
+ 'pop$
+ 'output.nonnull
+ if$
+}
+
+FUNCTION {output.warn}
+{ 't :=
+ duplicate$ empty$
+ { pop$ "empty " t * " in " * cite$ * warning$ }
+ 'output.nonnull
+ if$
+}
+
+% "fin.entry" is the output routine that handles the last item of the entry
+% (which will be on the top of the stack when "fin.entry" is called).
+
+FUNCTION {fin.entry}
+{ this.status.punct punct.no =
+ { skip$ }
+ { add.period$ }
+ if$
+ this.status.quote quote.close =
+ { "''" * }
+ { skip$ }
+ if$
+write$
+newline$
+}
+
+
+FUNCTION {is.last.char.not.punct}
+{ duplicate$
+ "}" * add.period$
+ #-1 #1 substring$ "." =
+}
+
+FUNCTION {is.multiple.pages}
+{ 't :=
+ #0 'multiresult :=
+ { multiresult not
+ t empty$ not
+ and
+ }
+ { t #1 #1 substring$
+ duplicate$ "-" =
+ swap$ duplicate$ "," =
+ swap$ "+" =
+ or or
+ { #1 'multiresult := }
+ { t #2 global.max$ substring$ 't := }
+ if$
+ }
+ while$
+ multiresult
+}
+
+FUNCTION {capitalize}{ "u" change.case$ "t" change.case$ }
+
+FUNCTION {emphasize}
+{ duplicate$ empty$
+ { pop$ "" }
+ { "\emph{" swap$ * "}" * }
+ if$
+}
+
+FUNCTION {do.name.latex.cmd}
+{ name.latex.cmd
+ empty$
+ { skip$ }
+ { name.latex.cmd "{" * swap$ * "}" * }
+ if$
+}
+
+% IEEEtran.bst uses its own \BIBforeignlanguage command which directly
+% invokes the TeX hyphenation patterns without the need of the Babel
+% package. Babel does a lot more than switch hyphenation patterns and
+% its loading can cause unintended effects in many class files (such as
+% IEEEtran.cls).
+FUNCTION {select.language}
+{ duplicate$ empty$ 'pop$
+ { language empty$ 'skip$
+ { "\BIBforeignlanguage{" language * "}{" * swap$ * "}" * }
+ if$
+ }
+ if$
+}
+
+FUNCTION {tie.or.space.prefix}
+{ duplicate$ text.length$ #3 <
+ { "~" }
+ { " " }
+ if$
+ swap$
+}
+
+FUNCTION {get.bbl.editor}
+{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ }
+
+FUNCTION {space.word}{ " " swap$ * " " * }
+
+
+% Field Conditioners, Converters, Checkers and External Interfaces
+
+FUNCTION {empty.field.to.null.string}
+{ duplicate$ empty$
+ { pop$ "" }
+ { skip$ }
+ if$
+}
+
+FUNCTION {either.or.check}
+{ empty$
+ { pop$ }
+ { "can't use both " swap$ * " fields in " * cite$ * warning$ }
+ if$
+}
+
+FUNCTION {empty.entry.warn}
+{ author empty$ title empty$ howpublished empty$
+ month empty$ year empty$ note empty$ url empty$
+ and and and and and and
+ { "all relevant fields are empty in " cite$ * warning$ }
+ 'skip$
+ if$
+}
+
+
+% The bibinfo system provides a way for the electronic parsing/acquisition
+% of a bibliography's contents as is done by ReVTeX. For example, a field
+% could be entered into the bibliography as:
+% \bibinfo{volume}{2}
+% Only the "2" would show up in the document, but the LaTeX \bibinfo command
+% could do additional things with the information. IEEEtran.bst does provide
+% a \bibinfo command via "\providecommand{\bibinfo}[2]{#2}". However, it is
+% currently not used as the bogus bibinfo functions defined here output the
+% entry values directly without the \bibinfo wrapper. The bibinfo functions
+% themselves (and the calls to them) are retained for possible future use.
+%
+% bibinfo.check avoids acting on missing fields while bibinfo.warn will
+% issue a warning message if a missing field is detected. Prior to calling
+% the bibinfo functions, the user should push the field value and then its
+% name string, in that order.
+
+FUNCTION {bibinfo.check}
+{ swap$ duplicate$ missing$
+ { pop$ pop$ "" }
+ { duplicate$ empty$
+ { swap$ pop$ }
+ { swap$ pop$ }
+ if$
+ }
+ if$
+}
+
+FUNCTION {bibinfo.warn}
+{ swap$ duplicate$ missing$
+ { swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ "" }
+ { duplicate$ empty$
+ { swap$ "empty " swap$ * " in " * cite$ * warning$ }
+ { swap$ pop$ }
+ if$
+ }
+ if$
+}
+
+
+% IEEE separates large numbers with more than 4 digits into groups of
+% three. IEEE uses a small space to separate these number groups.
+% Typical applications include patent and page numbers.
+
+% number of consecutive digits required to trigger the group separation.
+FUNCTION {large.number.trigger}{ #5 }
+
+% For numbers longer than the trigger, this is the blocksize of the groups.
+% The blocksize must be less than the trigger threshold, and 2 * blocksize
+% must be greater than the trigger threshold (can't do more than one
+% separation on the initial trigger).
+FUNCTION {large.number.blocksize}{ #3 }
+
+% What is actually inserted between the number groups.
+FUNCTION {large.number.separator}{ "\," }
+
+% So as to save on integer variables by reusing existing ones, numnames
+% holds the current number of consecutive digits read and nameptr holds
+% the number that will trigger an inserted space.
+FUNCTION {large.number.separate}
+{ 't :=
+ ""
+ #0 'numnames :=
+ large.number.trigger 'nameptr :=
+ { t empty$ not }
+ { t #-1 #1 substring$ is.num
+ { numnames #1 + 'numnames := }
+ { #0 'numnames :=
+ large.number.trigger 'nameptr :=
+ }
+ if$
+ t #-1 #1 substring$ swap$ *
+ t #-2 global.max$ substring$ 't :=
+ numnames nameptr =
+ { duplicate$ #1 nameptr large.number.blocksize - substring$ swap$
+ nameptr large.number.blocksize - #1 + global.max$ substring$
+ large.number.separator swap$ * *
+ nameptr large.number.blocksize - 'numnames :=
+ large.number.blocksize #1 + 'nameptr :=
+ }
+ { skip$ }
+ if$
+ }
+ while$
+}
+
+% Converts all single dashes "-" to double dashes "--".
+FUNCTION {n.dashify}
+{ large.number.separate
+ 't :=
+ ""
+ { t empty$ not }
+ { t #1 #1 substring$ "-" =
+ { t #1 #2 substring$ "--" = not
+ { "--" *
+ t #2 global.max$ substring$ 't :=
+ }
+ { { t #1 #1 substring$ "-" = }
+ { "-" *
+ t #2 global.max$ substring$ 't :=
+ }
+ while$
+ }
+ if$
+ }
+ { t #1 #1 substring$ *
+ t #2 global.max$ substring$ 't :=
+ }
+ if$
+ }
+ while$
+}
+
+
+% This function detects entries with names that are identical to that of
+% the previous entry and replaces the repeated names with dashes (if the
+% "is.dash.repeated.names" user control is nonzero).
+FUNCTION {name.or.dash}
+{ 's :=
+ oldname empty$
+ { s 'oldname := s }
+ { s oldname =
+ { is.dash.repeated.names
+ { repeated.name.dashes }
+ { s 'oldname := s }
+ if$
+ }
+ { s 'oldname := s }
+ if$
+ }
+ if$
+}
+
+% Converts the number string on the top of the stack to
+% "numerical ordinal form" (e.g., "7" to "7th"). There is
+% no artificial limit to the upper bound of the numbers as the
+% two least significant digits determine the ordinal form.
+FUNCTION {num.to.ordinal}
+{ duplicate$ #-2 #1 substring$ "1" =
+ { bbl.th * }
+ { duplicate$ #-1 #1 substring$ "1" =
+ { bbl.st * }
+ { duplicate$ #-1 #1 substring$ "2" =
+ { bbl.nd * }
+ { duplicate$ #-1 #1 substring$ "3" =
+ { bbl.rd * }
+ { bbl.th * }
+ if$
+ }
+ if$
+ }
+ if$
+ }
+ if$
+}
+
+% If the string on the top of the stack begins with a number,
+% (e.g., 11th) then replace the string with the leading number
+% it contains. Otherwise retain the string as-is. s holds the
+% extracted number, t holds the part of the string that remains
+% to be scanned.
+FUNCTION {extract.num}
+{ duplicate$ 't :=
+ "" 's :=
+ { t empty$ not }
+ { t #1 #1 substring$
+ t #2 global.max$ substring$ 't :=
+ duplicate$ is.num
+ { s swap$ * 's := }
+ { pop$ "" 't := }
+ if$
+ }
+ while$
+ s empty$
+ 'skip$
+ { pop$ s }
+ if$
+}
+
+% Converts the word number string on the top of the stack to
+% Arabic string form. Will be successful up to "tenth".
+FUNCTION {word.to.num}
+{ duplicate$ "l" change.case$ 's :=
+ s "first" =
+ { pop$ "1" }
+ { skip$ }
+ if$
+ s "second" =
+ { pop$ "2" }
+ { skip$ }
+ if$
+ s "third" =
+ { pop$ "3" }
+ { skip$ }
+ if$
+ s "fourth" =
+ { pop$ "4" }
+ { skip$ }
+ if$
+ s "fifth" =
+ { pop$ "5" }
+ { skip$ }
+ if$
+ s "sixth" =
+ { pop$ "6" }
+ { skip$ }
+ if$
+ s "seventh" =
+ { pop$ "7" }
+ { skip$ }
+ if$
+ s "eighth" =
+ { pop$ "8" }
+ { skip$ }
+ if$
+ s "ninth" =
+ { pop$ "9" }
+ { skip$ }
+ if$
+ s "tenth" =
+ { pop$ "10" }
+ { skip$ }
+ if$
+}
+
+
+% Converts the string on the top of the stack to numerical
+% ordinal (e.g., "11th") form.
+FUNCTION {convert.edition}
+{ duplicate$ empty$ 'skip$
+ { duplicate$ #1 #1 substring$ is.num
+ { extract.num
+ num.to.ordinal
+ }
+ { word.to.num
+ duplicate$ #1 #1 substring$ is.num
+ { num.to.ordinal }
+ { "edition ordinal word " quote$ * edition * quote$ *
+ " may be too high (or improper) for conversion" * " in " * cite$ * warning$
+ }
+ if$
+ }
+ if$
+ }
+ if$
+}
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% LATEX BIBLIOGRAPHY CODE %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% from plainnat.bst
+FUNCTION {format.full.names}
+{'s :=
+ #1 'nameptr :=
+ s num.names$ 'numnames :=
+ numnames 'namesleft :=
+ { namesleft #0 > }
+ { s nameptr
+ "{vv~}{ll}" format.name$ 't :=
+ nameptr #1 >
+ {
+ namesleft #1 >
+ { ", " * t * }
+ {
+ numnames #2 >
+ { "," * }
+ 'skip$
+ if$
+ t "others" =
+ { " et~al." * }
+ { " and " * t * }
+ if$
+ }
+ if$
+ }
+ 't
+ if$
+ nameptr #1 + 'nameptr :=
+ namesleft #1 - 'namesleft :=
+ }
+ while$
+}
+
+FUNCTION {author.editor.full}
+{ author empty$
+ { editor empty$
+ { "" }
+ { editor format.full.names }
+ if$
+ }
+ { author format.full.names }
+ if$
+}
+
+FUNCTION {author.full}
+{ author empty$
+ { "" }
+ { author format.full.names }
+ if$
+}
+
+FUNCTION {editor.full}
+{ editor empty$
+ { "" }
+ { editor format.full.names }
+ if$
+}
+
+FUNCTION {make.full.names}
+{ type$ "book" =
+ type$ "inbook" =
+ or
+ { author.editor.full }
+ { type$ "proceedings" =
+ type$ "periodical" =
+ or
+ { editor.full }
+ { author.full }
+ if$
+ }
+ if$
+}
+% END from plainnat.bst
+
+FUNCTION {start.entry}
+{ newline$
+ "\bibitem[" write$
+ label write$
+ ")" make.full.names duplicate$ short.list =
+ { pop$ }
+ { * }
+ if$
+ "]{" * write$
+ cite$ write$
+ "}" write$
+ newline$
+ ""
+ initialize.prev.this.status
+}
+
+% Here we write out all the LaTeX code that we will need. The most involved
+% code sequences are those that control the alternate interword spacing and
+% foreign language hyphenation patterns. The heavy use of \providecommand
+% gives users a way to override the defaults. Special thanks to Javier Bezos,
+% Johannes Braams, Robin Fairbairns, Heiko Oberdiek, Donald Arseneau and all
+% the other gurus on comp.text.tex for their help and advice on the topic of
+% \selectlanguage, Babel and BibTeX.
+FUNCTION {begin.bib}
+{ "% Generated by IEEEtranN.bst, version: " bst.file.version * " (" * bst.file.date * ")" *
+ write$ newline$
+ preamble$ empty$ 'skip$
+ { preamble$ write$ newline$ }
+ if$
+ "\begin{thebibliography}{" number.label int.to.str$ * "}" *
+ write$ newline$
+ "\providecommand{\natexlab}[1]{#1}"
+ write$ newline$
+ "\providecommand{\url}[1]{#1}"
+ write$ newline$
+ "\csname url@samestyle\endcsname"
+ write$ newline$
+ "\providecommand{\newblock}{\relax}"
+ write$ newline$
+ "\providecommand{\bibinfo}[2]{#2}"
+ write$ newline$
+ "\providecommand{\BIBentrySTDinterwordspacing}{\spaceskip=0pt\relax}"
+ write$ newline$
+ "\providecommand{\BIBentryALTinterwordstretchfactor}{"
+ ALTinterwordstretchfactor * "}" *
+ write$ newline$
+ "\providecommand{\BIBentryALTinterwordspacing}{\spaceskip=\fontdimen2\font plus "
+ write$ newline$
+ "\BIBentryALTinterwordstretchfactor\fontdimen3\font minus \fontdimen4\font\relax}"
+ write$ newline$
+ "\providecommand{\BIBforeignlanguage}[2]{{%"
+ write$ newline$
+ "\expandafter\ifx\csname l@#1\endcsname\relax"
+ write$ newline$
+ "\typeout{** WARNING: IEEEtranN.bst: No hyphenation pattern has been}%"
+ write$ newline$
+ "\typeout{** loaded for the language `#1'. Using the pattern for}%"
+ write$ newline$
+ "\typeout{** the default language instead.}%"
+ write$ newline$
+ "\else"
+ write$ newline$
+ "\language=\csname l@#1\endcsname"
+ write$ newline$
+ "\fi"
+ write$ newline$
+ "#2}}"
+ write$ newline$
+ "\providecommand{\BIBdecl}{\relax}"
+ write$ newline$
+ "\BIBdecl"
+ write$ newline$
+}
+
+FUNCTION {end.bib}
+{ newline$ "\end{thebibliography}" write$ newline$ }
+
+FUNCTION {if.url.alt.interword.spacing}
+{ is.use.alt.interword.spacing
+ {url empty$ 'skip$ {"\BIBentryALTinterwordspacing" write$ newline$} if$}
+ { skip$ }
+ if$
+}
+
+FUNCTION {if.url.std.interword.spacing}
+{ is.use.alt.interword.spacing
+ {url empty$ 'skip$ {"\BIBentrySTDinterwordspacing" write$ newline$} if$}
+ { skip$ }
+ if$
+}
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%
+%% FORMAT HANDLERS %%
+%%%%%%%%%%%%%%%%%%%%%
+
+%% Lower Level Formats (used by higher level formats)
+
+FUNCTION {format.address.org.or.pub.date}
+{ 't :=
+ ""
+ year empty$
+ { "empty year in " cite$ * warning$ }
+ { skip$ }
+ if$
+ address empty$ t empty$ and
+ year empty$ and month empty$ and
+ { skip$ }
+ { this.to.prev.status
+ this.status.std
+ cap.status.std
+ address "address" bibinfo.check *
+ t empty$
+ { skip$ }
+ { punct.period 'prev.status.punct :=
+ space.large 'prev.status.space :=
+ address empty$
+ { skip$ }
+ { ": " * }
+ if$
+ t *
+ }
+ if$
+ year empty$ month empty$ and
+ { skip$ }
+ { t empty$ address empty$ and
+ { skip$ }
+ { ", " * }
+ if$
+ month empty$
+ { year empty$
+ { skip$ }
+ { year "year" bibinfo.check * }
+ if$
+ }
+ { month "month" bibinfo.check *
+ year empty$
+ { skip$ }
+ { " " * year "year" bibinfo.check * }
+ if$
+ }
+ if$
+ }
+ if$
+ }
+ if$
+}
+
+
+FUNCTION {format.names}
+{ 'bibinfo :=
+ duplicate$ empty$ 'skip$ {
+ this.to.prev.status
+ this.status.std
+ 's :=
+ "" 't :=
+ #1 'nameptr :=
+ s num.names$ 'numnames :=
+ numnames 'namesleft :=
+ { namesleft #0 > }
+ { s nameptr
+ name.format.string
+ format.name$
+ bibinfo bibinfo.check
+ 't :=
+ nameptr #1 >
+ { nameptr num.names.shown.with.forced.et.al #1 + =
+ numnames max.num.names.before.forced.et.al >
+ is.forced.et.al and and
+ { "others" 't :=
+ #1 'namesleft :=
+ }
+ { skip$ }
+ if$
+ namesleft #1 >
+ { ", " * t do.name.latex.cmd * }
+ { s nameptr "{ll}" format.name$ duplicate$ "others" =
+ { 't := }
+ { pop$ }
+ if$
+ t "others" =
+ { " " * bbl.etal emphasize * }
+ { numnames #2 >
+ { "," * }
+ { skip$ }
+ if$
+ bbl.and
+ space.word * t do.name.latex.cmd *
+ }
+ if$
+ }
+ if$
+ }
+ { t do.name.latex.cmd }
+ if$
+ nameptr #1 + 'nameptr :=
+ namesleft #1 - 'namesleft :=
+ }
+ while$
+ cap.status.std
+ } if$
+}
+
+
+
+
+%% Higher Level Formats
+
+%% addresses/locations
+
+FUNCTION {format.address}
+{ address duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ cap.status.std
+ }
+ if$
+}
+
+
+
+%% author/editor names
+
+FUNCTION {format.authors}{ author "author" format.names }
+
+FUNCTION {format.editors}
+{ editor "editor" format.names duplicate$ empty$ 'skip$
+ { ", " *
+ get.bbl.editor
+ capitalize
+ *
+ }
+ if$
+}
+
+
+
+%% date
+
+FUNCTION {format.date}
+{
+ month "month" bibinfo.check duplicate$ empty$
+ year "year" bibinfo.check duplicate$ empty$
+ { swap$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ cap.status.std
+ "there's a month but no year in " cite$ * warning$ }
+ if$
+ *
+ }
+ { this.to.prev.status
+ this.status.std
+ cap.status.std
+ swap$ 'skip$
+ {
+ swap$
+ " " * swap$
+ }
+ if$
+ *
+ }
+ if$
+}
+
+FUNCTION {format.date.electronic}
+{ month "month" bibinfo.check duplicate$ empty$
+ year "year" bibinfo.check duplicate$ empty$
+ { swap$
+ { pop$ }
+ { "there's a month but no year in " cite$ * warning$
+ pop$ ")" * "(" swap$ *
+ this.to.prev.status
+ punct.no 'this.status.punct :=
+ space.normal 'this.status.space :=
+ quote.no 'this.status.quote :=
+ cap.yes 'status.cap :=
+ }
+ if$
+ }
+ { swap$
+ { swap$ pop$ ")" * "(" swap$ * }
+ { "(" swap$ * ", " * swap$ * ")" * }
+ if$
+ this.to.prev.status
+ punct.no 'this.status.punct :=
+ space.normal 'this.status.space :=
+ quote.no 'this.status.quote :=
+ cap.yes 'status.cap :=
+ }
+ if$
+}
+
+
+
+%% edition/title
+
+% Note: IEEE considers the edition to be closely associated with
+% the title of a book. So, in IEEEtran.bst the edition is normally handled
+% within the formatting of the title. The format.edition function is
+% retained here for possible future use.
+FUNCTION {format.edition}
+{ edition duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ convert.edition
+ status.cap
+ { "t" }
+ { "l" }
+ if$ change.case$
+ "edition" bibinfo.check
+ "~" * bbl.edition *
+ cap.status.std
+ }
+ if$
+}
+
+% This is used to format the booktitle of a conference proceedings.
+% Here we use the "intype" field to provide the user a way to
+% override the word "in" (e.g., with things like "presented at")
+% Use of intype stops the emphasis of the booktitle to indicate that
+% we no longer mean the written conference proceedings, but the
+% conference itself.
+FUNCTION {format.in.booktitle}
+{ booktitle "booktitle" bibinfo.check duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ select.language
+ intype missing$
+ { emphasize
+ bbl.in " " *
+ }
+ { intype " " * }
+ if$
+ swap$ *
+ cap.status.std
+ }
+ if$
+}
+
+% This is used to format the booktitle of collection.
+% Here the "intype" field is not supported, but "edition" is.
+FUNCTION {format.in.booktitle.edition}
+{ booktitle "booktitle" bibinfo.check duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ select.language
+ emphasize
+ edition empty$ 'skip$
+ { ", " *
+ edition
+ convert.edition
+ "l" change.case$
+ * "~" * bbl.edition *
+ }
+ if$
+ bbl.in " " * swap$ *
+ cap.status.std
+ }
+ if$
+}
+
+FUNCTION {format.article.title}
+{ title duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ "t" change.case$
+ }
+ if$
+ "title" bibinfo.check
+ duplicate$ empty$ 'skip$
+ { quote.close 'this.status.quote :=
+ is.last.char.not.punct
+ { punct.std 'this.status.punct := }
+ { punct.no 'this.status.punct := }
+ if$
+ select.language
+ "``" swap$ *
+ cap.status.std
+ }
+ if$
+}
+
+FUNCTION {format.article.title.electronic}
+{ title duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ cap.status.std
+ "t" change.case$
+ }
+ if$
+ "title" bibinfo.check
+ duplicate$ empty$
+ { skip$ }
+ { select.language }
+ if$
+}
+
+FUNCTION {format.book.title.edition}
+{ title "title" bibinfo.check
+ duplicate$ empty$
+ { "empty title in " cite$ * warning$ }
+ { this.to.prev.status
+ this.status.std
+ select.language
+ emphasize
+ edition empty$ 'skip$
+ { ", " *
+ edition
+ convert.edition
+ status.cap
+ { "t" }
+ { "l" }
+ if$
+ change.case$
+ * "~" * bbl.edition *
+ }
+ if$
+ cap.status.std
+ }
+ if$
+}
+
+FUNCTION {format.book.title}
+{ title "title" bibinfo.check
+ duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ cap.status.std
+ select.language
+ emphasize
+ }
+ if$
+}
+
+
+
+%% journal
+
+FUNCTION {format.journal}
+{ journal duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ cap.status.std
+ select.language
+ emphasize
+ }
+ if$
+}
+
+
+
+%% how published
+
+FUNCTION {format.howpublished}
+{ howpublished duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ cap.status.std
+ }
+ if$
+}
+
+
+
+%% institutions/organization/publishers/school
+
+FUNCTION {format.institution}
+{ institution duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ cap.status.std
+ }
+ if$
+}
+
+FUNCTION {format.organization}
+{ organization duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ cap.status.std
+ }
+ if$
+}
+
+FUNCTION {format.address.publisher.date}
+{ publisher "publisher" bibinfo.warn format.address.org.or.pub.date }
+
+FUNCTION {format.address.publisher.date.nowarn}
+{ publisher "publisher" bibinfo.check format.address.org.or.pub.date }
+
+FUNCTION {format.address.organization.date}
+{ organization "organization" bibinfo.check format.address.org.or.pub.date }
+
+FUNCTION {format.school}
+{ school duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ cap.status.std
+ }
+ if$
+}
+
+
+
+%% volume/number/series/chapter/pages
+
+FUNCTION {format.volume}
+{ volume empty.field.to.null.string
+ duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ bbl.volume
+ status.cap
+ { capitalize }
+ { skip$ }
+ if$
+ swap$ tie.or.space.prefix
+ "volume" bibinfo.check
+ * *
+ cap.status.std
+ }
+ if$
+}
+
+FUNCTION {format.number}
+{ number empty.field.to.null.string
+ duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ status.cap
+ { bbl.number capitalize }
+ { bbl.number }
+ if$
+ swap$ tie.or.space.prefix
+ "number" bibinfo.check
+ * *
+ cap.status.std
+ }
+ if$
+}
+
+FUNCTION {format.number.if.use.for.article}
+{ is.use.number.for.article
+ { format.number }
+ { "" }
+ if$
+}
+
+% IEEE does not seem to tie the series so closely with the volume
+% and number as is done in other bibliography styles. Instead the
+% series is treated somewhat like an extension of the title.
+FUNCTION {format.series}
+{ series empty$
+ { "" }
+ { this.to.prev.status
+ this.status.std
+ bbl.series " " *
+ series "series" bibinfo.check *
+ cap.status.std
+ }
+ if$
+}
+
+
+FUNCTION {format.chapter}
+{ chapter empty$
+ { "" }
+ { this.to.prev.status
+ this.status.std
+ type empty$
+ { bbl.chapter }
+ { type "l" change.case$
+ "type" bibinfo.check
+ }
+ if$
+ chapter tie.or.space.prefix
+ "chapter" bibinfo.check
+ * *
+ cap.status.std
+ }
+ if$
+}
+
+
+% The intended use of format.paper is for paper numbers of inproceedings.
+% The paper type can be overridden via the type field.
+% We allow the type to be displayed even if the paper number is absent
+% for things like "postdeadline paper"
+FUNCTION {format.paper}
+{ is.use.paper
+ { paper empty$
+ { type empty$
+ { "" }
+ { this.to.prev.status
+ this.status.std
+ type "type" bibinfo.check
+ cap.status.std
+ }
+ if$
+ }
+ { this.to.prev.status
+ this.status.std
+ type empty$
+ { bbl.paper }
+ { type "type" bibinfo.check }
+ if$
+ " " * paper
+ "paper" bibinfo.check
+ *
+ cap.status.std
+ }
+ if$
+ }
+ { "" }
+ if$
+}
+
+
+FUNCTION {format.pages}
+{ pages duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ duplicate$ is.multiple.pages
+ {
+ bbl.pages swap$
+ n.dashify
+ }
+ {
+ bbl.page swap$
+ }
+ if$
+ tie.or.space.prefix
+ "pages" bibinfo.check
+ * *
+ cap.status.std
+ }
+ if$
+}
+
+
+
+%% technical report number
+
+FUNCTION {format.tech.report.number}
+{ number "number" bibinfo.check
+ this.to.prev.status
+ this.status.std
+ cap.status.std
+ type duplicate$ empty$
+ { pop$
+ bbl.techrep
+ }
+ { skip$ }
+ if$
+ "type" bibinfo.check
+ swap$ duplicate$ empty$
+ { pop$ }
+ { tie.or.space.prefix * * }
+ if$
+}
+
+
+
+%% note
+
+FUNCTION {format.note}
+{ note empty$
+ { "" }
+ { this.to.prev.status
+ this.status.std
+ punct.period 'this.status.punct :=
+ note #1 #1 substring$
+ duplicate$ "{" =
+ { skip$ }
+ { status.cap
+ { "u" }
+ { "l" }
+ if$
+ change.case$
+ }
+ if$
+ note #2 global.max$ substring$ * "note" bibinfo.check
+ cap.yes 'status.cap :=
+ }
+ if$
+}
+
+
+
+%% patent
+
+FUNCTION {format.patent.date}
+{ this.to.prev.status
+ this.status.std
+ year empty$
+ { monthfiled duplicate$ empty$
+ { "monthfiled" bibinfo.check pop$ "" }
+ { "monthfiled" bibinfo.check }
+ if$
+ dayfiled duplicate$ empty$
+ { "dayfiled" bibinfo.check pop$ "" * }
+ { "dayfiled" bibinfo.check
+ monthfiled empty$
+ { "dayfiled without a monthfiled in " cite$ * warning$
+ *
+ }
+ { " " swap$ * * }
+ if$
+ }
+ if$
+ yearfiled empty$
+ { "no year or yearfiled in " cite$ * warning$ }
+ { yearfiled "yearfiled" bibinfo.check
+ swap$
+ duplicate$ empty$
+ { pop$ }
+ { ", " * swap$ * }
+ if$
+ }
+ if$
+ }
+ { month duplicate$ empty$
+ { "month" bibinfo.check pop$ "" }
+ { "month" bibinfo.check }
+ if$
+ day duplicate$ empty$
+ { "day" bibinfo.check pop$ "" * }
+ { "day" bibinfo.check
+ month empty$
+ { "day without a month in " cite$ * warning$
+ *
+ }
+ { " " swap$ * * }
+ if$
+ }
+ if$
+ year "year" bibinfo.check
+ swap$
+ duplicate$ empty$
+ { pop$ }
+ { ", " * swap$ * }
+ if$
+ }
+ if$
+ cap.status.std
+}
+
+FUNCTION {format.patent.nationality.type.number}
+{ this.to.prev.status
+ this.status.std
+ nationality duplicate$ empty$
+ { "nationality" bibinfo.warn pop$ "" }
+ { "nationality" bibinfo.check
+ duplicate$ "l" change.case$ "united states" =
+ { pop$ bbl.patentUS }
+ { skip$ }
+ if$
+ " " *
+ }
+ if$
+ type empty$
+ { bbl.patent "type" bibinfo.check }
+ { type "type" bibinfo.check }
+ if$
+ *
+ number duplicate$ empty$
+ { "number" bibinfo.warn pop$ }
+ { "number" bibinfo.check
+ large.number.separate
+ swap$ " " * swap$ *
+ }
+ if$
+ cap.status.std
+}
+
+
+
+%% standard
+
+FUNCTION {format.organization.institution.standard.type.number}
+{ this.to.prev.status
+ this.status.std
+ organization duplicate$ empty$
+ { pop$
+ institution duplicate$ empty$
+ { "institution" bibinfo.warn }
+ { "institution" bibinfo.warn " " * }
+ if$
+ }
+ { "organization" bibinfo.warn " " * }
+ if$
+ type empty$
+ { bbl.standard "type" bibinfo.check }
+ { type "type" bibinfo.check }
+ if$
+ *
+ number duplicate$ empty$
+ { "number" bibinfo.check pop$ }
+ { "number" bibinfo.check
+ large.number.separate
+ swap$ " " * swap$ *
+ }
+ if$
+ cap.status.std
+}
+
+FUNCTION {format.revision}
+{ revision empty$
+ { "" }
+ { this.to.prev.status
+ this.status.std
+ bbl.revision
+ revision tie.or.space.prefix
+ "revision" bibinfo.check
+ * *
+ cap.status.std
+ }
+ if$
+}
+
+
+%% thesis
+
+FUNCTION {format.master.thesis.type}
+{ this.to.prev.status
+ this.status.std
+ type empty$
+ {
+ bbl.mthesis
+ }
+ {
+ type "type" bibinfo.check
+ }
+ if$
+cap.status.std
+}
+
+FUNCTION {format.phd.thesis.type}
+{ this.to.prev.status
+ this.status.std
+ type empty$
+ {
+ bbl.phdthesis
+ }
+ {
+ type "type" bibinfo.check
+ }
+ if$
+cap.status.std
+}
+
+
+
+%% URL
+
+FUNCTION {format.url}
+{ url empty$
+ { "" }
+ { this.to.prev.status
+ this.status.std
+ cap.yes 'status.cap :=
+ name.url.prefix " " *
+ "\url{" * url * "}" *
+ punct.no 'this.status.punct :=
+ punct.period 'prev.status.punct :=
+ space.normal 'this.status.space :=
+ space.normal 'prev.status.space :=
+ quote.no 'this.status.quote :=
+ }
+ if$
+}
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%
+%% ENTRY HANDLERS %%
+%%%%%%%%%%%%%%%%%%%%
+
+
+% Note: In many journals, IEEE (or the authors) tend not to show the number
+% for articles, so the display of the number is controlled here by the
+% switch "is.use.number.for.article"
+FUNCTION {article}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors "author" output.warn
+ name.or.dash
+ format.article.title "title" output.warn
+ format.journal "journal" bibinfo.check "journal" output.warn
+ format.volume output
+ format.number.if.use.for.article output
+ format.pages output
+ format.date "year" output.warn
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {book}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ author empty$
+ { format.editors "author and editor" output.warn }
+ { format.authors output.nonnull }
+ if$
+ name.or.dash
+ format.book.title.edition output
+ format.series output
+ author empty$
+ { skip$ }
+ { format.editors output }
+ if$
+ format.address.publisher.date output
+ format.volume output
+ format.number output
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {booklet}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors output
+ name.or.dash
+ format.article.title "title" output.warn
+ format.howpublished "howpublished" bibinfo.check output
+ format.organization "organization" bibinfo.check output
+ format.address "address" bibinfo.check output
+ format.date output
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {electronic}
+{ std.status.using.period
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors output
+ name.or.dash
+ format.date.electronic output
+ format.article.title.electronic output
+ format.howpublished "howpublished" bibinfo.check output
+ format.organization "organization" bibinfo.check output
+ format.address "address" bibinfo.check output
+ format.note output
+ format.url output
+ fin.entry
+ empty.entry.warn
+ if.url.std.interword.spacing
+}
+
+FUNCTION {inbook}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ author empty$
+ { format.editors "author and editor" output.warn }
+ { format.authors output.nonnull }
+ if$
+ name.or.dash
+ format.book.title.edition output
+ format.series output
+ format.address.publisher.date output
+ format.volume output
+ format.number output
+ format.chapter output
+ format.pages output
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {incollection}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors "author" output.warn
+ name.or.dash
+ format.article.title "title" output.warn
+ format.in.booktitle.edition "booktitle" output.warn
+ format.series output
+ format.editors output
+ format.address.publisher.date.nowarn output
+ format.volume output
+ format.number output
+ format.chapter output
+ format.pages output
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {inproceedings}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors "author" output.warn
+ name.or.dash
+ format.article.title "title" output.warn
+ format.in.booktitle "booktitle" output.warn
+ format.series output
+ format.editors output
+ format.volume output
+ format.number output
+ publisher empty$
+ { format.address.organization.date output }
+ { format.organization "organization" bibinfo.check output
+ format.address.publisher.date output
+ }
+ if$
+ format.paper output
+ format.pages output
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {manual}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors output
+ name.or.dash
+ format.book.title.edition "title" output.warn
+ format.howpublished "howpublished" bibinfo.check output
+ format.organization "organization" bibinfo.check output
+ format.address "address" bibinfo.check output
+ format.date output
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {mastersthesis}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors "author" output.warn
+ name.or.dash
+ format.article.title "title" output.warn
+ format.master.thesis.type output.nonnull
+ format.school "school" bibinfo.warn output
+ format.address "address" bibinfo.check output
+ format.date "year" output.warn
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {misc}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors output
+ name.or.dash
+ format.article.title output
+ format.howpublished "howpublished" bibinfo.check output
+ format.organization "organization" bibinfo.check output
+ format.address "address" bibinfo.check output
+ format.pages output
+ format.date output
+ format.note output
+ format.url output
+ fin.entry
+ empty.entry.warn
+ if.url.std.interword.spacing
+}
+
+FUNCTION {patent}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors output
+ name.or.dash
+ format.article.title output
+ format.patent.nationality.type.number output
+ format.patent.date output
+ format.note output
+ format.url output
+ fin.entry
+ empty.entry.warn
+ if.url.std.interword.spacing
+}
+
+FUNCTION {periodical}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.editors output
+ name.or.dash
+ format.book.title "title" output.warn
+ format.series output
+ format.volume output
+ format.number output
+ format.organization "organization" bibinfo.check output
+ format.date "year" output.warn
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {phdthesis}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors "author" output.warn
+ name.or.dash
+ format.article.title "title" output.warn
+ format.phd.thesis.type output.nonnull
+ format.school "school" bibinfo.warn output
+ format.address "address" bibinfo.check output
+ format.date "year" output.warn
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {proceedings}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.editors output
+ name.or.dash
+ format.book.title "title" output.warn
+ format.series output
+ format.volume output
+ format.number output
+ publisher empty$
+ { format.address.organization.date output }
+ { format.organization "organization" bibinfo.check output
+ format.address.publisher.date output
+ }
+ if$
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {standard}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors output
+ name.or.dash
+ format.book.title "title" output.warn
+ format.howpublished "howpublished" bibinfo.check output
+ format.organization.institution.standard.type.number output
+ format.revision output
+ format.date output
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {techreport}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors "author" output.warn
+ name.or.dash
+ format.article.title "title" output.warn
+ format.howpublished "howpublished" bibinfo.check output
+ format.institution "institution" bibinfo.warn output
+ format.address "address" bibinfo.check output
+ format.tech.report.number output.nonnull
+ format.date "year" output.warn
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {unpublished}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors "author" output.warn
+ name.or.dash
+ format.article.title "title" output.warn
+ format.date output
+ format.note "note" output.warn
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+
+% The special entry type which provides the user interface to the
+% BST controls
+FUNCTION {IEEEtranBSTCTL}
+{ is.print.banners.to.terminal
+ { "** IEEEtran BST control entry " quote$ * cite$ * quote$ * " detected." *
+ top$
+ }
+ { skip$ }
+ if$
+ CTLuse_article_number
+ empty$
+ { skip$ }
+ { CTLuse_article_number
+ yes.no.to.int
+ 'is.use.number.for.article :=
+ }
+ if$
+ CTLuse_paper
+ empty$
+ { skip$ }
+ { CTLuse_paper
+ yes.no.to.int
+ 'is.use.paper :=
+ }
+ if$
+ CTLuse_forced_etal
+ empty$
+ { skip$ }
+ { CTLuse_forced_etal
+ yes.no.to.int
+ 'is.forced.et.al :=
+ }
+ if$
+ CTLmax_names_forced_etal
+ empty$
+ { skip$ }
+ { CTLmax_names_forced_etal
+ string.to.integer
+ 'max.num.names.before.forced.et.al :=
+ }
+ if$
+ CTLnames_show_etal
+ empty$
+ { skip$ }
+ { CTLnames_show_etal
+ string.to.integer
+ 'num.names.shown.with.forced.et.al :=
+ }
+ if$
+ CTLuse_alt_spacing
+ empty$
+ { skip$ }
+ { CTLuse_alt_spacing
+ yes.no.to.int
+ 'is.use.alt.interword.spacing :=
+ }
+ if$
+ CTLalt_stretch_factor
+ empty$
+ { skip$ }
+ { CTLalt_stretch_factor
+ 'ALTinterwordstretchfactor :=
+ "\renewcommand{\BIBentryALTinterwordstretchfactor}{"
+ ALTinterwordstretchfactor * "}" *
+ write$ newline$
+ }
+ if$
+ CTLdash_repeated_names
+ empty$
+ { skip$ }
+ { CTLdash_repeated_names
+ yes.no.to.int
+ 'is.dash.repeated.names :=
+ }
+ if$
+ CTLname_format_string
+ empty$
+ { skip$ }
+ { CTLname_format_string
+ 'name.format.string :=
+ }
+ if$
+ CTLname_latex_cmd
+ empty$
+ { skip$ }
+ { CTLname_latex_cmd
+ 'name.latex.cmd :=
+ }
+ if$
+ CTLname_url_prefix
+ missing$
+ { skip$ }
+ { CTLname_url_prefix
+ 'name.url.prefix :=
+ }
+ if$
+
+
+ num.names.shown.with.forced.et.al max.num.names.before.forced.et.al >
+ { "CTLnames_show_etal cannot be greater than CTLmax_names_forced_etal in " cite$ * warning$
+ max.num.names.before.forced.et.al 'num.names.shown.with.forced.et.al :=
+ }
+ { skip$ }
+ if$
+}
+
+
+%%%%%%%%%%%%%%%%%%%
+%% ENTRY ALIASES %%
+%%%%%%%%%%%%%%%%%%%
+FUNCTION {conference}{inproceedings}
+FUNCTION {online}{electronic}
+FUNCTION {internet}{electronic}
+FUNCTION {webpage}{electronic}
+FUNCTION {www}{electronic}
+FUNCTION {default.type}{misc}
+
+
+
+%%%%%%%%%%%%%%%%%%
+%% MAIN PROGRAM %%
+%%%%%%%%%%%%%%%%%%
+
+READ
+
+EXECUTE {initialize.controls}
+EXECUTE {initialize.status.constants}
+EXECUTE {banner.message}
+
+
+
+% BEGIN sort code based on unsrtnat.bst
+FUNCTION {sortify}
+{ purify$
+ "l" change.case$
+}
+
+INTEGERS { len }
+
+FUNCTION {chop.word}
+{ 's :=
+ 'len :=
+ s #1 len substring$ =
+ { s len #1 + global.max$ substring$ }
+ { s }
+ if$
+}
+
+STRINGS { last.label next.extra }
+
+INTEGERS { last.extra.num }
+
+FUNCTION {format.lab.names}
+{ 's :=
+ s #1 "{vv~}{ll}" format.name$
+ s num.names$ duplicate$
+ #2 >
+ { pop$ " et~al." * }
+ { #2 <
+ 'skip$
+ { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
+ { " et~al." * }
+ { " and " * s #2 "{vv~}{ll}" format.name$ * }
+ if$
+ }
+ if$
+ }
+ if$
+}
+
+FUNCTION {author.key.label}
+{ author empty$
+ { key empty$
+ { cite$ #1 #3 substring$ }
+ { key }
+ if$
+ }
+ { author format.lab.names }
+ if$
+}
+
+FUNCTION {author.editor.key.label}
+{ author empty$
+ { editor empty$
+ { key empty$
+ { cite$ #1 #3 substring$ }
+ { key }
+ if$
+ }
+ { editor format.lab.names }
+ if$
+ }
+ { author format.lab.names }
+ if$
+}
+
+FUNCTION {author.key.organization.label}
+{ author empty$
+ { key empty$
+ { organization empty$
+ { cite$ #1 #3 substring$ }
+ { "The " #4 organization chop.word #3 text.prefix$ }
+ if$
+ }
+ { key }
+ if$
+ }
+ { author format.lab.names }
+ if$
+}
+
+FUNCTION {author.key.organization.institution.label}
+{ author empty$
+ { key empty$
+ { organization empty$
+ { institution empty$
+ { cite$ #1 #3 substring$ }
+ { "The " #4 institution chop.word #3 text.prefix$ }
+ if$
+ }
+ { "The " #4 organization chop.word #3 text.prefix$ }
+ if$
+ }
+ { key }
+ if$
+ }
+ { author format.lab.names }
+ if$
+}
+
+FUNCTION {editor.key.organization.label}
+{ editor empty$
+ { key empty$
+ { organization empty$
+ { cite$ #1 #3 substring$ }
+ { "The " #4 organization chop.word #3 text.prefix$ }
+ if$
+ }
+ { key }
+ if$
+ }
+ { editor format.lab.names }
+ if$
+}
+
+FUNCTION {calc.label}
+{ type$ "book" =
+ type$ "inbook" =
+ or
+ { author.editor.key.label }
+ { type$ "proceedings" =
+ type$ "periodical" =
+ or
+ { editor.key.organization.label }
+ { type$ "manual" =
+ type$ "electronic" =
+ type$ "misc" =
+ or or
+ { author.key.organization.label }
+ { type$ "standard" =
+ { author.key.organization.institution.label }
+ { author.key.label }
+ if$
+ }
+ if$
+ }
+ if$
+ }
+ if$
+ duplicate$
+ 'short.list :=
+ "("
+ *
+ type$ "patent" =
+ { year empty$
+ { yearfiled }
+ { year }
+ if$
+ }
+ { year }
+ if$
+ duplicate$
+ empty$
+ short.list key empty.field.to.null.string = or
+ { pop$ "" }
+ { skip$ }
+ if$
+ *
+ 'label :=
+}
+
+
+INTEGERS { seq.num }
+
+FUNCTION {init.seq}
+{ #0 'seq.num :=}
+
+
+FUNCTION {int.to.fix}
+{ "000000000" swap$ int.to.str$ *
+ #-1 #10 substring$
+}
+
+
+FUNCTION {presort}
+{ type$ "ieeetranbstctl" =
+ { key empty$
+ { "_" }
+ { key sortify }
+ if$
+ " "
+ *
+ seq.num int.to.fix
+ }
+ { calc.label
+ label sortify
+ " "
+ *
+ seq.num #1 + 'seq.num :=
+ seq.num int.to.fix
+ }
+ if$
+ 'sort.label :=
+ sort.label *
+ #1 entry.max$ substring$
+ 'sort.key$ :=
+}
+
+
+FUNCTION {initialize.longest.label}
+{ "" 'longest.label :=
+ #0 int.to.chr$ 'last.label :=
+ "" 'next.extra :=
+ #0 'longest.label.width :=
+ #0 'last.extra.num :=
+ #0 'number.label :=
+}
+
+FUNCTION {forward.pass}
+{ type$ "ieeetranbstctl" =
+ { skip$ }
+ { last.label label =
+ { last.extra.num #1 + 'last.extra.num :=
+ last.extra.num int.to.chr$ 'extra.label :=
+ }
+ { "a" chr.to.int$ 'last.extra.num :=
+ "" 'extra.label :=
+ label 'last.label :=
+ }
+ if$
+ number.label #1 + 'number.label :=
+ }
+ if$
+}
+
+FUNCTION {reverse.pass}
+{ type$ "ieeetranbstctl" =
+ { skip$ }
+ { next.extra "b" =
+ { "a" 'extra.label := }
+ { skip$ }
+ if$
+ extra.label 'next.extra :=
+ extra.label
+ duplicate$ empty$
+ { skip$ }
+ { "{\natexlab{" swap$ * "}}" * }
+ if$
+ 'extra.label :=
+ label extra.label * 'label :=
+ }
+ if$
+}
+
+FUNCTION {bib.sort.order}
+{ sort.label 'sort.key$ :=
+}
+% END sort code based on unsrtnat.bst
+
+
+
+EXECUTE {init.seq}
+
+ITERATE {presort}
+
+SORT
+
+EXECUTE {initialize.longest.label}
+
+ITERATE {forward.pass}
+REVERSE {reverse.pass}
+
+ITERATE {bib.sort.order}
+
+SORT
+
+EXECUTE {begin.bib}
+ITERATE {call.type$}
+EXECUTE {end.bib}
+
+EXECUTE{completed.message}
+
+
+%% That's all folks, mds.
diff --git a/macros/latex/contrib/feupphdteses/IEEEtranSN.bst b/macros/latex/contrib/feupphdteses/IEEEtranSN.bst
new file mode 100644
index 0000000000..e13222105a
--- /dev/null
+++ b/macros/latex/contrib/feupphdteses/IEEEtranSN.bst
@@ -0,0 +1,2857 @@
+%%
+%% IEEEtranSN.bst
+%% BibTeX Bibliography Style file
+%% Sorting Natbib version of IEEEtran.bst
+%% *** Not for normal IEEE work ***
+%% Version 1.13 (2008/09/30)
+%%
+%% Copyright (c) 2003-2008 Michael Shell
+%%
+%% Original starting code base and algorithms obtained from the output of
+%% Patrick W. Daly's makebst package as well as from prior versions of
+%% IEEE BibTeX styles:
+%%
+%% 1. Howard Trickey and Oren Patashnik's ieeetr.bst (1985/1988)
+%% 2. Silvano Balemi and Richard H. Roy's IEEEbib.bst (1993)
+%%
+%% Added sorting and natbib code is from Patrick W Daly's plainnat.bst
+%% and Oren Patashnik's plain.bst.
+%%
+%%
+%% Support sites:
+%% http://www.michaelshell.org/tex/ieeetran/
+%% http://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/
+%% and/or
+%% http://www.ieee.org/
+%%
+%% For use with BibTeX version 0.99a or later
+%%
+%% This is a natbib compatible citation style.
+%%
+%%*************************************************************************
+%% Legal Notice:
+%% This code is offered as-is without any warranty either expressed or
+%% implied; without even the implied warranty of MERCHANTABILITY or
+%% FITNESS FOR A PARTICULAR PURPOSE!
+%% User assumes all risk.
+%% In no event shall IEEE or any contributor to this code be liable for
+%% any damages or losses, including, but not limited to, incidental,
+%% consequential, or any other damages, resulting from the use or misuse
+%% of any information contained here.
+%%
+%% All comments are the opinions of their respective authors and are not
+%% necessarily endorsed by the IEEE.
+%%
+%% This work is distributed under the LaTeX Project Public License (LPPL)
+%% ( http://www.latex-project.org/ ) version 1.3, and may be freely used,
+%% distributed and modified. A copy of the LPPL, version 1.3, is included
+%% in the base LaTeX documentation of all distributions of LaTeX released
+%% 2003/12/01 or later.
+%% Retain all contribution notices and credits.
+%% ** Modified files should be clearly indicated as such, including **
+%% ** renaming them and changing author support contact information. **
+%%
+%% File list of work: IEEEabrv.bib, IEEEfull.bib, IEEEexample.bib,
+%% IEEEtran.bst, IEEEtranS.bst, IEEEtranSA.bst,
+%% IEEEtranN.bst, IEEEtranSN.bst, IEEEtran_bst_HOWTO.pdf
+%%*************************************************************************
+%
+%
+% Changelog:
+%
+% 1.12 (2007/01/11) Initial release
+%
+% 1.13 (2008/09/30)
+% 1. Fixed bug with edition number to ordinal conversion. Thanks to
+% Michael Roland for reporting this and correcting the algorithm.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% DEFAULTS FOR THE CONTROLS OF THE BST STYLE %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% These are the defaults for the user adjustable controls. The values used
+% here can be overridden by the user via IEEEtranBSTCTL entry type.
+
+% NOTE: The recommended LaTeX command to invoke a control entry type is:
+%
+%\makeatletter
+%\def\bstctlcite{\@ifnextchar[{\@bstctlcite}{\@bstctlcite[@auxout]}}
+%\def\@bstctlcite[#1]#2{\@bsphack
+% \@for\@citeb:=#2\do{%
+% \edef\@citeb{\expandafter\@firstofone\@citeb}%
+% \if@filesw\immediate\write\csname #1\endcsname{\string\citation{\@citeb}}\fi}%
+% \@esphack}
+%\makeatother
+%
+% It is called at the start of the document, before the first \cite, like:
+% \bstctlcite{IEEEexample:BSTcontrol}
+%
+% IEEEtran.cls V1.6 and later does provide this command.
+
+
+
+% #0 turns off the display of the number for articles.
+% #1 enables
+FUNCTION {default.is.use.number.for.article} { #1 }
+
+
+% #0 turns off the display of the paper and type fields in @inproceedings.
+% #1 enables
+FUNCTION {default.is.use.paper} { #1 }
+
+
+% #0 turns off the forced use of "et al."
+% #1 enables
+FUNCTION {default.is.forced.et.al} { #0 }
+
+% The maximum number of names that can be present beyond which an "et al."
+% usage is forced. Be sure that num.names.shown.with.forced.et.al (below)
+% is not greater than this value!
+% Note: There are many instances of references in IEEE journals which have
+% a very large number of authors as well as instances in which "et al." is
+% used profusely.
+FUNCTION {default.max.num.names.before.forced.et.al} { #10 }
+
+% The number of names that will be shown with a forced "et al.".
+% Must be less than or equal to max.num.names.before.forced.et.al
+FUNCTION {default.num.names.shown.with.forced.et.al} { #1 }
+
+
+% #0 turns off the alternate interword spacing for entries with URLs.
+% #1 enables
+FUNCTION {default.is.use.alt.interword.spacing} { #1 }
+
+% If alternate interword spacing for entries with URLs is enabled, this is
+% the interword spacing stretch factor that will be used. For example, the
+% default "4" here means that the interword spacing in entries with URLs can
+% stretch to four times normal. Does not have to be an integer. Note that
+% the value specified here can be overridden by the user in their LaTeX
+% code via a command such as:
+% "\providecommand\BIBentryALTinterwordstretchfactor{1.5}" in addition to
+% that via the IEEEtranBSTCTL entry type.
+FUNCTION {default.ALTinterwordstretchfactor} { "4" }
+
+
+% #0 turns off the "dashification" of repeated (i.e., identical to those
+% of the previous entry) names. IEEE normally does this.
+% #1 enables
+FUNCTION {default.is.dash.repeated.names} { #1 }
+
+
+% The default name format control string.
+FUNCTION {default.name.format.string}{ "{f.~}{vv~}{ll}{, jj}" }
+
+
+% The default LaTeX font command for the names.
+FUNCTION {default.name.latex.cmd}{ "" }
+
+
+% The default URL prefix.
+FUNCTION {default.name.url.prefix}{ "[Online]. Available:" }
+
+
+% Other controls that cannot be accessed via IEEEtranBSTCTL entry type.
+
+% #0 turns off the terminal startup banner/completed message so as to
+% operate more quietly.
+% #1 enables
+FUNCTION {is.print.banners.to.terminal} { #1 }
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% FILE VERSION AND BANNER %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+FUNCTION{bst.file.version} { "1.13" }
+FUNCTION{bst.file.date} { "2008/09/30" }
+FUNCTION{bst.file.website} { "http://www.michaelshell.org/tex/ieeetran/bibtex/" }
+
+FUNCTION {banner.message}
+{ is.print.banners.to.terminal
+ { "-- IEEEtranSN.bst version" " " * bst.file.version *
+ " (" * bst.file.date * ") " * "by Michael Shell." *
+ top$
+ "-- " bst.file.website *
+ top$
+ "-- See the " quote$ * "IEEEtran_bst_HOWTO.pdf" * quote$ * " manual for usage information." *
+ top$
+ "** Sorting Natbib version - not for normal IEEE work."
+ top$
+ }
+ { skip$ }
+ if$
+}
+
+FUNCTION {completed.message}
+{ is.print.banners.to.terminal
+ { ""
+ top$
+ "Done."
+ top$
+ }
+ { skip$ }
+ if$
+}
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%
+%% STRING CONSTANTS %%
+%%%%%%%%%%%%%%%%%%%%%%
+
+FUNCTION {bbl.and}{ "and" }
+FUNCTION {bbl.etal}{ "et~al." }
+FUNCTION {bbl.editors}{ "eds." }
+FUNCTION {bbl.editor}{ "ed." }
+FUNCTION {bbl.edition}{ "ed." }
+FUNCTION {bbl.volume}{ "vol." }
+FUNCTION {bbl.of}{ "of" }
+FUNCTION {bbl.number}{ "no." }
+FUNCTION {bbl.in}{ "in" }
+FUNCTION {bbl.pages}{ "pp." }
+FUNCTION {bbl.page}{ "p." }
+FUNCTION {bbl.chapter}{ "ch." }
+FUNCTION {bbl.paper}{ "paper" }
+FUNCTION {bbl.part}{ "pt." }
+FUNCTION {bbl.patent}{ "Patent" }
+FUNCTION {bbl.patentUS}{ "U.S." }
+FUNCTION {bbl.revision}{ "Rev." }
+FUNCTION {bbl.series}{ "ser." }
+FUNCTION {bbl.standard}{ "Std." }
+FUNCTION {bbl.techrep}{ "Tech. Rep." }
+FUNCTION {bbl.mthesis}{ "Master's thesis" }
+FUNCTION {bbl.phdthesis}{ "Ph.D. dissertation" }
+FUNCTION {bbl.st}{ "st" }
+FUNCTION {bbl.nd}{ "nd" }
+FUNCTION {bbl.rd}{ "rd" }
+FUNCTION {bbl.th}{ "th" }
+
+
+% This is the LaTeX spacer that is used when a larger than normal space
+% is called for (such as just before the address:publisher).
+FUNCTION {large.space} { "\hskip 1em plus 0.5em minus 0.4em\relax " }
+
+% The LaTeX code for dashes that are used to represent repeated names.
+% Note: Some older IEEE journals used something like
+% "\rule{0.275in}{0.5pt}\," which is fairly thick and runs right along
+% the baseline. However, IEEE now uses a thinner, above baseline,
+% six dash long sequence.
+FUNCTION {repeated.name.dashes} { "------" }
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% PREDEFINED STRING MACROS %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+MACRO {jan} {"Jan."}
+MACRO {feb} {"Feb."}
+MACRO {mar} {"Mar."}
+MACRO {apr} {"Apr."}
+MACRO {may} {"May"}
+MACRO {jun} {"Jun."}
+MACRO {jul} {"Jul."}
+MACRO {aug} {"Aug."}
+MACRO {sep} {"Sep."}
+MACRO {oct} {"Oct."}
+MACRO {nov} {"Nov."}
+MACRO {dec} {"Dec."}
+
+
+
+%%%%%%%%%%%%%%%%%%
+%% ENTRY FIELDS %%
+%%%%%%%%%%%%%%%%%%
+
+ENTRY
+ { address
+ assignee
+ author
+ booktitle
+ chapter
+ day
+ dayfiled
+ edition
+ editor
+ howpublished
+ institution
+ intype
+ journal
+ key
+ language
+ month
+ monthfiled
+ nationality
+ note
+ number
+ organization
+ pages
+ paper
+ publisher
+ school
+ series
+ revision
+ title
+ type
+ url
+ volume
+ year
+ yearfiled
+ CTLuse_article_number
+ CTLuse_paper
+ CTLuse_forced_etal
+ CTLmax_names_forced_etal
+ CTLnames_show_etal
+ CTLuse_alt_spacing
+ CTLalt_stretch_factor
+ CTLdash_repeated_names
+ CTLname_format_string
+ CTLname_latex_cmd
+ CTLname_url_prefix
+ }
+ {}
+ { label extra.label sort.label short.list}
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%
+%% INTEGER VARIABLES %%
+%%%%%%%%%%%%%%%%%%%%%%%
+
+INTEGERS { prev.status.punct this.status.punct punct.std
+ punct.no punct.comma punct.period
+ prev.status.space this.status.space space.std
+ space.no space.normal space.large
+ prev.status.quote this.status.quote quote.std
+ quote.no quote.close
+ prev.status.nline this.status.nline nline.std
+ nline.no nline.newblock
+ status.cap cap.std
+ cap.no cap.yes}
+
+INTEGERS { longest.label.width multiresult nameptr namesleft number.label numnames }
+
+INTEGERS { is.use.number.for.article
+ is.use.paper
+ is.forced.et.al
+ max.num.names.before.forced.et.al
+ num.names.shown.with.forced.et.al
+ is.use.alt.interword.spacing
+ is.dash.repeated.names}
+
+
+%%%%%%%%%%%%%%%%%%%%%%
+%% STRING VARIABLES %%
+%%%%%%%%%%%%%%%%%%%%%%
+
+STRINGS { bibinfo
+ longest.label
+ oldname
+ s
+ t
+ ALTinterwordstretchfactor
+ name.format.string
+ name.latex.cmd
+ name.url.prefix}
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%
+%% LOW LEVEL FUNCTIONS %%
+%%%%%%%%%%%%%%%%%%%%%%%%%
+
+FUNCTION {initialize.controls}
+{ default.is.use.number.for.article 'is.use.number.for.article :=
+ default.is.use.paper 'is.use.paper :=
+ default.is.forced.et.al 'is.forced.et.al :=
+ default.max.num.names.before.forced.et.al 'max.num.names.before.forced.et.al :=
+ default.num.names.shown.with.forced.et.al 'num.names.shown.with.forced.et.al :=
+ default.is.use.alt.interword.spacing 'is.use.alt.interword.spacing :=
+ default.is.dash.repeated.names 'is.dash.repeated.names :=
+ default.ALTinterwordstretchfactor 'ALTinterwordstretchfactor :=
+ default.name.format.string 'name.format.string :=
+ default.name.latex.cmd 'name.latex.cmd :=
+ default.name.url.prefix 'name.url.prefix :=
+}
+
+
+% This IEEEtran.bst features a very powerful and flexible mechanism for
+% controlling the capitalization, punctuation, spacing, quotation, and
+% newlines of the formatted entry fields. (Note: IEEEtran.bst does not need
+% or use the newline/newblock feature, but it has been implemented for
+% possible future use.) The output states of IEEEtran.bst consist of
+% multiple independent attributes and, as such, can be thought of as being
+% vectors, rather than the simple scalar values ("before.all",
+% "mid.sentence", etc.) used in most other .bst files.
+%
+% The more flexible and complex design used here was motivated in part by
+% IEEE's rather unusual bibliography style. For example, IEEE ends the
+% previous field item with a period and large space prior to the publisher
+% address; the @electronic entry types use periods as inter-item punctuation
+% rather than the commas used by the other entry types; and URLs are never
+% followed by periods even though they are the last item in the entry.
+% Although it is possible to accommodate these features with the conventional
+% output state system, the seemingly endless exceptions make for convoluted,
+% unreliable and difficult to maintain code.
+%
+% IEEEtran.bst's output state system can be easily understood via a simple
+% illustration of two most recently formatted entry fields (on the stack):
+%
+% CURRENT_ITEM
+% "PREVIOUS_ITEM
+%
+% which, in this example, is to eventually appear in the bibliography as:
+%
+% "PREVIOUS_ITEM," CURRENT_ITEM
+%
+% It is the job of the output routine to take the previous item off of the
+% stack (while leaving the current item at the top of the stack), apply its
+% trailing punctuation (including closing quote marks) and spacing, and then
+% to write the result to BibTeX's output buffer:
+%
+% "PREVIOUS_ITEM,"
+%
+% Punctuation (and spacing) between items is often determined by both of the
+% items rather than just the first one. The presence of quotation marks
+% further complicates the situation because, in standard English, trailing
+% punctuation marks are supposed to be contained within the quotes.
+%
+% IEEEtran.bst maintains two output state (aka "status") vectors which
+% correspond to the previous and current (aka "this") items. Each vector
+% consists of several independent attributes which track punctuation,
+% spacing, quotation, and newlines. Capitalization status is handled by a
+% separate scalar because the format routines, not the output routine,
+% handle capitalization and, therefore, there is no need to maintain the
+% capitalization attribute for both the "previous" and "this" items.
+%
+% When a format routine adds a new item, it copies the current output status
+% vector to the previous output status vector and (usually) resets the
+% current (this) output status vector to a "standard status" vector. Using a
+% "standard status" vector in this way allows us to redefine what we mean by
+% "standard status" at the start of each entry handler and reuse the same
+% format routines under the various inter-item separation schemes. For
+% example, the standard status vector for the @book entry type may use
+% commas for item separators, while the @electronic type may use periods,
+% yet both entry handlers exploit many of the exact same format routines.
+%
+% Because format routines have write access to the output status vector of
+% the previous item, they can override the punctuation choices of the
+% previous format routine! Therefore, it becomes trivial to implement rules
+% such as "Always use a period and a large space before the publisher." By
+% pushing the generation of the closing quote mark to the output routine, we
+% avoid all the problems caused by having to close a quote before having all
+% the information required to determine what the punctuation should be.
+%
+% The IEEEtran.bst output state system can easily be expanded if needed.
+% For instance, it is easy to add a "space.tie" attribute value if the
+% bibliography rules mandate that two items have to be joined with an
+% unbreakable space.
+
+FUNCTION {initialize.status.constants}
+{ #0 'punct.no :=
+ #1 'punct.comma :=
+ #2 'punct.period :=
+ #0 'space.no :=
+ #1 'space.normal :=
+ #2 'space.large :=
+ #0 'quote.no :=
+ #1 'quote.close :=
+ #0 'cap.no :=
+ #1 'cap.yes :=
+ #0 'nline.no :=
+ #1 'nline.newblock :=
+}
+
+FUNCTION {std.status.using.comma}
+{ punct.comma 'punct.std :=
+ space.normal 'space.std :=
+ quote.no 'quote.std :=
+ nline.no 'nline.std :=
+ cap.no 'cap.std :=
+}
+
+FUNCTION {std.status.using.period}
+{ punct.period 'punct.std :=
+ space.normal 'space.std :=
+ quote.no 'quote.std :=
+ nline.no 'nline.std :=
+ cap.yes 'cap.std :=
+}
+
+FUNCTION {initialize.prev.this.status}
+{ punct.no 'prev.status.punct :=
+ space.no 'prev.status.space :=
+ quote.no 'prev.status.quote :=
+ nline.no 'prev.status.nline :=
+ punct.no 'this.status.punct :=
+ space.no 'this.status.space :=
+ quote.no 'this.status.quote :=
+ nline.no 'this.status.nline :=
+ cap.yes 'status.cap :=
+}
+
+FUNCTION {this.status.std}
+{ punct.std 'this.status.punct :=
+ space.std 'this.status.space :=
+ quote.std 'this.status.quote :=
+ nline.std 'this.status.nline :=
+}
+
+FUNCTION {cap.status.std}{ cap.std 'status.cap := }
+
+FUNCTION {this.to.prev.status}
+{ this.status.punct 'prev.status.punct :=
+ this.status.space 'prev.status.space :=
+ this.status.quote 'prev.status.quote :=
+ this.status.nline 'prev.status.nline :=
+}
+
+
+FUNCTION {not}
+{ { #0 }
+ { #1 }
+ if$
+}
+
+FUNCTION {and}
+{ { skip$ }
+ { pop$ #0 }
+ if$
+}
+
+FUNCTION {or}
+{ { pop$ #1 }
+ { skip$ }
+ if$
+}
+
+
+% convert the strings "yes" or "no" to #1 or #0 respectively
+FUNCTION {yes.no.to.int}
+{ "l" change.case$ duplicate$
+ "yes" =
+ { pop$ #1 }
+ { duplicate$ "no" =
+ { pop$ #0 }
+ { "unknown boolean " quote$ * swap$ * quote$ *
+ " in " * cite$ * warning$
+ #0
+ }
+ if$
+ }
+ if$
+}
+
+
+% pushes true if the single char string on the stack is in the
+% range of "0" to "9"
+FUNCTION {is.num}
+{ chr.to.int$
+ duplicate$ "0" chr.to.int$ < not
+ swap$ "9" chr.to.int$ > not and
+}
+
+% multiplies the integer on the stack by a factor of 10
+FUNCTION {bump.int.mag}
+{ #0 'multiresult :=
+ { duplicate$ #0 > }
+ { #1 -
+ multiresult #10 +
+ 'multiresult :=
+ }
+ while$
+pop$
+multiresult
+}
+
+% converts a single character string on the stack to an integer
+FUNCTION {char.to.integer}
+{ duplicate$
+ is.num
+ { chr.to.int$ "0" chr.to.int$ - }
+ {"noninteger character " quote$ * swap$ * quote$ *
+ " in integer field of " * cite$ * warning$
+ #0
+ }
+ if$
+}
+
+% converts a string on the stack to an integer
+FUNCTION {string.to.integer}
+{ duplicate$ text.length$ 'namesleft :=
+ #1 'nameptr :=
+ #0 'numnames :=
+ { nameptr namesleft > not }
+ { duplicate$ nameptr #1 substring$
+ char.to.integer numnames bump.int.mag +
+ 'numnames :=
+ nameptr #1 +
+ 'nameptr :=
+ }
+ while$
+pop$
+numnames
+}
+
+
+
+
+% The output routines write out the *next* to the top (previous) item on the
+% stack, adding punctuation and such as needed. Since IEEEtran.bst maintains
+% the output status for the top two items on the stack, these output
+% routines have to consider the previous output status (which corresponds to
+% the item that is being output). Full independent control of punctuation,
+% closing quote marks, spacing, and newblock is provided.
+%
+% "output.nonnull" does not check for the presence of a previous empty
+% item.
+%
+% "output" does check for the presence of a previous empty item and will
+% remove an empty item rather than outputing it.
+%
+% "output.warn" is like "output", but will issue a warning if it detects
+% an empty item.
+
+FUNCTION {output.nonnull}
+{ swap$
+ prev.status.punct punct.comma =
+ { "," * }
+ { skip$ }
+ if$
+ prev.status.punct punct.period =
+ { add.period$ }
+ { skip$ }
+ if$
+ prev.status.quote quote.close =
+ { "''" * }
+ { skip$ }
+ if$
+ prev.status.space space.normal =
+ { " " * }
+ { skip$ }
+ if$
+ prev.status.space space.large =
+ { large.space * }
+ { skip$ }
+ if$
+ write$
+ prev.status.nline nline.newblock =
+ { newline$ "\newblock " write$ }
+ { skip$ }
+ if$
+}
+
+FUNCTION {output}
+{ duplicate$ empty$
+ 'pop$
+ 'output.nonnull
+ if$
+}
+
+FUNCTION {output.warn}
+{ 't :=
+ duplicate$ empty$
+ { pop$ "empty " t * " in " * cite$ * warning$ }
+ 'output.nonnull
+ if$
+}
+
+% "fin.entry" is the output routine that handles the last item of the entry
+% (which will be on the top of the stack when "fin.entry" is called).
+
+FUNCTION {fin.entry}
+{ this.status.punct punct.no =
+ { skip$ }
+ { add.period$ }
+ if$
+ this.status.quote quote.close =
+ { "''" * }
+ { skip$ }
+ if$
+write$
+newline$
+}
+
+
+FUNCTION {is.last.char.not.punct}
+{ duplicate$
+ "}" * add.period$
+ #-1 #1 substring$ "." =
+}
+
+FUNCTION {is.multiple.pages}
+{ 't :=
+ #0 'multiresult :=
+ { multiresult not
+ t empty$ not
+ and
+ }
+ { t #1 #1 substring$
+ duplicate$ "-" =
+ swap$ duplicate$ "," =
+ swap$ "+" =
+ or or
+ { #1 'multiresult := }
+ { t #2 global.max$ substring$ 't := }
+ if$
+ }
+ while$
+ multiresult
+}
+
+FUNCTION {capitalize}{ "u" change.case$ "t" change.case$ }
+
+FUNCTION {emphasize}
+{ duplicate$ empty$
+ { pop$ "" }
+ { "\emph{" swap$ * "}" * }
+ if$
+}
+
+FUNCTION {do.name.latex.cmd}
+{ name.latex.cmd
+ empty$
+ { skip$ }
+ { name.latex.cmd "{" * swap$ * "}" * }
+ if$
+}
+
+% IEEEtran.bst uses its own \BIBforeignlanguage command which directly
+% invokes the TeX hyphenation patterns without the need of the Babel
+% package. Babel does a lot more than switch hyphenation patterns and
+% its loading can cause unintended effects in many class files (such as
+% IEEEtran.cls).
+FUNCTION {select.language}
+{ duplicate$ empty$ 'pop$
+ { language empty$ 'skip$
+ { "\BIBforeignlanguage{" language * "}{" * swap$ * "}" * }
+ if$
+ }
+ if$
+}
+
+FUNCTION {tie.or.space.prefix}
+{ duplicate$ text.length$ #3 <
+ { "~" }
+ { " " }
+ if$
+ swap$
+}
+
+FUNCTION {get.bbl.editor}
+{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ }
+
+FUNCTION {space.word}{ " " swap$ * " " * }
+
+
+% Field Conditioners, Converters, Checkers and External Interfaces
+
+FUNCTION {empty.field.to.null.string}
+{ duplicate$ empty$
+ { pop$ "" }
+ { skip$ }
+ if$
+}
+
+FUNCTION {either.or.check}
+{ empty$
+ { pop$ }
+ { "can't use both " swap$ * " fields in " * cite$ * warning$ }
+ if$
+}
+
+FUNCTION {empty.entry.warn}
+{ author empty$ title empty$ howpublished empty$
+ month empty$ year empty$ note empty$ url empty$
+ and and and and and and
+ { "all relevant fields are empty in " cite$ * warning$ }
+ 'skip$
+ if$
+}
+
+
+% The bibinfo system provides a way for the electronic parsing/acquisition
+% of a bibliography's contents as is done by ReVTeX. For example, a field
+% could be entered into the bibliography as:
+% \bibinfo{volume}{2}
+% Only the "2" would show up in the document, but the LaTeX \bibinfo command
+% could do additional things with the information. IEEEtran.bst does provide
+% a \bibinfo command via "\providecommand{\bibinfo}[2]{#2}". However, it is
+% currently not used as the bogus bibinfo functions defined here output the
+% entry values directly without the \bibinfo wrapper. The bibinfo functions
+% themselves (and the calls to them) are retained for possible future use.
+%
+% bibinfo.check avoids acting on missing fields while bibinfo.warn will
+% issue a warning message if a missing field is detected. Prior to calling
+% the bibinfo functions, the user should push the field value and then its
+% name string, in that order.
+
+FUNCTION {bibinfo.check}
+{ swap$ duplicate$ missing$
+ { pop$ pop$ "" }
+ { duplicate$ empty$
+ { swap$ pop$ }
+ { swap$ pop$ }
+ if$
+ }
+ if$
+}
+
+FUNCTION {bibinfo.warn}
+{ swap$ duplicate$ missing$
+ { swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ "" }
+ { duplicate$ empty$
+ { swap$ "empty " swap$ * " in " * cite$ * warning$ }
+ { swap$ pop$ }
+ if$
+ }
+ if$
+}
+
+
+% IEEE separates large numbers with more than 4 digits into groups of
+% three. IEEE uses a small space to separate these number groups.
+% Typical applications include patent and page numbers.
+
+% number of consecutive digits required to trigger the group separation.
+FUNCTION {large.number.trigger}{ #5 }
+
+% For numbers longer than the trigger, this is the blocksize of the groups.
+% The blocksize must be less than the trigger threshold, and 2 * blocksize
+% must be greater than the trigger threshold (can't do more than one
+% separation on the initial trigger).
+FUNCTION {large.number.blocksize}{ #3 }
+
+% What is actually inserted between the number groups.
+FUNCTION {large.number.separator}{ "\," }
+
+% So as to save on integer variables by reusing existing ones, numnames
+% holds the current number of consecutive digits read and nameptr holds
+% the number that will trigger an inserted space.
+FUNCTION {large.number.separate}
+{ 't :=
+ ""
+ #0 'numnames :=
+ large.number.trigger 'nameptr :=
+ { t empty$ not }
+ { t #-1 #1 substring$ is.num
+ { numnames #1 + 'numnames := }
+ { #0 'numnames :=
+ large.number.trigger 'nameptr :=
+ }
+ if$
+ t #-1 #1 substring$ swap$ *
+ t #-2 global.max$ substring$ 't :=
+ numnames nameptr =
+ { duplicate$ #1 nameptr large.number.blocksize - substring$ swap$
+ nameptr large.number.blocksize - #1 + global.max$ substring$
+ large.number.separator swap$ * *
+ nameptr large.number.blocksize - 'numnames :=
+ large.number.blocksize #1 + 'nameptr :=
+ }
+ { skip$ }
+ if$
+ }
+ while$
+}
+
+% Converts all single dashes "-" to double dashes "--".
+FUNCTION {n.dashify}
+{ large.number.separate
+ 't :=
+ ""
+ { t empty$ not }
+ { t #1 #1 substring$ "-" =
+ { t #1 #2 substring$ "--" = not
+ { "--" *
+ t #2 global.max$ substring$ 't :=
+ }
+ { { t #1 #1 substring$ "-" = }
+ { "-" *
+ t #2 global.max$ substring$ 't :=
+ }
+ while$
+ }
+ if$
+ }
+ { t #1 #1 substring$ *
+ t #2 global.max$ substring$ 't :=
+ }
+ if$
+ }
+ while$
+}
+
+
+% This function detects entries with names that are identical to that of
+% the previous entry and replaces the repeated names with dashes (if the
+% "is.dash.repeated.names" user control is nonzero).
+FUNCTION {name.or.dash}
+{ 's :=
+ oldname empty$
+ { s 'oldname := s }
+ { s oldname =
+ { is.dash.repeated.names
+ { repeated.name.dashes }
+ { s 'oldname := s }
+ if$
+ }
+ { s 'oldname := s }
+ if$
+ }
+ if$
+}
+
+% Converts the number string on the top of the stack to
+% "numerical ordinal form" (e.g., "7" to "7th"). There is
+% no artificial limit to the upper bound of the numbers as the
+% two least significant digits determine the ordinal form.
+FUNCTION {num.to.ordinal}
+{ duplicate$ #-2 #1 substring$ "1" =
+ { bbl.th * }
+ { duplicate$ #-1 #1 substring$ "1" =
+ { bbl.st * }
+ { duplicate$ #-1 #1 substring$ "2" =
+ { bbl.nd * }
+ { duplicate$ #-1 #1 substring$ "3" =
+ { bbl.rd * }
+ { bbl.th * }
+ if$
+ }
+ if$
+ }
+ if$
+ }
+ if$
+}
+
+% If the string on the top of the stack begins with a number,
+% (e.g., 11th) then replace the string with the leading number
+% it contains. Otherwise retain the string as-is. s holds the
+% extracted number, t holds the part of the string that remains
+% to be scanned.
+FUNCTION {extract.num}
+{ duplicate$ 't :=
+ "" 's :=
+ { t empty$ not }
+ { t #1 #1 substring$
+ t #2 global.max$ substring$ 't :=
+ duplicate$ is.num
+ { s swap$ * 's := }
+ { pop$ "" 't := }
+ if$
+ }
+ while$
+ s empty$
+ 'skip$
+ { pop$ s }
+ if$
+}
+
+% Converts the word number string on the top of the stack to
+% Arabic string form. Will be successful up to "tenth".
+FUNCTION {word.to.num}
+{ duplicate$ "l" change.case$ 's :=
+ s "first" =
+ { pop$ "1" }
+ { skip$ }
+ if$
+ s "second" =
+ { pop$ "2" }
+ { skip$ }
+ if$
+ s "third" =
+ { pop$ "3" }
+ { skip$ }
+ if$
+ s "fourth" =
+ { pop$ "4" }
+ { skip$ }
+ if$
+ s "fifth" =
+ { pop$ "5" }
+ { skip$ }
+ if$
+ s "sixth" =
+ { pop$ "6" }
+ { skip$ }
+ if$
+ s "seventh" =
+ { pop$ "7" }
+ { skip$ }
+ if$
+ s "eighth" =
+ { pop$ "8" }
+ { skip$ }
+ if$
+ s "ninth" =
+ { pop$ "9" }
+ { skip$ }
+ if$
+ s "tenth" =
+ { pop$ "10" }
+ { skip$ }
+ if$
+}
+
+
+% Converts the string on the top of the stack to numerical
+% ordinal (e.g., "11th") form.
+FUNCTION {convert.edition}
+{ duplicate$ empty$ 'skip$
+ { duplicate$ #1 #1 substring$ is.num
+ { extract.num
+ num.to.ordinal
+ }
+ { word.to.num
+ duplicate$ #1 #1 substring$ is.num
+ { num.to.ordinal }
+ { "edition ordinal word " quote$ * edition * quote$ *
+ " may be too high (or improper) for conversion" * " in " * cite$ * warning$
+ }
+ if$
+ }
+ if$
+ }
+ if$
+}
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% LATEX BIBLIOGRAPHY CODE %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% from plainnat.bst
+FUNCTION {format.full.names}
+{'s :=
+ #1 'nameptr :=
+ s num.names$ 'numnames :=
+ numnames 'namesleft :=
+ { namesleft #0 > }
+ { s nameptr
+ "{vv~}{ll}" format.name$ 't :=
+ nameptr #1 >
+ {
+ namesleft #1 >
+ { ", " * t * }
+ {
+ numnames #2 >
+ { "," * }
+ 'skip$
+ if$
+ t "others" =
+ { " et~al." * }
+ { " and " * t * }
+ if$
+ }
+ if$
+ }
+ 't
+ if$
+ nameptr #1 + 'nameptr :=
+ namesleft #1 - 'namesleft :=
+ }
+ while$
+}
+
+FUNCTION {author.editor.full}
+{ author empty$
+ { editor empty$
+ { "" }
+ { editor format.full.names }
+ if$
+ }
+ { author format.full.names }
+ if$
+}
+
+FUNCTION {author.full}
+{ author empty$
+ { "" }
+ { author format.full.names }
+ if$
+}
+
+FUNCTION {editor.full}
+{ editor empty$
+ { "" }
+ { editor format.full.names }
+ if$
+}
+
+FUNCTION {make.full.names}
+{ type$ "book" =
+ type$ "inbook" =
+ or
+ { author.editor.full }
+ { type$ "proceedings" =
+ type$ "periodical" =
+ or
+ { editor.full }
+ { author.full }
+ if$
+ }
+ if$
+}
+% END from plainnat.bst
+
+FUNCTION {start.entry}
+{ newline$
+ "\bibitem[" write$
+ label write$
+ ")" make.full.names duplicate$ short.list =
+ { pop$ }
+ { * }
+ if$
+ "]{" * write$
+ cite$ write$
+ "}" write$
+ newline$
+ ""
+ initialize.prev.this.status
+}
+
+% Here we write out all the LaTeX code that we will need. The most involved
+% code sequences are those that control the alternate interword spacing and
+% foreign language hyphenation patterns. The heavy use of \providecommand
+% gives users a way to override the defaults. Special thanks to Javier Bezos,
+% Johannes Braams, Robin Fairbairns, Heiko Oberdiek, Donald Arseneau and all
+% the other gurus on comp.text.tex for their help and advice on the topic of
+% \selectlanguage, Babel and BibTeX.
+FUNCTION {begin.bib}
+{ "% Generated by IEEEtranSN.bst, version: " bst.file.version * " (" * bst.file.date * ")" *
+ write$ newline$
+ preamble$ empty$ 'skip$
+ { preamble$ write$ newline$ }
+ if$
+ "\begin{thebibliography}{" number.label int.to.str$ * "}" *
+ write$ newline$
+ "\providecommand{\natexlab}[1]{#1}"
+ write$ newline$
+ "\providecommand{\url}[1]{#1}"
+ write$ newline$
+ "\csname url@samestyle\endcsname"
+ write$ newline$
+ "\providecommand{\newblock}{\relax}"
+ write$ newline$
+ "\providecommand{\bibinfo}[2]{#2}"
+ write$ newline$
+ "\providecommand{\BIBentrySTDinterwordspacing}{\spaceskip=0pt\relax}"
+ write$ newline$
+ "\providecommand{\BIBentryALTinterwordstretchfactor}{"
+ ALTinterwordstretchfactor * "}" *
+ write$ newline$
+ "\providecommand{\BIBentryALTinterwordspacing}{\spaceskip=\fontdimen2\font plus "
+ write$ newline$
+ "\BIBentryALTinterwordstretchfactor\fontdimen3\font minus \fontdimen4\font\relax}"
+ write$ newline$
+ "\providecommand{\BIBforeignlanguage}[2]{{%"
+ write$ newline$
+ "\expandafter\ifx\csname l@#1\endcsname\relax"
+ write$ newline$
+ "\typeout{** WARNING: IEEEtranSN.bst: No hyphenation pattern has been}%"
+ write$ newline$
+ "\typeout{** loaded for the language `#1'. Using the pattern for}%"
+ write$ newline$
+ "\typeout{** the default language instead.}%"
+ write$ newline$
+ "\else"
+ write$ newline$
+ "\language=\csname l@#1\endcsname"
+ write$ newline$
+ "\fi"
+ write$ newline$
+ "#2}}"
+ write$ newline$
+ "\providecommand{\BIBdecl}{\relax}"
+ write$ newline$
+ "\BIBdecl"
+ write$ newline$
+}
+
+FUNCTION {end.bib}
+{ newline$ "\end{thebibliography}" write$ newline$ }
+
+FUNCTION {if.url.alt.interword.spacing}
+{ is.use.alt.interword.spacing
+ {url empty$ 'skip$ {"\BIBentryALTinterwordspacing" write$ newline$} if$}
+ { skip$ }
+ if$
+}
+
+FUNCTION {if.url.std.interword.spacing}
+{ is.use.alt.interword.spacing
+ {url empty$ 'skip$ {"\BIBentrySTDinterwordspacing" write$ newline$} if$}
+ { skip$ }
+ if$
+}
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%
+%% FORMAT HANDLERS %%
+%%%%%%%%%%%%%%%%%%%%%
+
+%% Lower Level Formats (used by higher level formats)
+
+FUNCTION {format.address.org.or.pub.date}
+{ 't :=
+ ""
+ year empty$
+ { "empty year in " cite$ * warning$ }
+ { skip$ }
+ if$
+ address empty$ t empty$ and
+ year empty$ and month empty$ and
+ { skip$ }
+ { this.to.prev.status
+ this.status.std
+ cap.status.std
+ address "address" bibinfo.check *
+ t empty$
+ { skip$ }
+ { punct.period 'prev.status.punct :=
+ space.large 'prev.status.space :=
+ address empty$
+ { skip$ }
+ { ": " * }
+ if$
+ t *
+ }
+ if$
+ year empty$ month empty$ and
+ { skip$ }
+ { t empty$ address empty$ and
+ { skip$ }
+ { ", " * }
+ if$
+ month empty$
+ { year empty$
+ { skip$ }
+ { year "year" bibinfo.check * }
+ if$
+ }
+ { month "month" bibinfo.check *
+ year empty$
+ { skip$ }
+ { " " * year "year" bibinfo.check * }
+ if$
+ }
+ if$
+ }
+ if$
+ }
+ if$
+}
+
+
+FUNCTION {format.names}
+{ 'bibinfo :=
+ duplicate$ empty$ 'skip$ {
+ this.to.prev.status
+ this.status.std
+ 's :=
+ "" 't :=
+ #1 'nameptr :=
+ s num.names$ 'numnames :=
+ numnames 'namesleft :=
+ { namesleft #0 > }
+ { s nameptr
+ name.format.string
+ format.name$
+ bibinfo bibinfo.check
+ 't :=
+ nameptr #1 >
+ { nameptr num.names.shown.with.forced.et.al #1 + =
+ numnames max.num.names.before.forced.et.al >
+ is.forced.et.al and and
+ { "others" 't :=
+ #1 'namesleft :=
+ }
+ { skip$ }
+ if$
+ namesleft #1 >
+ { ", " * t do.name.latex.cmd * }
+ { s nameptr "{ll}" format.name$ duplicate$ "others" =
+ { 't := }
+ { pop$ }
+ if$
+ t "others" =
+ { " " * bbl.etal emphasize * }
+ { numnames #2 >
+ { "," * }
+ { skip$ }
+ if$
+ bbl.and
+ space.word * t do.name.latex.cmd *
+ }
+ if$
+ }
+ if$
+ }
+ { t do.name.latex.cmd }
+ if$
+ nameptr #1 + 'nameptr :=
+ namesleft #1 - 'namesleft :=
+ }
+ while$
+ cap.status.std
+ } if$
+}
+
+
+
+
+%% Higher Level Formats
+
+%% addresses/locations
+
+FUNCTION {format.address}
+{ address duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ cap.status.std
+ }
+ if$
+}
+
+
+
+%% author/editor names
+
+FUNCTION {format.authors}{ author "author" format.names }
+
+FUNCTION {format.editors}
+{ editor "editor" format.names duplicate$ empty$ 'skip$
+ { ", " *
+ get.bbl.editor
+ capitalize
+ *
+ }
+ if$
+}
+
+
+
+%% date
+
+FUNCTION {format.date}
+{
+ month "month" bibinfo.check duplicate$ empty$
+ year "year" bibinfo.check duplicate$ empty$
+ { swap$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ cap.status.std
+ "there's a month but no year in " cite$ * warning$ }
+ if$
+ *
+ }
+ { this.to.prev.status
+ this.status.std
+ cap.status.std
+ swap$ 'skip$
+ {
+ swap$
+ " " * swap$
+ }
+ if$
+ *
+ }
+ if$
+}
+
+FUNCTION {format.date.electronic}
+{ month "month" bibinfo.check duplicate$ empty$
+ year "year" bibinfo.check duplicate$ empty$
+ { swap$
+ { pop$ }
+ { "there's a month but no year in " cite$ * warning$
+ pop$ ")" * "(" swap$ *
+ this.to.prev.status
+ punct.no 'this.status.punct :=
+ space.normal 'this.status.space :=
+ quote.no 'this.status.quote :=
+ cap.yes 'status.cap :=
+ }
+ if$
+ }
+ { swap$
+ { swap$ pop$ ")" * "(" swap$ * }
+ { "(" swap$ * ", " * swap$ * ")" * }
+ if$
+ this.to.prev.status
+ punct.no 'this.status.punct :=
+ space.normal 'this.status.space :=
+ quote.no 'this.status.quote :=
+ cap.yes 'status.cap :=
+ }
+ if$
+}
+
+
+
+%% edition/title
+
+% Note: IEEE considers the edition to be closely associated with
+% the title of a book. So, in IEEEtran.bst the edition is normally handled
+% within the formatting of the title. The format.edition function is
+% retained here for possible future use.
+FUNCTION {format.edition}
+{ edition duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ convert.edition
+ status.cap
+ { "t" }
+ { "l" }
+ if$ change.case$
+ "edition" bibinfo.check
+ "~" * bbl.edition *
+ cap.status.std
+ }
+ if$
+}
+
+% This is used to format the booktitle of a conference proceedings.
+% Here we use the "intype" field to provide the user a way to
+% override the word "in" (e.g., with things like "presented at")
+% Use of intype stops the emphasis of the booktitle to indicate that
+% we no longer mean the written conference proceedings, but the
+% conference itself.
+FUNCTION {format.in.booktitle}
+{ booktitle "booktitle" bibinfo.check duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ select.language
+ intype missing$
+ { emphasize
+ bbl.in " " *
+ }
+ { intype " " * }
+ if$
+ swap$ *
+ cap.status.std
+ }
+ if$
+}
+
+% This is used to format the booktitle of collection.
+% Here the "intype" field is not supported, but "edition" is.
+FUNCTION {format.in.booktitle.edition}
+{ booktitle "booktitle" bibinfo.check duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ select.language
+ emphasize
+ edition empty$ 'skip$
+ { ", " *
+ edition
+ convert.edition
+ "l" change.case$
+ * "~" * bbl.edition *
+ }
+ if$
+ bbl.in " " * swap$ *
+ cap.status.std
+ }
+ if$
+}
+
+FUNCTION {format.article.title}
+{ title duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ "t" change.case$
+ }
+ if$
+ "title" bibinfo.check
+ duplicate$ empty$ 'skip$
+ { quote.close 'this.status.quote :=
+ is.last.char.not.punct
+ { punct.std 'this.status.punct := }
+ { punct.no 'this.status.punct := }
+ if$
+ select.language
+ "``" swap$ *
+ cap.status.std
+ }
+ if$
+}
+
+FUNCTION {format.article.title.electronic}
+{ title duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ cap.status.std
+ "t" change.case$
+ }
+ if$
+ "title" bibinfo.check
+ duplicate$ empty$
+ { skip$ }
+ { select.language }
+ if$
+}
+
+FUNCTION {format.book.title.edition}
+{ title "title" bibinfo.check
+ duplicate$ empty$
+ { "empty title in " cite$ * warning$ }
+ { this.to.prev.status
+ this.status.std
+ select.language
+ emphasize
+ edition empty$ 'skip$
+ { ", " *
+ edition
+ convert.edition
+ status.cap
+ { "t" }
+ { "l" }
+ if$
+ change.case$
+ * "~" * bbl.edition *
+ }
+ if$
+ cap.status.std
+ }
+ if$
+}
+
+FUNCTION {format.book.title}
+{ title "title" bibinfo.check
+ duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ cap.status.std
+ select.language
+ emphasize
+ }
+ if$
+}
+
+
+
+%% journal
+
+FUNCTION {format.journal}
+{ journal duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ cap.status.std
+ select.language
+ emphasize
+ }
+ if$
+}
+
+
+
+%% how published
+
+FUNCTION {format.howpublished}
+{ howpublished duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ cap.status.std
+ }
+ if$
+}
+
+
+
+%% institutions/organization/publishers/school
+
+FUNCTION {format.institution}
+{ institution duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ cap.status.std
+ }
+ if$
+}
+
+FUNCTION {format.organization}
+{ organization duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ cap.status.std
+ }
+ if$
+}
+
+FUNCTION {format.address.publisher.date}
+{ publisher "publisher" bibinfo.warn format.address.org.or.pub.date }
+
+FUNCTION {format.address.publisher.date.nowarn}
+{ publisher "publisher" bibinfo.check format.address.org.or.pub.date }
+
+FUNCTION {format.address.organization.date}
+{ organization "organization" bibinfo.check format.address.org.or.pub.date }
+
+FUNCTION {format.school}
+{ school duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ cap.status.std
+ }
+ if$
+}
+
+
+
+%% volume/number/series/chapter/pages
+
+FUNCTION {format.volume}
+{ volume empty.field.to.null.string
+ duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ bbl.volume
+ status.cap
+ { capitalize }
+ { skip$ }
+ if$
+ swap$ tie.or.space.prefix
+ "volume" bibinfo.check
+ * *
+ cap.status.std
+ }
+ if$
+}
+
+FUNCTION {format.number}
+{ number empty.field.to.null.string
+ duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ status.cap
+ { bbl.number capitalize }
+ { bbl.number }
+ if$
+ swap$ tie.or.space.prefix
+ "number" bibinfo.check
+ * *
+ cap.status.std
+ }
+ if$
+}
+
+FUNCTION {format.number.if.use.for.article}
+{ is.use.number.for.article
+ { format.number }
+ { "" }
+ if$
+}
+
+% IEEE does not seem to tie the series so closely with the volume
+% and number as is done in other bibliography styles. Instead the
+% series is treated somewhat like an extension of the title.
+FUNCTION {format.series}
+{ series empty$
+ { "" }
+ { this.to.prev.status
+ this.status.std
+ bbl.series " " *
+ series "series" bibinfo.check *
+ cap.status.std
+ }
+ if$
+}
+
+
+FUNCTION {format.chapter}
+{ chapter empty$
+ { "" }
+ { this.to.prev.status
+ this.status.std
+ type empty$
+ { bbl.chapter }
+ { type "l" change.case$
+ "type" bibinfo.check
+ }
+ if$
+ chapter tie.or.space.prefix
+ "chapter" bibinfo.check
+ * *
+ cap.status.std
+ }
+ if$
+}
+
+
+% The intended use of format.paper is for paper numbers of inproceedings.
+% The paper type can be overridden via the type field.
+% We allow the type to be displayed even if the paper number is absent
+% for things like "postdeadline paper"
+FUNCTION {format.paper}
+{ is.use.paper
+ { paper empty$
+ { type empty$
+ { "" }
+ { this.to.prev.status
+ this.status.std
+ type "type" bibinfo.check
+ cap.status.std
+ }
+ if$
+ }
+ { this.to.prev.status
+ this.status.std
+ type empty$
+ { bbl.paper }
+ { type "type" bibinfo.check }
+ if$
+ " " * paper
+ "paper" bibinfo.check
+ *
+ cap.status.std
+ }
+ if$
+ }
+ { "" }
+ if$
+}
+
+
+FUNCTION {format.pages}
+{ pages duplicate$ empty$ 'skip$
+ { this.to.prev.status
+ this.status.std
+ duplicate$ is.multiple.pages
+ {
+ bbl.pages swap$
+ n.dashify
+ }
+ {
+ bbl.page swap$
+ }
+ if$
+ tie.or.space.prefix
+ "pages" bibinfo.check
+ * *
+ cap.status.std
+ }
+ if$
+}
+
+
+
+%% technical report number
+
+FUNCTION {format.tech.report.number}
+{ number "number" bibinfo.check
+ this.to.prev.status
+ this.status.std
+ cap.status.std
+ type duplicate$ empty$
+ { pop$
+ bbl.techrep
+ }
+ { skip$ }
+ if$
+ "type" bibinfo.check
+ swap$ duplicate$ empty$
+ { pop$ }
+ { tie.or.space.prefix * * }
+ if$
+}
+
+
+
+%% note
+
+FUNCTION {format.note}
+{ note empty$
+ { "" }
+ { this.to.prev.status
+ this.status.std
+ punct.period 'this.status.punct :=
+ note #1 #1 substring$
+ duplicate$ "{" =
+ { skip$ }
+ { status.cap
+ { "u" }
+ { "l" }
+ if$
+ change.case$
+ }
+ if$
+ note #2 global.max$ substring$ * "note" bibinfo.check
+ cap.yes 'status.cap :=
+ }
+ if$
+}
+
+
+
+%% patent
+
+FUNCTION {format.patent.date}
+{ this.to.prev.status
+ this.status.std
+ year empty$
+ { monthfiled duplicate$ empty$
+ { "monthfiled" bibinfo.check pop$ "" }
+ { "monthfiled" bibinfo.check }
+ if$
+ dayfiled duplicate$ empty$
+ { "dayfiled" bibinfo.check pop$ "" * }
+ { "dayfiled" bibinfo.check
+ monthfiled empty$
+ { "dayfiled without a monthfiled in " cite$ * warning$
+ *
+ }
+ { " " swap$ * * }
+ if$
+ }
+ if$
+ yearfiled empty$
+ { "no year or yearfiled in " cite$ * warning$ }
+ { yearfiled "yearfiled" bibinfo.check
+ swap$
+ duplicate$ empty$
+ { pop$ }
+ { ", " * swap$ * }
+ if$
+ }
+ if$
+ }
+ { month duplicate$ empty$
+ { "month" bibinfo.check pop$ "" }
+ { "month" bibinfo.check }
+ if$
+ day duplicate$ empty$
+ { "day" bibinfo.check pop$ "" * }
+ { "day" bibinfo.check
+ month empty$
+ { "day without a month in " cite$ * warning$
+ *
+ }
+ { " " swap$ * * }
+ if$
+ }
+ if$
+ year "year" bibinfo.check
+ swap$
+ duplicate$ empty$
+ { pop$ }
+ { ", " * swap$ * }
+ if$
+ }
+ if$
+ cap.status.std
+}
+
+FUNCTION {format.patent.nationality.type.number}
+{ this.to.prev.status
+ this.status.std
+ nationality duplicate$ empty$
+ { "nationality" bibinfo.warn pop$ "" }
+ { "nationality" bibinfo.check
+ duplicate$ "l" change.case$ "united states" =
+ { pop$ bbl.patentUS }
+ { skip$ }
+ if$
+ " " *
+ }
+ if$
+ type empty$
+ { bbl.patent "type" bibinfo.check }
+ { type "type" bibinfo.check }
+ if$
+ *
+ number duplicate$ empty$
+ { "number" bibinfo.warn pop$ }
+ { "number" bibinfo.check
+ large.number.separate
+ swap$ " " * swap$ *
+ }
+ if$
+ cap.status.std
+}
+
+
+
+%% standard
+
+FUNCTION {format.organization.institution.standard.type.number}
+{ this.to.prev.status
+ this.status.std
+ organization duplicate$ empty$
+ { pop$
+ institution duplicate$ empty$
+ { "institution" bibinfo.warn }
+ { "institution" bibinfo.warn " " * }
+ if$
+ }
+ { "organization" bibinfo.warn " " * }
+ if$
+ type empty$
+ { bbl.standard "type" bibinfo.check }
+ { type "type" bibinfo.check }
+ if$
+ *
+ number duplicate$ empty$
+ { "number" bibinfo.check pop$ }
+ { "number" bibinfo.check
+ large.number.separate
+ swap$ " " * swap$ *
+ }
+ if$
+ cap.status.std
+}
+
+FUNCTION {format.revision}
+{ revision empty$
+ { "" }
+ { this.to.prev.status
+ this.status.std
+ bbl.revision
+ revision tie.or.space.prefix
+ "revision" bibinfo.check
+ * *
+ cap.status.std
+ }
+ if$
+}
+
+
+%% thesis
+
+FUNCTION {format.master.thesis.type}
+{ this.to.prev.status
+ this.status.std
+ type empty$
+ {
+ bbl.mthesis
+ }
+ {
+ type "type" bibinfo.check
+ }
+ if$
+cap.status.std
+}
+
+FUNCTION {format.phd.thesis.type}
+{ this.to.prev.status
+ this.status.std
+ type empty$
+ {
+ bbl.phdthesis
+ }
+ {
+ type "type" bibinfo.check
+ }
+ if$
+cap.status.std
+}
+
+
+
+%% URL
+
+FUNCTION {format.url}
+{ url empty$
+ { "" }
+ { this.to.prev.status
+ this.status.std
+ cap.yes 'status.cap :=
+ name.url.prefix " " *
+ "\url{" * url * "}" *
+ punct.no 'this.status.punct :=
+ punct.period 'prev.status.punct :=
+ space.normal 'this.status.space :=
+ space.normal 'prev.status.space :=
+ quote.no 'this.status.quote :=
+ }
+ if$
+}
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%
+%% ENTRY HANDLERS %%
+%%%%%%%%%%%%%%%%%%%%
+
+
+% Note: In many journals, IEEE (or the authors) tend not to show the number
+% for articles, so the display of the number is controlled here by the
+% switch "is.use.number.for.article"
+FUNCTION {article}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors "author" output.warn
+ name.or.dash
+ format.article.title "title" output.warn
+ format.journal "journal" bibinfo.check "journal" output.warn
+ format.volume output
+ format.number.if.use.for.article output
+ format.pages output
+ format.date "year" output.warn
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {book}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ author empty$
+ { format.editors "author and editor" output.warn }
+ { format.authors output.nonnull }
+ if$
+ name.or.dash
+ format.book.title.edition output
+ format.series output
+ author empty$
+ { skip$ }
+ { format.editors output }
+ if$
+ format.address.publisher.date output
+ format.volume output
+ format.number output
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {booklet}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors output
+ name.or.dash
+ format.article.title "title" output.warn
+ format.howpublished "howpublished" bibinfo.check output
+ format.organization "organization" bibinfo.check output
+ format.address "address" bibinfo.check output
+ format.date output
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {electronic}
+{ std.status.using.period
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors output
+ name.or.dash
+ format.date.electronic output
+ format.article.title.electronic output
+ format.howpublished "howpublished" bibinfo.check output
+ format.organization "organization" bibinfo.check output
+ format.address "address" bibinfo.check output
+ format.note output
+ format.url output
+ fin.entry
+ empty.entry.warn
+ if.url.std.interword.spacing
+}
+
+FUNCTION {inbook}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ author empty$
+ { format.editors "author and editor" output.warn }
+ { format.authors output.nonnull }
+ if$
+ name.or.dash
+ format.book.title.edition output
+ format.series output
+ format.address.publisher.date output
+ format.volume output
+ format.number output
+ format.chapter output
+ format.pages output
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {incollection}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors "author" output.warn
+ name.or.dash
+ format.article.title "title" output.warn
+ format.in.booktitle.edition "booktitle" output.warn
+ format.series output
+ format.editors output
+ format.address.publisher.date.nowarn output
+ format.volume output
+ format.number output
+ format.chapter output
+ format.pages output
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {inproceedings}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors "author" output.warn
+ name.or.dash
+ format.article.title "title" output.warn
+ format.in.booktitle "booktitle" output.warn
+ format.series output
+ format.editors output
+ format.volume output
+ format.number output
+ publisher empty$
+ { format.address.organization.date output }
+ { format.organization "organization" bibinfo.check output
+ format.address.publisher.date output
+ }
+ if$
+ format.paper output
+ format.pages output
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {manual}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors output
+ name.or.dash
+ format.book.title.edition "title" output.warn
+ format.howpublished "howpublished" bibinfo.check output
+ format.organization "organization" bibinfo.check output
+ format.address "address" bibinfo.check output
+ format.date output
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {mastersthesis}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors "author" output.warn
+ name.or.dash
+ format.article.title "title" output.warn
+ format.master.thesis.type output.nonnull
+ format.school "school" bibinfo.warn output
+ format.address "address" bibinfo.check output
+ format.date "year" output.warn
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {misc}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors output
+ name.or.dash
+ format.article.title output
+ format.howpublished "howpublished" bibinfo.check output
+ format.organization "organization" bibinfo.check output
+ format.address "address" bibinfo.check output
+ format.pages output
+ format.date output
+ format.note output
+ format.url output
+ fin.entry
+ empty.entry.warn
+ if.url.std.interword.spacing
+}
+
+FUNCTION {patent}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors output
+ name.or.dash
+ format.article.title output
+ format.patent.nationality.type.number output
+ format.patent.date output
+ format.note output
+ format.url output
+ fin.entry
+ empty.entry.warn
+ if.url.std.interword.spacing
+}
+
+FUNCTION {periodical}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.editors output
+ name.or.dash
+ format.book.title "title" output.warn
+ format.series output
+ format.volume output
+ format.number output
+ format.organization "organization" bibinfo.check output
+ format.date "year" output.warn
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {phdthesis}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors "author" output.warn
+ name.or.dash
+ format.article.title "title" output.warn
+ format.phd.thesis.type output.nonnull
+ format.school "school" bibinfo.warn output
+ format.address "address" bibinfo.check output
+ format.date "year" output.warn
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {proceedings}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.editors output
+ name.or.dash
+ format.book.title "title" output.warn
+ format.series output
+ format.volume output
+ format.number output
+ publisher empty$
+ { format.address.organization.date output }
+ { format.organization "organization" bibinfo.check output
+ format.address.publisher.date output
+ }
+ if$
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {standard}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors output
+ name.or.dash
+ format.book.title "title" output.warn
+ format.howpublished "howpublished" bibinfo.check output
+ format.organization.institution.standard.type.number output
+ format.revision output
+ format.date output
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {techreport}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors "author" output.warn
+ name.or.dash
+ format.article.title "title" output.warn
+ format.howpublished "howpublished" bibinfo.check output
+ format.institution "institution" bibinfo.warn output
+ format.address "address" bibinfo.check output
+ format.tech.report.number output.nonnull
+ format.date "year" output.warn
+ format.note output
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+FUNCTION {unpublished}
+{ std.status.using.comma
+ start.entry
+ if.url.alt.interword.spacing
+ format.authors "author" output.warn
+ name.or.dash
+ format.article.title "title" output.warn
+ format.date output
+ format.note "note" output.warn
+ format.url output
+ fin.entry
+ if.url.std.interword.spacing
+}
+
+
+% The special entry type which provides the user interface to the
+% BST controls
+FUNCTION {IEEEtranBSTCTL}
+{ is.print.banners.to.terminal
+ { "** IEEEtran BST control entry " quote$ * cite$ * quote$ * " detected." *
+ top$
+ }
+ { skip$ }
+ if$
+ CTLuse_article_number
+ empty$
+ { skip$ }
+ { CTLuse_article_number
+ yes.no.to.int
+ 'is.use.number.for.article :=
+ }
+ if$
+ CTLuse_paper
+ empty$
+ { skip$ }
+ { CTLuse_paper
+ yes.no.to.int
+ 'is.use.paper :=
+ }
+ if$
+ CTLuse_forced_etal
+ empty$
+ { skip$ }
+ { CTLuse_forced_etal
+ yes.no.to.int
+ 'is.forced.et.al :=
+ }
+ if$
+ CTLmax_names_forced_etal
+ empty$
+ { skip$ }
+ { CTLmax_names_forced_etal
+ string.to.integer
+ 'max.num.names.before.forced.et.al :=
+ }
+ if$
+ CTLnames_show_etal
+ empty$
+ { skip$ }
+ { CTLnames_show_etal
+ string.to.integer
+ 'num.names.shown.with.forced.et.al :=
+ }
+ if$
+ CTLuse_alt_spacing
+ empty$
+ { skip$ }
+ { CTLuse_alt_spacing
+ yes.no.to.int
+ 'is.use.alt.interword.spacing :=
+ }
+ if$
+ CTLalt_stretch_factor
+ empty$
+ { skip$ }
+ { CTLalt_stretch_factor
+ 'ALTinterwordstretchfactor :=
+ "\renewcommand{\BIBentryALTinterwordstretchfactor}{"
+ ALTinterwordstretchfactor * "}" *
+ write$ newline$
+ }
+ if$
+ CTLdash_repeated_names
+ empty$
+ { skip$ }
+ { CTLdash_repeated_names
+ yes.no.to.int
+ 'is.dash.repeated.names :=
+ }
+ if$
+ CTLname_format_string
+ empty$
+ { skip$ }
+ { CTLname_format_string
+ 'name.format.string :=
+ }
+ if$
+ CTLname_latex_cmd
+ empty$
+ { skip$ }
+ { CTLname_latex_cmd
+ 'name.latex.cmd :=
+ }
+ if$
+ CTLname_url_prefix
+ missing$
+ { skip$ }
+ { CTLname_url_prefix
+ 'name.url.prefix :=
+ }
+ if$
+
+
+ num.names.shown.with.forced.et.al max.num.names.before.forced.et.al >
+ { "CTLnames_show_etal cannot be greater than CTLmax_names_forced_etal in " cite$ * warning$
+ max.num.names.before.forced.et.al 'num.names.shown.with.forced.et.al :=
+ }
+ { skip$ }
+ if$
+}
+
+
+%%%%%%%%%%%%%%%%%%%
+%% ENTRY ALIASES %%
+%%%%%%%%%%%%%%%%%%%
+FUNCTION {conference}{inproceedings}
+FUNCTION {online}{electronic}
+FUNCTION {internet}{electronic}
+FUNCTION {webpage}{electronic}
+FUNCTION {www}{electronic}
+FUNCTION {default.type}{misc}
+
+
+
+%%%%%%%%%%%%%%%%%%
+%% MAIN PROGRAM %%
+%%%%%%%%%%%%%%%%%%
+
+READ
+
+EXECUTE {initialize.controls}
+EXECUTE {initialize.status.constants}
+EXECUTE {banner.message}
+
+
+
+% BEGIN sort code based on plainnat.bst
+FUNCTION {sortify}
+{ purify$
+ "l" change.case$
+}
+
+INTEGERS { len }
+
+FUNCTION {chop.word}
+{ 's :=
+ 'len :=
+ s #1 len substring$ =
+ { s len #1 + global.max$ substring$ }
+ { s }
+ if$
+}
+
+FUNCTION {sort.format.names}
+{ 's :=
+ #1 'nameptr :=
+ ""
+ s num.names$ 'numnames :=
+ numnames 'namesleft :=
+ { namesleft #0 > }
+ {
+ s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
+ nameptr #1 >
+ {
+ " " *
+ namesleft #1 = t "others" = and
+ { "zzzzz" * }
+ { numnames #2 > nameptr #2 = and
+ { "zz" *
+ type$ "patent" =
+ { year empty$
+ { yearfiled }
+ { year }
+ if$
+ }
+ { year }
+ if$
+ empty.field.to.null.string * " " *
+ }
+ { skip$ }
+ if$
+ t sortify *
+ }
+ if$
+ }
+ { t sortify * }
+ if$
+ nameptr #1 + 'nameptr :=
+ namesleft #1 - 'namesleft :=
+ }
+ while$
+}
+
+FUNCTION {sort.format.title}
+{ 't :=
+ "A " #2
+ "An " #3
+ "The " #4 t chop.word
+ chop.word
+ chop.word
+ sortify
+ #1 global.max$ substring$
+}
+
+FUNCTION {author.sort}
+{ author empty$
+ { key empty$
+ { "to sort, need author or key in " cite$ * warning$ "" }
+ { key sortify }
+ if$
+ }
+ { author sort.format.names }
+ if$
+}
+
+FUNCTION {author.editor.sort}
+{ author empty$
+ { editor empty$
+ { key empty$
+ { "to sort, need author, editor, or key in " cite$ * warning$ "" }
+ { key sortify }
+ if$
+ }
+ { editor sort.format.names }
+ if$
+ }
+ { author sort.format.names }
+ if$
+}
+
+FUNCTION {author.organization.sort}
+{ author empty$
+ { organization empty$
+ { key empty$
+ { "to sort, need author, organization, or key in " cite$ * warning$ "" }
+ { key sortify }
+ if$
+ }
+ { "The " #4 organization chop.word sortify }
+ if$
+ }
+ { author sort.format.names }
+ if$
+}
+
+FUNCTION {editor.organization.sort}
+{ editor empty$
+ { organization empty$
+ { key empty$
+ { "to sort, need editor, organization, or key in " cite$ * warning$ "" }
+ { key sortify }
+ if$
+ }
+ { "The " #4 organization chop.word sortify }
+ if$
+ }
+ { editor sort.format.names }
+ if$
+}
+
+FUNCTION {author.organization.institution.sort}
+{ author empty$
+ { organization empty$
+ { institution empty$
+ { key empty$
+ { "to sort, need author, organization, institution or key in " cite$ * warning$ "" }
+ { key sortify }
+ if$
+ }
+ { "The " #4 institution chop.word sortify }
+ if$
+ }
+ { "The " #4 organization chop.word sortify }
+ if$
+ }
+ { author sort.format.names }
+ if$
+}
+
+
+
+
+STRINGS { last.label next.extra }
+
+INTEGERS { last.extra.num }
+
+FUNCTION {format.lab.names}
+{ 's :=
+ s #1 "{vv~}{ll}" format.name$
+ s num.names$ duplicate$
+ #2 >
+ { pop$ " et~al." * }
+ { #2 <
+ 'skip$
+ { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
+ { " et~al." * }
+ { " and " * s #2 "{vv~}{ll}" format.name$ * }
+ if$
+ }
+ if$
+ }
+ if$
+}
+
+FUNCTION {author.key.label}
+{ author empty$
+ { key empty$
+ { cite$ #1 #3 substring$ }
+ { key }
+ if$
+ }
+ { author format.lab.names }
+ if$
+}
+
+FUNCTION {author.editor.key.label}
+{ author empty$
+ { editor empty$
+ { key empty$
+ { cite$ #1 #3 substring$ }
+ { key }
+ if$
+ }
+ { editor format.lab.names }
+ if$
+ }
+ { author format.lab.names }
+ if$
+}
+
+FUNCTION {author.key.organization.label}
+{ author empty$
+ { key empty$
+ { organization empty$
+ { cite$ #1 #3 substring$ }
+ { "The " #4 organization chop.word #3 text.prefix$ }
+ if$
+ }
+ { key }
+ if$
+ }
+ { author format.lab.names }
+ if$
+}
+
+FUNCTION {author.key.organization.institution.label}
+{ author empty$
+ { key empty$
+ { organization empty$
+ { institution empty$
+ { cite$ #1 #3 substring$ }
+ { "The " #4 institution chop.word #3 text.prefix$ }
+ if$
+ }
+ { "The " #4 organization chop.word #3 text.prefix$ }
+ if$
+ }
+ { key }
+ if$
+ }
+ { author format.lab.names }
+ if$
+}
+
+FUNCTION {editor.key.organization.label}
+{ editor empty$
+ { key empty$
+ { organization empty$
+ { cite$ #1 #3 substring$ }
+ { "The " #4 organization chop.word #3 text.prefix$ }
+ if$
+ }
+ { key }
+ if$
+ }
+ { editor format.lab.names }
+ if$
+}
+
+FUNCTION {calc.label}
+{ type$ "book" =
+ type$ "inbook" =
+ or
+ { author.editor.key.label }
+ { type$ "proceedings" =
+ type$ "periodical" =
+ or
+ { editor.key.organization.label }
+ { type$ "manual" =
+ type$ "electronic" =
+ type$ "misc" =
+ or or
+ { author.key.organization.label }
+ { type$ "standard" =
+ { author.key.organization.institution.label }
+ { author.key.label }
+ if$
+ }
+ if$
+ }
+ if$
+ }
+ if$
+ duplicate$
+ 'short.list :=
+ "("
+ *
+ type$ "patent" =
+ { year empty$
+ { yearfiled }
+ { year }
+ if$
+ }
+ { year }
+ if$
+ duplicate$
+ empty$
+ short.list key empty.field.to.null.string = or
+ { pop$ "" }
+ { skip$ }
+ if$
+ *
+ 'label :=
+}
+
+
+
+FUNCTION {presort}
+{ type$ "ieeetranbstctl" =
+ { key empty$
+ { "_" }
+ { key sortify }
+ if$
+ duplicate$
+ }
+ { calc.label
+ label sortify
+ " "
+ *
+ type$ "book" =
+ type$ "inbook" =
+ or
+ { author.editor.sort }
+ { type$ "proceedings" =
+ type$ "periodical" =
+ or
+ { editor.organization.sort }
+ { type$ "manual" =
+ type$ "electronic" =
+ type$ "misc" =
+ or or
+ { author.organization.sort }
+ { type$ "standard" =
+ { author.organization.institution.sort }
+ { author.sort }
+ if$
+ }
+ if$
+ }
+ if$
+ }
+ if$
+ " "
+ *
+ cite$
+ *
+ }
+ if$
+ #1 entry.max$ substring$
+ 'sort.label :=
+ #1 entry.max$ substring$
+ 'sort.key$ :=
+}
+
+
+FUNCTION {initialize.longest.label}
+{ "" 'longest.label :=
+ #0 int.to.chr$ 'last.label :=
+ "" 'next.extra :=
+ #0 'longest.label.width :=
+ #0 'last.extra.num :=
+ #0 'number.label :=
+}
+
+FUNCTION {forward.pass}
+{ type$ "ieeetranbstctl" =
+ { skip$ }
+ { last.label label =
+ { last.extra.num #1 + 'last.extra.num :=
+ last.extra.num int.to.chr$ 'extra.label :=
+ }
+ { "a" chr.to.int$ 'last.extra.num :=
+ "" 'extra.label :=
+ label 'last.label :=
+ }
+ if$
+ number.label #1 + 'number.label :=
+ }
+ if$
+}
+
+FUNCTION {reverse.pass}
+{ type$ "ieeetranbstctl" =
+ { skip$ }
+ { next.extra "b" =
+ { "a" 'extra.label := }
+ { skip$ }
+ if$
+ extra.label 'next.extra :=
+ extra.label
+ duplicate$ empty$
+ { skip$ }
+ { "{\natexlab{" swap$ * "}}" * }
+ if$
+ 'extra.label :=
+ label extra.label * 'label :=
+ }
+ if$
+}
+
+FUNCTION {bib.sort.order}
+{ sort.label 'sort.key$ :=
+}
+% END sort code based on plainnat.bst
+
+
+
+
+ITERATE {presort}
+
+SORT
+
+EXECUTE {initialize.longest.label}
+
+ITERATE {forward.pass}
+REVERSE {reverse.pass}
+
+ITERATE {bib.sort.order}
+
+SORT
+
+EXECUTE {begin.bib}
+ITERATE {call.type$}
+EXECUTE {end.bib}
+
+EXECUTE{completed.message}
+
+
+%% That's all folks, mds.
diff --git a/macros/latex/contrib/feupphdteses/Intro.tex b/macros/latex/contrib/feupphdteses/Intro.tex
new file mode 100644
index 0000000000..7d34c9a3bb
--- /dev/null
+++ b/macros/latex/contrib/feupphdteses/Intro.tex
@@ -0,0 +1,246 @@
+\chapter{Introduction}
+\label{chap:Intro}
+
+This is the introduction. And this is how a Figure would look like (see Figure~\ref{fig:FEUP_logo}).
+
+
+\begin{figure}[t]
+ \centering
+ \includegraphics[scale=0.5]{Figures/uporto-feup.pdf} %Use 'scale' to set how large the image should be
+ \caption{FEUP's Logotype}
+ \label{fig:FEUP_logo}
+\end{figure}
+
+A quote should look like this:
+
+\begin{quote}
+ ``Like the Abstract, the Introduction should be written to engage the
+ interest of the reader. It should also give the reader an idea of
+ how the dissertation is structured, and in doing so, define the
+ thread of the contents.''~\citep[chap.\ Introduction]{kn:Tha01}
+\end{quote}
+
+And a table should be written like Table~\ref{tab:example2}, or even better, Table~\ref{tab:example1}
+
+\begin{itemize}
+\item For code, set your preferences using the \emph{lstset} option (see \emph{listings} package documentation on CTAN).
+
+\item For importing figures in Matlab, use Nico Schlömer's \emph{matlab2tikz} files provided in the Matlab central \url{http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz}
+
+\item If you see yourself in trouble, ask your question at \url{http://tex.stackexchange.com}.
+
+\end{itemize}
+
+
+
+
+\begin{table}
+\centering
+\caption{Default Specifications}
+\label{tab:example1}
+\begin{tabular}{ll}
+\toprule
+\textbf{Parameter} & \textbf{Values}\\
+\midrule
+\textit{Area} & 3-20 pixels\\
+$T$ & 0.65\\
+\textit{Number of frames} & 10\\
+\textit{Frames per second} & 1\\
+\textit{Define movement for }& 3 frames\\
+\multirow{2}{*}{\textit{Number of candidate vesicles}} & Strong: 10\\
+& Ambiguous: 10\\
+\bottomrule
+\end{tabular}
+\end{table}
+
+
+
+\begin{table}[t]
+ \centering
+ \caption{Example Table}
+\begin{tabular}{c|r@{.}lr@{.}lr@{.}l|r}
+\multicolumn{8}{c}
+ {\rule[-3mm]{0mm}{8mm}Iteration $k$ of $f(x_n)$} \\
+\textbf{\em k}
+ & \multicolumn{2}{c}{$x_1^k$}
+ & \multicolumn{2}{c}{$x_2^k$}
+ & \multicolumn{2}{c|}{$x_3^k$}
+ & Comments \\ \hline \hline
+0 & -0&3 & 0&6 & 0&7 & - \\
+1 & 0&47102965 & 0&04883157 & -0&53345964 & $\delta<\epsilon$ \\
+2 & 0&49988691 & 0&00228830 & -0&52246185 & $\delta < \varepsilon$ \\
+3 & 0&49999976 & 0&00005380 & -0&523656 & $N$ \\
+4 & 0&5 & 0&00000307 & -0&52359743 & \\
+\vdots & \multicolumn{2}{c}{\vdots}
+ & \multicolumn{2}{c}{$\ddots$}
+ & \multicolumn{2}{c|}{\vdots} & \\
+7 & 0&5 & 0&0 & \textbf{-0}&\textbf{52359878}
+ & $\delta<10^{-8}$ \\
+\end{tabular}
+ \label{tab:example2}
+\end{table}
+
+
+\newpage
+For \emph{longtables} check the one available on the \emph{Abbs.tex} file, or Table~\ref{tab:longtableexample}
+
+ \begin{longtable}{lc}
+ \caption{Longtable Example}\label{tab:longtableexample}\\
+ \toprule
+ \textbf{School} & \textbf{Meaning} \\
+ \midrule
+ \endfirsthead
+ \caption*{Table \ref{tab:longtableexample} (Continue): Longtable Example}\\
+ \toprule
+ \textbf{School} & \textbf{Meaning} \\
+ \midrule
+ \endhead
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ FEUP & Faculdade de Engenharia da Universidade do Porto\\
+ \bottomrule
+ \end{longtable}
+
+\begin{landscape}
+
+Just to show you how to turn your page completely. If you just one to turn one figure, use the \emph{rotate} option instead
+
+\end{landscape}
+
+
+\section{Example of a Matlab figure (using \emph{matlab2tikx})}
+
+Here is the code obtained from the file in Matlab (just copy and paste it):
+
+\begin{figure}[h]
+\centering
+\begin{tikzpicture}
+\begin{axis}[%
+scale only axis,
+xmin=0,
+xmax=120,
+xlabel={Time [s]},
+ymin=0,
+ymax=120,
+ylabel={Distance [m]},
+title={Distance vs Time for dataset}
+]
+\addplot [
+color=cyan,
+solid,
+forget plot
+]
+table[row sep=crcr]{
+1.12 0.9667792\\
+8.45 2.5287607\\
+8.54 9.913476\\
+9.99 10.594364\\
+11.1 10.754158\\
+12.18 12.246912\\
+13.22 13.620711\\
+14.27 14.872885\\
+15.33 16.090015\\
+16.42 17.278852\\
+17.54 18.32099\\
+18.65 19.388561\\
+19.92 20.324896\\
+21.43 20.586063\\
+22.5 21.477476\\
+23.59 22.690266\\
+30.08 24.050547\\
+30.13 30.270317\\
+31.83 31.315056\\
+32.94 31.488174\\
+33.99 33.107754\\
+35.03 34.373497\\
+36.08 35.63807\\
+37.13 36.723347\\
+38.19 37.94308\\
+39.31 39.134987\\
+40.43 40.300858\\
+41.94 41.369823\\
+43.19 42.55742\\
+44.31 44.03123\\
+45.34 45.18666\\
+52.38 46.42933\\
+53.76 53.1462\\
+54.16 53.2205\\
+55.2 54.755077\\
+56.24 56.024307\\
+57.27 57.08118\\
+58.32 58.184376\\
+59.37 59.19243\\
+60.44 60.24227\\
+61.53 61.134487\\
+62.95 61.925873\\
+64.13 63.123123\\
+65.19 64.73521\\
+66.21 66.29376\\
+72.82 67.88995\\
+74.62 75.39087\\
+75.15 75.57744\\
+76.22 77.04989\\
+77.27 78.37899\\
+78.31 79.68579\\
+79.39 81.0405\\
+80.48 82.293175\\
+81.61 83.4804\\
+82.74 84.5754\\
+84.09 85.688416\\
+85.53 86.14043\\
+86.65 87.05914\\
+87.7 88.49611\\
+97.14 89.8551\\
+98.68 98.40683\\
+99 99.85365\\
+100.08 101.18116\\
+101.17 102.46642\\
+102.27 103.613914\\
+103.43 104.70302\\
+104.57 105.7168\\
+105.83 106.64546\\
+};
+\end{axis}
+\end{tikzpicture}%
+\caption{Complete distance vs time for the cyan dataset}
+\label{fig:ALLDistanceTimeFig}
+\end{figure}
diff --git a/macros/latex/contrib/feupphdteses/Publications.tex b/macros/latex/contrib/feupphdteses/Publications.tex
new file mode 100644
index 0000000000..6b9b932a1c
--- /dev/null
+++ b/macros/latex/contrib/feupphdteses/Publications.tex
@@ -0,0 +1,9 @@
+\thispagestyle{empty}
+
+\chapter*{Publications}
+
+\hspace{5mm}M. S. Espinoza, J. Gon\c{c}alves, J.L. S\'anchez, A. Herreros. \emph{Inverse Kinematics of a 10 DOF modular hyper-redundant robot resorting to exhaustive and error-optimization methods: A comparative study}. In IEEE Brazilian Robotics Symposium \& Latin American Robotics Symposium (SBR--LARS). \hskip 1em plus 0.5em minus 0.4em\relax Fortaleza, Brasil, 2012.
+
+\vspace{5mm}
+\hspace{5mm}M. S. Espinoza, A. Pereira, J. Gon\c{c}alves. \emph{Optimization methods for hyper-redundant robots' inverse kinematics in biomedical applications}. AIP Conference Proceedings of ICNAAM 2012. \hskip 1em plus 0.5em minus 0.4em\relax Kos, Greece, 2012.
+
diff --git a/macros/latex/contrib/feupphdteses/Quote.tex b/macros/latex/contrib/feupphdteses/Quote.tex
new file mode 100644
index 0000000000..cbb84cd71b
--- /dev/null
+++ b/macros/latex/contrib/feupphdteses/Quote.tex
@@ -0,0 +1,10 @@
+\cleardoublepage
+\thispagestyle{plain}
+
+\vspace*{8cm}
+
+\begin{flushright}
+ \textsl{``If I have seen further it is by standing on the shoulders of giants''} \\
+ \vspace*{1.5cm}
+ Sir Isaac Newton
+\end{flushright}
diff --git a/macros/latex/contrib/feupphdteses/README b/macros/latex/contrib/feupphdteses/README
new file mode 100644
index 0000000000..e51b2f1165
--- /dev/null
+++ b/macros/latex/contrib/feupphdteses/README
@@ -0,0 +1,102 @@
+%% FEUPPHDTESES Style for LaTeX README
+%% Document Style `FEUP PhD Teses'
+%% By Mario Saenz Espinoza
+%% mario.espinoza at fe.up.pt
+
+%% General Considerations:
+ %% - Uses BibTeX
+ %% - Uses MakeIndex
+
+%% Make sure to specify those properties in the "Project/Properties" section of your LaTeX editor.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% TOP MATTER
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Package options:
+ %% - prodeb/prodef/pdeqb/pdeec: choose a doctoral program
+ % PRODEB: Programa Doutoral em Engenharia Biomedica
+ % PRODEF: Programa Doutoral em Engenharia Fisica
+ % PDEQB: Programa Doutoral em Engenharia Quimica e Biologica
+ % PDEEC: Programa Doutoral em Engenharia em Electrotecnica e Computadores
+ %% - libre: for any kind of work that is not the PhD thesis (e.g. monografia, workplan, etc.)
+ %% - jury: copy for the Jury
+ %% - final: final copy
+ %% - onpaper: links are not shown (for paper versions)
+ %% - linenum: to include line numbers
+ %% - backrefs: include back references from bibliography to citation place
+
+%% \graphicspath:
+ %% - Where the "Figures" folder is located. Save all your images in this folder
+
+%% \include{mymacros}:
+ %% - Save all macros in this .tex file
+
+%% \hyphenation:
+ %% - Set all the special hyphenation exceptions. Shouldn't be needed, but could be useful for the "Resumo"
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% GENERAL INFORMATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% \author
+ %% - Your name
+
+%% \title
+ %% - Title of your thesis
+
+%% \supervisor
+ %% - Name of your Supervisor
+
+%% \thesisdate
+ %% - Date of your thesis. Use only "month, year"
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% CHAPTERS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Add your chapters, each in a sepparate .tex file
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% BIBLIOGRAPHY
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% This is tricky. There is a difference between 'bibliography' and 'references'. 'Bibliography' is all the literature you used in your research, whether you cited them explictly or not. 'References' are the specific entries you have cited and your work is referred to.
+
+%% Therefore, if you are using 'Bibliography', the whole section in the main file ('Template_EN.tex') should look like this:
+
+% \renewcommand{\bibname}{Bibliography}
+% \phantomsection
+% \addcontentsline{toc}{chapter}{Bibliography}
+% \begin{singlespace}
+ % \nocite{*}
+ % \bibliographystyle{IEEEtranSN}
+ % \bibliography{References} % Bibliography/References [.bib file]
+% \end{singlespace}
+% \clearemptydoublepage
+
+%% If you are using 'References':
+
+% \renewcommand{\bibname}{References}
+% \phantomsection
+% \addcontentsline{toc}{chapter}{References}
+% \begin{singlespace}
+ % \bibliographystyle{IEEEtranN}
+ % \bibliography{References} % Bibliography/References [.bib file]
+% \end{singlespace}
+% \clearemptydoublepage
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% APPENDIX
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%Don't do anything except adding your "Appendix.tex" file
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% OTHERS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% I hope you enjoy it! Keep up the good work. Bom trabalho. \ No newline at end of file
diff --git a/macros/latex/contrib/feupphdteses/References.bib b/macros/latex/contrib/feupphdteses/References.bib
new file mode 100644
index 0000000000..10407544e3
--- /dev/null
+++ b/macros/latex/contrib/feupphdteses/References.bib
@@ -0,0 +1,61 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% CONTROL COMMANDS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@IEEEtranBSTCTL{IEEEexample:BSTcontrol,
+ CTLdash_repeated_names = "no"
+}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% ARTICLES
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% PROCEEDINGS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@inproceedings{espinoza2012inverse,
+ title={Inverse Kinematics of a 10 DOF modular hyper-redundant robot resorting to exhaustive and error-optimization methods: A comparative study},
+ author={Espinoza, Mario S{\'a}enz and Goncalves, Jose and Leitao, Paulo and Sanchez, Jose Luis Gonzalez and Herreros, Alberto},
+ booktitle={Robotics Symposium and Latin American Robotics Symposium (SBR-LARS), 2012 Brazilian},
+ pages={125--130},
+ year={2012},
+ organization={IEEE}
+}
+
+@inproceedings{espinoza2012optimization,
+ title={Optimization methods for hyper-redundant robots' inverse kinematics in biomedical applications},
+ author={Espinoza, Mario S{\'a}enz and Pereira, Ana I and Gon{\c{c}}alves, Jos{\'e}},
+ booktitle={AIP Conference Proceedings},
+ volume={1479},
+ pages={818},
+ year={2012}
+}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% BOOKS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% INTERNET
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@MISC{kn:Tha01,
+ title={Writing Research Theses or Dissertations},
+ author={Ming Tham},
+ note={University of Newcastle Upon Tyne},
+ url={http://lorien.ncl.ac.uk/ming/dept/Tips/writing/thesis/thesis-intro.htm},
+ month={May},
+ year={2001}
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% THESIS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% PICTURES
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
diff --git a/macros/latex/contrib/feupphdteses/Resumo.tex b/macros/latex/contrib/feupphdteses/Resumo.tex
new file mode 100644
index 0000000000..c5a92e23f8
--- /dev/null
+++ b/macros/latex/contrib/feupphdteses/Resumo.tex
@@ -0,0 +1,12 @@
+\thispagestyle{empty}
+
+\chapter*{Resumo}
+
+
+\vspace*{10mm}
+
+Abstract in Portuguese
+
+\vspace*{15mm}
+
+\textbf{Keywords:} Keyword1. Keyword2. Keyword3.
diff --git a/macros/latex/contrib/feupphdteses/Template_EN.pdf b/macros/latex/contrib/feupphdteses/Template_EN.pdf
new file mode 100644
index 0000000000..f32c47fd60
--- /dev/null
+++ b/macros/latex/contrib/feupphdteses/Template_EN.pdf
Binary files differ
diff --git a/macros/latex/contrib/feupphdteses/Template_EN.tcp b/macros/latex/contrib/feupphdteses/Template_EN.tcp
new file mode 100644
index 0000000000..3c36560644
--- /dev/null
+++ b/macros/latex/contrib/feupphdteses/Template_EN.tcp
@@ -0,0 +1,12 @@
+[FormatInfo]
+Type=TeXnicCenterProjectInformation
+Version=4
+
+[ProjectInfo]
+MainFile=Template_EN.tex
+UseBibTeX=1
+UseMakeIndex=1
+ActiveProfile=LaTeX ⇨ PDF
+ProjectLanguage=en
+ProjectDialect=US
+
diff --git a/macros/latex/contrib/feupphdteses/Template_EN.tex b/macros/latex/contrib/feupphdteses/Template_EN.tex
new file mode 100644
index 0000000000..76b3bf6067
--- /dev/null
+++ b/macros/latex/contrib/feupphdteses/Template_EN.tex
@@ -0,0 +1,140 @@
+\documentclass[a4paper,twoside,11pt,openright]{report} % 11pt or 12pt?
+
+\usepackage[prodeb,final]{feupphdteses}
+%% - prodeb/prodef/pdeqb/pdeec: choose a doctoral program
+%% - libre: for any kind of work that is not the thesis (e.g. monografia, workplan, etc.)
+%% - jury: copy for the Jury (uses a second committee page)
+%% - onpaper: links are not shown (for paper printable versions)
+%% - linenum: to include line numbers
+%% - backrefs: include back references from bibliography to citation place
+%% - final: final copy
+
+%% Graphics Packages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\graphicspath{{./Figures/}} % Where the 'Figures' folder is located
+
+%% Macros %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\include{Mymacros} % Write all new macros in this file
+
+%% Hyphenation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\hyphenation{pro-pues-tos} % Specify hyphenations
+
+%% Index %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\makeindex % Make index
+
+%% Others %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\hfuzz3.5pt % Don't bother to report over-full boxes if over-edge is < 3.5pt (1.2345mm)
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% GENERAL INFORMATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{document}
+
+ %% Title Page
+ \author{Name of the Author}
+ \title{Title of the Dissertation}
+ \supervisor{Supervisor}{Name of the Supervisor}
+ \supervisor{Co-Supervisor}{Name of the Co-Supervisor} % Comment this line if no co-supervisor
+ \thesisdate{Month, Year}
+
+ %% Committee Page
+ \committeemember{President}{Name of the President}
+ \committeemember{Referee}{Name of the Referee}
+ \committeemember{Referee}{Name of the Referee}
+ \committeemember{Referee}{Name of the Referee}
+ \signature
+
+ %% Pre-work
+ \begin{Prolog}
+
+ \input{Dedicatory} % The dedicatory [.tex file]
+ \clearemptydoublepage
+
+ \input{Abstract} % The abstract [.tex file]
+ \clearemptydoublepage
+
+ \input{Resumo} % The abstract (em portugues) [.tex file]
+ \clearemptydoublepage
+
+ \input{Acknow} % The acknowledgments [.tex file]
+ \clearemptydoublepage
+
+ \input{Publications} % The list of your publications [.tex file]
+ \clearemptydoublepage
+
+ \input{Quote} % Initial quotation (if desired) [.tex file]
+ \clearemptydoublepage
+
+ \pdfbookmark[0]{Table of Contents}{contents} %% The Table of Contents (Do not modify)
+ \tableofcontents
+ \clearemptydoublepage
+
+ \listoffigures
+ \addcontentsline{toc}{chapter}{\listfigurename} %% The List of Figures (Do not modify)
+ \clearemptydoublepage
+
+ \listoftables
+ \addcontentsline{toc}{chapter}{\listtablename} %% The List of Tables (Do not modify)
+ \clearemptydoublepage
+
+ \input{Abbs} %% The list of Abbreviations [.tex file]
+ \addcontentsline{toc}{chapter}{List of Abbreviations}
+ \clearemptydoublepage
+ \end{Prolog}
+
+
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ %% CHAPTERS
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ \StartBody
+
+ \include{Intro} % Chapter 1: Introduction [.tex file]
+ \clearemptydoublepage
+
+ \part{Theoretical Background} % Part I: Theoretical Background
+
+ \include{Chapter2} % Chapter 2: Chapter 2 [.tex file]
+ \clearemptydoublepage
+
+ \part{Implemented Design} % Part II: Implemented Design
+
+ \include{Chapter3} % Chapter 3: Chapter 3 [.tex file]
+ \clearemptydoublepage
+
+ \include{Conclusions} % Chapter 6: Conclusions [.tex file]
+ \clearemptydoublepage
+
+
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ %% BIBLIOGRAPHY
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ \bookmarksetup{startatroot} % Reset pdf bookmark to initial
+ \addtocontents{toc}{\bigskip} % To add a little space after the last entry on TOC
+ \renewcommand{\bibname}{Bibliography} % Change "Bibliography" to "References" if needed
+ \phantomsection
+ \addcontentsline{toc}{chapter}{Bibliography} % Change "Bibliography" to "References" if needed
+ \begin{singlespace}
+ \bstctlcite{IEEEexample:BSTcontrol} % For avoiding the dashed line in IEEE format (Do not modify)
+ \nocite{*} % Use with "Bibliography", comment if you are using "References"
+ %\bibliographystyle{IEEEtranN} % Use with "References", comment if you are using "Bibliography" (sorted by order of appearance)
+ \bibliographystyle{IEEEtranSN} % Use with "Bibliography", comment if you are using "References" (alphabetically sorted)
+ \bibliography{References} % Bibliography/References [.bib file]
+ \end{singlespace}
+ \clearemptydoublepage
+
+
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ %% Index
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ \PrintIndex
+ \clearemptydoublepage
+
+
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ %% APPENDIX
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ \appendix
+ \input{Appendix} % Appendix [.tex file]
+ \clearemptydoublepage
+
+\end{document}
diff --git a/macros/latex/contrib/feupphdteses/Template_EN.tps b/macros/latex/contrib/feupphdteses/Template_EN.tps
new file mode 100644
index 0000000000..35bc01ce22
--- /dev/null
+++ b/macros/latex/contrib/feupphdteses/Template_EN.tps
@@ -0,0 +1,116 @@
+[FormatInfo]
+Type=TeXnicCenterProjectSessionInformation
+Version=2
+
+[Frame0]
+Flags=0
+ShowCmd=1
+MinPos.x=-1
+MinPos.y=-1
+MaxPos.x=-1
+MaxPos.y=-1
+NormalPos.left=4
+NormalPos.top=26
+NormalPos.right=1600
+NormalPos.bottom=615
+Class=LaTeXView
+Document=Intro.tex
+
+[Frame0_View0,0]
+TopLine=128
+Cursor=5876
+
+[Frame1]
+Flags=0
+ShowCmd=1
+MinPos.x=-1
+MinPos.y=-1
+MaxPos.x=-1
+MaxPos.y=-1
+NormalPos.left=4
+NormalPos.top=26
+NormalPos.right=1600
+NormalPos.bottom=615
+Class=LaTeXView
+Document=Abbs.tex
+
+[Frame1_View0,0]
+TopLine=0
+Cursor=117
+
+[Frame2]
+Flags=0
+ShowCmd=1
+MinPos.x=-1
+MinPos.y=-1
+MaxPos.x=-1
+MaxPos.y=-1
+NormalPos.left=4
+NormalPos.top=26
+NormalPos.right=1600
+NormalPos.bottom=615
+Class=LaTeXView
+Document=Template_EN.tex
+
+[Frame2_View0,0]
+TopLine=85
+Cursor=3159
+
+[Frame3]
+Flags=0
+ShowCmd=1
+MinPos.x=-1
+MinPos.y=-1
+MaxPos.x=-1
+MaxPos.y=-1
+NormalPos.left=4
+NormalPos.top=26
+NormalPos.right=1600
+NormalPos.bottom=615
+Class=LaTeXView
+Document=Chapter2.tex
+
+[Frame3_View0,0]
+TopLine=0
+Cursor=3037
+
+[Frame4]
+Flags=0
+ShowCmd=1
+MinPos.x=-1
+MinPos.y=-1
+MaxPos.x=-1
+MaxPos.y=-1
+NormalPos.left=4
+NormalPos.top=26
+NormalPos.right=1600
+NormalPos.bottom=615
+Class=LaTeXView
+Document=Appendix.tex
+
+[Frame4_View0,0]
+TopLine=0
+Cursor=292
+
+[Frame5]
+Flags=0
+ShowCmd=1
+MinPos.x=-1
+MinPos.y=-1
+MaxPos.x=-1
+MaxPos.y=-1
+NormalPos.left=4
+NormalPos.top=26
+NormalPos.right=1600
+NormalPos.bottom=615
+Class=BibTeXView
+Document=References.bib
+
+[Frame5_View0,0]
+TopLine=0
+Cursor=165
+
+[SessionInfo]
+FrameCount=6
+ActiveFrame=0
+
diff --git a/macros/latex/contrib/feupphdteses/feupphdteses.sty b/macros/latex/contrib/feupphdteses/feupphdteses.sty
new file mode 100644
index 0000000000..2e5e3655a1
--- /dev/null
+++ b/macros/latex/contrib/feupphdteses/feupphdteses.sty
@@ -0,0 +1,695 @@
+%% PhD FEUP THESIS STYLE for LaTeX2e
+%% Based on "feuptese.sty" by jcl and jcf at fe.up.pt
+%%
+%% Faculdade de Engenharia da Universidade do Porto
+%% Programa Doutoral em Engenharia Biomedica
+%% Mario Saenz Espinoza
+%%
+%% PLEASE send improvements to mario.espinoza at fe.up.pt
+%%
+%% Special thanks to Prof. Joao Correia Lopes, FEUP
+
+%% LOG
+ % March 20, 2013:
+ % Added "RequirePackage{tabularx}"
+ % Added "RequirePackage{array}"
+ % Moved "RequirePackage{longtable}" after "RequirePackage{array}" and "RequirePackage{tabularx}"
+ % Added "RequirePackage{xtab}"
+ % Added "RequirePackage{tabu}"
+ % March 22, 2013:
+ % Added "RequirePackage{siunitx}"
+ % Setup comma as decimal separator
+ % Setup minimum group of three
+ % Setup font to match text
+ % March 28, 2013:
+ % Added \bstctlcite part of bibliography
+ % April 2, 2013:
+ % Added \RequirePackage{arydshln}
+ % Added \RequirePackage{dashrule}
+ % Didn't work, took it out
+ % Moved `\modulolinenumbers[2]' from the required packages section (between siunitx and hyperref)
+ % Removed \Requirepackage{tabu}
+ % Added \RequirePackage{ltxtable}
+ % April 3, 2013:
+ % Added \RequirePackage{subcaption}
+ % April 5, 2013:
+ % Removing pdftex option (as described by: http://tex.stackexchange.com/questions/106159/why-i-shouldnt-load-pdftex-option-with-hyperref)
+ % in graphicx package
+ % in hyperref package
+ % April 6, 2013:
+ % Removed \RequirePackage{ltxtable}
+ % April 10, 2013:
+ % Added \RequirePackage{tikz}
+ % April 11, 2013:
+ % Removed \sisetup{detect-all}
+ % April 12, 2013:
+ % Added \RequirePackage{floats}
+ % Added \RequirePackage{pdfpages}
+ % April 22, 2013:
+ % Added \RequirePackage{placeins}
+ % Added option 'linenum' to include line numbers
+ % Added \RequirePackage{grffile}
+ % Removed option 'working'
+ % April 28, 2013:
+ % Added \RequirePackage{ltxtable}
+ % Added \RequirePackage{adjustbox}
+ % Removed \RequirePackage{ltxtable} (not working along with other packages)
+ % Added \RequirePackage{wrapfig}
+ % Removed \RequirePackage{wrapfig} (not treated as floats)
+ % April 29, 2013:
+ % Added \RequirePackage{amsmath}
+ % May 1, 2013:
+ % Added \RequirePackage{xcolor}
+ % Added \RequirePackage{pgfgantt}
+ % Added \RequirePackage{pdflscape}
+ % May 3, 2013:
+ % Added \usetikzlibrary{decorations.pathreplacing}
+ % Added \newcommand{citeauthorlist}
+ % Added \newcommand{citetlist}
+ % May 7, 2013:
+ % Added \RequirePackage{bookmark}
+ % May 12, 2013:
+ % Added \RequirePackage[inline]{enumitem}
+ % May 15, 2013:
+ % Added \newcommand*{\compressitem}{\@minipagetrue}
+ % Added \RequirePackage{booktabs}
+ % May 17, 2013:
+ % Added \RequirePackage{tabuarly}
+ % Removed \RequirePackage{arydshln} (incompatibility with tabulary)
+ % May 24, 2013:
+ % Added '~' on backrefs
+ % May 28,2013:
+ % Added fix for 'showframe' of geometry package
+ % May 30, 2013:
+ % Added \urlstyle{same}
+ % May 31, 2013:
+ % Added \usetikzlibrary{positioning,fit,backgrounds}
+ % Added \usetikzlibrary{matrix}
+ % June 12, 2013:
+ % Added \RequirePackage{listings}
+ % June 13, 2013:
+ % Added \RequirePackage{pgfplots}
+%%
+
+\NeedsTeXFormat{LaTeX2e}
+\def \filename {feupphdteses.sty}
+\def \filedate {2013/06/13}
+\def \fileversion {1.26}
+\ProvidesPackage {feupphdteses}[\filedate\space\fileversion\space]
+\typeout {Document Style `FEUP PhD Teses' \fileversion\space <\filedate> by Mario Saenz Espinoza}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%% Document Class %%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Make sure that report has been loaded and pdf package is in place
+\@ifundefined{chapter}{\@latexerr{The `feupphdteses' option should be used only with the `report' document style}{}}{}
+\RequirePackage{ifpdf}
+\ifpdf
+ \relax
+\else
+ \@latexerr{The 'feupphdteses' package may only be used with pdflatex}{Please process this file with pdflatex.}
+\fi
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%% Encoding %%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Ensure correct font encoding
+\RequirePackage[T1]{fontenc}
+\RequirePackage[utf8]{inputenc}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%% Declare General Input Options %%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Option jury
+\newif\if@jury
+\@juryfalse
+\DeclareOption{jury}{\@jurytrue}
+
+%% Option final
+\newif\if@final
+\@finalfalse
+\DeclareOption{final}{\@finaltrue}
+
+%% Option backrefs
+\newif\if@backrefs
+\@backrefsfalse
+\DeclareOption{backrefs}{\@backrefstrue}
+
+%% Option for print on paper
+\newif\if@onpaper
+\@onpaperfalse
+\DeclareOption{onpaper}{\@onpapertrue}
+
+%% Option libre
+\newif\if@libre
+\@librefalse
+\DeclareOption{libre}{\@libretrue}
+
+%% Option linenum
+\newif\if@linenum
+\@linenumfalse
+\DeclareOption{linenum}{\@linenumtrue}
+
+%% Doctoral Programs at FEUP
+
+ % Option PRODEB
+ \newif\if@prodeb
+ \@prodebfalse
+ \DeclareOption{prodeb}{\@prodebtrue}
+
+ % Option PRODEF
+ \newif\if@prodef
+ \@prodeffalse
+ \DeclareOption{prodef}{\@prodeftrue}
+
+ % Option PDEQB
+ \newif\if@pdeqb
+ \@pdeqbfalse
+ \DeclareOption{pdeqb}{\@pdeqbtrue}
+
+ % Option PDEEC
+ \newif\if@pdeec
+ \@pdeecfalse
+ \DeclareOption{pdeec}{\@pdeectrue}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%% Internal Options %%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Internal option: committeepage
+\newif\if@committeepage
+\@committeepagefalse
+
+%% Internal option: provisional
+\newif\if@provisional
+\@provisionalfalse
+
+%% Internal option: uselineno
+\newif\if@uselineno
+\@uselinenofalse
+
+\ProcessOptions\relax
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%% Global Packages of the document %%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% General packages
+\RequirePackage[english]{babel}
+\RequirePackage[outer=25mm,inner=35mm,vmargin=20mm,includehead,includefoot,headheight=15pt]{geometry} % Geometry package, %showframe option
+\RequirePackage{xcolor} % Different Colors
+\RequirePackage{mathptmx} % Font:Times
+\RequirePackage[scaled]{couriers} % Font: Courier
+\RequirePackage[scaled]{helvet} % Font: Helvetica
+\RequirePackage{graphicx} % Graphics
+\RequirePackage{grffile} % larger range of file names (dots and spaces)
+\RequirePackage{amsmath} % Math and equations
+\RequirePackage{tikz} % To make graphics
+\RequirePackage{pgfplots} % To import figures from Matlab
+\RequirePackage{url} % To handle URLs
+\RequirePackage{setspace} % Controls line spacing
+\RequirePackage{makeidx} % Index
+\RequirePackage[tableposition=top,figureposition=bottom]{caption} % Tables' captions
+\RequirePackage{multirow} % Tables with multiple rows
+\RequirePackage{eurosym} % Currency: Euro
+\RequirePackage{array} % Needed for 'tabularx'
+\RequirePackage{tabularx} % Tables' width can be set
+\RequirePackage{tabulary} % Columns' width can be set to length
+\RequirePackage{longtable} % Tables can break into two pages
+\RequirePackage[pagewise,switch*]{lineno} % Line numbers
+\RequirePackage{siunitx} % SI units
+\RequirePackage{float} % To be able to use the 'Here' specification
+\RequirePackage{subcaption} % Subcaptions in subfigures
+\RequirePackage{adjustbox} % Alignment of cells in tables
+\RequirePackage[inline]{enumitem} % Itemize, enumerate, lists, etc.
+\RequirePackage[section]{placeins} % To prevent floats going over different sections
+\RequirePackage{booktabs} % To use toprule, midrule, bottomrule
+\RequirePackage{pgfgantt} % Create Gantt diagrams
+\RequirePackage{pdflscape} % Landscape mode
+\RequirePackage{pdfpages} % To include .pdf (papers) at the end as appendix
+\RequirePackage{listings} % To include code
+\RequirePackage[pdfpagelabels,bookmarks,hyperindex,hyperfigures]{hyperref} % Hyper References
+\RequirePackage{bookmark} % For resetting bookmarks
+
+%% Special declarations
+
+ %Line Numbers
+ \modulolinenumbers[2] % Set counter multiple
+
+ %Graphics
+ \DeclareGraphicsExtensions{.pdf,.jpeg,.png,.jpg} % Consider all these extensions as graphics
+
+ %SI units
+ \sisetup{output-decimal-marker = {.}} % Use comma as decimal point (as described by the SI)
+ \sisetup{group-minimum-digits = 3} % \num{1234} should be 1 234, not 1234 (as described by the SI)
+ %\sisetup{separate-uncertainty} % for using \pm in the uncertainty instead of ()
+
+ %Tikz Calendar
+ %\usetikzlibrary{calendar,shapes.geometric} (Podria llegar a ser util para calendarios)
+ \usetikzlibrary{decorations.pathreplacing}
+ \usetikzlibrary{positioning,fit,backgrounds}
+ \usetikzlibrary{matrix}
+
+ %Colors
+ \definecolor{barblue}{RGB}{153,204,254}
+
+ %URL
+ \urlstyle{same}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%% Title, Program, Degree, Date, Supervisor, etc. Spaces %%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% University
+\gdef\@school{Faculdade de Engenharia da Universidade do Porto}
+\def\school#1{\gdef\@school{#1}}
+
+%% Thesis date
+\gdef\@thesisdate{\today}
+\def\thesisdate#1{\gdef\@thesisdate{#1}}
+
+%% Program
+ % Programa Doutoral em Engenharia Biomedica
+ \if@prodeb
+ \gdef\@program{Programa Doutoral em Engenharia Biom\'{e}dica}
+ \gdef\@department{Biomedical Engineering}
+ \fi
+
+ % Programa Doutoral em Engenharia Fisica
+ \if@prodef
+ \gdef\@program{Programa Doutoral em Engenharia F\'{i}sica}
+ \gdef\@department{Physics Engineering}
+ \fi
+
+ % Programa Doutoral em Engenharia Quimica e Biologica
+ \if@pdeqb
+ \gdef\@program{Programa Doutoral em Engenharia Qu\'{i}mica e Biol\'{o}gica}
+ \gdef\@department{Chemical Engineering}
+ \fi
+
+ % Programa Doutoral em Engenharia Electrotecnica e de Computadores
+ \if@pdeec
+ \gdef\@program{Programa Doutoral em Engenharia Electrot\'{e}cnica e de Computadores}
+ \gdef\@department{Electronic \& Computer Engineering}
+ \fi
+
+%% Degree
+ \gdef\@degree{Doctor Philosophiae in \@department}
+ \def\degree#1{\gdef\@degree{#1}}
+
+%% Provisional text space
+\gdef\@provisionaltext{\@empty}
+\def\additionalfronttext#1{\gdef\@provisionaltext{#1}}
+
+%% Committee text
+\newbox\@vivatext
+
+ \def\committeetext#1{%
+ \setbox\@vivatext\vbox
+ {\Large\noindent #1
+ \par\vskip 0.5\baselineskip}}
+
+ % For more than 1 member
+ \def\committeemember#1#2{%
+ \setbox\@vivatext\vbox
+ {\unvbox\@vivatext
+ \vskip 0.5\baselineskip%
+ \par%
+ {\noindent\large #1: #2}}}
+
+ %Space for signatures
+ \def\signature{%
+ \setbox\@vivatext\vbox
+ {\unvbox\@vivatext
+ \vskip 2\baselineskip%
+ {\hfill \rule{0.75\linewidth}{0.2mm}}
+ \vskip 2\baselineskip}}
+
+%% Supervisor text
+\newbox\@supervisorstext
+
+\def\supervisor#1#2{%
+ \setbox\@supervisorstext\vbox%
+ {\unvbox\@supervisorstext
+ \vskip 0.5\baselineskip%
+ \par%
+ \center{\noindent\large #1: #2}}}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%% Versions & Options Do %%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Working version
+\if@final
+ \relax
+\else
+ \if@jury
+ \relax
+ \else
+ \additionalfronttext{Working version}
+ \fi
+\fi
+
+%% Jury version
+\if@jury
+ \def\committeetext#1{\gdef\@committeetext{#1}}
+ \@committeepagetrue
+ \additionalfronttext{For Jury Evaluation}
+\fi
+
+%% Final version
+\if@final
+ \additionalfronttext{}
+ \@committeepagetrue
+\fi
+
+%% Libre version
+\if@libre
+ \@committeepagefalse
+\fi
+
+%% Backrefs version
+\if@backrefs
+ \RequirePackage[hyperpageref]{backref}
+ \renewcommand*{\backref}[1]{}
+ \renewcommand*{\backrefalt}[4]{%
+ \ifcase #1 %
+ \or
+ {\footnotesize Cited on page~#2.}%
+ \else
+ {\footnotesize Cited on pages~#2.}%
+ \fi
+ }
+\fi
+
+%% Line number version
+\if@linenum
+ \@uselinenotrue
+\fi
+
+%% Onpaper version
+\if@onpaper
+ \hypersetup{%
+ plainpages=false,
+ pdfpagelayout=SinglePage,
+ bookmarksopen=false,
+ bookmarksnumbered=true,
+ breaklinks=true,
+ linktocpage,
+ colorlinks=false,
+ pdfborder=0 0 0
+ }
+\else
+ \hypersetup{%
+ plainpages=false,
+ pdfpagelayout=SinglePage,
+ bookmarksopen=false,
+ bookmarksnumbered=true,
+ breaklinks=true,
+ linktocpage,
+ colorlinks=true,
+ linkcolor=blue,
+ urlcolor=blue,
+ citecolor=blue,
+ anchorcolor=green
+ }
+\fi
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%% Copyright Info %%%%%%%%%%%%%%%%%%%%%%%%%
+
+\gdef\@permission{\null}
+\def\permission#1{\gdef\@permission{#1}}
+
+%% define a copyrightnotice variable and initialize it
+\gdef\@copyrightnotice{}
+\def\copyrightnotice#1{\gdef\@copyrightnotice{\copyright\ #1\par\@permission}}
+
+\copyrightnotice{\@author: \@thesisdate}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%% Title %%%%%%%%%%%%%%%%%%%%%%%%%
+
+\def\maketitle{%
+\newbox\@crestbox
+
+%% Title page
+\begin{titlepage}
+
+\hbox to \textwidth
+{
+ \setbox\@crestbox=\vbox{\includegraphics[scale=0.82]{uporto-feup.pdf}} % University Logo
+ %\setbox\@crestbox=\vbox{\includegraphics[width=90mm]{uporto-feup.pdf}} % University Logo
+ \box\@crestbox%
+}
+\vfill%
+
+%\vspace*{20mm}%
+{\def\baselinestretch{1.2}\Huge\bf \@title \par} % Title
+\vskip 25mm%
+
+{\huge\bf \@author} % Author
+\vskip 10mm%
+
+
+{\Large\textsc \@provisionaltext} % Provisional text
+\vfill
+
+\unvbox\@supervisorstext % Supervisor
+\vskip 5mm
+
+{\large \@program} % Program
+%\vskip 30mm
+\vfill
+
+\@thesisdate % Date
+
+\end{titlepage}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%% Copyright Page %%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% copyright page
+\ifx\@copyrightnotice\@empty
+ \relax
+\else
+ \vspace*{\fill}
+ \par
+ \begin{center}
+ \@copyrightnotice
+ \end{center}
+\fi
+\clearpage
+} % maketitle
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%% Second Page %%%%%%%%%%%%%%%%%%%%%%%%%
+%\newpage
+\def\committeepage
+{%
+ \cleardoublepage
+ \thispagestyle{empty}
+ \begin{center}%
+ \null\vskip 12mm
+ {\Large\textnormal{\@school}}\\[16mm]
+ {\LARGE\bf \@title}\\[16mm]
+ {\Large\bf \@author}\\[16mm]
+ %{\Large \@degree}%
+ \end{center}
+ \vspace*{\fill}
+
+ \begin{center}
+ Dissertation submitted to Faculdade de Engenharia da Universidade do Porto\\ to obtain the degree of
+ \vskip 3mm
+ \large{\textbf{Doctor Philosophiae in \@department}}
+ \end{center}
+
+ \unvbox\@supervisorstext
+ \vspace*{\fill}
+
+ \unvbox\@vivatext
+
+ \begin{center}
+ \@thesisdate
+ \end{center}
+}
+
+%% Second Title Page Grooming
+\def\titlepage
+{
+ \cleardoublepage\centering
+ \thispagestyle{empty}
+ \parindent 0pt \parskip 10pt plus 1fil minus 1fil
+ \def\baselinestretch{1}\@normalsize\vbox to \vsize\bgroup\vbox to 9in\bgroup
+}
+
+%% The \kern0pt pushes any depth into the height. Thanks to Richard Stone.
+\def\endtitlepage{\par\kern 0pt\egroup\vss\egroup\clearpage}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%% General Layout %%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Avoid widows and orphans
+\clubpenalty=6000
+\widowpenalty=6000
+
+%% Headers
+\RequirePackage{fancyhdr}
+\pagestyle{fancy}
+
+%% Remember chapter title
+\renewcommand{\chaptermark}[1]{\markboth{#1}{#1}}
+
+%% Section number and title
+\renewcommand{\sectionmark}[1]{\markright{{\ifnum \c@secnumdepth >\z@ \thesection\ \fi #1}}}
+
+%% Two sided printinig
+\if@twoside
+ \lhead[\fancyplain{}{\rm\thepage}]{\fancyplain{}{\sl\rightmark}}
+ \chead{}
+ \rhead[\fancyplain{}{\sl\leftmark}]{\fancyplain{}{\rm\thepage}}
+ \lfoot{}
+ \cfoot{\fancyplain{\rm\thepage}{}}
+ \rfoot{}
+\else
+ \lhead{\fancyplain{}{\sl\ifodd\c@page\rightmark\else\leftmark\fi}}
+ \chead{}
+ \rhead[]{\fancyplain{}{\rm\thepage}}
+ \lfoot{}
+ \cfoot{\fancyplain{\rm\thepage}{}}
+ \rfoot{}
+\fi
+
+%% Renew some commands
+\renewcommand{\headrulewidth}{0pt}
+\renewcommand{\footrulewidth}{0pt}
+\addtolength{\headheight}{0.5pt}
+
+%% changes to report.sty
+\lineskip 1pt
+\normallineskip 1pt
+\onehalfspacing % One and a half line spacing
+\setcounter{secnumdepth}{3} % To number subsubsections
+\setcounter{tocdepth}{2} % Sets the depth of sectional units listed in the toc
+\setcounter{topnumber}{1} % Maximum number of floats at top of page
+\renewcommand{\topfraction}{0.8} % Maximum fraction of the page occupied by floats
+
+%% Fix pagenumbering so that it works even when the \pagenumbering command is in a file that has not been \include-d
+\def\c@pagenumbering{arabic}
+\def\@pagenumbering#1{\gdef\thepage{\csname @#1\endcsname \c@page}
+\gdef\c@pagenumbering{#1}}
+\def\pagenumbering#1{\global\c@page\@ne \@pagenumbering{#1}}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%% New Commands & Environments %%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Some new commands
+\newcommand{\Activate@lineno}{\if@uselineno\linenumbers\switchlinenumbers*\fi}
+\newcommand{\@StartPrelim}{\cleardoublepage\pagenumbering{roman}\setcounter{page}{1}\pagestyle{fancy}}
+\newcommand{\clearemptydoublepage}{\newpage{\pagestyle{empty}\cleardoublepage}}
+\newcommand{\StartBody}{\cleardoublepage\pagenumbering{arabic}\setcounter{page}{1}\pagestyle{fancy}\Activate@lineno}
+\newcommand{\@StartDoc}{\setcounter{page}{-3}\pagestyle{empty}\pdfbookmark[0]{Front Page}{init}}
+\newcommand{\PrintIndex}{\cleardoublepage\phantomsection\addcontentsline{toc}{chapter}{Index}\begin{singlespace}\printindex\end{singlespace}}
+\newcommand*{\compressitem}{\@minipagetrue}
+
+%% Some new columns
+\newcolumntype{P}[1]{>{\endgraf\vspace*{-\baselineskip}}p{#1}} % For itemize inside a longtable
+
+%% Prolog
+\newenvironment{Prolog}
+{
+ \maketitle
+ \if@committeepage
+ \committeepage
+ \fi
+ \@StartPrelim
+ \begin{singlespace}
+}
+{\end{singlespace}}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%% Bibbliography %%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Bibliography Style
+\RequirePackage[]{natbib}
+
+\newcommand\MidSep{, }% separator for two elements, not the last two (for citeauthorlist and citetlist)
+\newcommand\LastSep{ and }% separator for last two elements
+
+%citeauthorlist
+\newcommand\citeauthorlist[1]{%
+ \let\last@elem\relax
+ \let\last@sep\relax
+ \@for\@list:=#1\do{%
+ \ifx\last@elem\relax\else
+ \ifx\last@sep\relax
+ \def\last@sep{\LastSep}% the separator between the last two elements should is "and"
+ \else\MidSep % the separator between two elements (not the two last) is a comma
+ \fi
+ \citeauthor{\last@elem}%
+ \fi
+ \let\last@elem\@list
+ }% the last element of the list:
+ \ifx\last@elem\relax\else
+ \last@sep\citeauthor{\last@elem}%
+ \fi
+}
+
+%citetlist
+\newcommand\citetlist[1]{%
+ \let\last@elem\relax
+ \let\last@sep\relax
+ \@for\@list:=#1\do{%
+ \ifx\last@elem\relax\else
+ \ifx\last@sep\relax
+ \def\last@sep{\LastSep}% the separator between the last two elements should is "and"
+ \else\MidSep % the separator between two elements (not the two last) is a comma
+ \fi
+ \citet{\last@elem}%
+ \fi
+ \let\last@elem\@list
+ }% the last element of the list:
+ \ifx\last@elem\relax\else
+ \last@sep\citet{\last@elem}%
+ \fi
+}
+
+%%%citeplist %Still work in progress
+%%\newcommand\citeplist[1]{%
+ %%\let\last@elem\relax
+ %%\let\last@sep\relax
+ %%\@for\@list:=#1\do{%
+ %%\ifx\last@elem\relax\else
+ %%\ifx\last@sep\relax
+ %%\def\last@sep{\LastSep}% the separator between the last two elements should is "and"
+ %%\else\MidSep % the separator between two elements (not the two last) is a comma
+ %%\fi
+ %%\citep{\last@elem}%
+ %%\fi
+ %%\let\last@elem\@list
+ %%}% the last element of the list:
+ %%\ifx\last@elem\relax\else
+ %%\last@sep\citep{\last@elem}%
+ %%\fi
+%%}
+
+\def\bstctlcite{\@ifnextchar[{\@bstctlcite}{\@bstctlcite[@auxout]}}
+\def\@bstctlcite[#1]#2{\@bsphack
+ \@for\@citeb:=#2\do{%
+ \edef\@citeb{\expandafter\@firstofone\@citeb}%
+ \if@filesw\immediate\write\csname #1\endcsname{\string\citation{\@citeb}}\fi}%
+\@esphack}
+
+%%%%%%%%%%%%%%%%%%%%%%%%% Fixes %%%%%%%%%%%%%%%%%%%%%%%%%
+
+% 'showframe' of geometry package
+\newcommand*{\gmshow@textheight}{\textheight}
+\newdimen\gmshow@@textheight
+\g@addto@macro\landscape{%
+ \gmshow@@textheight=\hsize
+ \renewcommand*{\gmshow@textheight}{\gmshow@@textheight}%
+}
+\def\Gm@vrule{%
+ \vrule width 0.2pt height\gmshow@textheight depth\z@
+}%
+
+%%%%%%%%%%%%%%%%%%%%%%%%% Go, go, go! %%%%%%%%%%%%%%%%%%%%%%%%%
+\AtBeginDocument{\@StartDoc}
+
+\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/feupphdteses/mymacros.tex b/macros/latex/contrib/feupphdteses/mymacros.tex
new file mode 100644
index 0000000000..1f67dc672d
--- /dev/null
+++ b/macros/latex/contrib/feupphdteses/mymacros.tex
@@ -0,0 +1,11 @@
+%some macro definitions
+
+% format
+\newcommand{\class}[1]{{\normalfont\slshape #1\/}}
+
+% School
+\newcommand{\Feup}{Faculdade de Engenharia da Universidade do Porto}
+
+\newcommand{\svg}{\class{SVG}}
+\newcommand{\scada}{\class{SCADA}}
+\newcommand{\scadadms}{\class{SCADA/DMS}}