├── document ├── Thesis.lol ├── Bibliography.bib ├── make.bat ├── make.sh ├── BackMatter │ ├── Bibliography.tex │ ├── Conclusions.tex │ └── Recomendations.tex ├── MainMatter │ ├── Proposal.tex │ ├── Background.tex │ ├── Implementation.tex │ └── Introduction.tex ├── FrontMatter │ ├── Dedication.tex │ ├── SupervisorOpinion.tex │ ├── Thanks.tex │ ├── Contents.tex │ └── Abstract.tex ├── Graphics │ └── uhlogo.pdf ├── make_logo.bat ├── make_logo.sh ├── latexmkrc ├── Thesis.tex ├── uhthesis.cls └── babplain-uh.bst ├── README.md ├── .gitignore ├── .github └── workflows │ └── build-deploy.yml ├── .vscode └── settings.json └── LICENSE /document/Thesis.lol: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /document/Bibliography.bib: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /document/make.bat: -------------------------------------------------------------------------------- 1 | call make_logo.bat 2 | latexmk -------------------------------------------------------------------------------- /document/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | make_logo.sh 3 | latexmk -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Latex template for students thesis of MatCom 2 | -------------------------------------------------------------------------------- /document/BackMatter/Bibliography.tex: -------------------------------------------------------------------------------- 1 | \printbibliography[heading=bibintoc] 2 | -------------------------------------------------------------------------------- /document/MainMatter/Proposal.tex: -------------------------------------------------------------------------------- 1 | \chapter{Propuesta}\label{chapter:proposal} 2 | -------------------------------------------------------------------------------- /document/FrontMatter/Dedication.tex: -------------------------------------------------------------------------------- 1 | \begin{dedication} 2 | Dedicación 3 | \end{dedication} -------------------------------------------------------------------------------- /document/MainMatter/Background.tex: -------------------------------------------------------------------------------- 1 | \chapter{Estado del Arte}\label{chapter:state-of-the-art} 2 | -------------------------------------------------------------------------------- /document/BackMatter/Conclusions.tex: -------------------------------------------------------------------------------- 1 | \begin{conclusions} 2 | Conclusiones 3 | \end{conclusions} 4 | -------------------------------------------------------------------------------- /document/FrontMatter/SupervisorOpinion.tex: -------------------------------------------------------------------------------- 1 | \begin{opinion} 2 | Opiniones de los tutores 3 | \end{opinion} -------------------------------------------------------------------------------- /document/FrontMatter/Thanks.tex: -------------------------------------------------------------------------------- 1 | \begin{acknowledgements} 2 | Agradecimientos 3 | \end{acknowledgements} -------------------------------------------------------------------------------- /document/Graphics/uhlogo.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matcom/thesis/HEAD/document/Graphics/uhlogo.pdf -------------------------------------------------------------------------------- /document/make_logo.bat: -------------------------------------------------------------------------------- 1 | inkscape -D --export-filename=.\Graphics\uhlogo.pdf --export-latex .\Graphics\uhlogo.svg -------------------------------------------------------------------------------- /document/BackMatter/Recomendations.tex: -------------------------------------------------------------------------------- 1 | \begin{recomendations} 2 | Recomendaciones 3 | \end{recomendations} 4 | -------------------------------------------------------------------------------- /document/make_logo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | inkscape -D --export-filename=.\Graphics\uhlogo.pdf --export-latex .\Graphics\uhlogo.svg -------------------------------------------------------------------------------- /document/MainMatter/Implementation.tex: -------------------------------------------------------------------------------- 1 | \chapter{Detalles de Implementación y Experimentos}\label{chapter:implementation} 2 | -------------------------------------------------------------------------------- /document/FrontMatter/Contents.tex: -------------------------------------------------------------------------------- 1 | \tableofcontents 2 | \listoffigures 3 | % \listoftables 4 | % \listofalgorithms 5 | \lstlistoflistings -------------------------------------------------------------------------------- /document/latexmkrc: -------------------------------------------------------------------------------- 1 | $pdf_mode = 1; 2 | $pdflatex = 'pdflatex -synctex=1 -interaction=nonstopmode'; 3 | @default_files = ('Thesis.tex'); 4 | -------------------------------------------------------------------------------- /document/MainMatter/Introduction.tex: -------------------------------------------------------------------------------- 1 | \chapter*{Introducción}\label{chapter:introduction} 2 | \addcontentsline{toc}{chapter}{Introducción} 3 | -------------------------------------------------------------------------------- /document/FrontMatter/Abstract.tex: -------------------------------------------------------------------------------- 1 | \begin{resumen} 2 | Resumen en español 3 | \end{resumen} 4 | 5 | \begin{abstract} 6 | Resumen en inglés 7 | \end{abstract} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.aux 2 | *.bbl 3 | *.blg 4 | *.brf 5 | *.lof 6 | *.log 7 | *.lot 8 | *.out 9 | *.pdf 10 | !document/Graphics/uhlogo.pdf 11 | *.backup 12 | *.toc 13 | *~ 14 | *.nlo 15 | *.rar 16 | *.loa 17 | *.gz 18 | *.fdb_latexmk 19 | *.fls 20 | *.py 21 | *.bcf 22 | *.xml 23 | *.pdf_tex -------------------------------------------------------------------------------- /.github/workflows/build-deploy.yml: -------------------------------------------------------------------------------- 1 | name: Build & Deploy 2 | on: 3 | push: 4 | branches: [ main ] 5 | workflow_dispatch: 6 | jobs: 7 | build-deploy: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Clone repo 11 | uses: actions/checkout@v2 12 | - name: LaTeX compilation 13 | uses: dante-ev/latex-action@2021-A 14 | with: 15 | root_file: Thesis.tex 16 | working_directory: document 17 | - name: Prepare for Deploy 18 | run: | 19 | mkdir build 20 | mv document/Thesis.pdf build/document.pdf 21 | - name: Deploy 🚀 22 | uses: JamesIves/github-pages-deploy-action@4.1.5 23 | with: 24 | branch: gh-pages 25 | folder: build 26 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.exclude": { 3 | "**/*.aux": true, 4 | "**/*.bbl": true, 5 | "**/*.blg": true, 6 | "**/*.brf": true, 7 | "**/*.lof": true, 8 | "**/*.log": true, 9 | "**/*.lot": true, 10 | "**/*.out": true, 11 | "**/*.pdf": true, 12 | "**/!Graphics/uhlogo.pdf": true, 13 | "**/*.backup": true, 14 | "**/*.toc": true, 15 | "**/*~": true, 16 | "**/*.nlo": true, 17 | "**/*.rar": true, 18 | "**/*.loa": true, 19 | "**/*.gz": true, 20 | "**/*.fdb_latexmk": true, 21 | "**/*.fls": true, 22 | "**/*.py": true, 23 | "**/*.bcf": true, 24 | "**/*.xml": true, 25 | "**/*.pdf_tex": true 26 | } 27 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 MatCom 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /document/Thesis.tex: -------------------------------------------------------------------------------- 1 | \documentclass[12pt,oneside]{uhthesis} 2 | \usepackage{subfigure} 3 | \usepackage[ruled,lined,linesnumbered,titlenumbered,algochapter,spanish,onelanguage]{algorithm2e} 4 | \usepackage{amsmath} 5 | \usepackage{amssymb} 6 | \usepackage{amsbsy} 7 | \usepackage{caption,booktabs} 8 | \captionsetup{ justification = centering } 9 | %\usepackage{mathpazo} 10 | \usepackage{float} 11 | \setlength{\marginparwidth}{2cm} 12 | \usepackage{todonotes} 13 | \usepackage{listings} 14 | \usepackage{xcolor} 15 | \usepackage{multicol} 16 | \usepackage{graphicx} 17 | \floatstyle{plaintop} 18 | \restylefloat{table} 19 | \addbibresource{Bibliography.bib} 20 | % \setlength{\parskip}{\baselineskip}% 21 | \renewcommand{\tablename}{Tabla} 22 | \renewcommand{\listalgorithmcfname}{Índice de Algoritmos} 23 | %\dontprintsemicolon 24 | \SetAlgoNoEnd 25 | 26 | \definecolor{codegreen}{rgb}{0,0.6,0} 27 | \definecolor{codegray}{rgb}{0.5,0.5,0.5} 28 | \definecolor{codepurple}{rgb}{0.58,0,0.82} 29 | \definecolor{backcolour}{rgb}{0.95,0.95,0.92} 30 | 31 | \lstdefinestyle{mystyle}{ 32 | backgroundcolor=\color{backcolour}, 33 | commentstyle=\color{codegreen}, 34 | keywordstyle=\color{purple}, 35 | numberstyle=\tiny\color{codegray}, 36 | stringstyle=\color{codepurple}, 37 | basicstyle=\ttfamily\footnotesize, 38 | breakatwhitespace=false, 39 | breaklines=true, 40 | captionpos=b, 41 | keepspaces=true, 42 | numbers=left, 43 | numbersep=5pt, 44 | showspaces=false, 45 | showstringspaces=false, 46 | showtabs=false, 47 | tabsize=4 48 | } 49 | 50 | \lstset{style=mystyle} 51 | 52 | \title{Título de la tesis} 53 | \author{\\\vspace{0.25cm}Nombre del autor} 54 | \advisor{\\\vspace{0.25cm}Nombre del primer tutor\\\vspace{0.2cm}Nombre del segundo tutor} 55 | \degree{Licenciado en (Matemática o Ciencia de la Computación)} 56 | \faculty{Facultad de Matemática y Computación} 57 | \date{Fecha\\\vspace{0.25cm}\href{https://github.com/username/repo}{github.com/username/repo}} 58 | \logo{Graphics/uhlogo} 59 | \makenomenclature 60 | 61 | \renewcommand{\vec}[1]{\boldsymbol{#1}} 62 | \newcommand{\diff}[1]{\ensuremath{\mathrm{d}#1}} 63 | \newcommand{\me}[1]{\mathrm{e}^{#1}} 64 | \newcommand{\pf}{\mathfrak{p}} 65 | \newcommand{\qf}{\mathfrak{q}} 66 | %\newcommand{\kf}{\mathfrak{k}} 67 | \newcommand{\kt}{\mathtt{k}} 68 | \newcommand{\mf}{\mathfrak{m}} 69 | \newcommand{\hf}{\mathfrak{h}} 70 | \newcommand{\fac}{\mathrm{fac}} 71 | \newcommand{\maxx}[1]{\max\left\{ #1 \right\} } 72 | \newcommand{\minn}[1]{\min\left\{ #1 \right\} } 73 | \newcommand{\lldpcf}{1.25} 74 | \newcommand{\nnorm}[1]{\left\lvert #1 \right\rvert } 75 | \renewcommand{\lstlistingname}{Ejemplo de código} 76 | \renewcommand{\lstlistlistingname}{Ejemplos de código} 77 | 78 | \begin{document} 79 | 80 | \frontmatter 81 | \maketitle 82 | 83 | \include{FrontMatter/Dedication} 84 | \include{FrontMatter/Thanks} 85 | \include{FrontMatter/SupervisorOpinion} 86 | \include{FrontMatter/Abstract} 87 | \include{FrontMatter/Contents} 88 | 89 | \mainmatter 90 | 91 | \include{MainMatter/Introduction} 92 | \include{MainMatter/Background} 93 | \include{MainMatter/Proposal} 94 | \include{MainMatter/Implementation} 95 | 96 | \backmatter 97 | 98 | \include{BackMatter/Conclusions} 99 | \include{BackMatter/Recomendations} 100 | \include{BackMatter/Bibliography} 101 | 102 | \end{document} -------------------------------------------------------------------------------- /document/uhthesis.cls: -------------------------------------------------------------------------------- 1 | % Created by Yasser González-Fernández 2 | % Created by Ariel Hernández Amador 3 | 4 | \NeedsTeXFormat{LaTeX2e} 5 | \ProvidesClass{uhthesis}[2011/04/12 0.1 uhthesis] 6 | 7 | \RequirePackage[utf8]{inputenc} 8 | 9 | \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}} 10 | \ProcessOptions 11 | \relax 12 | \LoadClass{book} 13 | \RequirePackage{mathptmx} 14 | \RequirePackage[T1]{fontenc} 15 | \RequirePackage{lmodern} 16 | 17 | \RequirePackage[spanish,es-ucroman]{babel} 18 | \RequirePackage[refpage, intoc, spanish]{nomencl} 19 | \RequirePackage{graphicx} 20 | \RequirePackage{xcolor} 21 | \RequirePackage[nottoc,notlof,notlot]{tocbibind} 22 | \RequirePackage{footmisc} 23 | \RequirePackage{csquotes} 24 | \RequirePackage[ 25 | style=apa, 26 | citestyle=authoryear, 27 | hyperref=true, 28 | backref=true 29 | ]{biblatex} 30 | \RequirePackage[linktocpage,breaklinks,colorlinks,% 31 | linkcolor=black,anchorcolor=black,citecolor=black,% 32 | filecolor=black,menucolor=black,runcolor=black,% 33 | urlcolor=black]{hyperref} 34 | 35 | % fancyhdr settings from texlive-doc 36 | \RequirePackage{fancyhdr} 37 | \fancypagestyle{plain}{% 38 | \fancyhf{} % clear all header and footer fields 39 | \fancyfoot[C]{\bfseries \thepage} % except the center 40 | \renewcommand{\headrulewidth}{0pt} 41 | \renewcommand{\footrulewidth}{0pt}} 42 | 43 | \fancyhf{} 44 | \if@twoside 45 | \renewcommand{\chaptermark}[1]{\markboth{\small \ \chaptername\ \thechapter. \ #1}{}} 46 | \renewcommand{\sectionmark}[1]{\markright{\thesection \ \ #1}} 47 | \fancyhead[L]{\slshape \leftmark} 48 | \fancyhead[R]{\thepage} 49 | \fancyhead[LO]{\slshape \rightmark} 50 | \fancyhead[RO,LE]{\textbf{\thepage}} 51 | \fancyhead[RE]{\slshape \leftmark} 52 | \else 53 | \renewcommand{\chaptermark}[1]{\markboth{\small \ \chaptername\ \thechapter. \ #1}{}} 54 | \fancyhead[L]{\slshape \leftmark} 55 | \fancyhead[R]{\thepage} 56 | \fi 57 | \renewcommand{\headheight}{28pt} 58 | 59 | \setlength\oddsidemargin{30.1\p@} 60 | \setlength\evensidemargin{30.1\p@} 61 | \setlength\marginparwidth{30.1\p@} 62 | \marginparsep 8pt 63 | \topmargin 0pt 64 | \headsep .5in 65 | \textheight 8.1in 66 | \textwidth 6in 67 | 68 | % More liberal float placement from BYUPhys.cls. 69 | \renewcommand{\topfraction}{0.9} 70 | \renewcommand{\bottomfraction}{0.8} 71 | \setcounter{topnumber}{2} 72 | \setcounter{bottomnumber}{2} 73 | \setcounter{totalnumber}{4} 74 | \renewcommand{\textfraction}{0.07} 75 | 76 | % Whole biblatex hyperref to bibliography 77 | \DeclareCiteCommand{\cite} 78 | {\usebibmacro{prenote}} 79 | {\usebibmacro{citeindex}% 80 | \printtext[bibhyperref]{\usebibmacro{cite}}} 81 | {\multicitedelim} 82 | {\usebibmacro{postnote}} 83 | 84 | \DeclareCiteCommand*{\cite} 85 | {\usebibmacro{prenote}} 86 | {\usebibmacro{citeindex}% 87 | \printtext[bibhyperref]{\usebibmacro{citeyear}}} 88 | {\multicitedelim} 89 | {\usebibmacro{postnote}} 90 | 91 | \DeclareCiteCommand{\parencite}[\mkbibparens] 92 | {\usebibmacro{prenote}} 93 | {\usebibmacro{citeindex}% 94 | \printtext[bibhyperref]{\usebibmacro{cite}}} 95 | {\multicitedelim} 96 | {\usebibmacro{postnote}} 97 | 98 | \DeclareCiteCommand*{\parencite}[\mkbibparens] 99 | {\usebibmacro{prenote}} 100 | {\usebibmacro{citeindex}% 101 | \printtext[bibhyperref]{\usebibmacro{citeyear}}} 102 | {\multicitedelim} 103 | {\usebibmacro{postnote}} 104 | 105 | \DeclareCiteCommand{\footcite}[\mkbibfootnote] 106 | {\usebibmacro{prenote}} 107 | {\usebibmacro{citeindex}% 108 | \printtext[bibhyperref]{ \usebibmacro{cite}}} 109 | {\multicitedelim} 110 | {\usebibmacro{postnote}} 111 | 112 | \DeclareCiteCommand{\footcitetext}[\mkbibfootnotetext] 113 | {\usebibmacro{prenote}} 114 | {\usebibmacro{citeindex}% 115 | \printtext[bibhyperref]{\usebibmacro{cite}}} 116 | {\multicitedelim} 117 | {\usebibmacro{postnote}} 118 | 119 | \DeclareCiteCommand{\textcite} 120 | {\boolfalse{cbx:parens}} 121 | {\usebibmacro{citeindex}% 122 | \printtext[bibhyperref]{\usebibmacro{textcite}}} 123 | {\ifbool{cbx:parens} 124 | {\bibcloseparen\global\boolfalse{cbx:parens}} 125 | {}% 126 | \multicitedelim} 127 | {\usebibmacro{textcite:postnote}} 128 | 129 | % % Backreferences in the bibliography. 130 | % \backrefspanish 131 | % \renewcommand{\backref}[1]{} 132 | % \renewcommand{\backrefalt}[4]{% 133 | % \ifcase #1 \relax% 134 | % \or (Citado en la página~#2).% 135 | % \else (Citado en las páginas~#2).% 136 | % \fi% 137 | % } 138 | % \btxifchangecaseoff 139 | % \renewcommand{\btxselectlanguage}[1]{\relax} 140 | 141 | % % Book edition numbers. 142 | % \declarebtxcommands{spanish}{% 143 | % \def\btxnumeralshort#1{#1.^a}% 144 | % \def\btxnumerallong#1{% 145 | % \ifnumber{#1}{% 146 | % \ifcase#1 0\or 147 | % primera\or segunda\or tercera\or cuarta\or quinta\or 148 | % sexta\or séptima\or octava\or novena\or décima\else 149 | % #1.^a% 150 | % \fi% 151 | % }% 152 | % {#1}% 153 | % }% 154 | % } 155 | 156 | \renewcommand{\nomname}{Glosario} 157 | \newcommand{\advisor}[1]{\def\@advisor{#1}} 158 | \newcommand{\degree}[1]{\def\@degree{#1}} 159 | \newcommand{\faculty}[1]{\def\@faculty{#1}} 160 | \newcommand{\logo}[1]{\def\@logo{#1}} 161 | 162 | \newenvironment{opinion}% 163 | {\chapter*{Opinión del tutor}}% 164 | {} 165 | \newenvironment{acknowledgements}% 166 | {\chapter*{Agradecimientos}}% 167 | {} 168 | \newenvironment{resumen}% 169 | {\chapter*{Resumen}}% 170 | {} 171 | \newenvironment{abstract}% 172 | {\chapter*{Abstract}}% 173 | {} 174 | \newenvironment{introduction}% 175 | {\cleardoublepage% 176 | \phantomsection% 177 | \addcontentsline{toc}{chapter}{Introducción}% 178 | \chapter*{Introducción}}% 179 | {} 180 | \newenvironment{conclusions}% 181 | {\cleardoublepage% 182 | \phantomsection% 183 | \addcontentsline{toc}{chapter}{Conclusiones}% 184 | \chapter*{Conclusiones}}% 185 | {} 186 | \newenvironment{recomendations}% 187 | {\cleardoublepage% 188 | \phantomsection% 189 | \addcontentsline{toc}{chapter}{Recomendaciones}% 190 | \chapter*{Recomendaciones}}% 191 | {} 192 | \newenvironment{dedication}% 193 | {\cleardoublepage% 194 | \thispagestyle{empty}% 195 | \vskip 3.5cm% 196 | \begin{flushright}}% 197 | {\end{flushright}} 198 | 199 | \newtheorem{theorem}{Teorema}[chapter] 200 | \newtheorem{definition}{Definición}[chapter] 201 | \newtheorem{lemma}{Lema}[chapter] 202 | 203 | 204 | \AtBeginDocument{% 205 | % \hypersetup{pdftitle=\@title,pdfauthor=\@author}% 206 | % Renaming cuadro to tabla. 207 | \renewcommand{\listtablename}{Índice de tablas}% 208 | \renewcommand{\tablename}{Tabla}% 209 | } 210 | 211 | % The title page. 212 | \def\maketitle{% 213 | \thispagestyle{empty}% 214 | \begin{center} 215 | {\large Universidad de La Habana} \\ \@faculty \\ 216 | \vskip 0.25cm 217 | \includegraphics[width=1.75cm]{\@logo} \\ 218 | \vfill 219 | {\LARGE \textbf{\@title}} \\ 220 | \vskip 2cm 221 | {\Large Autor: \textbf{\@author}} \\ 222 | \vskip 0.5cm 223 | {\Large Tutores: \textbf{\@advisor}} \\ 224 | \vfill 225 | {\large Trabajo de Diploma \\presentado en opción al título de \\ \@degree} \\ 226 | \vskip 1cm 227 | \@date 228 | \end{center} 229 | } 230 | 231 | \def\frontmatter{% 232 | \pagenumbering{roman} 233 | \pagestyle{empty} 234 | } 235 | 236 | \def\mainmatter{% 237 | \cleardoublepage% 238 | \pagenumbering{arabic} 239 | \pagestyle{fancy} 240 | } 241 | 242 | \def\backmatter{% 243 | \pagestyle{plain} 244 | } 245 | 246 | % Created by Yasser González-Fernández -------------------------------------------------------------------------------- /document/babplain-uh.bst: -------------------------------------------------------------------------------- 1 | %% 2 | %% This is file `babplain.bst', 3 | %% generated with the docstrip utility. 4 | %% 5 | %% The original source files were: 6 | %% 7 | %% babelbib.dtx (with options: `bst,bststd') 8 | %% 9 | %% babelbib package 10 | %% 11 | %% Copyright 2003--2009 Harald Harders 12 | %% 13 | %% This program can be redistributed and/or modified under the terms 14 | %% of the LaTeX Project Public License Distributed from CTAN 15 | %% archives in directory macros/latex/base/lppl.txt; either 16 | %% version 1 of the License, or any later version. 17 | %% 18 | %% h.harders@tu-bs.de 19 | %% 20 | %% 2009/10/10 v1.29 babelbib: multilingual bibliographies (HH) 21 | ENTRY 22 | { address 23 | annote 24 | annotelanguage 25 | author 26 | booktitle 27 | chapter 28 | edition 29 | editor 30 | howpublished 31 | institution 32 | isbn 33 | issn 34 | journal 35 | key 36 | language 37 | month 38 | note 39 | number 40 | organization 41 | pages 42 | publisher 43 | school 44 | series 45 | title 46 | type 47 | url 48 | urldate 49 | volume 50 | year 51 | } 52 | {} 53 | { label } 54 | 55 | INTEGERS 56 | { output.state 57 | before.all 58 | mid.sentence 59 | after.sentence 60 | after.block 61 | before.title 62 | } 63 | 64 | STRINGS 65 | { s 66 | t 67 | language.state 68 | change.temp 69 | isbn.command 70 | } 71 | 72 | FUNCTION {init.state.consts} 73 | { #0 'before.all := 74 | #1 'mid.sentence := 75 | #2 'after.sentence := 76 | #3 'after.block := 77 | #4 'before.title := 78 | "nostate" 'language.state := 79 | } 80 | 81 | FUNCTION {not} 82 | { { #0 } 83 | { #1 } 84 | if$ 85 | } 86 | 87 | FUNCTION {and} 88 | { 'skip$ 89 | { pop$ #0 } 90 | if$ 91 | } 92 | 93 | FUNCTION {or} 94 | { { pop$ #1 } 95 | 'skip$ 96 | if$ 97 | } 98 | 99 | FUNCTION {language.change.case} 100 | { 101 | 'change.temp := 102 | 't := 103 | "\btxifchangecase {" 104 | t change.temp change.case$ * 105 | "}{" * 106 | t * 107 | "}" * 108 | } 109 | 110 | FUNCTION {output.nonnull} 111 | { 's := 112 | output.state mid.sentence = 113 | { ", " * write$ } 114 | { output.state after.block = 115 | { add.period$ write$ 116 | newline$ 117 | "\newblock " write$ 118 | } 119 | { output.state before.all = 120 | 'write$ 121 | { 122 | output.state before.title = 123 | { "\btxauthorcolon\ " * write$ } 124 | { add.period$ " " * write$ } 125 | if$ 126 | } 127 | if$ 128 | } 129 | if$ 130 | mid.sentence 'output.state := 131 | } 132 | if$ 133 | s 134 | } 135 | 136 | FUNCTION {output} 137 | { duplicate$ empty$ 138 | 'pop$ 139 | 'output.nonnull 140 | if$ 141 | } 142 | 143 | FUNCTION {output.check} 144 | { 't := 145 | duplicate$ empty$ 146 | { pop$ "empty " t * " in " * cite$ * warning$ } 147 | 'output.nonnull 148 | if$ 149 | } 150 | 151 | FUNCTION {output.bibitem} 152 | { newline$ 153 | language empty$ 154 | { 155 | language.state "nolanguage" = 156 | 'skip$ 157 | { 158 | "empty language in " cite$ * warning$ 159 | "\expandafter\btxselectlanguage\expandafter {" 160 | "\btxfallbacklanguage}" * 161 | write$ newline$ 162 | } 163 | if$ 164 | "nolanguage" 'language.state := 165 | } 166 | { 167 | language.state language = 168 | 'skip$ 169 | { 170 | "\btxselectlanguage {" language * "}" * 171 | write$ newline$ 172 | } 173 | if$ 174 | language 'language.state := 175 | } 176 | if$ 177 | "\bibitem {" write$ 178 | cite$ write$ 179 | "}" write$ 180 | newline$ 181 | "" 182 | before.all 'output.state := 183 | } 184 | 185 | FUNCTION {output.isbn} 186 | { 187 | 'isbn.command := 188 | duplicate$ 189 | empty$ 190 | 'pop$ 191 | { 192 | 's := 193 | output.state mid.sentence = 194 | { 195 | isbn.command * " {, " * write$ 196 | s "}" * 197 | } 198 | { output.state after.block = 199 | { 200 | add.period$ 201 | write$ 202 | newline$ 203 | "\newblock " write$ 204 | isbn.command " {" * s * ".}" * 205 | } 206 | { output.state before.all = 207 | { 208 | write$ 209 | isbn.command " {" * write$ 210 | s "}" * 211 | } 212 | { 213 | output.state before.title = 214 | { 215 | "\btxauthorcolon\ " * write$ 216 | isbn.command " {" * write$ 217 | s "}" * 218 | } 219 | { 220 | add.period$ " " * write$ 221 | isbn.command " {" * write$ 222 | s ".}" * 223 | } 224 | if$ 225 | } 226 | if$ 227 | } 228 | if$ 229 | mid.sentence 'output.state := 230 | } 231 | if$ 232 | } 233 | if$ 234 | } 235 | 236 | FUNCTION {fin.entry} 237 | { add.period$ 238 | write$ 239 | newline$ 240 | } 241 | 242 | FUNCTION {new.block} 243 | { output.state before.all = 244 | 'skip$ 245 | { after.block 'output.state := } 246 | if$ 247 | } 248 | 249 | FUNCTION {new.sentence} 250 | { output.state after.block = 251 | 'skip$ 252 | { output.state before.all = 253 | 'skip$ 254 | { after.sentence 'output.state := } 255 | if$ 256 | } 257 | if$ 258 | } 259 | 260 | FUNCTION {after.authors} 261 | { output.state before.all = 262 | 'skip$ 263 | { before.title 'output.state := } 264 | if$ 265 | } 266 | 267 | FUNCTION {new.block.checka} 268 | { empty$ 269 | 'skip$ 270 | 'new.block 271 | if$ 272 | } 273 | 274 | FUNCTION {new.block.checkb} 275 | { empty$ 276 | swap$ empty$ 277 | and 278 | 'skip$ 279 | 'new.block 280 | if$ 281 | } 282 | 283 | FUNCTION {new.block.checkc} 284 | { empty$ 285 | swap$ empty$ 286 | and 287 | 'skip$ 288 | 'after.authors 289 | if$ 290 | } 291 | 292 | FUNCTION {new.sentence.checka} 293 | { empty$ 294 | 'skip$ 295 | 'new.sentence 296 | if$ 297 | } 298 | 299 | FUNCTION {new.sentence.checkb} 300 | { empty$ 301 | swap$ empty$ 302 | and 303 | 'skip$ 304 | 'new.sentence 305 | if$ 306 | } 307 | 308 | FUNCTION {field.or.null} 309 | { duplicate$ empty$ 310 | { pop$ "" } 311 | 'skip$ 312 | if$ 313 | } 314 | 315 | FUNCTION {namefont} 316 | { duplicate$ empty$ 317 | { pop$ "" } 318 | { "\btxnamefont {" swap$ * "}" * } 319 | if$ 320 | } 321 | 322 | FUNCTION {lastnamefont} 323 | { duplicate$ empty$ 324 | { pop$ "" } 325 | { "\btxlastnamefont {" swap$ * "}" * } 326 | if$ 327 | } 328 | FUNCTION {titlefont} 329 | { duplicate$ empty$ 330 | { pop$ "" } 331 | { "\btxtitlefont {" swap$ * "}" * } 332 | if$ 333 | } 334 | FUNCTION {jtitlefont} 335 | { duplicate$ empty$ 336 | { pop$ "" } 337 | { "\btxjtitlefont {" swap$ * "}" * } 338 | if$ 339 | } 340 | FUNCTION {journalfont} 341 | { duplicate$ empty$ 342 | { pop$ "" } 343 | { "\btxjournalfont {" swap$ * "}" * } 344 | if$ 345 | } 346 | FUNCTION {publisherfont} 347 | { duplicate$ empty$ 348 | { pop$ "" } 349 | { "\btxpublisherfont {" swap$ * "}" * } 350 | if$ 351 | } 352 | FUNCTION {volumefont} 353 | { duplicate$ empty$ 354 | { pop$ "" } 355 | { "\btxvolumefont {" swap$ * "}" * } 356 | if$ 357 | } 358 | 359 | FUNCTION {etalfont} 360 | { duplicate$ empty$ 361 | { pop$ "" } 362 | { "\btxetalfont {" swap$ * "}" * } 363 | if$ 364 | } 365 | 366 | INTEGERS { nameptr namesleft numnames } 367 | 368 | FUNCTION {format.names} 369 | { 's := 370 | #1 'nameptr := 371 | s num.names$ 'numnames := 372 | numnames 'namesleft := 373 | { namesleft #0 > } 374 | { nameptr #1 > 375 | { 376 | s nameptr "{ff{\btxfnamespacelong } }{vv~}" format.name$ 377 | s nameptr "{ll}" format.name$ lastnamefont * 378 | s nameptr "{, jj}" format.name$ * 379 | 't := 380 | namesleft #1 > 381 | { ", " * t namefont * } 382 | { numnames #2 > 383 | { "\btxandcomma {}" * } 384 | 'skip$ 385 | if$ 386 | s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ "others" = 387 | { " " "\btxetalshort {.}" etalfont * * } 388 | { " \btxandlong {}\ " * t namefont * } 389 | if$ 390 | } 391 | if$ 392 | } 393 | { 394 | s nameptr "{ll}" format.name$ lastnamefont 395 | s nameptr "{,~jj}{, ff{\btxfnamespacelong }}{~vv}" 396 | format.name$ * namefont 397 | } 398 | if$ 399 | nameptr #1 + 'nameptr := 400 | namesleft #1 - 'namesleft := 401 | } 402 | while$ 403 | } 404 | 405 | FUNCTION {format.authors} 406 | { author empty$ 407 | { "" } 408 | { author format.names } 409 | if$ 410 | } 411 | 412 | FUNCTION {format.editors} 413 | { editor empty$ 414 | { "" } 415 | { editor format.names 416 | editor num.names$ #1 > 417 | { "\ (\btxeditorslong {})" * } 418 | { "\ (\btxeditorlong {})" * } 419 | if$ 420 | } 421 | if$ 422 | } 423 | FUNCTION {format.title} 424 | { title empty$ 425 | { "" } 426 | { title "t" language.change.case titlefont } 427 | if$ 428 | } 429 | FUNCTION {format.jtitle} 430 | { title empty$ 431 | { "" } 432 | { title "t" language.change.case jtitlefont } 433 | if$ 434 | } 435 | FUNCTION {n.dashify} 436 | { 't := 437 | "" 438 | { t empty$ not } 439 | { t #1 #1 substring$ "-" = 440 | { t #1 #2 substring$ "--" = not 441 | { "--" * 442 | t #2 global.max$ substring$ 't := 443 | } 444 | { { t #1 #1 substring$ "-" = } 445 | { "-" * 446 | t #2 global.max$ substring$ 't := 447 | } 448 | while$ 449 | } 450 | if$ 451 | } 452 | { t #1 #1 substring$ * 453 | t #2 global.max$ substring$ 't := 454 | } 455 | if$ 456 | } 457 | while$ 458 | } 459 | 460 | FUNCTION {format.date} 461 | { year empty$ 462 | { month empty$ 463 | { "" } 464 | { "there's a month but no year in " cite$ * warning$ 465 | month 466 | } 467 | if$ 468 | } 469 | { month empty$ 470 | 'year 471 | { "\btxprintmonthyear{.}{" 472 | month * "}{" * year * "}{long}" * 473 | } 474 | if$ 475 | } 476 | if$ 477 | } 478 | 479 | FUNCTION {format.btitle} 480 | { title titlefont 481 | } 482 | 483 | FUNCTION {tie.or.space.connect} 484 | { duplicate$ text.length$ #3 < 485 | { "~" } 486 | { "\ " } 487 | if$ 488 | swap$ * * 489 | } 490 | 491 | FUNCTION {volume.tie.or.space.connect} 492 | { duplicate$ text.length$ #3 < 493 | { "~" } 494 | { "\ " } 495 | if$ 496 | swap$ volumefont * * 497 | } 498 | 499 | FUNCTION {either.or.check} 500 | { empty$ 501 | 'pop$ 502 | { "can't use both " swap$ * " fields in " * cite$ * warning$ } 503 | if$ 504 | } 505 | 506 | FUNCTION {format.bvolume} 507 | { volume empty$ 508 | { "" } 509 | { output.state after.block = 510 | { "\Btxvolumelong {}" } 511 | { "\btxvolumelong {}" } 512 | if$ 513 | volume volume.tie.or.space.connect 514 | series empty$ 515 | 'skip$ 516 | { " \btxofserieslong {}\ " * series titlefont * } 517 | if$ 518 | "volume and number" number either.or.check 519 | } 520 | if$ 521 | } 522 | 523 | FUNCTION {format.number.series} 524 | { volume empty$ 525 | { number empty$ 526 | { series field.or.null } 527 | { output.state mid.sentence = 528 | { "\btxnumberlong {}" } 529 | { "\Btxnumberlong {}" } 530 | if$ 531 | number tie.or.space.connect 532 | series empty$ 533 | { "there's a number but no series in " cite$ * warning$ } 534 | { " \btxinserieslong {}\ " * series titlefont * } 535 | if$ 536 | } 537 | if$ 538 | } 539 | { "" } 540 | if$ 541 | } 542 | 543 | FUNCTION {format.edition} 544 | { edition empty$ 545 | { "" } 546 | { 547 | output.state mid.sentence = 548 | { edition "l" change.case$ } 549 | { edition "t" change.case$ } 550 | if$ 551 | "\btxnumerallong {" swap$ * 552 | "}~\btxeditionlong {}" * 553 | } 554 | if$ 555 | } 556 | 557 | FUNCTION {format.isbn} 558 | { isbn empty$ 559 | { "" } 560 | { "\mbox{\btxISBN~\btxISBNfont {" isbn * "}}" * } 561 | if$ 562 | } 563 | 564 | FUNCTION {format.issn} 565 | { issn empty$ 566 | { "" } 567 | { "\mbox{\btxISSN~\btxISSNfont {" issn * "}}" * } 568 | if$ 569 | } 570 | FUNCTION {format.url} 571 | { url empty$ 572 | { "" } 573 | { 574 | urldate empty$ 575 | { "{\latintext \btxurlfont{" url * "}}" * } 576 | { 577 | "{\latintext \btxurlfont{" url * "}}\empty " * 578 | "\btxurldatecomment {\btxkeywordlanguage {\btxurldatefont{" * 579 | urldate * "}}}" * 580 | } 581 | if$ 582 | } 583 | if$ 584 | } 585 | FUNCTION {write.annote} 586 | { annote empty$ 587 | 'skip$ 588 | { 589 | annotelanguage empty$ 590 | { "\btxkeywordlanguage {" } 591 | { "{\selectlanguage {" annotelanguage * "}" * } 592 | if$ 593 | "\btxannotation {" * annote * "}}" * 594 | write$ newline$ 595 | } 596 | if$ 597 | } 598 | INTEGERS { multiresult } 599 | 600 | FUNCTION {multi.page.check} 601 | { 't := 602 | #0 'multiresult := 603 | { multiresult not 604 | t empty$ not 605 | and 606 | } 607 | { t #1 #1 substring$ 608 | duplicate$ "-" = 609 | swap$ duplicate$ "," = 610 | swap$ "+" = 611 | or or 612 | { #1 'multiresult := } 613 | { t #2 global.max$ substring$ 't := } 614 | if$ 615 | } 616 | while$ 617 | multiresult 618 | } 619 | 620 | FUNCTION {format.pages} 621 | { pages empty$ 622 | { "" } 623 | { pages multi.page.check 624 | { "\btxpageslong {}" pages n.dashify tie.or.space.connect } 625 | { "\btxpagelong {}" pages tie.or.space.connect } 626 | if$ 627 | } 628 | if$ 629 | } 630 | 631 | FUNCTION {format.vol.num.pages} 632 | { volume field.or.null 633 | number empty$ 634 | 'skip$ 635 | { "(" number * ")" * * 636 | volume empty$ 637 | { "there's a number but no volume in " cite$ * warning$ } 638 | 'skip$ 639 | if$ 640 | } 641 | if$ 642 | pages empty$ 643 | 'skip$ 644 | { duplicate$ empty$ 645 | { pop$ format.pages } 646 | { ":" * pages n.dashify * } 647 | if$ 648 | } 649 | if$ 650 | } 651 | 652 | FUNCTION {format.chapter.pages} 653 | { chapter empty$ 654 | 'format.pages 655 | { type empty$ 656 | { "\btxchapterlong {}" } 657 | { type "l" language.change.case } 658 | if$ 659 | chapter tie.or.space.connect 660 | pages empty$ 661 | 'skip$ 662 | { ", " * format.pages * } 663 | if$ 664 | } 665 | if$ 666 | } 667 | 668 | FUNCTION {format.in.ed.booktitle} 669 | { booktitle empty$ 670 | { "" } 671 | { editor empty$ 672 | { "\Btxinlong {}\ " booktitle titlefont * } 673 | { "\Btxinlong {}\ " format.editors * ": " * booktitle titlefont * } 674 | if$ 675 | } 676 | if$ 677 | } 678 | 679 | FUNCTION {empty.misc.check} 680 | { author empty$ title empty$ howpublished empty$ 681 | month empty$ year empty$ note empty$ 682 | and and and and and 683 | key empty$ not and 684 | { "all relevant fields are empty in " cite$ * warning$ } 685 | 'skip$ 686 | if$ 687 | } 688 | 689 | FUNCTION {format.thesis.type} 690 | { type empty$ 691 | 'skip$ 692 | { pop$ 693 | type "t" language.change.case 694 | } 695 | if$ 696 | } 697 | 698 | FUNCTION {format.tr.number} 699 | { 700 | number empty$ 701 | { 702 | type empty$ 703 | { "\btxtechreplong {}" } 704 | { type "t" language.change.case } 705 | if$ 706 | } 707 | { 708 | type empty$ 709 | { "\Btxtechreplong {}" } 710 | { type "t" language.change.case } 711 | if$ 712 | number tie.or.space.connect 713 | } 714 | if$ 715 | } 716 | 717 | FUNCTION {format.article.crossref} 718 | { key empty$ 719 | { journal empty$ 720 | { "need key or journal for " cite$ * " to crossref " * crossref * 721 | warning$ 722 | "" 723 | } 724 | { "\Btxinlong {}\ " journal titlefont * } 725 | if$ 726 | } 727 | { "\Btxinlong {}\ " key titlefont * } 728 | if$ 729 | " \cite{" * crossref * "}" * 730 | } 731 | 732 | FUNCTION {format.crossref.editor} 733 | { 734 | editor #1 "{ll}{,~jj}{, ff}{~vv}" format.name$ namefont 735 | editor num.names$ duplicate$ 736 | #2 > 737 | { pop$ " " "\btxetalshort {.}" etalfont * * } 738 | { #2 < 739 | 'skip$ 740 | { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = 741 | { " " "\btxetalshort {.}" etalfont * * } 742 | { " \btxandlong {}\ " * editor #2 "{ff}{~vv}{~ll}{, jj}" 743 | format.name$ namefont * } 744 | if$ 745 | } 746 | if$ 747 | } 748 | if$ 749 | } 750 | 751 | FUNCTION {format.book.crossref} 752 | { volume empty$ 753 | { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ 754 | "\Btxinlong {}\ " 755 | } 756 | { "\Btxvolumelong {}" volume volume.tie.or.space.connect 757 | " \btxofserieslong {}\ " * 758 | } 759 | if$ 760 | editor empty$ 761 | editor field.or.null author field.or.null = 762 | or 763 | { key empty$ 764 | { series empty$ 765 | { "need editor, key, or series for " cite$ * " to crossref " * 766 | crossref * warning$ 767 | "" * 768 | } 769 | { series titlefont * } 770 | if$ 771 | } 772 | { key titlefont * } 773 | if$ 774 | } 775 | { format.crossref.editor * } 776 | if$ 777 | " \cite{" * crossref * "}" * 778 | } 779 | 780 | FUNCTION {format.incoll.inproc.crossref} 781 | { editor empty$ 782 | editor field.or.null author field.or.null = 783 | or 784 | { key empty$ 785 | { booktitle empty$ 786 | { "need editor, key, or booktitle for " cite$ * " to crossref " * 787 | crossref * warning$ 788 | "" 789 | } 790 | { "\Btxinlong {}\ " booktitle titlefont * } 791 | if$ 792 | } 793 | { "\Btxinlong {}\ " key titlefont * } 794 | if$ 795 | } 796 | { "\Btxinlong {}\ " format.crossref.editor * } 797 | if$ 798 | " \cite{" * crossref * "}" * 799 | } 800 | 801 | FUNCTION {article} 802 | { output.bibitem 803 | format.authors "author" output.check 804 | after.authors 805 | format.jtitle "title" output.check 806 | new.block 807 | crossref missing$ 808 | { journal 809 | title missing$ 810 | { titlefont } 811 | { journalfont } 812 | if$ 813 | "journal" output.check 814 | format.vol.num.pages output 815 | format.date "year" output.check 816 | } 817 | { format.article.crossref output.nonnull 818 | format.pages output 819 | } 820 | if$ 821 | format.issn "\ifbtxprintISSN" output.isbn 822 | new.block 823 | format.url output 824 | note output 825 | fin.entry 826 | write.annote 827 | } 828 | 829 | FUNCTION {book} 830 | { output.bibitem 831 | author empty$ 832 | { format.editors "author and editor" output.check } 833 | { format.authors output.nonnull 834 | crossref missing$ 835 | { "author and editor" editor either.or.check } 836 | 'skip$ 837 | if$ 838 | } 839 | if$ 840 | after.authors 841 | format.btitle "title" output.check 842 | crossref missing$ 843 | { format.bvolume output 844 | new.block 845 | format.number.series output 846 | new.sentence 847 | publisher "publisher" output.check publisherfont 848 | address output 849 | } 850 | { new.block 851 | format.book.crossref output.nonnull 852 | } 853 | if$ 854 | format.edition output 855 | format.date "year" output.check 856 | format.isbn "\ifbtxprintISBN" output.isbn 857 | new.block 858 | format.url output 859 | note output 860 | fin.entry 861 | write.annote 862 | } 863 | 864 | FUNCTION {booklet} 865 | { output.bibitem 866 | format.authors output 867 | after.authors 868 | format.title "title" output.check 869 | howpublished address new.block.checkb 870 | howpublished output 871 | address output 872 | format.date output 873 | new.block 874 | format.url output 875 | note output 876 | fin.entry 877 | write.annote 878 | } 879 | 880 | FUNCTION {inbook} 881 | { output.bibitem 882 | author empty$ 883 | { format.editors "author and editor" output.check } 884 | { format.authors output.nonnull 885 | crossref missing$ 886 | { "author and editor" editor either.or.check } 887 | 'skip$ 888 | if$ 889 | } 890 | if$ 891 | after.authors 892 | format.btitle "title" output.check 893 | crossref missing$ 894 | { format.bvolume output 895 | format.chapter.pages "chapter and pages" output.check 896 | new.block 897 | format.number.series output 898 | new.sentence 899 | publisher "publisher" output.check publisherfont 900 | address output 901 | } 902 | { format.chapter.pages "chapter and pages" output.check 903 | new.block 904 | format.book.crossref output.nonnull 905 | } 906 | if$ 907 | format.edition output 908 | format.date "year" output.check 909 | format.isbn "\ifbtxprintISBN" output.isbn 910 | new.block 911 | format.url output 912 | note output 913 | fin.entry 914 | write.annote 915 | } 916 | 917 | FUNCTION {incollection} 918 | { output.bibitem 919 | format.authors "author" output.check 920 | after.authors 921 | format.title "title" output.check 922 | new.block 923 | crossref missing$ 924 | { format.in.ed.booktitle "booktitle" output.check 925 | format.bvolume output 926 | format.number.series output 927 | format.chapter.pages output 928 | new.sentence 929 | publisher "publisher" output.check publisherfont 930 | address output 931 | format.edition output 932 | format.date "year" output.check 933 | } 934 | { format.incoll.inproc.crossref output.nonnull 935 | format.chapter.pages output 936 | } 937 | if$ 938 | format.isbn "\ifbtxprintISBN" output.isbn 939 | new.block 940 | format.url output 941 | note output 942 | fin.entry 943 | write.annote 944 | } 945 | 946 | FUNCTION {inproceedings} 947 | { output.bibitem 948 | format.authors "author" output.check 949 | after.authors 950 | format.title "title" output.check 951 | new.block 952 | crossref missing$ 953 | { format.in.ed.booktitle "booktitle" output.check 954 | format.bvolume output 955 | format.number.series output 956 | format.pages output 957 | address empty$ 958 | { organization publisher new.sentence.checkb 959 | organization output 960 | publisher publisherfont output 961 | format.date "year" output.check 962 | } 963 | { address output.nonnull 964 | format.date "year" output.check 965 | new.sentence 966 | organization output 967 | publisher publisherfont output 968 | } 969 | if$ 970 | } 971 | { format.incoll.inproc.crossref output.nonnull 972 | format.pages output 973 | } 974 | if$ 975 | format.isbn "\ifbtxprintISBN" output.isbn 976 | new.block 977 | format.url output 978 | note output 979 | fin.entry 980 | write.annote 981 | } 982 | 983 | FUNCTION {conference} { inproceedings } 984 | 985 | FUNCTION {manual} 986 | { output.bibitem 987 | author empty$ 988 | { organization empty$ 989 | 'skip$ 990 | { organization output.nonnull 991 | address output 992 | } 993 | if$ 994 | } 995 | { format.authors output.nonnull } 996 | if$ 997 | after.authors 998 | format.btitle "title" output.check 999 | author empty$ 1000 | { organization empty$ 1001 | { address new.block.checka 1002 | address output 1003 | } 1004 | 'skip$ 1005 | if$ 1006 | } 1007 | { organization address new.block.checkb 1008 | organization output 1009 | address output 1010 | } 1011 | if$ 1012 | format.edition output 1013 | format.date output 1014 | format.isbn "\ifbtxprintISBN" output.isbn 1015 | new.block 1016 | format.url output 1017 | note output 1018 | fin.entry 1019 | write.annote 1020 | } 1021 | 1022 | FUNCTION {mastersthesis} 1023 | { output.bibitem 1024 | format.authors "author" output.check 1025 | after.authors 1026 | format.title "title" output.check 1027 | new.block 1028 | "\btxmastthesis {}" format.thesis.type output.nonnull 1029 | school "school" output.check 1030 | new.block 1031 | address output 1032 | format.date "year" output.check 1033 | new.block 1034 | format.url output 1035 | note output 1036 | fin.entry 1037 | write.annote 1038 | } 1039 | 1040 | FUNCTION {misc} 1041 | { output.bibitem 1042 | format.authors output 1043 | title howpublished new.block.checkc 1044 | format.title output 1045 | howpublished new.block.checka 1046 | howpublished output 1047 | format.date output 1048 | format.isbn "\ifbtxprintISBN" output.isbn 1049 | new.block 1050 | format.issn "\ifbtxprintISSN" output.isbn 1051 | new.block 1052 | format.url output 1053 | note output 1054 | fin.entry 1055 | write.annote 1056 | empty.misc.check 1057 | } 1058 | 1059 | FUNCTION {phdthesis} 1060 | { output.bibitem 1061 | format.authors "author" output.check 1062 | after.authors 1063 | format.btitle "title" output.check 1064 | new.block 1065 | "\btxphdthesis {}" format.thesis.type output.nonnull 1066 | school "school" output.check 1067 | address output 1068 | format.date "year" output.check 1069 | format.isbn "\ifbtxprintISBN" output.isbn 1070 | new.block 1071 | format.url output 1072 | note output 1073 | fin.entry 1074 | write.annote 1075 | } 1076 | 1077 | FUNCTION {proceedings} 1078 | { output.bibitem 1079 | editor empty$ 1080 | { organization output } 1081 | { format.editors output.nonnull } 1082 | if$ 1083 | after.authors 1084 | format.btitle "title" output.check 1085 | format.bvolume output 1086 | format.number.series output 1087 | address empty$ 1088 | { editor empty$ 1089 | { publisher new.sentence.checka } 1090 | { organization publisher new.sentence.checkb 1091 | organization output 1092 | } 1093 | if$ 1094 | publisher publisherfont output 1095 | format.date "year" output.check 1096 | } 1097 | { address output.nonnull 1098 | format.date "year" output.check 1099 | new.sentence 1100 | editor empty$ 1101 | 'skip$ 1102 | { organization output } 1103 | if$ 1104 | publisher publisherfont output 1105 | } 1106 | if$ 1107 | format.isbn "\ifbtxprintISBN" output.isbn 1108 | new.block 1109 | format.url output 1110 | note output 1111 | fin.entry 1112 | write.annote 1113 | } 1114 | 1115 | FUNCTION {techreport} 1116 | { output.bibitem 1117 | format.authors "author" output.check 1118 | after.authors 1119 | format.title "title" output.check 1120 | new.block 1121 | format.tr.number output.nonnull 1122 | institution "institution" output.check 1123 | address output 1124 | format.date "year" output.check 1125 | format.isbn "\ifbtxprintISBN" output.isbn 1126 | new.block 1127 | format.url output 1128 | note output 1129 | fin.entry 1130 | write.annote 1131 | } 1132 | 1133 | FUNCTION {unpublished} 1134 | { output.bibitem 1135 | format.authors "author" output.check 1136 | after.authors 1137 | format.title "title" output.check 1138 | new.block 1139 | format.url output 1140 | note "note" output.check 1141 | format.date output 1142 | fin.entry 1143 | write.annote 1144 | } 1145 | 1146 | FUNCTION {default.type} { misc } 1147 | 1148 | MACRO {jan} {"1"} 1149 | MACRO {feb} {"2"} 1150 | MACRO {mar} {"3"} 1151 | MACRO {apr} {"4"} 1152 | MACRO {may} {"5"} 1153 | MACRO {jun} {"6"} 1154 | MACRO {jul} {"7"} 1155 | MACRO {aug} {"8"} 1156 | MACRO {sep} {"9"} 1157 | MACRO {oct} {"10"} 1158 | MACRO {nov} {"11"} 1159 | MACRO {dec} {"12"} 1160 | MACRO {acmcs} {"ACM Computing Surveys"} 1161 | MACRO {acta} {"Acta Informatica"} 1162 | MACRO {cacm} {"Communications of the ACM"} 1163 | MACRO {ibmjrd} {"IBM Journal of Research and Development"} 1164 | MACRO {ibmsj} {"IBM Systems Journal"} 1165 | MACRO {ieeese} {"IEEE Transactions on Software Engineering"} 1166 | MACRO {ieeetc} {"IEEE Transactions on Computers"} 1167 | MACRO {ieeetcad} 1168 | {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} 1169 | MACRO {ipl} {"Information Processing Letters"} 1170 | MACRO {jacm} {"Journal of the ACM"} 1171 | MACRO {jcss} {"Journal of Computer and System Sciences"} 1172 | MACRO {scp} {"Science of Computer Programming"} 1173 | MACRO {sicomp} {"SIAM Journal on Computing"} 1174 | MACRO {tocs} {"ACM Transactions on Computer Systems"} 1175 | MACRO {tods} {"ACM Transactions on Database Systems"} 1176 | MACRO {tog} {"ACM Transactions on Graphics"} 1177 | MACRO {toms} {"ACM Transactions on Mathematical Software"} 1178 | MACRO {toois} {"ACM Transactions on Office Information Systems"} 1179 | MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} 1180 | MACRO {tcs} {"Theoretical Computer Science"} 1181 | 1182 | READ 1183 | 1184 | FUNCTION {sortify} 1185 | { purify$ 1186 | "l" change.case$ 1187 | } 1188 | 1189 | INTEGERS { len } 1190 | 1191 | FUNCTION {chop.word} 1192 | { 's := 1193 | 'len := 1194 | s #1 len substring$ = 1195 | { s len #1 + global.max$ substring$ } 1196 | 's 1197 | if$ 1198 | } 1199 | 1200 | FUNCTION {sort.format.names} 1201 | { 's := 1202 | #1 'nameptr := 1203 | "" 1204 | s num.names$ 'numnames := 1205 | numnames 'namesleft := 1206 | { namesleft #0 > } 1207 | { nameptr #1 > 1208 | { " " * } 1209 | 'skip$ 1210 | if$ 1211 | s nameptr "{ll{ }}{ ff{ }}{vv{ } }{ jj{ }}" format.name$ 't := 1212 | nameptr numnames = t "others" = and 1213 | { "et al" * } 1214 | { t sortify * } 1215 | if$ 1216 | nameptr #1 + 'nameptr := 1217 | namesleft #1 - 'namesleft := 1218 | } 1219 | while$ 1220 | } 1221 | 1222 | FUNCTION {sort.format.title} 1223 | { 't := 1224 | "A " #2 1225 | "An " #3 1226 | "The " #4 t chop.word 1227 | chop.word 1228 | chop.word 1229 | sortify 1230 | #1 global.max$ substring$ 1231 | } 1232 | 1233 | FUNCTION {author.sort} 1234 | { author empty$ 1235 | { key empty$ 1236 | { "to sort, need author or key in " cite$ * warning$ 1237 | "" 1238 | } 1239 | { key sortify } 1240 | if$ 1241 | } 1242 | { author sort.format.names } 1243 | if$ 1244 | } 1245 | 1246 | FUNCTION {author.editor.sort} 1247 | { author empty$ 1248 | { editor empty$ 1249 | { key empty$ 1250 | { "to sort, need author, editor, or key in " cite$ * warning$ 1251 | "" 1252 | } 1253 | { key sortify } 1254 | if$ 1255 | } 1256 | { editor sort.format.names } 1257 | if$ 1258 | } 1259 | { author sort.format.names } 1260 | if$ 1261 | } 1262 | 1263 | FUNCTION {author.organization.sort} 1264 | { author empty$ 1265 | { organization empty$ 1266 | { key empty$ 1267 | { "to sort, need author, organization, or key in " cite$ * warning$ 1268 | "" 1269 | } 1270 | { key sortify } 1271 | if$ 1272 | } 1273 | { "The " #4 organization chop.word sortify } 1274 | if$ 1275 | } 1276 | { author sort.format.names } 1277 | if$ 1278 | } 1279 | 1280 | FUNCTION {editor.organization.sort} 1281 | { editor empty$ 1282 | { organization empty$ 1283 | { key empty$ 1284 | { "to sort, need editor, organization, or key in " cite$ * warning$ 1285 | "" 1286 | } 1287 | { key sortify } 1288 | if$ 1289 | } 1290 | { "The " #4 organization chop.word sortify } 1291 | if$ 1292 | } 1293 | { editor sort.format.names } 1294 | if$ 1295 | } 1296 | 1297 | FUNCTION {presort} 1298 | { 1299 | type$ "book" = 1300 | type$ "inbook" = 1301 | or 1302 | 'author.editor.sort 1303 | { type$ "proceedings" = 1304 | 'editor.organization.sort 1305 | { type$ "manual" = 1306 | 'author.organization.sort 1307 | 'author.sort 1308 | if$ 1309 | } 1310 | if$ 1311 | } 1312 | if$ 1313 | " " 1314 | * 1315 | year field.or.null sortify 1316 | * 1317 | " " 1318 | * 1319 | title field.or.null 1320 | sort.format.title 1321 | * 1322 | #1 entry.max$ substring$ 1323 | 'sort.key$ := 1324 | } 1325 | 1326 | ITERATE {presort} 1327 | 1328 | SORT 1329 | 1330 | STRINGS { longest.label } 1331 | 1332 | INTEGERS { number.label longest.label.width } 1333 | 1334 | FUNCTION {initialize.longest.label} 1335 | { "" 'longest.label := 1336 | #1 'number.label := 1337 | #0 'longest.label.width := 1338 | } 1339 | 1340 | FUNCTION {longest.label.pass} 1341 | { number.label int.to.str$ 'label := 1342 | number.label #1 + 'number.label := 1343 | label width$ longest.label.width > 1344 | { label 'longest.label := 1345 | label width$ 'longest.label.width := 1346 | } 1347 | 'skip$ 1348 | if$ 1349 | } 1350 | 1351 | EXECUTE {initialize.longest.label} 1352 | 1353 | ITERATE {longest.label.pass} 1354 | 1355 | FUNCTION {begin.bib} 1356 | { 1357 | preamble$ empty$ 1358 | 'skip$ 1359 | { preamble$ write$ newline$ } 1360 | if$ 1361 | "\begin{thebibliography}{" longest.label * "}" * write$ newline$ 1362 | " \providebibliographyfont{name}{}%" write$ newline$ 1363 | " \providebibliographyfont{lastname}{}%" write$ newline$ 1364 | " \providebibliographyfont{title}{\emph}%" write$ newline$ 1365 | " \providebibliographyfont{jtitle}{\btxtitlefont}%" write$ newline$ 1366 | " \providebibliographyfont{etal}{\emph}%" write$ newline$ 1367 | " \providebibliographyfont{journal}{}%" write$ newline$ 1368 | " \providebibliographyfont{volume}{}%" write$ newline$ 1369 | " \providebibliographyfont{ISBN}{\MakeUppercase}%" write$ newline$ 1370 | " \providebibliographyfont{ISSN}{\MakeUppercase}%" write$ newline$ 1371 | " \providebibliographyfont{url}{\url}%" write$ newline$ 1372 | " \providebibliographyfont{numeral}{}%" write$ newline$ 1373 | " \expandafter\btxselectlanguage\expandafter {\btxfallbacklanguage}" 1374 | write$ newline$ 1375 | } 1376 | 1377 | EXECUTE {begin.bib} 1378 | 1379 | EXECUTE {init.state.consts} 1380 | 1381 | ITERATE {call.type$} 1382 | 1383 | FUNCTION {end.bib} 1384 | { newline$ 1385 | "\end{thebibliography}" write$ newline$ 1386 | } 1387 | 1388 | EXECUTE {end.bib} 1389 | 1390 | --------------------------------------------------------------------------------