From a185ac0553753b6c33b9ae5fb754fc2cbd7c1a05 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fran=C3=A7ois=20Fleuret?= Date: Sat, 22 Apr 2023 09:04:56 +0200 Subject: [PATCH 1/1] Initial commit --- layout.tex | 531 ++++++++++++++++ plainnatmodified.bst | 1450 ++++++++++++++++++++++++++++++++++++++++++ test.bib | 26 + test.tex | 227 +++++++ 4 files changed, 2234 insertions(+) create mode 100644 layout.tex create mode 100644 plainnatmodified.bst create mode 100644 test.bib create mode 100644 test.tex diff --git a/layout.tex b/layout.tex new file mode 100644 index 0000000..411b039 --- /dev/null +++ b/layout.tex @@ -0,0 +1,531 @@ +% -*- mode: latex; mode: reftex; mode: auto-fill; mode: flyspell; coding: utf-8; tex-command: "pdflatex.sh"; TeX-master: "lbdl.tex" -*- + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{dsfont} +\usepackage{ifthen} +\usepackage{caption} + +\let\ordinal\relax +\usepackage[us]{datetime} +\newdateformat{dotdate}{\THEYEAR.\twodigit{\THEMONTH}.\twodigit{\THEDAY}} + +\usepackage{imakeidx} +\makeindex[intoc,columns=1] + +\usepackage{enumitem} +\setlist[itemize]{leftmargin=0pt,itemindent=1em,itemsep=2ex} +\setlist{nosep} % or \setlist{noitemsep} to leave space around whole list + +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage[osf]{libertine} +\usepackage{microtype} + +\usepackage[ + linktocpage=true, + unicode=true, + bookmarks=true, + bookmarksnumbered=false, + bookmarksopen=false, + breaklinks=true, + pdfborder={0 0 1}, + backref=page, + colorlinks=true, + linkcolor=links, + urlcolor=links, + citecolor=links, +]{hyperref} % PDF meta-information specification + +\urlstyle{same} + +\usepackage[object=vectorian]{pgfornament} +\def\textsep{% +\vskip1.5ex + +\centerline{\pgfornament[anchor=center,ydelta=0pt,width=2cm]{82}} + +\vskip0.5ex +} + +\AddToHook{cmd/section/before}{\clearpage} +\usepackage[section]{placeins} + +\usepackage{xspace} +\def\wordfig{Figure\xspace} +\def\wordtable{Table\xspace} +\def\wordchap{Chapter\xspace} + +\let\oldcenter\center +\let\oldendcenter\endcenter +\renewenvironment{center}{\setlength\topsep{0pt}\oldcenter}{\oldendcenter} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Math +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\setlength{\thinmuskip}{1mu} % by default it is equal to 3 mu +\setlength{\medmuskip}{1mu} % by default it is equal to 4 mu +\setlength{\thickmuskip}{3mu} % by default it is equal to 5 mu + +\makeatletter +\DeclareFontEncoding{LS1}{}{} +\DeclareFontSubstitution{LS1}{stix}{m}{n} +\DeclareMathAlphabet{\mathcal}{LS1}{stixscr}{m}{n} +\makeatother + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\def\given{\,\middle\vert\,} +\newcommand{\proba}{{P}} +\newcommand{\seq}{{S}} +\newcommand{\expect}{\mathds{E}} +\newcommand{\variance}{\mathds{V}} +\newcommand{\empexpect}{\hat{\mathds{E}}} +\newcommand{\mutinf}{\mathds{I}} +\newcommand{\empmutinf}{\hat{\mathds{I}}} +\newcommand{\entropy}{\mathds{H}} +\newcommand{\empentropy}{\hat{\mathds{H}}} +\newcommand{\ganG}{\mathbf{G}} +\newcommand{\ganD}{\mathbf{D}} +\newcommand{\ganF}{\mathbf{F}} + +\newcommand{\dkl}{\mathds{D}_{\mathsf{KL}}} +\newcommand{\djs}{\mathds{D}_{\mathsf{JS}}} + +\newcommand*{\vertbar}{\rule[-1ex]{0.5pt}{2.5ex}} +\newcommand*{\horzbar}{\rule[.5ex]{2.5ex}{0.5pt}} + +\def\positionalencoding{\operatorname{pos-enc}} +\def\concat{\operatorname{concat}} +\def\crossentropy{\LL_{\operatorname{ce}}} + +\def\embedding{\operatorname{embed}} +\def\mha{\operatorname{mha}} +\def\layernorm{\operatorname{layernorm}} +\def\batchnorm{\operatorname{batchnorm}} +\def\fullyconnected{\operatorname{fully-conn}} +\def\softargmax{\operatorname{softargmax}} +\def\selfattention{\operatorname{self-att}} +\def\crossattention{\operatorname{cross-att}} +\def\attention{\operatorname{att}} +\def\relu{\operatorname{relu}} +\def\gelu{\operatorname{gelu}} +\def\dropout{\operatorname{dropout}} +\def\resblock{\operatorname{resblock}} +\def\dresblock{\operatorname{dresblock}} +\def\reshape{\operatorname{reshape}} +\def\convtwod{\operatorname{conv-2d}} +\def\maxpool{\operatorname{maxpool}} +\def\avgpool{\operatorname{avgpool}} +%\def\samax{\Upsilon} +%\def\samax{\operatorname{samax}} +\def\sigmoid{\operatorname{sigm}} +\def\sample{\operatorname{sample}} +\def\diag{\operatorname{diag}} +\def\sign{\operatorname{sign}} +\def\argmax{\operatornamewithlimits{argmax}} +\def\argmin{\operatornamewithlimits{argmin}} + +%\usepackage{oldgerm} +\usepackage{relsize} + +%\newcommand{\li}[1]{^{\textgoth{#1}}} +\newcommand{\li}[1]{^{\scalebox{.5}{\textbf{#1}}}} +%% \newcommand{\li}[1]{^{\textbf{#1}}} +%\newcommand{\li}[1]{{|#1}} +\newcommand{\DATAVAR}{\mathbf{{\cal D}}} +\newcommand{\DATAVAL}{\mathbf{d}} +\newcommand{\BD}{\mathbf{D}} +\newcommand{\LL}{\mathcal{L}} +\newcommand{\Ll}{\mathcal{l}} +\newcommand{\RR}{\mathbb{R}} +\newcommand{\Lh}{\mathcal{h}} +\newcommand{\transpose}{^{\top}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% tikz +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\usepackage{tikz} +\usetikzlibrary{arrows,arrows.meta,calc} +\usetikzlibrary{patterns,backgrounds} +\usetikzlibrary{positioning,fit} +\usetikzlibrary{shapes.geometric,shapes.multipart} +\usetikzlibrary{patterns.meta,decorations.pathreplacing,calligraphy} +\usetikzlibrary{tikzmark} +\usetikzlibrary{decorations.pathmorphing} + +% remove the "There is no ... in font nullfont!" errors +\AtBeginEnvironment{tikzpicture}{\tracinglostchars=0\relax} + +%% \tikzset{ +%% } + +\definecolor{paramcolor}{rgb}{0.85,0.85,0.85} + +\tikzset{ + axes/.style={ + samples=1000, + %smooth, + scale=0.8, + }, +} + +\newlength{\layergap} +\setlength{\layergap}{2pt} +\newlength{\layerthickness} +\setlength{\layerthickness}{12pt} +\newlength{\layerwidth} +\setlength{\layerwidth}{4.5em} + +\newlength{\diminfoshift} +\setlength{\diminfoshift}{70pt} + +\tikzset{ + >={Straight Barb[angle'=80,scale=1.2]}, + deepnet/.style={ +%% background rectangle/.style={fill=paper}, +%% show background rectangle, + %every text node part/.style={align=center}, + rounded corners=0.5pt, + curly brace/.style={sharp corners,very thick,decoration={calligraphic brace,amplitude=0.20cm},decorate}, + font=\footnotesize, + halo/.style={ + %% on layer=background, + preaction={ + draw=white,line width=2pt,-,%shorten <=1pt,shorten >=1pt, + }, + }, + operator/.style={draw=black,inner sep=1pt}, + next/.style={above=##1\layergap of \tikzlastnode}, + next/.default={1}, + prev/.style={below=##1\layergap of \tikzlastnode}, + prev/.default={1}, + var/.style={inner sep=2pt}, + layer/.style={operator,minimum width=\layerwidth,minimum height=\layerthickness,text depth=1pt,text height=1.3ex}, + layer large/.style={layer,minimum height=1.75\layerthickness}, + layer small/.style={layer,minimum width=\layerthickness}, + info line/.style={ + draw=black,line width=0.4pt,dash pattern=on 0.4pt off 2pt, +%% draw=black!50,line width=0.2pt,-, + shorten >=2pt,shorten <=2pt, + }, + block definition/.style={draw=black,inner sep=2\layergap,dash pattern=on 2.5pt off 0.5pt}, + replicated/.style={ + draw=black, + inner sep=\layergap, dash pattern=on 2.5pt off 0.35pt, + label={[% + inner sep=2pt, + anchor=south west, + ]south east:$\times ##1$}, + }, + % + inputs/.style={ + text depth=1.5ex, + path picture={% + \draw[black,very thin] + ($(path picture bounding box.south west)+(1pt,6pt)$)--($(path picture bounding box.south east)+(-1pt,6pt)$) + % + node[midway,yshift=-15.5pt] {\scalebox{.5}{##1}}; + } + }, + % + param/.style={% + fill=paramcolor, +%% preaction={fill=white}, +%% pattern color=black!15, +%% pattern={Lines[line width=0.5pt,angle=-45,distance=1pt]} + }, + meta param/.style={label={[% + inner sep=0pt, + text depth=0pt, + anchor=south west, + shift={(1.5pt,0pt)}, + ]south east:{\tiny\color{blue}##1}}}, + } +} + +\newcommand{\diminfo}[3]{% + \coordinate (t) at ($(#2.north)+(\diminfoshift,0.5\layergap)$); + \node[inner sep=0pt,yshift=-0.5pt] (s) at (#1.north east-|t) {\tiny #3}; + \draw[info line] (#1.north east|-s)--(s); +} + +\newcommand{\defop}[2]{% +%% \coordinate (BL) at ($(#1.north)+(-0.49\textwidth, 4\layergap)$); +%% \coordinate (BR) at ($(#1.north)+( 0.49\textwidth, 4\layergap)$); +%% \coordinate (TL) at ($(#2.south-|#1)+(-0.49\textwidth,-4\layergap)$); +%% \coordinate (TR) at ($(#2.south-|#1)+( 0.49\textwidth,-4\layergap)$); + \begin{pgfinterruptboundingbox} + \node[anchor=south west,inner sep=2pt] (label) at #1 {#2}; + \draw[decorate,decoration={coil,amplitude=0.5pt,segment length=2pt,aspect=0}] (label.south west) -- (label.south east); + \end{pgfinterruptboundingbox} +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% style on layer + +\tikzset{% + on layer/.code={ + \pgfonlayer{#1}\begingroup + \aftergroup\endpgfonlayer + \aftergroup\endgroup + }} + +\makeatletter +%% fix for bb computation of double wires. +%% from https://tex.stackexchange.com/questions/130456/tikz-double-lines-are-shifted +\tikzset{ + only coordinates are relevant/.is choice, + only coordinates are relevant/.default=true, + only coordinates are relevant/true/.code={% + \tikz@addmode{\pgf@relevantforpicturesizefalse}}, + only coordinates are relevant/false/.code={% + \tikz@addmode{\pgf@relevantforpicturesizetrue}} +} +\makeatother + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\makeatletter +% extract interval `start:end` values +\def\get@interval@start#1:#2\@nil{#1} +\def\get@interval@end#1:#2\@nil{#2} +% get domain +\def\domainmin{\expandafter\get@interval@start\tikz@plot@domain\@nil} +\def\domainmax{\expandafter\get@interval@end\tikz@plot@domain\@nil} +% get range +\def\rangemin{\expandafter\get@interval@start\tikz@plot@range\@nil} +\def\rangemax{\expandafter\get@interval@end\tikz@plot@range\@nil} +\makeatother + +\usepackage{pgfplots} +\usepgfplotslibrary{patchplots,colormaps} +\pgfplotsset{compat = newest} + +\newcommand{\mygrid}[5]{% + \pgfmathsetmacro{\xmin}{#1+1} + \pgfmathsetmacro{\xmax}{#1+#3-1} + \pgfmathsetmacro{\ymin}{#2+1} + \pgfmathsetmacro{\ymax}{#2+#4-1} + \ifthenelse{\equal{#5}{}} + {\draw (#1,#2) rectangle ++(#3,#4);} + {\draw[fill=#5] (#1,#2) rectangle ++(#3,#4);} + \foreach \x in {\xmin,...,\xmax}{ + \draw (\x,#2)-- ++(0,#4); + } + \foreach \y in {\ymin,...,\ymax}{ + \draw (#1,\y)-- ++(#3,0); + } +} + +\newcommand{\amatrix}[7]{% + \begin{tikzpicture}[scale=0.2] + \ifthenelse{\equal{#7}{}} + {} + {\draw[draw=none,fill=#7] (#3,#4) rectangle ++(#5,#6);} + \mygrid{0}{0}{#1}{#2}{} + \end{tikzpicture}% +} + +\newcommand{\gridcube}[3]{% 7,4,6 + + \foreach \b in { 0,...,#2 }{ + \draw (0,\b,0)--++(#1,0,0)--++(0,0,#3); + } + + \foreach \d in { 0,...,#1 }{ + \draw (\d,0,0)--++(0,#2,0)--++(0,0,#3); + } + + \foreach \hw in { 0,...,#3 }{ + \draw (0,0,\hw)++(#1,0,0)--++(0,#2,0)--++(-#1,0,0); + } +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Bibliography +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\usepackage[square]{natbib} +\bibliographystyle{plainnatmodified} + +\newcommand{\biburl}[1]{\href{#1}{pdf}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Layout +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\cftsetindents{part}{0em}{1.8em} +\cftsetindents{chapter}{0em}{1.8em} +\cftsetindents{section}{1.8em}{2.2em} + +\setlength{\parindent}{0cm} +\setlength{\parskip}{2ex} + +\setstocksize{15cm}{8cm} +\settrimmedsize{\stockheight}{\stockwidth}{*} +\setlrmarginsandblock{8pt}{8pt}{*} +\setulmarginsandblock{14pt}{26pt}{*} +\setheadfoot{14pt}{14pt} +\setheaderspaces{*}{*}{*} + +\makepagestyle{littlebook} +\makeoddhead{littlebook}{}{}{} +\makeevenhead{littlebook}{}{}{} +\newcommand{\myfooter}{\footnotesize {\thepage \hskip 0.8em \raisebox{-2pt}{\vline height 8pt} \hskip 0.4em \thelastpage}} +\makeoddfoot{littlebook}{}{\myfooter}{} +\makeoddfoot{plain}{}{\myfooter}{} +\pagestyle{littlebook} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\renewcommand{\partnamefont}{\centering\sffamily\scshape\Huge} +\renewcommand{\partnumfont}{\sffamily\Huge} +\renewcommand{\parttitlefont}{\centering\sffamily\scshape\Huge} +\renewcommand{\beforepartskip}{\vspace*{\stretch{3}}} +\renewcommand{\afterpartskip}{% +\vspace*{\stretch{4}} +\newpage% +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\makechapterstyle{Tufte}{ +\renewcommand{\chapterheadstart}{\null \vskip3.0\onelineskip} +\renewcommand{\printchaptername}{\large\itshape\chaptername} +\renewcommand{\printchapternum}{\LARGE\thechapter \\} +\renewcommand{\afterchapternum}{} +\renewcommand{\printchaptertitle}[1]{ +\raggedright +\itshape\Huge{##1}} +\renewcommand{\afterchaptertitle}{ +\vskip3.5\onelineskip +}} +\chapterstyle{Tufte} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\setsecheadstyle{\sethangfrom{\noindent ##1}\raggedright\sffamily\itshape\Large} +\setbeforesecskip{-.9\onelineskip} +\setaftersecskip{.5\onelineskip} + +\setsubsecheadstyle{\sethangfrom{\noindent ##1}\raggedright\sffamily\large\itshape} +\setbeforesubsecskip{-.6\onelineskip} +\setaftersubsecskip{.5\onelineskip} + +\setsubsubsecheadstyle{\sethangfrom{\noindent ##1}\raggedright\sffamily\itshape} +\setbeforesubsubsecskip{-.5\onelineskip} +\setaftersubsubsecskip{.1\onelineskip} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\captiontitlefont{\itshape\small} +\captionnamefont{\small} +\newcommand{\likecaption}{\color{black}\itshape\small} + +\midsloppy + +\checkandfixthelayout + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% The \todo command +\newcounter{nbdrafts} +\setcounter{nbdrafts}{0} +\makeatletter +\newcommand{\checknbdrafts}{ +\ifnum \thenbdrafts > 0 +\@latex@warning@no@line{*WARNING* The document contains \thenbdrafts \space draft note(s)} +\fi} +\newcommand{\todo}[1]{\addtocounter{nbdrafts}{1}{\color{red} #1}} +\makeatother +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\definecolor{paper}{rgb}{0.95,0.95,0.95} +\definecolor{math}{rgb}{0.0,0.5,0.0} +%\definecolor{links}{rgb}{0.0,0.2,0.5} +\definecolor{links}{rgb}{0.0,0.2,0.85} +%\definecolor{hlcolor}{rgb}{0.8,1.0,0.85} + +\definecolor{blue}{rgb}{0.3,0.5,0.85} +\definecolor{red}{rgb}{0.65,0.0,0.0} +\definecolor{green}{rgb}{0.0,0.50,0.0} +\definecolor{dimmed}{rgb}{0.8,0.8,0.8} +\definecolor{orange}{rgb}{1.0,0.75,0.0} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Pretty underline, taken from +% https://tex.stackexchange.com/questions/36894/underline-omitting-the-descenders + +\usepackage{soul} +\usepackage{xcolor} +\usepackage{xparse} +\makeatletter + +\ExplSyntaxOn +\cs_new:Npn \white_text:n #1 + { + \fp_set:Nn \l_tmpa_fp {#1 * .01} + \llap{\textcolor{white}{\the\SOUL@syllable}\hspace{\fp_to_decimal:N \l_tmpa_fp em}} + \llap{\textcolor{white}{\the\SOUL@syllable}\hspace{-\fp_to_decimal:N \l_tmpa_fp em}} + } +\NewDocumentCommand{\whiten}{ m } + { + \int_step_function:nnnN {1}{1}{#1} \white_text:n + } +\ExplSyntaxOff + +\NewDocumentCommand{ \prettyul }{ D<>{5} O{0.2ex} O{0.1ex} +m } {% +\begingroup +\setul{#2}{#3}% +\def\SOUL@uleverysyllable{% + \setbox0=\hbox{\the\SOUL@syllable}% + \ifdim\dp0>\z@ + \SOUL@ulunderline{\phantom{\the\SOUL@syllable}}% + \whiten{#1}% + \llap{% + \the\SOUL@syllable + \SOUL@setkern\SOUL@charkern + }% + \else + \SOUL@ulunderline{% + \the\SOUL@syllable + \SOUL@setkern\SOUL@charkern + }% + \fi}% + \ul{#4}% +\endgroup +} + +\makeatother + +% end of prettyul +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\usepackage{accsupp} +\usepackage{xcolor, soul} + +\definecolor{hlcolor}{rgb}{1.0,1.0,0.5} +\definecolor{ulcolor}{rgb}{0.80,0.80,0.80} +\sethlcolor{hlcolor} +\setulcolor{ulcolor} +\newcommand{\keyterm}[2][]{% + \BeginAccSupp{method=escape,ActualText={#2}}% + \ifthenelse{\equal{#1}{}} + {\prettyul[2pt]{#2}\index{#2}} + {\prettyul[2pt]{#2}\index{#1}}% + \EndAccSupp{}% +} + +\newcommand{\gizmo}{% + \begin{tikzpicture}[scale=0.25] + \draw[draw=none,fill=red] (0,0) rectangle ++(1,1); + \draw[draw=none,fill=blue] (1,0) rectangle ++(1,1); + \draw[draw=none,fill=blue] (0,1) rectangle ++(1,1); + \draw[draw=none,fill=red] (1,1) rectangle ++(1,1); + \end{tikzpicture} +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/plainnatmodified.bst b/plainnatmodified.bst new file mode 100644 index 0000000..276d968 --- /dev/null +++ b/plainnatmodified.bst @@ -0,0 +1,1450 @@ +%% 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 + pdf + 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$ "" } + { "\textit{" swap$ * "}" * } + if$ +} + +INTEGERS { nameptr namesleft numnames } + +FUNCTION {format.names} +{ 's := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't := + nameptr #1 > + { + nameptr #3 + #1 + = + numnames #4 + > and + { "others" 't := + #1 'namesleft := } + 'skip$ + if$ + namesleft #1 > + { ", " * t * } + { + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + 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.pdf} +{ pdf empty$ + { "" } + { new.block "[\biburl{" pdf * "}]" * } + if$ +} + +FUNCTION {format.doi} +{ doi empty$ + { "" } + { new.block "\doi{" doi * "}" * } + if$ +} + +FUNCTION {format.title} +{ title empty$ + { "" } + { title } + 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.pdf 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.pdf 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.pdf 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.pdf 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.pdf 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.pdf 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.pdf 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.pdf 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.pdf 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.pdf 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.pdf 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.pdf 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.pdf 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/test.bib b/test.bib new file mode 100644 index 0000000..0116549 --- /dev/null +++ b/test.bib @@ -0,0 +1,26 @@ +@article{arxiv-1706.03762, + author={Vaswani, A. and Shazeer, N. and Parmar, N. and Uszkoreit, J. and Jones, L. and Gomez, A. and Kaiser, L. and Polosukhin, I.}, + title={Attention Is All You Need}, + journal={CoRR}, + volume={abs/1706.03762}, + year={2017}, + pdf={https://arxiv.org/pdf/1706.03762} +} + +@article{arxiv-1502.05767, + author={Baydin, A. and Pearlmutter, B. and Radul, A. and Siskind, J.}, + title={Automatic differentiation in machine learning: a survey}, + journal={CoRR}, + volume={abs/1502.05767}, + year={2015}, + pdf={https://arxiv.org/pdf/1502.05767} +} + +@article{arxiv-1907.07174, + author={Hendrycks, D. and Zhao, K. and Basart, S. and Steinhardt, J. and Song, D.}, + title={Natural Adversarial Examples}, + journal={CoRR}, + volume={abs/1907.07174}, + year={2019}, + pdf={https://arxiv.org/pdf/1907.07174} +} diff --git a/test.tex b/test.tex new file mode 100644 index 0000000..6178d03 --- /dev/null +++ b/test.tex @@ -0,0 +1,227 @@ +% -*- mode: latex; mode: reftex; mode: auto-fill; mode: flyspell; coding: utf-8; tex-command: "pdflatex.sh" -*- + +\documentclass[oneside,11pt]{memoir} + +\input{layout.tex} + +\usepackage{lipsum} + +\hypersetup{ + pdfauthor={xxxxxx}, + pdftitle={xxxxxx}, + pdfsubject={xxxxxx}, + pdfkeywords={xxxxxx}, + pdfproducer={LaTeX and TikZ}, + pdfcreator={pdflatex}, +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{document} + +\thispagestyle{empty} + +\begin{center} + +\vspace*{\stretch{1}} + +{\huge The Little Book\\[0.75ex] of\\[1.75ex] Something} + +\vspace*{4ex} + +xxx xxx + +\vspace*{\stretch{1}} + +\end{center} + +\newpage + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\vspace*{\stretch{1.25}} + +\lipsum[1-2] + +\vspace*{\stretch{1}} + +\begin{flushright} +\footnotesize beta-\dotdate\today +\end{flushright} + +\vspace*{-3ex} + +\newpage + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Table of content +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +{ +\everymath{\color{black}} +\tableofcontents* % Prints the table of contents +%\addcontentsline{toc}{chapter}{Contents} +} + +\clearpage + +\listoffigures* +\addcontentsline{toc}{chapter}{List of figures} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\chapter*{Foreword} +\addcontentsline{toc}{chapter}{Foreword} + +\keyterm[lorem]{Lorem} + +\lipsum[1-3] + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\part{Foundations} + + +%% This first part provides a minimal background about machine +%% learning, issues and techniques for efficient computation, and the +%% strategies to train a parametric model. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\chapter{Lorem} + +\cite{arxiv-1907.07174} + +\lipsum[1-10] + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\chapter{Ipsum} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{figure} + \center + \begin{tikzpicture}[deepnet] + \path + node[var] (X) {$X$} + coordinate[next=4,layer] (encoder start) + node[next=4,layer,param] (encoder embed) {$\embedding$} + node[next,layer small] (encoder sum) {$+$} + node[next=4,layer large,param] (encoder sa) {$\selfattention$} + coordinate[next=4,layer] (encoder end) + ; + + \node[var,left=10pt of encoder sum] (encoder pe) {$\positionalencoding$}; + + \path + node[var,above=8mm of encoder sa] (Z) {$Z$} + coordinate[next=4,layer] (decoder start) + node[next=4,layer,param] (decoder embed) {$\embedding$} + node[next,layer small] (decoder sum) {$+$} + node[next=4,layer large,param,text height=3.5ex,every text node part/.style={align=center}] (decoder sa) {$\operatorname{causal}$\\[-1pt]$\selfattention$} + node[next=4,param,layer large,inputs={$\hspace*{3pt}Q\hspace*{38pt}KV$}] (decoder ca) {$\crossattention$} + node[next=4,layer,param] (decoder readout) {$\fullyconnected$} + coordinate[next=4,layer] (end) + node[next=4,var] (Y) {$Y$} + ; + + \node[var,left=10pt of decoder sum] (decoder pe) {$\positionalencoding$}; + + \begin{scope}[on background layer] + \node[replicated=N,fit=(encoder sa)] {}; + \node[replicated=N,fit=(decoder sa) (decoder ca)] {}; + + \draw[halo] + (X)--(encoder start)--(encoder embed)--(encoder sum)--(encoder sa) + ; + + \draw[halo] + (Z)--(decoder start)--(decoder embed)--(decoder sum)--(decoder sa) + ; + + \draw[halo] (encoder pe)--(encoder sum); + \draw[halo,->] (decoder ca) -- (decoder readout) -- (Y); + + \draw[halo] (decoder pe)--(decoder sum); + + \coordinate (decoder ca q) at ($(decoder ca.south west)!0.5!(decoder ca.south)$); + \coordinate (decoder ca kv) at ($(decoder ca.south east)!0.5!(decoder ca.south)$); + \coordinate (decoder ca kv d) at ($(decoder ca kv)!0.5!(decoder ca kv|-decoder sa.north)$); + + \draw[halo] (decoder ca q)--(decoder ca q|-decoder sa.north); + %% \draw[halo] (decoder ca kv)|-(encoder end)--(encoder sa.north); + \draw[halo] (decoder ca kv)--(decoder ca kv d)--++(3.25\layerthickness,0)|-(encoder end)--(encoder sa.north); + \end{scope} + + \begin{pgfinterruptboundingbox} + + \node[fit=(encoder embed) (encoder pe) (encoder sa),xshift=-5pt] (encoder) {}; + + \draw[curly brace] + % + (encoder.south west) -- (encoder.north west) + % + node[midway,left,every text node part/.style={align=center},xshift=-0.5em,yshift=2pt] {\likecaption Encoder}; + + \node[fit=(decoder embed) (decoder pe) (decoder readout),xshift=-5pt] (decoder) {}; + + \draw[curly brace] + % + (decoder.south west) -- (decoder.north west) + % + node[midway,left,every text node part/.style={align=center},xshift=-0.5em,yshift=2pt] {\likecaption Decoder}; + + \setlength{\diminfoshift}{85pt} + \diminfo{X}{X}{$T$} + \diminfo{encoder embed}{X}{$T \times D$} + \diminfo{encoder sa}{X}{$T \times D$} + \diminfo{Z}{X}{$S$} + \diminfo{decoder embed}{X}{$S \times D$} + \diminfo{decoder ca}{X}{$S \times D$} + \diminfo{decoder readout}{X}{$S \times V$} + \end{pgfinterruptboundingbox} + + \end{tikzpicture} + + \caption[Transformer]{Original encoder-decoder + \keyterm[Transformer]{Transformer model} for sequence-to-sequence + translation \citep{arxiv-1706.03762}.}\label{fig:transformer} +\end{figure} + +\lipsum[1-10] + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\bibliography{test} + +%% If there is an index, it should follow the bibliography (see the +%% Manual, 14.62). Bibliography entries are listed in one alphabetical +%% sequence arranged by the surname of the first author or by title if +%% there is no author.25 Nov 2022 +%% +%% Bibliography - Chicago Citation Style, 17th Edition - Library + +\printindex + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\newpage + +\vspace*{\stretch{1}} + +\ifdefined\draft +\begin{center} + {\color{red} (draft, do not circulate)} +\end{center} +\else +This book is licensed under the +\href{https://creativecommons.org/licenses/by-nc-sa/4.0/}{Creative + Commons BY-NC-SA 4.0 International License.} +\fi + +\vspace*{\stretch{1}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\checknbdrafts + +\end{document} -- 2.39.5