commit ddde48d3b0307572be111f17441f245ff0c9adaa Author: Thomas Dehaeze Date: Thu Nov 27 18:41:23 2025 +0100 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0e3ab6a --- /dev/null +++ b/.gitignore @@ -0,0 +1,259 @@ +ltximg/ +*.autosave +slprj/ +matlab/slprj/ +*.slxc + + +# ============================================================ +# ============================================================ +# LATEX +# ============================================================ +# ============================================================ + +## Core latex/pdflatex auxiliary files: +*.aux +*.lof +*.log +*.lot +*.fls +*.out +*.toc +*.fmt +*.fot +*.cb +*.cb2 +.*.lb + +## Intermediate documents: +*.dvi +*.xdv +*-converted-to.* +# these rules might exclude image files for figures etc. +# *.ps +# *.eps +# *.pdf + +## Generated if empty string is given at "Please type another file name for output:" +.pdf + +## Bibliography auxiliary files (bibtex/biblatex/biber): +*.bbl +*.bcf +*.blg +*-blx.aux +*-blx.bib +*.run.xml + +## Build tool auxiliary files: +*.fdb_latexmk +*.synctex +*.synctex(busy) +*.synctex.gz +*.synctex.gz(busy) +*.pdfsync + +## Build tool directories for auxiliary files +# latexrun +latex.out/ + +## Auxiliary and intermediate files from other packages: +# algorithms +*.alg +*.loa + +# achemso +acs-*.bib + +# amsthm +*.thm + +# beamer +*.nav +*.pre +*.snm +*.vrb + +# changes +*.soc + +# cprotect +*.cpt + +# elsarticle (documentclass of Elsevier journals) +*.spl + +# endnotes +*.ent + +# fixme +*.lox + +# feynmf/feynmp +*.mf +*.mp +*.t[1-9] +*.t[1-9][0-9] +*.tfm + +#(r)(e)ledmac/(r)(e)ledpar +*.end +*.?end +*.[1-9] +*.[1-9][0-9] +*.[1-9][0-9][0-9] +*.[1-9]R +*.[1-9][0-9]R +*.[1-9][0-9][0-9]R +*.eledsec[1-9] +*.eledsec[1-9]R +*.eledsec[1-9][0-9] +*.eledsec[1-9][0-9]R +*.eledsec[1-9][0-9][0-9] +*.eledsec[1-9][0-9][0-9]R + +# glossaries +*.acn +*.acr +*.glg +*.glo +*.gls +*.glsdefs + +# gnuplottex +*-gnuplottex-* + +# gregoriotex +*.gaux +*.gtex + +# htlatex +*.4ct +*.4tc +*.idv +*.lg +*.trc +*.xref + +# hyperref +*.brf + +# knitr +*-concordance.tex +# TODO Comment the next line if you want to keep your tikz graphics files +*.tikz +*-tikzDictionary + +# listings +*.lol + +# makeidx +*.idx +*.ilg +*.ind +*.ist + +# minitoc +*.maf +*.mlf +*.mlt +*.mtc[0-9]* +*.slf[0-9]* +*.slt[0-9]* +*.stc[0-9]* + +# minted +_minted* +*.pyg + +# morewrites +*.mw + +# nomencl +*.nlg +*.nlo +*.nls + +# pax +*.pax + +# pdfpcnotes +*.pdfpc + +# sagetex +*.sagetex.sage +*.sagetex.py +*.sagetex.scmd + +# scrwfile +*.wrt + +# sympy +*.sout +*.sympy +sympy-plots-for-*.tex/ + +# pdfcomment +*.upa +*.upb + +# pythontex +*.pytxcode +pythontex-files-*/ + +# thmtools +*.loe + +# TikZ & PGF +*.dpth +*.md5 +*.auxlock + +# todonotes +*.tdo + +# easy-todo +*.lod + +# xmpincl +*.xmpi + +# xindy +*.xdy + +# xypic precompiled matrices +*.xyc + +# endfloat +*.ttt +*.fff + +# Latexian +TSWLatexianTemp* + +## Editors: +# WinEdt +*.bak +*.sav + +# Texpad +.texpadtmp + +# LyX +*.lyx~ + +# Kile +*.backup + +# KBibTeX +*~[0-9]* + +# auto folder when using emacs and auctex +./auto/* +*.el + +# expex forward references with \gathertags +*-tags.tex + +# standalone packages +*.sta diff --git a/inkscape/figs b/inkscape/figs new file mode 120000 index 0000000..30fa883 --- /dev/null +++ b/inkscape/figs @@ -0,0 +1 @@ +../paper/figs \ No newline at end of file diff --git a/inkscape/tikz.org b/inkscape/tikz.org new file mode 100644 index 0000000..b57d0de --- /dev/null +++ b/inkscape/tikz.org @@ -0,0 +1,20 @@ +#+TITLE: Nano Active Stabilization System +:DRAWER: +#+LANGUAGE: en +#+EMAIL: dehaeze.thomas@gmail.com +#+AUTHOR: Dehaeze Thomas + +#+PROPERTY: header-args:latex :headers '("\\usepackage{tikz}" "\\usepackage{import}" "\\import{$HOME/Cloud/tikz/org/}{config.tex}") +#+PROPERTY: header-args:latex+ :imagemagick t :fit yes +#+PROPERTY: header-args:latex+ :iminoptions -scale 100% -density 150 +#+PROPERTY: header-args:latex+ :imoutoptions -quality 100 +#+PROPERTY: header-args:latex+ :results file raw replace +#+PROPERTY: header-args:latex+ :buffer no +#+PROPERTY: header-args:latex+ :tangle no +#+PROPERTY: header-args:latex+ :eval no-export +#+PROPERTY: header-args:latex+ :exports results +#+PROPERTY: header-args:latex+ :mkdirp yes +#+PROPERTY: header-args:latex+ :output-dir figs +#+PROPERTY: header-args:latex+ :post pdf2svg(file=*this*, ext="png") +:END: + diff --git a/matlab/figs b/matlab/figs new file mode 120000 index 0000000..30fa883 --- /dev/null +++ b/matlab/figs @@ -0,0 +1 @@ +../paper/figs \ No newline at end of file diff --git a/matlab/index.org b/matlab/index.org new file mode 100644 index 0000000..baa6838 --- /dev/null +++ b/matlab/index.org @@ -0,0 +1,54 @@ +#+TITLE: Nano Active Stabilization System +:DRAWER: +#+LANGUAGE: en +#+EMAIL: dehaeze.thomas@gmail.com +#+AUTHOR: Dehaeze Thomas + +#+PROPERTY: header-args:matlab :session *MATLAB* +#+PROPERTY: header-args:matlab+ :comments no +#+PROPERTY: header-args:matlab+ :exports none +#+PROPERTY: header-args:matlab+ :results none +#+PROPERTY: header-args:matlab+ :eval no-export +#+PROPERTY: header-args:matlab+ :noweb yes +#+PROPERTY: header-args:matlab+ :mkdirp yes +#+PROPERTY: header-args:matlab+ :output-dir figs +#+PROPERTY: header-args:matlab+ :tangle dehaeze26_decoupling.m +:END: + +* Matlab Init :noexport:ignore: +#+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name) +<> +#+end_src + +#+begin_src matlab :exports none :results silent :noweb yes +<> +#+end_src + +#+begin_src matlab :eval no :noweb yes :results silent +<> +#+end_src + +#+begin_src matlab :noweb yes :results silent +<> + +%% Initialize Frequency Vector +freqs = logspace(0, 3, 1000); +#+end_src + +* Helping Functions :noexport: +:PROPERTIES: +:HEADER-ARGS:matlab+: :tangle no +:END: +** Initialize Path +#+NAME: m-init-path-tangle +#+BEGIN_SRC matlab +%% Path for functions, data and scripts +addpath('./src/'); % Path for functions +#+END_SRC + +** Initialize other elements +#+NAME: m-init-other +#+BEGIN_SRC matlab +%% Colors for the figures +colors = colororder; +#+END_SRC diff --git a/paper/.latexmkrc b/paper/.latexmkrc new file mode 100644 index 0000000..f318e18 --- /dev/null +++ b/paper/.latexmkrc @@ -0,0 +1,111 @@ +#!/bin/env perl + +# Shebang is only to get syntax highlighting right across GitLab, GitHub and IDEs. +# This file is not meant to be run, but read by `latexmk`. + +# ====================================================================================== +# Perl `latexmk` configuration file +# ====================================================================================== + +# ====================================================================================== +# PDF Generation/Building/Compilation +# ====================================================================================== + +@default_files=('dehaeze26_nass.tex'); + +# PDF-generating modes are: +# 1: pdflatex, as specified by $pdflatex variable (still largely in use) +# 2: postscript conversion, as specified by the $ps2pdf variable (useless) +# 3: dvi conversion, as specified by the $dvipdf variable (useless) +# 4: lualatex, as specified by the $lualatex variable (best) +# 5: xelatex, as specified by the $xelatex variable (second best) +$pdf_mode = 1; + +# Treat undefined references and citations as well as multiply defined references as +# ERRORS instead of WARNINGS. +# This is only checked in the *last* run, since naturally, there are undefined references +# in initial runs. +# This setting is potentially annoying when debugging/editing, but highly desirable +# in the CI pipeline, where such a warning should result in a failed pipeline, since the +# final document is incomplete/corrupted. +# +# However, I could not eradicate all warnings, so that `latexmk` currently fails with +# this option enabled. +# Specifically, `microtype` fails together with `fontawesome`/`fontawesome5`, see: +# https://tex.stackexchange.com/a/547514/120853 +# The fix in that answer did not help. +# Setting `verbose=silent` to mute `microtype` warnings did not work. +# Switching between `fontawesome` and `fontawesome5` did not help. +$warnings_as_errors = 0; + +# Show used CPU time. Looks like: https://tex.stackexchange.com/a/312224/120853 +$show_time = 1; + +# Default is 5; we seem to need more owed to the complexity of the document. +# Actual documents probably don't need this many since they won't use all features, +# plus won't be compiling from cold each time. +$max_repeat=7; + +# --shell-escape option (execution of code outside of latex) is required for the +#'svg' package. +# It converts raw SVG files to the PDF+PDF_TEX combo using InkScape. +# +# SyncTeX allows to jump between source (code) and output (PDF) in IDEs with support +# (many have it). A value of `1` is enabled (gzipped), `-1` is enabled but uncompressed, +# `0` is off. +# Testing in VSCode w/ LaTeX Workshop only worked for the compressed version. +# Adjust this as needed. Of course, only relevant for local use, no effect on a remote +# CI pipeline (except for slower compilation, probably). +# +# %O and %S will forward Options and the Source file, respectively, given to latexmk. +# +# `set_tex_cmds` applies to all *latex commands (latex, xelatex, lualatex, ...), so +# no need to specify these each. This allows to simply change `$pdf_mode` to get a +# different engine. Check if this works with `latexmk --commands`. +set_tex_cmds("--shell-escape -interaction=nonstopmode --synctex=1 %O %S"); + +# Use default pdf viewer +$pdf_previewer = 'zathura'; + +# option 2 is same as 1 (run biber when necessary), but also deletes the +# regeneratable bbl-file in a clenaup (`latexmk -c`). Do not use if original +# bib file is not available! +$bibtex_use = 2; # default: 1 + +# Change default `biber` call, help catch errors faster/clearer. See +# https://web.archive.org/web/20200526101657/https://www.semipol.de/2018/06/12/latex-best-practices.html#database-entries +$biber = "biber --validate-datamodel %O %S"; + +# Glossaries +add_cus_dep('glo', 'gls', 0, 'run_makeglossaries'); +add_cus_dep('acn', 'acr', 0, 'run_makeglossaries'); + +sub run_makeglossaries { + if ( $silent ) { + system "makeglossaries -q -s '$_[0].ist' '$_[0]'"; + } + else { + system "makeglossaries -s '$_[0].ist' '$_[0]'"; + }; +} + +# ====================================================================================== +# Auxiliary Files +# ====================================================================================== + +# Let latexmk know about generated files, so they can be used to detect if a +# rerun is required, or be deleted in a cleanup. +# loe: List of Examples (KOMAScript) +# lol: List of Listings (`listings` and `minted` packages) +# run.xml: biber runs +# glg: glossaries log +# glstex: generated from glossaries-extra +push @generated_exts, 'loe', 'lol', 'run.xml', 'glstex', 'glo', 'gls', 'glg', 'acn', 'acr', 'alg'; + +# Also delete the *.glstex files from package glossaries-extra. Problem is, +# that that package generates files of the form "basename-digit.glstex" if +# multiple glossaries are present. Latexmk looks for "basename.glstex" and so +# does not find those. For that purpose, use wildcard. +# Also delete files generated by gnuplot/pgfplots contour plots +# (.dat, .script, .table). +$clean_ext = "%R-*.glstex %R_contourtmp*.*"; diff --git a/paper/dehaeze26_nass.bib b/paper/dehaeze26_nass.bib new file mode 100644 index 0000000..2e01e08 --- /dev/null +++ b/paper/dehaeze26_nass.bib @@ -0,0 +1,8 @@ +@phdthesis{dehaeze25_nano_activ_stabil, + author = {Dehaeze, T.}, + school = {Universit{\'e} de Li{\`e}ge}, + title = {Nano Active Stabilization of samples for tomography + experiments: A mechatronic design approach}, + year = 2025, +} + diff --git a/paper/dehaeze26_nass.org b/paper/dehaeze26_nass.org new file mode 100644 index 0000000..eb27439 --- /dev/null +++ b/paper/dehaeze26_nass.org @@ -0,0 +1,127 @@ +#+TITLE: Nano Active Stabilization Sysystem +:DRAWER: +#+BIND: org-latex-image-default-option "scale=1" +#+BIND: org-latex-image-default-width "" + +#+OPTIONS: toc:nil date:nil +#+AUTHOR: + +#+LaTeX_CLASS: iucrjournals +#+LaTeX_CLASS_OPTIONS: [preprint,12pt] +# #+LATEX_HEADER: \input{preamble.tex} + +#+LATEX_HEADER_EXTRA: \author[a,b]{Thomas Dehaeze\IUCrCemaillink{thomas.dehaeze@esrf.fr}\IUCrOrcidlink{0000-0002-9528-5832}}% +#+LATEX_HEADER_EXTRA: \author[b]{Christophe Collette\IUCrEmaillink{christophe.collette@uliege.be}\IUCrOrcidlink{0000-0002-4430-3703}}% +#+LATEX_HEADER_EXTRA: \affil[a]{ESRF, The European Synchrotron, Grenoble, France} +#+LATEX_HEADER_EXTRA: \affil[b]{Precision Mechatronics Laboratory, University of Li\`{e}ge, Belgium} + +# #+LATEX_HEADER_EXTRA: \input{preamble_extra.tex} + +#+BIND: org-latex-bib-compiler "biber" +:END: + +* Build :noexport: +#+NAME: startblock +#+BEGIN_SRC emacs-lisp :results none :tangle no +(add-to-list 'org-latex-classes + '("iucrjournals" + "\\documentclass{iucrjournals}" + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}") + ("\\paragraph{%s}" . "\\paragraph*{%s}") + )) + +;; Remove automatic org heading labels +(defun my-latex-filter-removeOrgAutoLabels (text backend info) + "Org-mode automatically generates labels for headings despite explicit use of `#+LABEL`. This filter forcibly removes all automatically generated org-labels in headings." + (when (org-export-derived-backend-p backend 'latex) + (replace-regexp-in-string "\\\\label{sec:org[a-f0-9]+}\n" "" text))) +(add-to-list 'org-export-filter-headline-functions + 'my-latex-filter-removeOrgAutoLabels) + +;; Remove all org comments in the output LaTeX file +(defun delete-org-comments (backend) + (loop for comment in (reverse (org-element-map (org-element-parse-buffer) + 'comment 'identity)) + do + (setf (buffer-substring (org-element-property :begin comment) + (org-element-property :end comment)) + ""))) +(add-hook 'org-export-before-processing-hook 'delete-org-comments) + +;; Use no package by default +(setq org-latex-packages-alist nil) +(setq org-latex-default-packages-alist nil) + +;; Do not include the subtitle inside the title +(setq org-latex-subtitle-separate t) +(setq org-latex-subtitle-format "\\subtitle{%s}") + +(setq org-export-before-parsing-hook '(org-ref-glossary-before-parsing + org-ref-acronyms-before-parsing)) +#+END_SRC + +* Notes :noexport: +** Journal +JSV: https://www.sciencedirect.com/journal/journal-of-sound-and-vibration + +#+begin_quote +*Original full length articles* + +Full length articles are the standard type of contribution in the Journal. +There is no fixed upper length limit; however, short papers are encouraged and generally get reviewed quicker. +Likewise no minimum length applies, but papers whose contribution is judged incremental will not be accepted for publication. +#+end_quote + +** DONE [#B] Find a journal +CLOSED: [2025-11-27 Thu 18:27] +MSPP does not seem to be adequate + +JSV seems adequate: https://www.sciencedirect.com/journal/journal-of-sound-and-vibration + +* Title Page :ignore: +#+begin_export latex +\begin{synopsis} +One or two sentences suitable for the Journal contents listing and use in promoting your article via social media, highlighting the findings and significance of your work. +\end{synopsis} + +\begin{abstract} +Single paragraph stating as specifically and as quantitatively as possible the principal results obtained, and providing an indication of the broader significance of the work. The abstract should be capable of being understood on its own without access to the text or figures. +\end{abstract} + +\keywords{ Three or four key words/phrases separated by semi-colons. } +#+end_export + +* Introduction + +introduction + +[[cite:&dehaeze25_nano_activ_stabil]] + +* Comparison of decoupling strategies +results + +* Acknowledgments +#+begin_export latex +\begin{acknowledgements} +The contributions of non-authors etc. should be given here. +\end{acknowledgements} + +\begin{funding} +List funding organizations, recipients, grant numbers, etc. +\end{funding} + +\ConflictsOfInterest{Please declare any conflicts of interest, or declare that there are no conflicts of interest. +} + +\DataAvailability{Please state how the data supporting the results reported in your article can be accessed, e.g. within the article, as published supporting material, in repositories, upon request... +} +#+end_export + +* Bibliography :ignore: +#+latex: \bibliography{dehaeze26_nass} + +* Footnotes + +[fn:1]$n$ corresponds to the number of degrees of freedom, here $n = 3$ diff --git a/paper/dehaeze26_nass.pdf b/paper/dehaeze26_nass.pdf new file mode 100644 index 0000000..0e50bb9 Binary files /dev/null and b/paper/dehaeze26_nass.pdf differ diff --git a/paper/dehaeze26_nass.tex b/paper/dehaeze26_nass.tex new file mode 100644 index 0000000..5778258 --- /dev/null +++ b/paper/dehaeze26_nass.tex @@ -0,0 +1,46 @@ +% Created 2025-11-27 Thu 18:40 +% Intended LaTeX compiler: pdflatex +\documentclass[preprint,12pt]{iucrjournals} + +\author[a,b]{Thomas Dehaeze\IUCrCemaillink{thomas.dehaeze@esrf.fr}\IUCrOrcidlink{0000-0002-9528-5832}}% +\author[b]{Christophe Collette\IUCrEmaillink{christophe.collette@uliege.be}\IUCrOrcidlink{0000-0002-4430-3703}}% +\affil[a]{ESRF, The European Synchrotron, Grenoble, France} +\affil[b]{Precision Mechatronics Laboratory, University of Li\`{e}ge, Belgium} + +\title{Nano Active Stabilization Sysystem} + +\begin{document} + +\maketitle +\begin{synopsis} +One or two sentences suitable for the Journal contents listing and use in promoting your article via social media, highlighting the findings and significance of your work. +\end{synopsis} + +\begin{abstract} +Single paragraph stating as specifically and as quantitatively as possible the principal results obtained, and providing an indication of the broader significance of the work. The abstract should be capable of being understood on its own without access to the text or figures. +\end{abstract} + +\keywords{ Three or four key words/phrases separated by semi-colons. } +\section{Introduction} + +introduction + +\cite{dehaeze25_nano_activ_stabil} +\section{Comparison of decoupling strategies} +results +\section{Acknowledgments} +\begin{acknowledgements} +The contributions of non-authors etc. should be given here. +\end{acknowledgements} + +\begin{funding} +List funding organizations, recipients, grant numbers, etc. +\end{funding} + +\ConflictsOfInterest{Please declare any conflicts of interest, or declare that there are no conflicts of interest. +} + +\DataAvailability{Please state how the data supporting the results reported in your article can be accessed, e.g. within the article, as published supporting material, in repositories, upon request... +} +\bibliography{dehaeze26_nass} +\end{document} diff --git a/paper/iucr.bst b/paper/iucr.bst new file mode 100644 index 0000000..6a4de0d --- /dev/null +++ b/paper/iucr.bst @@ -0,0 +1,1577 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% This is the IUCr BibTeX bibliography style file iucr.bst % +% Copyright (c) 1998-2023 International Union of Crystallography % +% % +% Usage: \bibliographystyle{iucr} % +% % +% Maintained by: Brian McMahon bm@iucr.org % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% ChangeLog: % +% 1.1.2 % +% 2023-05-11 tweaked "misc": allows separator for line break and % +% removes trailing comma for organizational author % +% 1.1.1 % +% 2021-04-15 equivalenced "online" to "misc" % +% 1.1 % +% 2002-08-27 added appropriate baselineskip, parskip to begin.bib % +% 1.0 % +% 2000-06-28 numnames compared with #99 instead of #9 to allow % +% up to 99 authors to be enumerated in reference list % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% This is file `iucr.bst', generated by makebst with the docstrip utility. +%% Copyright (C) 1994-98 Patrick W. Daly +%% The original source files were: +%% merlin.mbs [1998/02/25 3.85a (PWD)] +%% (with options: `,ay,har,harnm,vonx,nm-rev,nmlm,x9,m3,xlab-it,dt-beg,yr-par, +%% yrp-per,note-yr,jtit-x,trtit-b,trnum-it,vol-bf,volp-com,jnm-x,add-pub +%% ,edpar,edby,pp,ed,abr,ednx,ord,amper,and-xcom,etal-it,nfss') +%% ------------------------------------------------------------------ +%% *** Bibliography style for IUCr journals *** + %------------------------------------------------------------------- + % For use with BibTeX version 0.99a or later + %------------------------------------------------------------------- + % This bibliography style file is intended for texts in ENGLISH + % This is an author-year citation style bibliography. As such, it is + % non-standard LaTeX, and requires a special package file to function properly. + % Such a package is natbib.sty by Patrick W. Daly + % or: harvard.sty by Peter Williams and Thorsten Schnier + % (needs natbib v5.3 or harvard v2.0.3) + % The form of the bibitem entries is + % \harvarditem[Jones et al.]{Jones, Baker, and Smith}{1990}{key}... + %--------------------------------------------------------------------- + +ENTRY + { address + author + booktitle + chapter + edition + editor + howpublished + institution + journal + key + month + note + number + organization + pages + publisher + school + separator + series + title + type + URL + volume + year + } + {} + { label extra.label sort.label short.list } + +INTEGERS { output.state before.all mid.sentence after.sentence after.block } + +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} + +STRINGS { s t } + +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} + +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} + +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} + +FUNCTION {fin.entry} +{ add.period$ + write$ + newline$ +} + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} + +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} + +FUNCTION {add.blank} +{ " " * before.all 'output.state := +} + +FUNCTION {date.block} +{ + new.block +} + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} + +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} + +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} + +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} + +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} + +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "\emph{" swap$ * "}" * } + if$ +} + +% \volbf is specific to IUCr, allowing A40 to be typeset as A\textbf{40} +FUNCTION {bolden} +{ duplicate$ empty$ + { pop$ "" } + { "\volbf{" swap$ * "}" * } + if$ +} + +FUNCTION {capitalize} +{ "u" change.case$ "t" change.case$ } + +FUNCTION {space.word} +{ " " swap$ * " " * } + + % Here are the language-specific definitions for explicit words. + % Each function has a name bbl.xxx where xxx is the English word. + % The language selected here is ENGLISH +FUNCTION {bbl.and} +{ "and"} + +FUNCTION {bbl.editors} +{ "eds." } + +FUNCTION {bbl.editor} +{ "ed." } + +FUNCTION {bbl.edby} +{ "edited by" } + +FUNCTION {bbl.edition} +{ "ed." } + +FUNCTION {bbl.volume} +{ "vol." } + +FUNCTION {bbl.of} +{ "of" } + +FUNCTION {bbl.number} +{ "no." } + +FUNCTION {bbl.nr} +{ "no." } + +FUNCTION {bbl.in} +{ "in" } + +FUNCTION {bbl.pages} +{ "pp." } + +FUNCTION {bbl.page} +{ "p." } + +FUNCTION {bbl.chapter} +{ "chap." } + +FUNCTION {bbl.techrep} +{ "Tech. Rep." } + +FUNCTION {bbl.mthesis} +{ "Master's thesis" } + +FUNCTION {bbl.phdthesis} +{ "Ph.D. thesis" } + +FUNCTION {bbl.first} +{ "1st" } + +FUNCTION {bbl.second} +{ "2nd" } + +FUNCTION {bbl.third} +{ "3rd" } + +FUNCTION {bbl.fourth} +{ "4th" } + +FUNCTION {bbl.fifth} +{ "5th" } + +FUNCTION {bbl.st} +{ "st" } + +FUNCTION {bbl.nd} +{ "nd" } + +FUNCTION {bbl.rd} +{ "rd" } + +FUNCTION {bbl.th} +{ "th" } + +MACRO {jan} {"Jan."} +MACRO {feb} {"Feb."} +MACRO {mar} {"Mar."} +MACRO {apr} {"Apr."} +MACRO {may} {"May"} +MACRO {jun} {"Jun."} +MACRO {jul} {"Jul."} +MACRO {aug} {"Aug."} +MACRO {sep} {"Sep."} +MACRO {oct} {"Oct."} +MACRO {nov} {"Nov."} +MACRO {dec} {"Dec."} + +FUNCTION {eng.ord} +{ duplicate$ "1" swap$ * + #-2 #1 substring$ "1" = + { bbl.th * } + { duplicate$ #-1 #1 substring$ + duplicate$ "1" = + { pop$ bbl.st * } + { duplicate$ "2" = + { pop$ bbl.nd * } + { "3" = + { bbl.rd * } + { bbl.th * } + if$ + } + if$ + } + if$ + } + if$ +} + +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"} + + +FUNCTION {write.separator} +{ separator empty$ + { skip$ } + { separator write$ newline$ } + if$ +} + +FUNCTION {write.url} +{ URL empty$ + { skip$ } + { "\newline\harvardurl{" URL * "}" * write$ newline$ } + if$ +} + +INTEGERS { nameptr namesleft numnames } + +FUNCTION {format.names} +{ 's := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv~}{ll}{, jj}{, f.}" format.name$ + 't := + nameptr #1 > + { + nameptr #4 = + numnames #99 > and + { "others" 't := + #1 'namesleft := } + 'skip$ + if$ + namesleft #1 > + { ", " * t * } + { + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * "et~al." emphasize * + } + { " \harvardand\ " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} +FUNCTION {format.names.ed} +{ 's := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{f.~}{vv~}{ll}{, jj}" + format.name$ + 't := + nameptr #1 > + { + namesleft #1 > + { ", " * t * } + { + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * "et~al." emphasize * + } + { " \harvardand\ " * 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 > + { " (" * bbl.editors * ")" * } + { " (" * bbl.editor * ")" * } + if$ + } + if$ +} + +FUNCTION {format.in.editors} +{ editor empty$ + { "" } + { editor format.names.ed + } + if$ +} + +FUNCTION {format.note} +{ note empty$ + { "" } + { note #1 #1 substring$ + duplicate$ "{" = + 'skip$ + { output.state mid.sentence = + { "l" } + { "u" } + if$ + change.case$ + } + if$ + note #2 global.max$ substring$ * + } + if$ +} + +FUNCTION {format.title} +{ title empty$ + { "" } + { title "t" change.case$ + } + if$ +} + +FUNCTION {format.full.names} +{'s := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv~}{ll}" format.name$ + 't := + nameptr #1 > + { + nameptr #4 = + numnames #99 > and + { "others" 't := + #1 'namesleft := } + 'skip$ + if$ + namesleft #1 > + { ", " * t * } + { + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * "et~al." emphasize * + } + { " \harvardand\ " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {author.editor.key.full} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.full.names } + if$ + } + { author format.full.names } + if$ +} + +FUNCTION {author.key.full} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.full.names } + if$ +} + +FUNCTION {editor.key.full} +{ editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.full.names } + if$ +} + +FUNCTION {make.full.names} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.full + { type$ "proceedings" = + 'editor.key.full + 'author.key.full + if$ + } + if$ +} + +FUNCTION {output.bibitem} +{ newline$ + "\harvarditem" write$ + make.full.names duplicate$ label = + 'skip$ + { "[" label * "]" * write$ } + if$ + "{" swap$ * "}{" * write$ + year duplicate$ empty$ + { pop$ "????" } + 'skip$ + if$ + extra.label * "}{" * 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 {word.in} +{ bbl.in capitalize + " " * } + +FUNCTION {format.date} +{ year duplicate$ empty$ + { "empty year in " cite$ * "; set to ????" * warning$ + pop$ "????" } + 'skip$ + if$ + extra.label * + " \harvardyearleft " swap$ * "\harvardyearright{}" * +} + +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$ + { "" } + { bbl.volume volume tie.or.space.connect + series empty$ + 'skip$ + { bbl.of space.word * 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 = + { bbl.number } + { bbl.number capitalize } + if$ + number tie.or.space.connect + series empty$ + { "there's a number but no series in " cite$ * warning$ } + { bbl.in space.word * series * } + if$ + } + if$ + } + { "" } + if$ +} + +FUNCTION {is.num} +{ chr.to.int$ + duplicate$ "0" chr.to.int$ < not + swap$ "9" chr.to.int$ > not and +} + +FUNCTION {extract.num} +{ duplicate$ 't := + "" 's := + { t empty$ not } + { t #1 #1 substring$ + t #2 global.max$ substring$ 't := + duplicate$ is.num + { s swap$ * 's := } + { pop$ "" 't := } + if$ + } + while$ + s empty$ + 'skip$ + { pop$ s } + if$ +} + +FUNCTION {convert.edition} +{ edition extract.num "l" change.case$ 's := + s "first" = s "1" = or + { bbl.first 't := } + { s "second" = s "2" = or + { bbl.second 't := } + { s "third" = s "3" = or + { bbl.third 't := } + { s "fourth" = s "4" = or + { bbl.fourth 't := } + { s "fifth" = s "5" = or + { bbl.fifth 't := } + { s #1 #1 substring$ is.num + { s eng.ord 't := } + { edition 't := } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + t +} + +FUNCTION {format.edition} +{ edition empty$ + { "" } + { output.state mid.sentence = + { convert.edition "l" change.case$ " " * bbl.edition * } + { convert.edition "t" change.case$ " " * bbl.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 + { bbl.pages pages n.dashify tie.or.space.connect } + { bbl.page pages tie.or.space.connect } + if$ + } + if$ +} + +FUNCTION {format.journal.pages} +{ pages empty$ + 'skip$ + { duplicate$ empty$ + { pop$ format.pages } + { + ", " * + pages n.dashify * + } + if$ + } + if$ +} + +FUNCTION {format.vol.num.pages} +{ volume field.or.null + bolden + number empty$ + 'skip$ + { + "(" number * ")" * * + volume empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + } + if$ + format.journal.pages +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { bbl.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$ + { word.in booktitle emphasize * } + { word.in booktitle emphasize * + ", " * + bbl.edby + * " " * + format.in.editors * + } + if$ + } + if$ +} + +FUNCTION {format.thesis.type} +{ type empty$ + 'skip$ + { pop$ + type "t" change.case$ + } + if$ +} + +FUNCTION {format.tr.number} +{ type empty$ + { bbl.techrep } + 'type + if$ + number empty$ + { "t" change.case$ } + { number tie.or.space.connect } + if$ +} + +FUNCTION {format.article.crossref} +{ + word.in + " \cite{" * crossref * "}" * +} + +FUNCTION {format.book.crossref} +{ volume empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + word.in + } + { bbl.volume capitalize + volume tie.or.space.connect + bbl.of space.word * + } + if$ + " \cite{" * crossref * "}" * +} + +FUNCTION {format.incoll.inproc.crossref} +{ + word.in + " \cite{" * crossref * "}" * +} + +FUNCTION {format.publisher} +{ publisher empty$ + { "empty publisher in " cite$ * warning$ } + 'skip$ + if$ + "" + address empty$ publisher empty$ and + 'skip$ + { + address empty$ + 'skip$ + { address * } + if$ + publisher empty$ + 'skip$ + { address empty$ + 'skip$ + { ": " * } + if$ + publisher * + } + if$ + } + if$ + output +} + +FUNCTION {non.stop} +{ duplicate$ + "}" * add.period$ + #-1 #1 substring$ "." = +} + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check +% Suppress final comma (BM: 1998-07-15) + add.blank + author format.key output + format.date "year" output.check + date.block + crossref missing$ + { journal + emphasize + "journal" output.check +% Want to have comma if last character of the journal field is not '.' +% replace unadorned add.blank with the following "non.stop" test +% (BM: 1998-07-15) + non.stop + { skip$ } + { add.blank } + if$ + format.vol.num.pages output + } + { format.article.crossref output.nonnull + format.pages output + } + if$ + new.block + format.note output + fin.entry + write.url +} + +FUNCTION {book} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check +% Suppress final comma (BM: 1998-07-15) + add.blank + editor format.key output + } + { format.authors output.nonnull +% Suppress final comma (BM: 1998-07-15) + add.blank + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + format.date "year" output.check + date.block + format.btitle "title" output.check + crossref missing$ + { format.bvolume output + new.block + format.number.series output + new.sentence + format.publisher + } + { + new.block + format.book.crossref output.nonnull + } + if$ + format.edition output + new.block + format.note output + fin.entry + write.url +} + +FUNCTION {booklet} +{ output.bibitem + format.authors output +% Suppress final comma (BM: 1998-07-15) + add.blank + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + new.block + howpublished output + address output + new.block + format.note output + fin.entry + write.url +} + +FUNCTION {inbook} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check +% Suppress final comma (BM: 1998-07-15) + add.blank + editor format.key output + } + { format.authors output.nonnull +% Suppress final comma (BM: 1998-07-15) + add.blank + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + format.date "year" output.check + date.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 + format.publisher + } + { + format.chapter.pages "chapter and pages" output.check + new.block + format.book.crossref output.nonnull + } + if$ + format.edition output + new.block + format.note output + fin.entry + write.url +} + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check +% Suppress final comma (BM: 1998-07-15) + add.blank + author format.key output + format.date "year" output.check + date.block + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.number.series output + format.chapter.pages output + new.sentence + format.publisher + format.edition output + } + { format.incoll.inproc.crossref output.nonnull + format.chapter.pages output + } + if$ + new.block + format.note output + fin.entry + write.url +} + +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check +% Suppress final comma (BM: 1998-07-15) + add.blank + author format.key output + format.date "year" output.check + date.block + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.number.series output + format.pages output + new.sentence + publisher empty$ + { organization output + address output + } + { organization output + format.publisher + } + if$ + } + { format.incoll.inproc.crossref output.nonnull + format.pages output + } + if$ + new.block + format.note output + fin.entry + write.url +} + +FUNCTION {conference} { inproceedings } + +FUNCTION {manual} +{ output.bibitem + format.authors output + author format.key output + format.date "year" output.check + date.block + format.btitle "title" output.check + organization address new.block.checkb + organization output + address output + format.edition output + new.block + format.note output + fin.entry + write.url +} + +FUNCTION {mastersthesis} +{ output.bibitem + format.authors "author" output.check +% Suppress final comma (BM: 1998-07-15) + add.blank + author format.key output + format.date "year" output.check + date.block + format.btitle "title" output.check + new.block + bbl.mthesis format.thesis.type output.nonnull + school "school" output.check + address output + new.block + format.note output + fin.entry + write.url +} + +FUNCTION {misc} +{ output.bibitem + format.authors "author" output.check +% Suppress final comma (BM: 2023-02-14) + add.blank + author format.key output + format.date "year" output.check + date.block + format.title output + new.block + howpublished output + new.block + format.note output + fin.entry +% separator allows URL to be forced to new line (BM: 2023-02-15) + write.separator + write.url +} + +FUNCTION {online} {misc} + +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" output.check +% Suppress final comma (BM: 1998-07-15) + add.blank + author format.key output + format.date "year" output.check + date.block + format.btitle "title" output.check + new.block + bbl.phdthesis format.thesis.type output.nonnull + school "school" output.check + address output + new.block + format.note output + fin.entry + write.url +} + +FUNCTION {proceedings} +{ output.bibitem + format.editors output + editor format.key output + format.date "year" output.check + date.block + format.btitle "title" output.check + format.bvolume output + format.number.series output + address output + new.sentence + organization output + publisher output + new.block + format.note output + fin.entry + write.url +} + +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check +% Suppress final comma (BM: 1998-07-15) + add.blank + author format.key output + format.date "year" output.check + date.block + format.btitle "title" output.check + new.block +% Report name NOT italic; modify punctuation (bm: 1998-07-15) + % format.tr.number emphasize output.nonnull + format.tr.number output.nonnull add.period$ add.blank + institution "institution" output.check + address output + new.block + format.note output + fin.entry + write.url +} + +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check +% Suppress final comma (BM: 1998-07-15) + add.blank + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + new.block + format.note "note" output.check + fin.entry + write.url +} + +FUNCTION {default.type} { misc } + +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." emphasize * + } + { #2 < + 'skip$ + { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { + " " * "et~al." emphasize * + } + { " \harvardand\ " * 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 {editor.key.label} +{ editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ +} + +FUNCTION {calc.short.authors} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.label + { type$ "proceedings" = + 'editor.key.label + 'author.key.label + if$ + } + if$ + 'short.list := +} + +FUNCTION {calc.label} +{ calc.short.authors + short.list + ", " + * + year duplicate$ empty$ + { pop$ "????" } + 'skip$ + if$ + * + 'label := +} + +FUNCTION {calc.short.label} +{ calc.short.authors short.list + 'label := +} + +FUNCTION {sort.format.names} +{ 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{ll{ }}{ f{ }}{ jj{ }}" + format.name$ 't := + nameptr #1 > + { + nameptr #4 = + numnames #99 > and + { "others" 't := + #1 'namesleft := } + 'skip$ + if$ + " " * + namesleft #1 = t "others" = and + { "zzzzz" * } + { 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 {editor.sort} +{ editor empty$ + { key empty$ + { "to sort, need editor or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ +} + +FUNCTION {presort} +{ calc.label + label sortify + " " + * + type$ "book" = + type$ "inbook" = + or + 'author.editor.sort + { type$ "proceedings" = + 'editor.sort + 'author.sort + if$ + } + if$ + #1 entry.max$ substring$ + 'sort.label := + sort.label + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} + +ITERATE {presort} + +SORT + +STRINGS { last.label next.extra } + +INTEGERS { last.extra.num number.label } + +FUNCTION {initialize.extra.label.stuff} +{ #0 int.to.chr$ 'last.label := + "" 'next.extra := + #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 + emphasize + % duplicate$ empty$ 'skip$ { "{\natexlab{" swap$ * "}}" * } if$ + 'extra.label := +} + +EXECUTE {initialize.extra.label.stuff} + +ITERATE {forward.pass} + +REVERSE {reverse.pass} + +FUNCTION {bib.sort.order} +{ sort.label + " " + * + year field.or.null sortify + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := + calc.short.label +} + +ITERATE {bib.sort.order} + +SORT + +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" number.label int.to.str$ * "}" * + % write$ newline$ + % "\expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi" + write$ newline$ "\baselineskip=9pt\parskip=0pt" + write$ newline$ +} + +EXECUTE {begin.bib} + +EXECUTE {init.state.consts} + +ITERATE {call.type$} + +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} + +EXECUTE {end.bib} +%% End of customized bst file +%% +%% End of file `iucr.bst'. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/paper/iucrjournals.cls b/paper/iucrjournals.cls new file mode 100644 index 0000000..db41387 --- /dev/null +++ b/paper/iucrjournals.cls @@ -0,0 +1,385 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% This is the IUCr LaTeX2e class macro file iucrjournals.cls +% This work has been dedicated to the public domain +% License: CC0 1.0 Universal +% https://creativecommons.org/publicdomain/zero/1.0/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Usage: +% \documentclass{iucrjournals} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesClass{iucrjournals} +\date{} + +\LoadClass[11pt]{article} + +\RequirePackage{lineno} +\linenumbers + +\RequirePackage[parfill]{parskip} +\RequirePackage{setspace} +\onehalfspacing + +\RequirePackage[margin=1in]{geometry} +\RequirePackage{float} +\RequirePackage{graphicx} + +\RequirePackage{xcolor} +\RequirePackage{hyperref} +\hypersetup{colorlinks = true, allcolors = blue} + +\RequirePackage{authblk} +\RequirePackage{booktabs} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% bibtex: +\RequirePackage{harvard} +% The following hack addresses a problem with bibtex failing when +% there is whitespace in a comma-separated list of labels passed as +% an argument to \cite - see +% http://tex.stackexchange.com/questions/4517/cite-that-tolerates-whitespace +% +\let\OLDcite\cite +\def\tok@scan#1{% + \ifx#1\relax + \let\tok@next\relax + \else + \edef\my@list{\my@list#1}% + \let\tok@next\tok@scan + \fi + \tok@next +} +\newcommand{\@strip}[2]{% + \def\my@list{}\tok@scan#2\relax\let#1\my@list} +\renewcommand{\cite}[1]{\@strip\@args{#1}\OLDcite\@args} + +% The iucr.bst BibTeX bibliography style requires the harvard.sty package. +% IUCr citations are similar to the "dcu" style within harvard.sty, but +% require the conjunction to be changed to '&'; also abbreviated citations +% ('et al.') are always used. +\citationstyle{dcu} % (Doe, 1990; Soape, 1991) +\renewcommand{\harvardand}{\&} % (Doe & Soape, 1990) +\citationmode{abbr} % (Doe et al., 1990) +\bibliographystyle{iucr} +\renewcommand{\harvardurl}{\relax} % incompatibility with hyperref +% \newblock is output by BibTeX to separate logical sections of a reference +% listing. It serves no useful purpose, and can cause extra spacing to +% intrude +\let\newblock\relax +% A complication of the preferred style of citation of IUCr journals +% is that the volume number for Acta includes the section label, +% which is NOT printed in bold; to accommodate this, \volbf is defined +% and generated by iucr.bst. \volbf needs to test just the first character +% of the volume number +\gdef\@A@{A}% +\gdef\@B@{B}% +\gdef\@C@{C}% +\gdef\@D@{D}% +\gdef\@E@{E}% +\gdef\@F@{F}% +\gdef\@J@{J}% +\gdef\@M@{M}% +\gdef\@S@{S}% +\newif\iffirst\firsttrue +\def\volbf#1{% + {\firsttrue\v@lbf#1\end}% +} +\def\v@lbf#1{% + \ifx#1\end + \let\next=\relax% + \else + \let\next=\v@lbf\iffirst + \def\t@st{#1} + \if\t@st\@A@{\rmfamily{#1}}\else + \if\t@st\@B@{\rmfamily{#1}}\else + \if\t@st\@C@{\rmfamily{#1}}\else + \if\t@st\@D@{\rmfamily{#1}}\else + \if\t@st\@E@{\rmfamily{#1}}\else + \if\t@st\@F@{\rmfamily{#1}}\else + \textbf{#1}% + \fi + \fi + \fi + \fi + \fi + \fi% + \firstfalse% + \else + {\textbf #1}% + \fi% + \fi + \next% +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% nice orcid links for use in author block: +\RequirePackage{tikz} +\usetikzlibrary{svg.path} + +\IfFileExists{orcidlink.sty}% +{\RequirePackage{orcidlink}}% +{% orcidlink is post 2020, so include full code if sty file not available +\definecolor{orcidlogocol}{HTML}{A6CE39} +\tikzset{ + orcidlogo/.pic={ + \fill[orcidlogocol] svg{M256,128c0,70.7-57.3,128-128,128C57.3,256,0,198.7,0,128C0,57.3,57.3,0,128,0C198.7,0,256,57.3,256,128z}; + \fill[white] svg{M86.3,186.2H70.9V79.1h15.4v48.4V186.2z} + svg{M108.9,79.1h41.6c39.6,0,57,28.3,57,53.6c0,27.5-21.5,53.6-56.8,53.6h-41.8V79.1z M124.3,172.4h24.5c34.9,0,42.9-26.5,42.9-39.7c0-21.5-13.7-39.7-43.7-39.7h-23.7V172.4z} + svg{M88.7,56.8c0,5.5-4.5,10.1-10.1,10.1c-5.6,0-10.1-4.6-10.1-10.1c0-5.6,4.5-10.1,10.1-10.1C84.2,46.7,88.7,51.3,88.7,56.8z}; + } +} +%% Reciprocal of the height of the svg whose source is above. The +%% original generates a 256pt high graphic; this macro holds 1/256. +\newcommand{\@OrigHeightRecip}{0.00390625} +%% We will compute the current X height to make the logo the right height +\newlength{\@curXheight} + +%% Prevent externalization of the ORCiD logo. +\newcommand{\@preventExternalization}{% +\ifcsname tikz@library@external@loaded\endcsname% +\tikzset{external/export next=false}\else\fi% +} + +\newcommand{\orcidlogo}{% +\texorpdfstring{% +\setlength{\@curXheight}{\fontcharht\font`X}% +\XeTeXLinkBox{% +\@preventExternalization% +\begin{tikzpicture}[yscale=-\@OrigHeightRecip*\@curXheight, +xscale=\@OrigHeightRecip*\@curXheight,transform shape] +\pic{orcidlogo}; +\end{tikzpicture}% +}}{}} +\DeclareRobustCommand\orcidlinkX[1]{\href{https://orcid.org/##1}{% +\orcidlogo}} +\newcommand{\orcidlink}[1]{\orcidlinkX{##1}} +} +\newcommand{\IUCrOrcidlink}[1]{\orcidlink{#1}\,} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% nice email links for use in author block (based on orcidlink): +\definecolor{IUCr@emaillogocol}{HTML}{AAAAAA} +\tikzset{ + IUCr@emaillogo/.pic={ + \fill[IUCr@emaillogocol] + svg{M 0 11.755 v 66.489 h 90 V 11.755 H 0 z M 45 50.49 L 7.138 15.755 h 75.724 L 45 50.49 z M 33.099 45 L 4 71.695 V 18.304 L 33.099 45 z M 36.058 47.714 L 45 55.918 l 8.943 -8.204 l 28.919 26.53 H 7.138 L 36.058 47.714 z M 56.901 45 L 86 18.304 v 53.392 L 56.901 45 z}; + } +} +\definecolor{IUCr@cemaillogocol}{HTML}{0000FF} +\tikzset{ + IUCr@cemaillogo/.pic={ + \fill[IUCr@cemaillogocol] + svg{M 0 11.755 v 66.489 h 90 V 11.755 H 0 z M 45 50.49 L 7.138 15.755 h 75.724 L 45 50.49 z M 33.099 45 L 4 71.695 V 18.304 L 33.099 45 z M 36.058 47.714 L 45 55.918 l 8.943 -8.204 l 28.919 26.53 H 7.138 L 36.058 47.714 z M 56.901 45 L 86 18.304 v 53.392 L 56.901 45 z}; + } +} +\newcommand{\IUCr@OrigHeightRecipE}{0.01400625} +\newlength{\IUCr@curXheightE} +\newcommand{\IUCr@preventExternalizationE}{% +\ifcsname tikz@library@external@loaded\endcsname% +\tikzset{external/export next=false}\else\fi% +} +\newcommand{\IUCr@emaillogo}{% +\texorpdfstring{% +\setlength{\IUCr@curXheightE}{\fontcharht\font`X}% +\XeTeXLinkBox{% +\IUCr@preventExternalizationE% +\begin{tikzpicture}[yscale=-\IUCr@OrigHeightRecipE*\IUCr@curXheightE, +xscale=\IUCr@OrigHeightRecipE*\IUCr@curXheightE,transform shape] +\pic{IUCr@emaillogo}; +\end{tikzpicture}% +}}{}} +\newcommand{\IUCr@cemaillogo}{% +\texorpdfstring{% +\setlength{\IUCr@curXheightE}{\fontcharht\font`X}% +\XeTeXLinkBox{% +\IUCr@preventExternalizationE% +\begin{tikzpicture}[yscale=-\IUCr@OrigHeightRecipE*\IUCr@curXheightE, +xscale=\IUCr@OrigHeightRecipE*\IUCr@curXheightE,transform shape] +\pic{IUCr@cemaillogo}; +\end{tikzpicture}% +}}{}} +\DeclareRobustCommand\IUCr@emaillinkX[1]{\href{mailto:#1}{% +\IUCr@emaillogo}} +\DeclareRobustCommand\IUCr@cemaillinkX[1]{\href{mailto:#1}{% +\IUCr@cemaillogo}} +\newcommand{\IUCrEmaillink}[1]{\,\IUCr@emaillinkX{#1}\,} +\newcommand{\IUCrCemaillink}[1]{\,\IUCr@cemaillinkX{#1}\,} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% author footnotes for use in author block +% (alternative to using \thanks or \footnote) + +\newcounter{IUCr@aufnc} +\setcounter{IUCr@aufnc}{0} +\newcommand{\IUCr@storeaufn}[1]{\stepcounter{IUCr@aufnc}\global\expandafter\def\csname aufnX\theIUCr@aufnc\endcsname{#1}} +\newcommand{\IUCr@printaufn}[1]{\footnotesize\IUCr@fnsymbol{#1}\csname aufnX#1\endcsname\\} +\newcommand{\IUCr@printauthornotes}{% +\ifnum\theIUCr@aufnc>0 +\begin{center} +\vskip-22pt +\newcounter{tmpIUCr@aufnc} +\setcounter{tmpIUCr@aufnc}{0} +\loop +\stepcounter{tmpIUCr@aufnc} +%\thetmpIUCr@aufnc +\IUCr@printaufn{\thetmpIUCr@aufnc}% +\addtocounter{IUCr@aufnc}{-1} +\ifnum\theIUCr@aufnc>0 +\repeat +\end{center} +\bigskip +\fi +} +\newcommand{\IUCrAufn}[2][0]{% +% store the note as a new macro for later output using \IUCr@printauthornotes +\if0#1% +\IUCr@storeaufn{#2}% +%$^\theIUCr@aufnc$% +\IUCr@fnsymbol{\theIUCr@aufnc}\,% +\else% allows multiple footnote markers pointing to same text +% if the number is greater than \theIUCr@aufnc count, store as new? +\ifnum#1>\theIUCr@aufnc% +\IUCr@storeaufn{#2}% +\fi% +\IUCr@fnsymbol{\theIUCr@aufnc}\,% +\fi% +} + +\newcommand{\IUCr@fnsymbol}[1]{% +\ifnum#1<6% +$^\IUCr@fnsymbolsingle{#1}$% +\else% +\newcount\@lrepeat +\@lrepeat=#1 +\divide\@lrepeat by 5 +%\the\@lrepeat +%modulo gives symbol number: +\newcount\@modsym +\@modsym=#1 +\divide\@modsym by 5 +\multiply\@modsym by 5 +\multiply\@modsym by -1 +\advance\@modsym by #1\relax +%\the\@modsym +$^{% +\IUCr@fnsymbolsingle{\@modsym}% +\loop +\IUCr@fnsymbolsingle{\@modsym}% +\advance\@lrepeat by -1 +\ifnum\@lrepeat>0 +\repeat +}$% +\fi% +} +\newcommand{\IUCr@fnsymbolsingle}[1]{% + \ensuremath{% + \ifcase#1% 0 + \or % 1 + \dagger + \or % 2 + \ddagger + \or % 3 + \mathsection + \or % 4 + \mathparagraph + \or \| + \else % >= 6 + #1 + \fi + }% +} + +% print author notes after maketitle +\let\IUCr@maketitle=\maketitle +\def\maketitle{% +\IUCr@maketitle +\IUCr@printauthornotes +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% commands and formatting tweaks: + +\let\origtitle\title +\renewcommand{\title}[1]{\origtitle{\textbf{#1}}} + +\renewenvironment{abstract} + {%\small + \begin{center} + \bfseries \abstractname\vspace{-.5em}\vspace{0pt} + \end{center} + \list{}{ + \setlength{\leftmargin}{1cm}% + \setlength{\rightmargin}{\leftmargin}% + }% + \item\relax} + {\endlist\bigskip} + +\newenvironment{synopsis}% +{%\small + \begin{center} + \bfseries Synopsis\vspace{-.5em}\vspace{0pt} + \end{center} + \list{}{ + \setlength{\leftmargin}{1cm}% + \setlength{\rightmargin}{\leftmargin}% + }% + \item\relax} + {\endlist\bigskip} + +\newcommand{\keywords}[1]{ + \begin{center} + \small + \list{}{ + \setlength{\leftmargin}{1cm}% + \setlength{\rightmargin}{\leftmargin}% + }% + \item\relax\textbf{Keywords:} #1\endlist\end{center}\bigskip} + +\let\origaffil\affil +\def\affil#1#{\origaffilA{#1}} +\def\origaffilA#1#2{\origaffil#1{\footnotesize #2}} + +\newenvironment{acknowledgements}% +{%\small +\bigskip + %\begin{center} + {\bfseries\Large Acknowledgements}\vspace{-.5em}\vspace{0pt} + %\end{center} + \list{}{ + \setlength{\leftmargin}{0cm}% + \setlength{\rightmargin}{\leftmargin}% + }% + \item\relax} + {\endlist\medskip} + +\newenvironment{funding}% +{%\small +\medskip + %\begin{center} + {\bfseries\Large Funding}\vspace{-.5em}\vspace{0pt} + %\end{center} + \list{}{ + \setlength{\leftmargin}{0cm}% + \setlength{\rightmargin}{\leftmargin}% + }% + \item\relax} + {\endlist\medskip} + +\newcommand{\ConflictsOfInterest}[1]{ + \begin{center} + \small + \list{}{ + \setlength{\leftmargin}{0cm}% + \setlength{\rightmargin}{\leftmargin}% + }% + \item\relax\textbf{Conflicts of interest:} #1\endlist\end{center}\medskip} + +\newcommand{\DataAvailability}[1]{ + \begin{center} + \small + \list{}{ + \setlength{\leftmargin}{0cm}% + \setlength{\rightmargin}{\leftmargin}% + }% + \item\relax\textbf{Data availability:} #1\endlist\end{center}\medskip} + diff --git a/paper/preamble.tex b/paper/preamble.tex new file mode 100644 index 0000000..a786423 --- /dev/null +++ b/paper/preamble.tex @@ -0,0 +1,4 @@ +\usepackage{amssymb} +\usepackage{amsmath} +\usepackage{cases} +\usepackage{empheq} diff --git a/paper/preamble_extra.tex b/paper/preamble_extra.tex new file mode 100644 index 0000000..eec2039 --- /dev/null +++ b/paper/preamble_extra.tex @@ -0,0 +1,71 @@ +\usepackage{float} +\usepackage{enumitem} + +\usepackage{tabularx,booktabs} +\usepackage{bm} + +\usepackage{xpatch} % Recommanded for biblatex +\usepackage[ % use biblatex for bibliography + backend=biber, % use biber backend (bibtex replacement) or bibtex + style=ieee, % bib style + hyperref=true, % activate hyperref support + backref=true, % activate backrefs + isbn=false, % don't show isbn tags + url=false, % don't show url tags + doi=false, % don't show doi tags + urldate=long, % display type for dates + maxnames=3, % + minnames=1, % + maxbibnames=5, % + minbibnames=3, % + maxcitenames=2, % + mincitenames=1 % + ]{biblatex} + +\setlength\bibitemsep{1.1\itemsep} + +\usepackage{caption} +\usepackage{subcaption} + +\captionsetup[figure]{labelfont=bf} +\captionsetup[subfigure]{labelfont=bf} +\captionsetup[listing]{labelfont=bf} +\captionsetup[table]{labelfont=bf} + +\usepackage{xcolor} + +\definecolor{my-blue}{HTML}{6b7adb} +\definecolor{my-pale-blue}{HTML}{e6e9f9} +\definecolor{my-red}{HTML}{db6b6b} +\definecolor{my-pale-red}{HTML}{f9e6e6} +\definecolor{my-green}{HTML}{6bdbb6} +\definecolor{my-pale-green}{HTML}{e6f9f3} +\definecolor{my-yellow}{HTML}{dbd26b} +\definecolor{my-pale-yellow}{HTML}{f9f7e6} +\definecolor{my-orange}{HTML}{dba76b} +\definecolor{my-pale-orange}{HTML}{f9f0e6} +\definecolor{my-grey}{HTML}{a3a3a3} +\definecolor{my-pale-grey}{HTML}{f0f0f0} +\definecolor{my-turq}{HTML}{6bc7db} +\definecolor{my-pale-turq}{HTML}{e6f6f9} + +\usepackage{inconsolata} + + +\let\OldTexttt\texttt +\renewcommand{\texttt}[1]{{\ttfamily\hl{\mbox{\,#1\,}}}} + +\makeatletter +\preto\Gin@extensions{png,} +\DeclareGraphicsRule{.png}{pdf}{.pdf}{\noexpand\Gin@base.pdf} +\preto\Gin@extensions{gif,} +\DeclareGraphicsRule{.gif}{png}{.png}{\noexpand\Gin@base.png} +\makeatother + +\usepackage{hyperref} +\hypersetup{ + colorlinks = true, + allcolors = my-blue +} + +\usepackage{hypcap}