commit b35069875a2a31c3286c5926b96c8a2928076bb5 Author: polsevev Date: Fri Apr 12 13:54:05 2024 +0200 initial transfer from Overleaf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e964244 --- /dev/null +++ b/.gitignore @@ -0,0 +1,301 @@ +## Core latex/pdflatex auxiliary files: +*.aux +*.lof +*.log +*.lot +*.fls +*.out +*.toc +*.fmt +*.fot +*.cb +*.cb2 +.*.lb + +## Intermediate documents: +*.dvi +*.xdv +*-converted-to.* +# these rules might exclude image files for figures etc. +# *.ps +# *.eps +# *.pdf + +## Generated if empty string is given at "Please type another file name for output:" +.pdf + +## Bibliography auxiliary files (bibtex/biblatex/biber): +*.bbl +*.bcf +*.blg +*-blx.aux +*-blx.bib +*.run.xml + +## Build tool auxiliary files: +*.fdb_latexmk +*.synctex +*.synctex(busy) +*.synctex.gz +*.synctex.gz(busy) +*.pdfsync + +## Build tool directories for auxiliary files +# latexrun +latex.out/ + +## Auxiliary and intermediate files from other packages: +# algorithms +*.alg +*.loa + +# achemso +acs-*.bib + +# amsthm +*.thm + +# beamer +*.nav +*.pre +*.snm +*.vrb + +# changes +*.soc + +# comment +*.cut + +# cprotect +*.cpt + +# elsarticle (documentclass of Elsevier journals) +*.spl + +# endnotes +*.ent + +# fixme +*.lox + +# feynmf/feynmp +*.mf +*.mp +*.t[1-9] +*.t[1-9][0-9] +*.tfm + +#(r)(e)ledmac/(r)(e)ledpar +*.end +*.?end +*.[1-9] +*.[1-9][0-9] +*.[1-9][0-9][0-9] +*.[1-9]R +*.[1-9][0-9]R +*.[1-9][0-9][0-9]R +*.eledsec[1-9] +*.eledsec[1-9]R +*.eledsec[1-9][0-9] +*.eledsec[1-9][0-9]R +*.eledsec[1-9][0-9][0-9] +*.eledsec[1-9][0-9][0-9]R + +# glossaries +*.acn +*.acr +*.glg +*.glo +*.gls +*.glsdefs +*.lzo +*.lzs +*.slg +*.slo +*.sls + +# uncomment this for glossaries-extra (will ignore makeindex's style files!) +# *.ist + +# gnuplot +*.gnuplot +*.table + +# gnuplottex +*-gnuplottex-* + +# gregoriotex +*.gaux +*.glog +*.gtex + +# htlatex +*.4ct +*.4tc +*.idv +*.lg +*.trc +*.xref + +# hyperref +*.brf + +# knitr +*-concordance.tex +# TODO Uncomment the next line if you use knitr and want to ignore its generated tikz files +# *.tikz +*-tikzDictionary + +# listings +*.lol + +# luatexja-ruby +*.ltjruby + +# makeidx +*.idx +*.ilg +*.ind + +# minitoc +*.maf +*.mlf +*.mlt +*.mtc[0-9]* +*.slf[0-9]* +*.slt[0-9]* +*.stc[0-9]* + +# minted +_minted* +*.pyg + +# morewrites +*.mw + +# newpax +*.newpax + +# nomencl +*.nlg +*.nlo +*.nls + +# pax +*.pax + +# pdfpcnotes +*.pdfpc + +# sagetex +*.sagetex.sage +*.sagetex.py +*.sagetex.scmd + +# scrwfile +*.wrt + +# svg +svg-inkscape/ + +# sympy +*.sout +*.sympy +sympy-plots-for-*.tex/ + +# pdfcomment +*.upa +*.upb + +# pythontex +*.pytxcode +pythontex-files-*/ + +# tcolorbox +*.listing + +# thmtools +*.loe + +# TikZ & PGF +*.dpth +*.md5 +*.auxlock + +# titletoc +*.ptc + +# todonotes +*.tdo + +# vhistory +*.hst +*.ver + +# easy-todo +*.lod + +# xcolor +*.xcp + +# xmpincl +*.xmpi + +# xindy +*.xdy + +# xypic precompiled matrices and outlines +*.xyc +*.xyd + +# endfloat +*.ttt +*.fff + +# Latexian +TSWLatexianTemp* + +## Editors: +# WinEdt +*.bak +*.sav + +# Texpad +.texpadtmp + +# LyX +*.lyx~ + +# Kile +*.backup + +# gummi +.*.swp + +# KBibTeX +*~[0-9]* + +# TeXnicCenter +*.tps + +# auto folder when using emacs and auctex +./auto/* +*.el + +# expex forward references with \gathertags +*-tags.tex + +# standalone packages +*.sta + +# Makeindex log files +*.lpz + +# xwatermark package +*.xwm + +# REVTeX puts footnotes in the bibliography by default, unless the nofootinbib +# option is specified. Footnotes are the stored in a file with suffix Notes.bib. +# Uncomment the next line to have this generated file ignored. +#*Notes.bib diff --git a/README.md b/README.md new file mode 100644 index 0000000..6f84975 --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +# LaTeX template for masteroppgaver ved Institutt for informatikk ved UiB + +Denne LaTeX templaten er basert på Diddern sin [UiB-LaTeX-Template](https://github.com/Diddern/UiB-LaTeX-Template) (se fork). + +## Komme i gang + +Clone og kompiler med din favoritt [TeX-distribusjon](https://www.latex-project.org/get/). + +## Logo + +Logo for ditt fakultet? +[UiB profilmanual](http://kapd.h.uib.no/profilmanual/99LastNed/99a_lastned.html) +Endre til `canvas.png` hvis du ønsker kun logo uten fakultet. + +## Lisens + +UiB logo: Copyright (C) tilhørende Universitetet i Bergen. +University Assignment Title Page: CC BY-NC-SA 3.0 WikiBooks diff --git a/build/report.pdf b/build/report.pdf new file mode 100644 index 0000000..4b89f38 Binary files /dev/null and b/build/report.pdf differ diff --git a/chapter/ch3/ch3.tex b/chapter/ch3/ch3.tex new file mode 100644 index 0000000..b1e8233 --- /dev/null +++ b/chapter/ch3/ch3.tex @@ -0,0 +1,65 @@ +\section{Collecting User Feedback for Syntactic Proposals} + +The goal for this project is to utilize users familiarity with their own code to gain early and worthwhile user feedback on new +syntactic proposals for EcmaScript. + +\subsection{The core idea} + +Users of EcmaScript have a familiarity with code they themselves have written. This means they have knowledge of how their own code works and why they might have written it a certain way. This project aims to utilize this pre-exisiting knowledge to showcase new proposals for EcmaScript. Showcasing proposals this way will allow users to focus on what the proposal actually entails, instead of focusing on the examples written by the proposal author. + +% Should this be moved to chapter 2? +A proposal for EcmaScript is a suggestion for a change to the language. These changes come with a set of problems that if the proposal is included as a part of EcmaScript, those problems should be solved by utilizing the additions contained within the proposal. + +Further in this chapter, we will be discussing the \textit{old} and \textit{new} way of solving a problem. What we are referring to in this case is whatever set of problems a proposal is trying to solve, if that proposal is allowed into EcmaScript as part of the language, there will be a \textit{new} way of solving said problems. The \textit{old} way is the current status quo when the proposal is not part of EcmaScript, and the \textit{new} way is when the proposal is part of EcmaScript and we are utilizing the new features of said proposal. + +\subsection{Applying a proposal} + +The way this project will use the pre-existing knowledge the user harbors of their own code is to use it as a base, and \textit{apply} the proposal to that base. + +When a proposal is \textit{applied} to a piece of code there are some main steps. A code snippet where the proposal might be used has to be identified. That same code snippet has to be transformed to use the new features the proposal implements. Then both the original and the transformed code snippet has to be showcased to the user. + +Identifying a code snippet where the proposal might be utilized, the problem a proposal is solving allows us to iden + +\subsection{Syntactic proposal} + +A proposal for EcmaScript is a suggested change for the language, in the case of EcmaScript this comes in the form of an addition to the language, as EcmaScript does not allow for breaking changes. There are many different kinds of proposals, one such example is a Syntactic proposal + +A syntactic proposal, is a proposal that contains only changes to the syntax of a language. This means, the proposal contains either no, or very limited change to functionality, and no changes to semantics. + +This is an example of a very simple syntactic proposal. + +Consider a imaginary proposal \exProp. This proposal describes adding an optional keyword for declaring numerical variables if the expression of the declaration is a numerical literal. + +This proposal will look something like this: + +\begin{lstlisting}[language={JavaScript}, caption={Example of imaginary proposal \exProp}, label={ex:proposal}] +// Original code +let x = 100; +let b = "Some String"; +let c = 200; + +// Code after application of proposal +int x = 100; +let b = "Some String"; +let c = 200; +\end{lstlisting} + +See that in \ref{ex:proposal} the change is optional, and is not applied to the declaration of \textit{c}, but it is applied to the declaration of \textit{x}. Since the change is optional to use, and essentially is just \textit{syntax sugar}, this proposal does not make any changes to functionality or semantics, and can therefore be categorized as a syntactic proposal. + + +\subsection{Showcasing syntactic proposals} + +The application of a proposal on a program will then be utilized as a way of presenting the proposal to developers using EcmaScript(hereby referred to as users). If the code used for the application is already familiar to the user, we can severely limit the amount of time spent to understand the functionality of the initial code used in the application of the proposal. This allows the users more focus on the actual change presented by the proposal, which in turn might present itself in better feedback on the proposal, as well as presenting issues about the proposal earlier in the process. + + +This showcase is done by, The user being presented with two pieces of code. One being the original version with no changes, and the other being the transformed code after, this will allow the user to see how it was written before, and see how the proposal could have been applied here. This will give a low barrier of entry to understand a proposal and give meaningful feedback to the committee. + +This paper does not focus on showcasing and gathering user feedback, however focusing more on the process of applying a proposal to some piece of code, while maintaining its functionality. + + +\subsection{\DSL} + +In order to match ...... + + +\subsection{Using the \DSL with an actual syntactic proposal} \ No newline at end of file diff --git a/chapter/introduction.tex b/chapter/introduction.tex new file mode 100644 index 0000000..98c79b3 --- /dev/null +++ b/chapter/introduction.tex @@ -0,0 +1,64 @@ +\chapter{Introduction} + +Natum mucius vim id. Tota detracto ei sed, id sumo sapientem sed. Vim in nostro latine gloriatur, cetero vocent vim id. Erat sanctus eam te, nec assueverit necessitatibus ex, id delectus fabellas has. + +Lorem ipsum dolor sit amet, iisque feugait quo eu, sed vocent commodo aliquid an. Minim suavitate dissentiet te eos. Dicunt eirmod adolescens no sed. Esse nonumy melius an mel, mei ut maiorum luptatum. Eu eum iudico scripta, movet option assueverit mel ex, mea at odio noluisse efficiendi. Ad vidisse atomorum conceptam quo, saepe volumus philosophia eos eu, delenit conceptam no usu. + +Vituperata sadipscing deterruisset ei mel, at qui nonumy blandit. Delectus dissentiet et sea, ut rebum regione numquam nam, cum ex augue constituto. Te per nihil semper. Posse voluptatum qui an, aliquando democritum disputando id quo, everti perpetua cu vim. Laudem fabellas mei an, eu reprimique quaerendum usu. Quidam prompta fabellas ne est. + +\section{Background} + +Lorem ipsum dolor sit amet, cu graecis propriae sea. Eam feugiat docendi an, ei scripta blandit pri. Nonumes delicata reprimique nam ut. Eu suas alterum concludaturque est, ferri mucius sensibus id sed~\cite{raftAlg}. + +We can do glossary for acronymes and abriviations also: \gls{saas}. As you see the first time it is used, the full version is used, but the second time we use \gls{saas} the short form is used. It is also a link to the lookup. + + +\subsection{Listings} +You can do listings, like in Listing~\ref{ListingReference} +\begin{lstlisting}[caption={[Short caption]Look at this cool listing. Find the rest in Appendix~\ref{Listing}},label=ListingReference] +$ java -jar myAwesomeCode.jar +\end{lstlisting} + +You can also do language highlighting for instance with Golang: +And in line~\ref{LineThatDoesSomething} of Listing~\ref{ListingGolang} you can see that we can ref to lines in listings. + +\begin{lstlisting}[caption={Hello world in Golang},label=ListingGolang,escapechar=|] +package main + +import "fmt" + +func main() { + fmt.Println("hello world") |\label{LineThatDoesSomething}| +} + +\end{lstlisting} + +\subsection{Figures} + +Example of a centred figure +\begin{figure}[H] + \centering + \includegraphics[scale=0.5]{figures/Flowchart} + \caption{Caption for flowchart} + \medskip + \hspace*{15pt}\hbox{\scriptsize Credit: Acme company makes everything \url{https://acme.com/}} + \label{FlowchartFigure} +\end{figure} + +\subsection{Tables} + +We can also do tables. Protip: use \url{https://www.tablesgenerator.com/} for generating tables. +\begin{table}[H] +\centering +\caption{Caption of table} +\label{TableLabel} +\begin{tabular}{|l|l|l|} +\hline +Title1 & Title2 & Title3 \\ \hline +data1 & data2 & data3 \\ \hline +\end{tabular} +\end{table} + +\subsection{\gls{git}} + +\gls{git} is fun, use it! \ No newline at end of file diff --git a/figures/Flowchart.png b/figures/Flowchart.png new file mode 100644 index 0000000..578bd4e Binary files /dev/null and b/figures/Flowchart.png differ diff --git a/figures/canvas.png b/figures/canvas.png new file mode 100755 index 0000000..3a19281 Binary files /dev/null and b/figures/canvas.png differ diff --git a/figures/canvasWithFaculty.png b/figures/canvasWithFaculty.png new file mode 100644 index 0000000..2f8b0ba Binary files /dev/null and b/figures/canvasWithFaculty.png differ diff --git a/generators/abstract.tex b/generators/abstract.tex new file mode 100644 index 0000000..c9aa89a --- /dev/null +++ b/generators/abstract.tex @@ -0,0 +1,20 @@ +\pagenumbering{roman} + +\begin{abstract} + +\noindent Lorem ipsum dolor sit amet, his veri singulis necessitatibus ad. Nec insolens periculis ex. Te pro purto eros error, nec alia graeci placerat cu. Hinc volutpat similique no qui, ad labitur mentitum democritum sea. Sale inimicus te eum. + +No eros nemore impedit his, per at salutandi eloquentiam, ea semper euismod meliore sea. Mutat scaevola cotidieque cu mel. Eum an convenire tractatos, ei duo nulla molestie, quis hendrerit et vix. In aliquam intellegam philosophia sea. At quo bonorum adipisci. Eros labitur deleniti ius in, sonet congue ius at, pro suas meis habeo no. + +\end{abstract} + +\renewcommand{\abstractname}{Acknowledgements} +\begin{abstract} + Est suavitate gubergren referrentur an, ex mea dolor eloquentiam, novum ludus suscipit in nec. Ea mea essent prompta constituam, has ut novum prodesset vulputate. Ad noster electram pri, nec sint accusamus dissentias at. Est ad laoreet fierent invidunt, ut per assueverit conclusionemque. An electram efficiendi mea. + + \vspace{1cm} + \hspace*{\fill}\texttt{Your name}\\ + \hspace*{\fill}\today +\end{abstract} +\setcounter{page}{1} +\newpage \ No newline at end of file diff --git a/generators/appendix-a.tex b/generators/appendix-a.tex new file mode 100644 index 0000000..a9887f5 --- /dev/null +++ b/generators/appendix-a.tex @@ -0,0 +1,5 @@ +\chapter{Generated code from Protocol buffers} + +\begin{lstlisting}[caption={Source code of something},label=Listing] +System.out.println("Hello Mars"); +\end{lstlisting} \ No newline at end of file diff --git a/generators/commands.sty b/generators/commands.sty new file mode 100644 index 0000000..87a8c6c --- /dev/null +++ b/generators/commands.sty @@ -0,0 +1,2 @@ +\newcommand{\DSL}{DSL NAME HERE?} +\newcommand{\exProp}{\textbf{optional let to int for declaring numerical literal variables}} \ No newline at end of file diff --git a/generators/frontpage.tex b/generators/frontpage.tex new file mode 100644 index 0000000..37abe79 --- /dev/null +++ b/generators/frontpage.tex @@ -0,0 +1,52 @@ +\begin{titlepage} + +\newcommand{\HRule}{\rule{\linewidth}{0.5mm}} % Defines a new command for the horizontal lines, change thickness here + +\center % Center everything on the page + +%---------------------------------------------------------------------------------------- +% HEADING SECTIONS +%---------------------------------------------------------------------------------------- + +\textsc{\LARGE University of Bergen \\ Department of Informatics}\\[1.5cm] % Name of your university/college + +%---------------------------------------------------------------------------------------- +% TITLE SECTION +%---------------------------------------------------------------------------------------- + +\HRule \\[0.5cm] +\begin{Huge} + \bfseries{Title of your master thesis}\\[0.7cm] % Title of your document +\end{Huge} +\HRule \\[0.5cm] + +%---------------------------------------------------------------------------------------- +% AUTHOR SECTION +%---------------------------------------------------------------------------------------- + +\large \emph{Author:} Your name\\ +\large \emph{Supervisors:} Name of supervisors\\[2cm] + +%---------------------------------------------------------------------------------------- +% LOGO SECTION +% This will require the graphicx package +% Change the line to comment if you only want the UiB Logo +% Logo for other faculties here: http://kapd.h.uib.no/profilmanual/99LastNed/99a_lastned.html +%---------------------------------------------------------------------------------------- + +\centerline{\includegraphics[scale=1.9]{figures/canvasWithFaculty}} +%\centerline{\includegraphics[scale=0.15]{figures/canvas}} %change for your faculty + +%---------------------------------------------------------------------------------------- +% DATE SECTION +%---------------------------------------------------------------------------------------- + +{\large \monthyeardate\today}\\[3cm] % Date, change the \today to a set date if you want to be precise + +%---------------------------------------------------------------------------------------- +% LOGO SECTION +%---------------------------------------------------------------------------------------- + +\vfill % Fill the rest of the page with whitespace + +\end{titlepage} diff --git a/generators/glossary.tex b/generators/glossary.tex new file mode 100644 index 0000000..eabf874 --- /dev/null +++ b/generators/glossary.tex @@ -0,0 +1,13 @@ +%\makeglossaries % alt 1 +\makenoidxglossaries % alt 2 + +\renewcommand*{\acronymname}{List of Acronyms and Abbreviations} +\renewcommand{\glsnamefont}[1]{\textbf{#1}} + +%Create acronyms here. +\newacronym{saas}{SaaS}{Software as a Service} +\newacronym{vcs}{VCS}{Version Control System} + +%You can also do explanations. +\newglossaryentry{git}{name={Git}, + description={Git is a \gls{vcs} for tracking changes in computer files and coordinating work on those files among multiple people}} \ No newline at end of file diff --git a/generators/imports.sty b/generators/imports.sty new file mode 100644 index 0000000..8b870d9 --- /dev/null +++ b/generators/imports.sty @@ -0,0 +1,80 @@ +\usepackage[utf8]{inputenc} % This defines the font-\usepackage[utf8]{inputenc} +\usepackage{url} +\def\UrlBreaks{\do\/\do-} +\usepackage[square, numbers]{natbib} +\usepackage{booktabs} +\usepackage{graphicx} +\usepackage{floatpag} +\usepackage{xcolor} +\usepackage{caption} +\usepackage{float} +\usepackage{geometry} +\usepackage{wrapfig} +\usepackage{amssymb} +\usepackage[colorinlistoftodos,prependcaption,textsize=tiny]{todonotes} +\usepackage{soul} +\usepackage{textcomp} +\usepackage{marvosym} +\usepackage[integrals]{wasysym} +\usepackage{latexsym} +\DeclareRobustCommand{\VAN}[3]{#2} +\usepackage{amssymb} + +\renewcommand{\labelenumii}{\theenumii} +\renewcommand{\theenumii}{\theenumi.\arabic{enumii}.} + +\usepackage{hyperref} +\tolerance=1000 +\usepackage{amsmath} +\usepackage{titlesec} +\usepackage{setspace} +\onehalfspacing +\usepackage{fullpage} +\graphicspath{{figures/}} + +\usepackage{listings} +\usepackage{generators/listings-golang} +\usepackage{generators/listings-js} +\usepackage{generators/commands} +\lstset{ + frame=single, + basicstyle=\linespread{0.8}\footnotesize\ttfamily, + keywordstyle=\color{red}, + numbers=left, + numbersep=5pt, + showstringspaces=false, + stringstyle=\color{blue}, + commentstyle=\color{gray}, + breakatwhitespace=true, + breaklines=true, + postbreak=\mbox{\textcolor{violet}{$\hookrightarrow$}\space}, + tabsize=4, + language=Golang +} + +\newlength\glsdescwidth + \setlength{\glsdescwidth}{1\hsize} + +\usepackage{datetime} +\newdateformat{monthyeardate}{% + \monthname[\THEMONTH], \THEYEAR} + +\newcommand\blankpage{% + \null + \thispagestyle{empty}% + \addtocounter{page}{-1}% + \newpage} + +\usepackage{enumitem, kantlipsum} +\renewcommand{\maketitle}{} +\usepackage{paralist} + \let\itemize\compactitem + \let\enditemize\endcompactitem + \let\endenumerate\endcompactenum + \let\description\compactdesc + \let\enddescription\endcompactdesc + \pltopsep=\medskipamount + \plitemsep=1pt + \plparsep=1pt + +\usepackage[acronym,nonumberlist,toc,nogroupskip]{glossaries} \ No newline at end of file diff --git a/generators/listings-golang.sty b/generators/listings-golang.sty new file mode 100644 index 0000000..d0d3cd4 --- /dev/null +++ b/generators/listings-golang.sty @@ -0,0 +1,23 @@ +%% Golang definition for listings +%% http://github.io/julienc91/lstlistings-golang +%% +\RequirePackage{listings} + +\lstdefinelanguage{Golang}% + {morekeywords=[1]{package,import,func,type,struct,return,defer,panic,% + recover,select,var,const,iota},% + morekeywords=[2]{string,uint,uint8,uint16,uint32,uint64,int,int8,int16,% + int32,int64,bool,float32,float64,complex64,complex128,byte,rune,uintptr,% + error,interface},% + morekeywords=[3]{map,slice,make,new,nil,len,cap,copy,close,true,false,% + delete,append,real,imag,complex,chan,},% + morekeywords=[4]{for,break,continue,range,goto,switch,case,fallthrough,if,% + else,default,},% + morekeywords=[5]{Println,Printf,Error, err, Print,},% + sensitive=true,% + morecomment=[l]{//},% + morecomment=[s]{/*}{*/},% + morestring=[b]',% + morestring=[b]",% + morestring=[s]{`}{`},% + } \ No newline at end of file diff --git a/generators/listings-js.sty b/generators/listings-js.sty new file mode 100644 index 0000000..822cf89 --- /dev/null +++ b/generators/listings-js.sty @@ -0,0 +1,31 @@ +\RequirePackage{listings} +\lstdefinelanguage{JavaScript}{ + keywords={typeof, new, true, false, catch, function, return, null, catch, switch, var, if, in, while, do, else, case, break}, + keywordstyle=\color{blue}\bfseries, + ndkeywords={class, export, boolean, throw, implements, import, this}, + ndkeywordstyle=\color{darkgray}\bfseries, + identifierstyle=\color{black}, + sensitive=false, + comment=[l]{//}, + morecomment=[s]{/*}{*/}, + commentstyle=\color{purple}\ttfamily, + stringstyle=\color{red}\ttfamily, + morestring=[b]', + morestring=[b]" +} + +\lstset{ + language=JavaScript, + backgroundcolor=\color{lightgray}, + extendedchars=true, + basicstyle=\footnotesize\ttfamily, + showstringspaces=false, + showspaces=false, + numbers=left, + numberstyle=\footnotesize, + numbersep=9pt, + tabsize=2, + breaklines=true, + showtabs=false, + captionpos=b + } \ No newline at end of file diff --git a/generators/myplainnat.bst b/generators/myplainnat.bst new file mode 100644 index 0000000..9bac443 --- /dev/null +++ b/generators/myplainnat.bst @@ -0,0 +1,1436 @@ +%% File: `plainnat.bst' +%% A modification of `plain.bst' for use with natbib package +%% +%% Copyright 1993-2007 Patrick W Daly +%% Max-Planck-Institut f\"ur Sonnensystemforschung +%% Max-Planck-Str. 2 +%% D-37191 Katlenburg-Lindau +%% Germany +%% E-mail: daly@mps.mpg.de +%% +%% This program can be redistributed and/or modified under the terms +%% of the LaTeX Project Public License Distributed from CTAN +%% archives in directory macros/latex/base/lppl.txt; either +%% version 1 of the License, or any later version. +%% + % Version and source file information: + % \ProvidesFile{natbst.mbs}[2007/11/26 1.93 (PWD)] + % + % BibTeX `plainnat' family + % version 0.99b for BibTeX versions 0.99a or later, + % for LaTeX versions 2.09 and 2e. + % + % For use with the `natbib.sty' package; emulates the corresponding + % member of the `plain' family, but with author-year citations. + % + % With version 6.0 of `natbib.sty', it may also be used for numerical + % citations, while retaining the commands \citeauthor, \citefullauthor, + % and \citeyear to print the corresponding information. + % + % For version 7.0 of `natbib.sty', the KEY field replaces missing + % authors/editors, and the date is left blank in \bibitem. + % + % Includes field EID for the sequence/citation number of electronic journals + % which is used instead of page numbers. + % + % Includes fields ISBN and ISSN. + % + % Includes field URL for Internet addresses. + % + % Includes field DOI for Digital Object Idenfifiers. + % + % Works best with the url.sty package of Donald Arseneau. + % + % Works with identical authors and year are further sorted by + % citation key, to preserve any natural sequence. + % +ENTRY + { address + author + booktitle + chapter + doi + eid + edition + editor + howpublished + institution + isbn + issn + journal + key + month + note + number + organization + pages + publisher + school + series + title + type + url + volume + year + } + {} + { label extra.label sort.label short.list } + +INTEGERS { output.state before.all mid.sentence after.sentence after.block } + +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} + +STRINGS { s t } + +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} + +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} + +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} + +FUNCTION {fin.entry} +{ add.period$ + write$ + newline$ +} + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} + +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} + +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} + +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} + +FUNCTION {new.block.checka} +{ empty$ + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.sentence.checka} +{ empty$ + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {new.sentence.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} + +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "\emph{" swap$ * "}" * } + if$ +} + +INTEGERS { nameptr namesleft numnames } + +FUNCTION {format.names} +{ 's := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr "{ff~}{vv~}{ll}{, jj}" 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 {format.key} +{ empty$ + { key field.or.null } + { "" } + if$ +} + +FUNCTION {format.authors} +{ author empty$ + { "" } + { author format.names } + if$ +} + +FUNCTION {format.editors} +{ editor empty$ + { "" } + { editor format.names + editor num.names$ #1 > + { ", editors" * } + { ", editor" * } + if$ + } + if$ +} + +FUNCTION {format.isbn} +{ isbn empty$ + { "" } + { new.block "ISBN " isbn * } + if$ +} + +FUNCTION {format.issn} +{ issn empty$ + { "" } + { new.block "ISSN " issn * } + if$ +} + +FUNCTION {format.url} +{ url empty$ + { "" } + { new.block "\\{\footnotesize \textbf{URL:}\hspace{2mm}\url{" url * "}}" * } + if$ +} + +FUNCTION {format.doi} +{ doi empty$ + { "" } + { new.block "\doi{" doi * "}" * } + if$ +} + +FUNCTION {format.title} +{ title empty$ + { "" } + { title "t" change.case$ } + if$ +} + +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" = + 'editor.full + 'author.full + if$ + } + if$ +} + +FUNCTION {output.bibitem} +{ newline$ + "\bibitem[" write$ + label write$ + ")" make.full.names duplicate$ short.list = + { pop$ } + { * } + if$ + "]{" * write$ + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {n.dashify} +{ '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$ +} + +FUNCTION {format.date} +{ year duplicate$ empty$ + { "empty year in " cite$ * warning$ + pop$ "" } + 'skip$ + if$ + month empty$ + 'skip$ + { month + " " * swap$ * + } + if$ + extra.label * +} + +FUNCTION {format.btitle} +{ title emphasize +} + +FUNCTION {tie.or.space.connect} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ * * +} + +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} + +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { "volume" volume tie.or.space.connect + series empty$ + 'skip$ + { " of " * series emphasize * } + if$ + "volume and number" number either.or.check + } + if$ +} + +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { output.state mid.sentence = + { "number" } + { "Number" } + if$ + number tie.or.space.connect + series empty$ + { "there's a number but no series in " cite$ * warning$ } + { " in " * series * } + if$ + } + if$ + } + { "" } + if$ +} + +FUNCTION {format.edition} +{ edition empty$ + { "" } + { output.state mid.sentence = + { edition "l" change.case$ " edition" * } + { edition "t" change.case$ " edition" * } + if$ + } + if$ +} + +INTEGERS { multiresult } + +FUNCTION {multi.page.check} +{ '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 {format.pages} +{ pages empty$ + { "" } + { pages multi.page.check + { "pages" pages n.dashify tie.or.space.connect } + { "page" pages tie.or.space.connect } + if$ + } + if$ +} + +FUNCTION {format.eid} +{ eid empty$ + { "" } + { "art." eid tie.or.space.connect } + if$ +} + +FUNCTION {format.vol.num.pages} +{ volume field.or.null + number empty$ + 'skip$ + { "\penalty0 (" number * ")" * * + volume empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + } + if$ + pages empty$ + 'skip$ + { duplicate$ empty$ + { pop$ format.pages } + { ":\penalty0 " * pages n.dashify * } + if$ + } + if$ +} + +FUNCTION {format.vol.num.eid} +{ volume field.or.null + number empty$ + 'skip$ + { "\penalty0 (" number * ")" * * + volume empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + } + if$ + eid empty$ + 'skip$ + { duplicate$ empty$ + { pop$ format.eid } + { ":\penalty0 " * eid * } + if$ + } + if$ +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { "chapter" } + { type "l" change.case$ } + if$ + chapter tie.or.space.connect + pages empty$ + 'skip$ + { ", " * format.pages * } + if$ + } + if$ +} + +FUNCTION {format.in.ed.booktitle} +{ booktitle empty$ + { "" } + { editor empty$ + { "In " booktitle emphasize * } + { "In " format.editors * ", " * booktitle emphasize * } + if$ + } + if$ +} + +FUNCTION {empty.misc.check} +{ author empty$ title empty$ howpublished empty$ + month empty$ year empty$ note empty$ + and and and and and + key empty$ not and + { "all relevant fields are empty in " cite$ * warning$ } + 'skip$ + if$ +} + +FUNCTION {format.thesis.type} +{ type empty$ + 'skip$ + { pop$ + type "t" change.case$ + } + if$ +} + +FUNCTION {format.tr.number} +{ type empty$ + { "Technical Report" } + 'type + if$ + number empty$ + { "t" change.case$ } + { number tie.or.space.connect } + if$ +} + +FUNCTION {format.article.crossref} +{ key empty$ + { journal empty$ + { "need key or journal for " cite$ * " to crossref " * crossref * + warning$ + "" + } + { "In \emph{" journal * "}" * } + if$ + } + { "In " } + if$ + " \citet{" * crossref * "}" * +} + +FUNCTION {format.book.crossref} +{ volume empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + "In " + } + { "Volume" volume tie.or.space.connect + " of " * + } + if$ + editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { series empty$ + { "need editor, key, or series for " cite$ * " to crossref " * + crossref * warning$ + "" * + } + { "\emph{" * series * "}" * } + if$ + } + 'skip$ + if$ + } + 'skip$ + if$ + " \citet{" * crossref * "}" * +} + +FUNCTION {format.incoll.inproc.crossref} +{ editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { booktitle empty$ + { "need editor, key, or booktitle for " cite$ * " to crossref " * + crossref * warning$ + "" + } + { "In \emph{" booktitle * "}" * } + if$ + } + { "In " } + if$ + } + { "In " } + if$ + " \citet{" * crossref * "}" * +} + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + author format.key output + new.block + format.title "title" output.check + new.block + crossref missing$ + { journal emphasize "journal" output.check + eid empty$ + { format.vol.num.pages output } + { format.vol.num.eid output } + if$ + format.date "year" output.check + } + { format.article.crossref output.nonnull + eid empty$ + { format.pages output } + { format.eid output } + if$ + } + if$ + format.issn output + format.doi output + format.url output + new.block + note output + fin.entry +} + +FUNCTION {book} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + editor format.key output + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + new.block + format.btitle "title" output.check + crossref missing$ + { format.bvolume output + new.block + format.number.series output + new.sentence + publisher "publisher" output.check + address output + } + { new.block + format.book.crossref output.nonnull + } + if$ + format.edition output + format.date "year" output.check + format.isbn output + format.doi output + format.url output + new.block + note output + fin.entry +} + +FUNCTION {booklet} +{ output.bibitem + format.authors output + author format.key output + new.block + format.title "title" output.check + howpublished address new.block.checkb + howpublished output + address output + format.date output + format.isbn output + format.doi output + format.url output + new.block + note output + fin.entry +} + +FUNCTION {inbook} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + editor format.key output + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + new.block + format.btitle "title" output.check + crossref missing$ + { format.bvolume output + format.chapter.pages "chapter and pages" output.check + new.block + format.number.series output + new.sentence + publisher "publisher" output.check + address output + } + { format.chapter.pages "chapter and pages" output.check + new.block + format.book.crossref output.nonnull + } + if$ + format.edition output + format.date "year" output.check + format.isbn output + format.doi output + format.url output + new.block + note output + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + author format.key output + new.block + format.title "title" output.check + new.block + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.number.series output + format.chapter.pages output + new.sentence + publisher "publisher" output.check + address output + format.edition output + format.date "year" output.check + } + { format.incoll.inproc.crossref output.nonnull + format.chapter.pages output + } + if$ + format.isbn output + format.doi output + format.url output + new.block + note output + fin.entry +} + +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check + author format.key output + new.block + format.title "title" output.check + new.block + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.number.series output + format.pages output + address empty$ + { organization publisher new.sentence.checkb + organization output + publisher output + format.date "year" output.check + } + { address output.nonnull + format.date "year" output.check + new.sentence + organization output + publisher output + } + if$ + } + { format.incoll.inproc.crossref output.nonnull + format.pages output + } + if$ + format.isbn output + format.doi output + format.url output + new.block + note output + fin.entry +} + +FUNCTION {conference} { inproceedings } + +FUNCTION {manual} +{ output.bibitem + format.authors output + author format.key output + new.block + format.btitle "title" output.check + organization address new.block.checkb + organization output + address output + format.edition output + format.date output + format.url output + new.block + note output + fin.entry +} + +FUNCTION {mastersthesis} +{ output.bibitem + format.authors "author" output.check + author format.key output + new.block + format.title "title" output.check + new.block + "Master's thesis" format.thesis.type output.nonnull + school "school" output.check + address output + format.date "year" output.check + format.url output + new.block + note output + fin.entry +} + +FUNCTION {misc} +{ output.bibitem + format.authors output + author format.key output + title howpublished new.block.checkb + format.title output + howpublished new.block.checka + howpublished output + format.date output + format.issn output + format.url output + new.block + note output + fin.entry + empty.misc.check +} + +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" output.check + author format.key output + new.block + format.btitle "title" output.check + new.block + "PhD thesis" format.thesis.type output.nonnull + school "school" output.check + address output + format.date "year" output.check + format.url output + new.block + note output + fin.entry +} + +FUNCTION {proceedings} +{ output.bibitem + format.editors output + editor format.key output + new.block + format.btitle "title" output.check + format.bvolume output + format.number.series output + address output + format.date "year" output.check + new.sentence + organization output + publisher output + format.isbn output + format.doi output + format.url output + new.block + note output + fin.entry +} + +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check + author format.key output + new.block + format.title "title" output.check + new.block + format.tr.number output.nonnull + institution "institution" output.check + address output + format.date "year" output.check + format.url output + new.block + note output + fin.entry +} + +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check + author format.key output + new.block + format.title "title" output.check + new.block + note "note" output.check + format.date output + format.url output + fin.entry +} + +FUNCTION {default.type} { misc } + + +MACRO {jan} {"January"} + +MACRO {feb} {"February"} + +MACRO {mar} {"March"} + +MACRO {apr} {"April"} + +MACRO {may} {"May"} + +MACRO {jun} {"June"} + +MACRO {jul} {"July"} + +MACRO {aug} {"August"} + +MACRO {sep} {"September"} + +MACRO {oct} {"October"} + +MACRO {nov} {"November"} + +MACRO {dec} {"December"} + + + +MACRO {acmcs} {"ACM Computing Surveys"} + +MACRO {acta} {"Acta Informatica"} + +MACRO {cacm} {"Communications of the ACM"} + +MACRO {ibmjrd} {"IBM Journal of Research and Development"} + +MACRO {ibmsj} {"IBM Systems Journal"} + +MACRO {ieeese} {"IEEE Transactions on Software Engineering"} + +MACRO {ieeetc} {"IEEE Transactions on Computers"} + +MACRO {ieeetcad} + {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} + +MACRO {ipl} {"Information Processing Letters"} + +MACRO {jacm} {"Journal of the ACM"} + +MACRO {jcss} {"Journal of Computer and System Sciences"} + +MACRO {scp} {"Science of Computer Programming"} + +MACRO {sicomp} {"SIAM Journal on Computing"} + +MACRO {tocs} {"ACM Transactions on Computer Systems"} + +MACRO {tods} {"ACM Transactions on Database Systems"} + +MACRO {tog} {"ACM Transactions on Graphics"} + +MACRO {toms} {"ACM Transactions on Mathematical Software"} + +MACRO {toois} {"ACM Transactions on Office Information Systems"} + +MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} + +MACRO {tcs} {"Theoretical Computer Science"} + + +READ + +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 {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 {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.short.authors} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.label + { type$ "proceedings" = + 'editor.key.organization.label + { type$ "manual" = + 'author.key.organization.label + 'author.key.label + if$ + } + if$ + } + if$ + 'short.list := +} + +FUNCTION {calc.label} +{ calc.short.authors + short.list + "(" + * + year duplicate$ empty$ + short.list key field.or.null = or + { pop$ "" } + 'skip$ + if$ + * + 'label := +} + +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" * year field.or.null * " " * } + '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 {presort} +{ calc.label + label sortify + " " + * + type$ "book" = + type$ "inbook" = + or + 'author.editor.sort + { type$ "proceedings" = + 'editor.organization.sort + { type$ "manual" = + 'author.organization.sort + 'author.sort + if$ + } + if$ + } + if$ + " " + * + year field.or.null sortify + * + " " + * + cite$ + * + #1 entry.max$ substring$ + 'sort.label := + sort.label * + #1 entry.max$ substring$ + 'sort.key$ := +} + +ITERATE {presort} + +SORT + +STRINGS { longest.label last.label next.extra } + +INTEGERS { longest.label.width last.extra.num number.label } + +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} +{ 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 := +} + +FUNCTION {reverse.pass} +{ 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 := +} + +EXECUTE {initialize.longest.label} + +ITERATE {forward.pass} + +REVERSE {reverse.pass} + +FUNCTION {bib.sort.order} +{ sort.label 'sort.key$ := +} + +ITERATE {bib.sort.order} + +SORT + +FUNCTION {begin.bib} +{ 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]{\texttt{#1}}" + write$ newline$ + "\expandafter\ifx\csname urlstyle\endcsname\relax" + write$ newline$ + " \providecommand{\doi}[1]{doi: #1}\else" + write$ newline$ + " \providecommand{\doi}{doi: \begingroup \urlstyle{rm}\Url}\fi" + write$ newline$ +} + +EXECUTE {begin.bib} + +EXECUTE {init.state.consts} + +ITERATE {call.type$} + +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} + +EXECUTE {end.bib} diff --git a/generators/refs.bib b/generators/refs.bib new file mode 100755 index 0000000..565e9f3 --- /dev/null +++ b/generators/refs.bib @@ -0,0 +1,14 @@ +@inproceedings{raftAlg, + author = {Ongaro, Diego and Ousterhout, John}, + title = {In Search of an Understandable Consensus Algorithm}, + booktitle = {Proceedings of the 2014 USENIX Conference on USENIX Annual Technical Conference}, + series = {USENIX ATC'14}, + year = {2014}, + isbn = {978-1-931971-10-2}, + location = {Philadelphia, PA}, + pages = {305--320}, + numpages = {16}, + acmid = {2643666}, + publisher = {USENIX Association}, + address = {Berkeley, CA, USA}, +} \ No newline at end of file diff --git a/generators/tableOfContentsAndListings.tex b/generators/tableOfContentsAndListings.tex new file mode 100644 index 0000000..615bff0 --- /dev/null +++ b/generators/tableOfContentsAndListings.tex @@ -0,0 +1,6 @@ +{ +\tableofcontents +\let\cleardoublepage\clearpage \listoffigures +\let\cleardoublepage\clearpage \listoftables +\let\cleardoublepage\clearpage \lstlistoflistings +} \ No newline at end of file diff --git a/report.tex b/report.tex new file mode 100644 index 0000000..dc6d60b --- /dev/null +++ b/report.tex @@ -0,0 +1,48 @@ +%---------------------------------------------------------------------------------------- +% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS +%---------------------------------------------------------------------------------------- + + +\documentclass[12pt,oneside,final,a4paper]{report} +\usepackage{generators/imports} +\include{generators/glossary} +\begin{document} +\include{generators/frontpage} % This is the titlepage +\include{generators/abstract} +\include{generators/tableOfContentsAndListings} +\pagenumbering{arabic} +\setcounter{page}{1} +\setlength{\parskip}{0.5cm plus4mm minus3mm} + +\include{chapter/introduction} + +\include{chapter/ch3/ch3} +% Include more chapters as required. +%%========================================= + +% Alternative 1 of printing glossaries & acronymes +%\renewcommand{\glossarypreamble}{\footnotesize} +%\printglossary[style=super, type=\glsdefaulttype] \let\cleardoublepage\clearpage +%\printglossary[style=super, type=\acronymtype] + + +%Alternative 2 +%Simplified way of printing glossaries, slower than alt 1, but has better compatibility +\printnoidxglossaries + +% Include more appendices as required. +%%========================================= +\clearpage +\DeclareRobustCommand{\VAN}[3]{#3} +\addcontentsline{toc}{chapter}{Bibliography} +\bibliographystyle{generators/myplainnat} +\bibliography{generators/refs} +\appendix +\titleformat{\chapter}[display] + {\normalfont\large\bfseries}% <- font for label "Appendix A", default \huge + {\chaptertitlename\ \thechapter} + {20pt} + {\large}% <- font for title, default \Huge + +\include{generators/appendix-a} +\end{document}