From 14cf24d42f26d6570b0d833728b3bb7bb9fbb839 Mon Sep 17 00:00:00 2001 From: Alvaro Uzaheta Date: Tue, 23 Feb 2021 14:08:50 +0100 Subject: [PATCH] add `ims_article()` (#372) Co-authored-by: Christophe Dervieux --- DESCRIPTION | 3 +- NAMESPACE | 1 + NEWS.md | 2 + R/article.R | 43 + README.md | 1 + inst/rmarkdown/templates/ims/LICENSE | 21 + .../templates/ims/resources/template.tex | 236 + inst/rmarkdown/templates/ims/skeleton/ims.bib | 30 + .../ims/skeleton/imsart-nameyear.bst | 2332 +++++++++ .../templates/ims/skeleton/imsart-number.bst | 2331 +++++++++ .../templates/ims/skeleton/imsart.cls | 151 + .../templates/ims/skeleton/imsart.sty | 4637 +++++++++++++++++ .../templates/ims/skeleton/skeleton.Rmd | 414 ++ inst/rmarkdown/templates/ims/template.yaml | 4 + man/article.Rd | 26 + tests/testit/test-formats.R | 10 +- 16 files changed, 10238 insertions(+), 4 deletions(-) create mode 100644 inst/rmarkdown/templates/ims/LICENSE create mode 100644 inst/rmarkdown/templates/ims/resources/template.tex create mode 100644 inst/rmarkdown/templates/ims/skeleton/ims.bib create mode 100644 inst/rmarkdown/templates/ims/skeleton/imsart-nameyear.bst create mode 100644 inst/rmarkdown/templates/ims/skeleton/imsart-number.bst create mode 100644 inst/rmarkdown/templates/ims/skeleton/imsart.cls create mode 100644 inst/rmarkdown/templates/ims/skeleton/imsart.sty create mode 100644 inst/rmarkdown/templates/ims/skeleton/skeleton.Rmd create mode 100644 inst/rmarkdown/templates/ims/template.yaml diff --git a/DESCRIPTION b/DESCRIPTION index 03918da38..9fa8edda9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -45,7 +45,8 @@ Authors@R: c( person('Jay', 'Hesselberth', role = c('aut', 'ctb'), email = 'jay.hesselberth@gmail.com', comment = c(ORCID = '0000-0002-6299-179X')), person("Alfredo", "Hernández", role = c("ctb"), email = "aldomann.designs@gmail.com", comment = c(ORCID = "0000-0002-2660-4545")), person("Christophe", "Dervieux", role = c("aut"), email = "cderv@rstudio.com", comment = c(ORCID = "0000-0003-4474-2498")), - person("Stefano", "Coretta", role = c("ctb"), email = "stefano.coretta@gmail.com", comment = c(ORCID = "0000-0001-9627-5532", github = "stefanocoretta")) + person("Stefano", "Coretta", role = c("ctb"), email = "stefano.coretta@gmail.com", comment = c(ORCID = "0000-0001-9627-5532", github = "stefanocoretta")), + person("Alvaro", "Uzaheta", role = c("ctb"), email = "alvaro.uzaheta@gess.ethz.ch", comment = c(github = "auzaheta")) ) Description: A suite of custom R Markdown formats and templates for authoring journal articles and conference submissions. diff --git a/NAMESPACE b/NAMESPACE index 55dcb2d55..36319c927 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -17,6 +17,7 @@ export(ctex_article) export(elsevier_article) export(frontiers_article) export(ieee_article) +export(ims_article) export(jasa_article) export(joss_article) export(journals) diff --git a/NEWS.md b/NEWS.md index 9ca34dfd1..3a3727beb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,8 @@ rticles 0.19 - Add article template `pihph_article()` for the *Papers in Historical Phonology* (PiHPh) (thanks, @stefanocoretta, #362). +- Add article template `ims_article()` for *Institute of Mathematical Statistics* Journals, e.g., *Annals of Applied Statistics* (thanks, @auzaheta, #372) + rticles 0.18 --------------------------------------------------------------------- diff --git a/R/article.R b/R/article.R index d9eb80f09..2f81fb0d9 100644 --- a/R/article.R +++ b/R/article.R @@ -175,6 +175,49 @@ frontiers_article <- function(..., keep_tex = TRUE) { pdf_document_format("frontiers", keep_tex = keep_tex, ...) } +#' @param journal one of \code{"aoas"}, \code{"aap"}, \code{"aop"}, \code{"aos"}, \code{"sts"} for \code{ims_article} +#' @section \code{ims_article}: Format for creating submissions to the Institute of Mathematical Statistics +#' \href{https://imstat.org/}{IMS} journals and publications. Adapted from +#' \url{https://github.com/vtex-soft/texsupport.ims-aoas}. +#' +#' The argument \code{journal} accepts the acronym of any of the +#' \href{https://www.e-publications.org/ims/support/ims-instructions.html}{journals} in IMS: +#' \itemize{ +#' \item \code{aap}: The Annals of Applied Probability +#' \item \code{aoas}: The Annals of Applied Statistics +#' \item \code{aop}: The Annals of Probability +#' \item \code{aos}: The Annals of Statistics +#' \item \code{sts}: Statistical Science} +#' @export +#' @rdname article +ims_article <- function(journal = c("aoas", "aap", "aop", "aos", "sts"), + keep_tex = TRUE, citation_package = "natbib", + md_extensions = c( + "-autolink_bare_uris" # disables automatic links + ), ...) { + + journal <- match.arg(journal) + if (length(journal) > 1) stop("Please choose just one ", dQuote("journal")) + + with_kwsc <- journal %in% c("aap", "aop", "aos") # with keyword_subclass + + args <- c( + "journal" = journal, + if (with_kwsc) c("with_kwsc" = with_kwsc) + ) + + # Convert to pandoc arguments + pandoc_arg_list <- mapply(rmarkdown::pandoc_variable_arg, names(args), args, + SIMPLIFY = FALSE, USE.NAMES = FALSE) + pandoc_arg_list <- unlist(pandoc_arg_list) + + pdf_document_format( + "ims", keep_tex = keep_tex, citation_package = citation_package, + md_extensions = md_extensions, pandoc_args = pandoc_arg_list, + ... + ) +} + #' @section \code{jasa_article}: Format for creating submissions to the #' Journal of the Acoustical Society of America. Adapted from #' \url{https://acousticalsociety.org/preparing-latex-manuscripts/}. diff --git a/README.md b/README.md index e5478ba07..fab49fd61 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ Currently included templates and their contributors are the following: | [Elsevier](https://www.elsevier.com) | [@cboettig](https://github.com/cboettig) | [#27](https://github.com/rstudio/rticles/pull/27) | `elsevier_article()` | | [Frontiers](https://www.frontiersin.org/) | [@muschellij2](https://github.com/muschellij2) | [#211](https://github.com/rstudio/rticles/pull/211) | `frontiers_article()` | | [IEEE Transaction](http://www.ieee.org/publications_standards/publications/authors/author_templates.html) | [@Emaasit](https://github.com/Emaasit), [@espinielli](https://github.com/espinielli), [@nathanweeks](https://github.com/nathanweeks), [@DunLug](https://github.com/DunLug) | [#97](https://github.com/rstudio/rticles/pull/97), [#169](https://github.com/rstudio/rticles/pull/169), [#227](https://github.com/rstudio/rticles/pull/227), [#263](https://github.com/rstudio/rticles/pull/263), [#264](https://github.com/rstudio/rticles/pull/264), [#265](https://github.com/rstudio/rticles/pull/265) | `ieee_article()` | +| [IMS: Institute of Mathematical Statistics](https://imstat.org/) [AoAS: Annals of Applied Statistics](https://imstat.org/journals-and-publications/annals-of-applied-statistics/) | [@auzaheta](https://github.com/auzaheta) | [#372](https://github.com/rstudio/rticles/pull/372) | `ims_article()` | | [JASA: Journal of the Acoustical Society of America](https://asa.scitation.org/journal/jas) | [@stefanocoretta](https://github.com/stefanocoretta) | [#364](https://github.com/rstudio/rticles/pull/364) | `jasa_article()` | | [JOSS: Journal of Open Source Software](https://joss.theoj.org/) [JOSE: Journal of Open Source Education](https://jose.theoj.org/) | [@noamross](https://github.com/noamross) | [#229](https://github.com/rstudio/rticles/pull/229) | `joss_article()` | | [JSS: Journal of Statistical Software](https://www.jstatsoft.org) | | | `jss_article()` | diff --git a/inst/rmarkdown/templates/ims/LICENSE b/inst/rmarkdown/templates/ims/LICENSE new file mode 100644 index 000000000..2e0160c61 --- /dev/null +++ b/inst/rmarkdown/templates/ims/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 VTeX Software + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/inst/rmarkdown/templates/ims/resources/template.tex b/inst/rmarkdown/templates/ims/resources/template.tex new file mode 100644 index 000000000..c0376572f --- /dev/null +++ b/inst/rmarkdown/templates/ims/resources/template.tex @@ -0,0 +1,236 @@ +\documentclass[$journal$]{imsart} +%% LaTeX 2e style file for the processing of LaTeX2e files +%% of the following IMS/BS journals: +%% +%% - The Annals of Probability +%% - The Annals of Applied Probability +%% - The Annals of Statistics +%% - The Annals of Applied Statistics +%% - Statistical Science +%% - Probability Surveys +%% - Statistics Surveys +%% - Electronic Journal of Statistics +%% - Bernoulli +%% - Annales de l'Institut Henri Poincar\'e - Probabilit\'es et Statistiques +%% - Brazilian Journal of Probability and Statistics +%% - Bayesian Analysis +%% +%% - Institute of Mathematical Statistics, U.S.A. +%% - Bernoulli Society +%% - Institut Henry Poincare +%% - Brazilian Statistical Association +%% - International Society for Bayesian Analysis +%% +%% Macros written by Vytas Statulevicius, VTeX, Lithuania +%% Maintained by TeX group members, VTeX, Lithuania +%% for Institute of Mathematical Statistics, U.S.A. +%% Please submit bugs or your comments to latex-support@vtex.lt +%% +%% The original distribution is located at: +%% https://www.e-publications.org/ims/support + +\RequirePackage{amsthm,amsmath,amsfonts,amssymb} +\RequirePackage[authoryear]{natbib} +\RequirePackage[colorlinks,citecolor=blue,urlcolor=blue]{hyperref} +\RequirePackage{graphicx} + +% Added package +\usepackage[T1]{fontenc} +\usepackage[english]{babel} + +% Pandoc syntax highlighting +$if(highlighting-macros)$ +$highlighting-macros$ +$endif$ + +% Pandoc citation processing +$if(csl-refs)$ +\newlength{\csllabelwidth} +\setlength{\csllabelwidth}{3em} +\newlength{\cslhangindent} +\setlength{\cslhangindent}{1.5em} +% for Pandoc 2.8 to 2.10.1 +\newenvironment{cslreferences}% + {$if(csl-hanging-indent)$\setlength{\parindent}{0pt}% + \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces$endif$}% + {\par} +% For Pandoc 2.11+ +\newenvironment{CSLReferences}[3] % #1 hanging-ident, #2 entry spacing + {% don't indent paragraphs + \setlength{\parindent}{0pt} + % turn on hanging indent if param 1 is 1 + \ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi + % set entry spacing + \ifnum #2 > 0 + \setlength{\parskip}{#2\baselineskip} + \fi + }% + {} +\usepackage{calc} % for calculating minipage widths +\newcommand{\CSLBlock}[1]{#1\hfill\break} +\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}} +\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}} +\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1} +$endif$ + + +% Garantees bookdown compilation +%\usepackage{lmodern} + +\makeatletter +\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi} +\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi} +\makeatother +% Scale images if necessary, so that they will not overflow the page +% margins by default, and it is still possible to overwrite the defaults +% using explicit options in \includegraphics[width, height, ...]{} +\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio} +% Set default figure placement to htbp +\makeatletter +\def\fps@figure{htbp} +\makeatother +\setlength{\emergencystretch}{3em} % prevent overfull lines +\providecommand{\tightlist}{% + \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} + +% alternative version to the shaded problem +\makeatletter +\@ifundefined{Shaded}{ +}{\renewenvironment{Shaded}{\begin{kframe}}{\end{kframe}}} +\makeatother + +$if(predefined-theoremstyle)$ +\startlocaldefs +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% +% Uncomment next line to change %% +% the type of equation numbering %% +% %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\numberwithin{equation}{section} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% +% For Axiom, Claim, Corollary, Hypothezis, %% +% Lemma, Theorem, Proposition %% +% use \theoremstyle{plain} %% +% %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\theoremstyle{plain} +\newtheorem{axiom}{Axiom} +\newtheorem{claim}[axiom]{Claim} +\newtheorem{theorem}{Theorem}[section] +\newtheorem{lemma}[theorem]{Lemma} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% +% For Assumption, Definition, Example, %% +% Notation, Property, Remark, Fact %% +% use \theoremstyle{remark} %% +% %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\theoremstyle{remark} +\newtheorem{definition}[theorem]{Definition} +\newtheorem*{example}{Example} +\newtheorem*{fact}{Fact} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Please put your definitions here: %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\endlocaldefs +$endif$ + +% pandoc header +$for(header-includes)$ +$header-includes$ +$endfor$ + +\begin{document} +\begin{frontmatter} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% %% +%% Enter the title of your article here %% +%% %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\title{$title$$if(thanks)$$for(thanks)$\thanksref{$thanks.ref$}$endfor$$endif$} +%\title{A sample article title with some additional note\thanksref{T1}} +\runtitle{$runtitle$} +%\thankstext{T1}{A sample of additional note to the title.} + +$if(thanks)$ +$for(thanks)$ +\thankstext{$thanks.ref$}{$thanks.text$}$sep$ +$endfor$ +$endif$ + + +\begin{aug} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%Only one address is permitted per author. %% +%%Only division, organization and e-mail is %% +%%included in the address. %% +%%Additional information can be included in %% +%%the Acknowledgments section if necessary. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Example: +%%\author[A]{\fnms{First} \snm{Author}\ead[label=e1]{first@somewhere.com}}, +%%\author[B]{\fnms{Second} \snm{Author}\ead[label=e2,mark]{second@somewhere.com}} +%%\and +%%\author[B]{\fnms{Third} \snm{Author}\ead[label=e3,mark]{third@somewhere.com}} + +$for(author)$ +\author[$author.addressLabel$]{\fnms{$author.name$} \snm{$author.surname$} + \ead[label=$author.label$]{$author.email$}} + $if(author.sepNext)$$author.sepNext$$endif$ +$endfor$ + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Addresses %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Example: +%%\address[B]{Department, +%%University or Company Name, +%%\printead{e2,e3}} +$for(affiliation)$ +\address[$affiliation.label$]{$affiliation.name$, + \printead{$affiliation.authorsLabels$}} +$sep$ +$endfor$ +\end{aug} + +\begin{abstract} +$abstract$ +\end{abstract} + +$if(with_kwsc)$ +$for(keyword-subclass)$ +$keyword-subclass$ +$endfor$ +$endif$ + +\begin{keyword} +$for(keywords)$ +\kwd{$keywords$} +$sep$ +$endfor$ +\end{keyword} + +\end{frontmatter} + +$if(toc)$ +\tableofcontents +$endif$ + +$body$ + +$if(bibliography)$ +$if(biblio-style)$ +\bibliographystyle{$biblio-style$} +$endif$ +\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$} +$endif$ + +$for(include-after)$ +$include-after$ + +$endfor$ + +\end{document} diff --git a/inst/rmarkdown/templates/ims/skeleton/ims.bib b/inst/rmarkdown/templates/ims/skeleton/ims.bib new file mode 100644 index 000000000..9bd2b8b75 --- /dev/null +++ b/inst/rmarkdown/templates/ims/skeleton/ims.bib @@ -0,0 +1,30 @@ +@book{billingsley2013convergence, + title={Convergence of Probability Measures}, + author={Billingsley, Patrick}, + year={1999}, + publisher={John Wiley \& Sons}, + edition={2nd ed.} +} +@book{bourbaki1966general, + title={General Topology}, + author={Bourbaki, Nicolas}, + volume={1}, + year={1966}, + publisher={Addison--Wesley, Reading, MA.} +} +@book{ethier1985markov, + title={Markov Processes: Characterization and Convergence}, + author={Ethier, Stewart N and Kurtz, Thomas G}, + year={1985}, + publisher={Wiley, New York} +} +@article{prokhorov1956convergence, + title={Convergence of random processes and limit theorems in probability theory}, + author={Prokhorov, Yu V}, + journal={Theory of Probability \& Its Applications}, + volume={1}, + number={2}, + pages={157--214}, + year={1956}, + publisher={SIAM} +} diff --git a/inst/rmarkdown/templates/ims/skeleton/imsart-nameyear.bst b/inst/rmarkdown/templates/ims/skeleton/imsart-nameyear.bst new file mode 100644 index 000000000..97477e229 --- /dev/null +++ b/inst/rmarkdown/templates/ims/skeleton/imsart-nameyear.bst @@ -0,0 +1,2332 @@ +%% This is file `imsart-nameyear.bst' +%% +%% +%% You are free to use this style file as you see fit, provided +%% that you do not make changes to the file. +%% If you DO make changes, you are required to rename this file. +%% +%% It may be distributed under the terms of the LaTeX Project Public +%% License, as described in lppl.txt in the base LaTeX distribution. +%% Either version 1.0 or, at your option, any later version. +%% +%% TeX programming: Linas Stonys, VTeX, Lithuania, lstonys@vtex.lt +%% +%% This bibtex style produces structured bibliography (.bbl) file which could be +%% converted back into the database (.bib) format. +%% bibtex program must be invoked with the maximum allocation of memory (-w switch) +%% +%% This bibtex style could be used only with the imsart package +%% starting with version from 2009/08/13 + +%% 2010-02-01 - splited inits "A.D." -> "A. D." and "A.{\,}D." -> "A. D." +%% 2010-03-19 - fixed sorting. +%% 2011-01-07 - inserted options: sort, nameyear, alpha, number. +%% 2013-01-28 - added: arxiv, mrnumber. Changed tags. + +ENTRY + { address + author + arxiv + booktitle + bpt_note + bpt_ok + chapter + doi + edition + editor + howpublished + institution + isbn + journal + key + month + mrnumber + note + number + organization + pages + publisher + school + series + src + sortkey + title + type + volume + year + url + id + options + } + {} + { label extra.label sort.label short.list } + +INTEGERS { output.state before.all mid.sentence after.sentence + after.block between.elements } + +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := + #5 'between.elements := +} + +STRINGS { s t tmp1 tmp2 tmp3 tmp4 tmp5} +STRINGS { longest.label last.label list.string temp.str default.list} + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} + +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} + +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} + + +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { " " * write$ newline$} + { output.state after.block = + { add.period$ write$ + newline$ + % "\newblock " write$ + } + { output.state between.elements = + { ", " * write$ newline$ } + { output.state before.all = + 'write$ + { add.period$ " " * write$ newline$} + if$ + } + 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 {insert.comma} +{ output.state before.all = + 'skip$ + { between.elements 'output.state := } + if$ +} +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state :=} + if$ + } + if$ +} + + +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} + +STRINGS { v l f j b ff} +INTEGERS { nameptr namesleft numnames bother} +INTEGERS {str.length count return save.num1 save.num2 save.num3 save.num4 int done} +FUNCTION {is.in.list}{ + 'f := + %%%% issisaugoju originalius "s" ir "t" + s 'j := + f 's := + t 'f := + list.string text.length$ 'str.length := + list.string 't := +% s text.length$ 'slen := + int 'save.num1 := + count 'save.num2 := + #1 'int := + #1 'count := + #0 'return := + + { count str.length = not + #0 str.length = not + and + } + { + count #1 + 'count := + t int #1 substring$ "," = + { + t #1 int substring$ s "," * = + { + #1 'return := + str.length 'count := + } + 'skip$ + if$ + + int #1 + 'int := + t int global.max$ substring$ 't := + #0 'int := + } + 'skip$ + if$ + int #1 + 'int := +% "count=" count int.to.str$ * " slen=" * str.length int.to.str$ * top$ + } + while$ + + save.num1 'int := + save.num2 'count := + + #0 return = + { s t = + {#1 'return :=} + 'skip$ + if$ + } + 'skip$ + if$ + %%%% grazinu originalius "s" ir "t" + j 's := + f 't := + + return +} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% formating bbl +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.tag} +{ 't := + duplicate$ empty$ + { pop$ "" } + { bother #0 = + { t "volume" = + {"\textbf{" swap$ * "}" * } + 'skip$ + if$ + } + { "\b" t * "{" * swap$ * "}" * } + if$ + } + if$ +} + +INTEGERS {sk} +FUNCTION {is.num} +{ chr.to.int$ + duplicate$ "0" chr.to.int$ < not + swap$ "9" chr.to.int$ > not and +} + +FUNCTION {byear} +{ duplicate$ empty$ + { pop$ "" } + {'t := + t text.length$ 'sk := + #5 sk = + {t #1 #4 substring$ 's := + t #5 #1 substring$ 'longest.label := + longest.label is.num not + {"\byear{" s * "}" * longest.label * } + {"\byear{" t * "}" * } + if$ + } + {t "year" make.tag + "type=nameyear" is.in.list + {extra.label *} + 'skip$ + if$ + } + if$ + } + if$ +} + + + +FUNCTION {format.address} +{address empty$ + { "" } + {address "address" make.tag } + if$ +} + +FUNCTION {format.organization} +{organization empty$ + { "" } + {organization "publisher" make.tag} + if$ +} + +FUNCTION {format.org} +{organization empty$ + { "" } + {organization "organization" make.tag add.period$} + if$ +} + + + + +FUNCTION {format.pub.address} +{ publisher empty$ + { "" } + { publisher "publisher" make.tag + address empty$ + 'skip$ + {", " * format.address * add.period$} + if$ + } + if$ +} + +FUNCTION {mk.tag} +{ 'temp.str := + duplicate$ empty$ + { pop$ "" } + { + b "nothing" = + 'skip$ + {"\b" temp.str * "{" * swap$ * "}" * } + if$ + } + if$ +} + +FUNCTION {space.after.dot} +{'t := + "" 'l := + "" 's := + { t empty$ not } + { t #1 #1 substring$ 's := + l s * 'l := + s "." = + { t #2 #1 substring$ " " = + 'skip$ + { + l " " * 'l := + t #2 #4 substring$ "{\,}" = + { + t #5 global.max$ substring$ 't := + } + 'skip$ + if$ + } + if$ + } + 'skip$ + + if$ + t #2 global.max$ substring$ 't := + } + while$ + l +} + +FUNCTION {format.author.editor} +{ 'b := + + b "editor" = + b "beditor" = + b "editor2" = + or or + {editor space.after.dot 's :=} + {author space.after.dot 's :=} + if$ + + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { + s nameptr "{vv}" format.name$ "particle" mk.tag 'v := + s nameptr "{ll}" format.name$ "snm" mk.tag 'l := + s nameptr "{f.}" format.name$ "inits" mk.tag 'f := + s nameptr "{ff}" format.name$ "fnm" mk.tag 'ff := + s nameptr "{jj}" format.name$ "suffix" mk.tag 'j := + + j empty$ + {"" 'j :=} + {" " j * 'j :=} + if$ + + v empty$ + {"" 'v :=} + {v " " * 'v :=} + if$ + + l "\bsnm{others}" = + { "et~al." "etal" make.tag * } + { + b "editor2" = + {"\beditor{" * ff * f * + ff "" = f "" = and + 'skip$ + {"~" * } + if$ + v * l * j * "}" * "" 't := + } + 'skip$ + if$ + + b "author" = + b "editor" = + or + {"\b" * b * "{" * v * l * + ff "" = f "" = and + 'skip$ + {",~" * } + if$ + ff * f * j * "}" * "" 't :=} + 'skip$ + if$ + + } + if$ + + namesleft #0 > + { namesleft #1 > + { namesleft #2 = + { s numnames "{ll}" format.name$ "others" = + {" " * t * } + {" \AND " * t * } + if$ + } + {", " * t * } + if$ + } + {""} + if$ + } + 't + + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + + +FUNCTION {format.editors} +{ editor empty$ + {""} + { + bother #0 = + {author empty$ + {"editor"} + {"nothing"} + if$ + } + {"editor"} + if$ + format.author.editor + editor num.names$ #1 > + { ", eds." * } + { ", ed." * } + if$ + } + if$ +} + +FUNCTION {format.authors} +{ author empty$ + {""} + {"author" format.author.editor} + if$ +} + +FUNCTION {make.editors} +{ editor empty$ + { "" } + { "(" + + bother #0 = + {author empty$ + {"editor"} + {"nothing"} + if$ + } + {"editor2"} + if$ + format.author.editor + * + editor num.names$ #1 > + { ", eds.)" * } + { ", ed.)" * } + if$ + } + if$ +} + + + +FUNCTION {cite.author.editor} +{ 's := + + s #1 "{vv~}{ll}" format.name$ + s num.names$ duplicate$ + #3 > + { pop$ " et~al." * } + { #3 = + { s #3 "{vv~}{ll}{ jj}{ f}" format.name$ "others" = + { " et~al." * } + { ", " * s #2 "{vv~}{ll}" format.name$ * + " and " * s #3 "{vv~}{ll}" format.name$ * + } + if$ + } + {s num.names$ #2 = + {s #2 "{vv~}{ll}{ jj}{ f}" format.name$ "others" = + { " et~al." * } + { " and " * s #2 "{vv~}{ll}" format.name$ * } + if$ + } + 'skip$ + if$ + } + if$ + } + if$ +} + + +FUNCTION {check.auth.edit.org} +{author empty$ + { + editor empty$ + { + organization empty$ + {""} + {organization} + if$ + } + {editor cite.author.editor} + if$ + } + {author cite.author.editor} + if$ +} + +FUNCTION {check.year} +{year empty$ + {""} + {year extra.label * + } + if$ +} + +FUNCTION {output.bibitem} +{ newline$ + "\bibitem" + "type=nameyear" is.in.list + { + "[\protect\citeauthoryear{" * write$ + check.auth.edit.org write$ + "}{" write$ + check.year write$ + "}]" + } + 'skip$ + if$ + "type=alpha" is.in.list + { + "[" * write$ + label write$ + "]" + } + 'skip$ + if$ + + "{" * write$ + cite$ write$ + "}" write$ + newline$ + "" before.all 'output.state := +} + +INTEGERS { multiresult char.num k } + + +FUNCTION {string.to.integer} +{ 't := + t text.length$ 'k := + #1 'char.num := + { t char.num #1 substring$ 's := + s is.num + s "." = + or + char.num k = not + and + } + {char.num #1 + 'char.num :=} + while$ + char.num #1 - 'char.num := + t #1 char.num substring$ +} + +FUNCTION {check.mrnumber} +{mrnumber 't := + "" + { t empty$ not } + { t #1 #2 substring$ "\#" = + { t #1 #2 substring$ * + t #2 global.max$ substring$ 't := + } + { + t #1 #1 substring$ "#" = + { "\#" * + t #2 global.max$ substring$ 't := + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + if$ + } + while$ +} + + +FUNCTION {remove.braces} +{'t := + "" + { t empty$ not } + { t #1 #1 substring$ "{" = + t #1 #1 substring$ "}" = + or + { + t #2 global.max$ substring$ 't := + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {format.mrnumber} +{ mrnumber empty$ + { "" } + { bother #0 = + {check.mrnumber} + {"\bmrnumber{" check.mrnumber * "}" * } + if$ + } + if$ +} + +INTEGERS { found } +FUNCTION {cut.info} +{ 't := + #0 'found := + "" 's := + "" 'v := + { t empty$ not } + { + t #1 #5 substring$ "info:" = + { + t #6 global.max$ substring$ 't := + #1 'found := + "}" 'v := + } + 'skip$ + if$ + + t #1 #1 substring$ "/" = + #1 found = + and + { + t #2 global.max$ substring$ 't := + s "={" * 's := + #0 'found := + + } + 'skip$ + if$ + + t #1 #2 substring$ ", " = + v "}" = + and + { + t #2 global.max$ substring$ 't := + s "}," * 's := + } + 'skip$ + if$ + s t #1 #1 substring$ * 's := + t #2 global.max$ substring$ 't := + } + while$ +s v * +} + +FUNCTION {format.id} +{ id empty$ + { "" } + { bother #0 = + { "" } + {"\bid{" id cut.info * "}" * } + if$ + } + if$ +} + +FUNCTION {format.journal} +{ journal empty$ + { "" } + { bother #0 = + {journal "t" change.case$} + {"\bjournal{" journal * "}" * } + if$ + } + if$ +} +FUNCTION {title.sep} +{ type$ "article" = + type$ "incollection" = + type$ "inproceedings" = + type$ "booklet" = + type$ "unpublished" = + or or or or + 'add.period$ + 'skip$ + if$ + + type$ "inbook" = + type$ "manual" = + or + edition empty$ not + and + {"," *} + { + edition empty$ + series empty$ not + and + 'add.period$ + 'skip$ + if$ + } + if$ + + type$ "book" = + { + edition empty$ not + series empty$ not + and + {"," *} + { + edition empty$ + series empty$ not + and + 'add.period$ + 'skip$ + if$ + } + if$ + } + 'skip$ + if$ + +} + +FUNCTION {format.title} +{ title empty$ + { "" } + { + title "title" make.tag + title.sep + } + if$ +} +FUNCTION {format.year} +{ year empty$ + {""} + { bother #0 = + {"(" year extra.label * * ")." *} + {"(" year byear * ")." *} + if$ + } + if$ +} + +FUNCTION {format.month} +{ month empty$ + {""} + { "\bmonth{" month * "}" *} + if$ +} +FUNCTION {format.type} +{ type empty$ + {""} + { "\btype{" type * "}" *} + if$ +} + +FUNCTION {formatpatent.date} +{ year empty$ + { month empty$ + { "" } + { "there's a month but no year in " cite$ * warning$} + + if$ + } + { month empty$ + { year byear} + {format.month " " * year byear *} + if$ + } + if$ +} +FUNCTION {format.btitle} +{ title "btitle" make.tag +} + + + +FUNCTION {format.note} +{ note empty$ + {""} + { note "note" make.tag} + if$ +} +FUNCTION {format.bptnote} +{bpt_note empty$ + {""} + {"\bptnote{" bpt_note * "}%" * } +if$ +} +FUNCTION {format.bptok} +{bpt_ok empty$ + {""} + {"\bptok{" bpt_ok * "}%" * } +if$ +} + +FUNCTION {add.note} +{ note empty$ + {""} + { note } + if$ +} +FUNCTION {format.chapter} +{chapter empty$ + {""} + {"\bchapter{" chapter * "}" * } +if$ +} + + +FUNCTION {chap.type} +{chapter empty$ + {""} + { type empty$ + { "Chapter "} + { type "Section" = + { "Section "} + { "Chapter "} + if$ + } + if$ + "\bchapter{" chapter * "}" * * + } +if$ +} + + +FUNCTION {chap.note} +{ format.note output + new.sentence +} + +FUNCTION {tie.or.space.connect} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ * * +} +FUNCTION {no.space.connect} +{ duplicate$ text.length$ #3 < + { "" } + { "" } + if$ + swap$ * * +} + + +%%%%%%%%%%%%%%%%%%%%%%%%%% patent names +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} +FUNCTION {format.series} +{ series empty$ + { "" } + { bother #0 = + {series} + {"\bseries{" series * "}" * } + if$ + } + if$ +} +FUNCTION {format.edition} +{ edition empty$ + { "" } + { output.state mid.sentence = + { edition "l" change.case$ } + { edition "t" change.case$ } + if$ + "edition" make.tag + " ed." * + } + if$ +} + + +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.isbn} +{ isbn empty$ + { "" } + {"\bisbn{" isbn * "}" *} + if$ +} + +FUNCTION {format.school} +{ school empty$ + {""} + {"\bpublisher{" school * "}" * } + if$ +} + +FUNCTION {format.institution} +{ institution empty$ + {""} + { bother #0 = + {institution} + { "techreport" type$ = + {"\bpublisher{" } + {"\binstitute{" } + if$ + + institution * "}" * + } + if$ + } + if$ +} +FUNCTION {format.howpublished} +{ howpublished empty$ + {""} + { howpublished "howpublished" make.tag } + if$ +} + +FUNCTION {format.vol} +{ volume empty$ + number empty$ + and + {""} + { volume empty$ + {number} + {volume} + if$ + "volume" make.tag + } + if$ +} + +FUNCTION {note.presented} + {note #1 #9 substring$ "presented" = + note #1 #9 substring$ "Presented" = + or} + + + +FUNCTION {format.url} +{ url empty$ + { "" } + {"\url{" url * "}" * } + if$ +} + +FUNCTION {format.arxiv} +{ arxiv empty$ + { "" } + {"\arxiv{" arxiv * "}" * } + if$ +} + +FUNCTION {format.doi} +{ doi empty$ + {""} + {"\bdoi{" doi * "}" * } + if$ +} + +FUNCTION {format.ppages} +{ pages empty$ + {""} + {pages "pages" make.tag + add.period$ + } + if$ +} + + +FUNCTION {format.booktitle} +{ booktitle empty$ + { "" } + { bother #0 = + {"In " booktitle *} + {"In \bbooktitle{" booktitle * "}" *} + if$ + type$ "incollection" = + { series empty$ + volume empty$ + and + 'skip$ + { editor empty$ series empty$ not and + {"." *} + {"," *} + if$ + } + if$ + } + 'skip$ + if$ + + type$ "inproceedings" = + { series empty$ + editor empty$ +% volume empty$ not + and + 'skip$ + {editor empty$ + {"." *} + 'skip$ + if$ + } + if$ + } + 'skip$ + if$ + } + if$ +} + +FUNCTION {format.tr.number} +{ type empty$ + { "\btype{Technical Report}" } + { "\btype{" type * "}" * } + if$ + + number empty$ + 'skip$ + { " No. \bnumber{" number * "}" * * } + if$ + +% type empty$ not +% number empty$ + institution empty$ not + {"," *} + 'skip$ + if$ + +} + +FUNCTION {format.number} +{number empty$ + {""} + {"\bnumber{" number * "}" * } + if$ +} +INTEGERS { len } + +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} + + +FUNCTION {bcomment.note} +{note empty$ +'skip$ + {note "note" make.tag output add.period$} + if$ +} + +FUNCTION {empty.misc.check} +{ author empty$ title empty$ howpublished empty$ + month empty$ year empty$ note empty$ + and and and and and + { "all relevant fields are empty in " cite$ * warning$ } + 'skip$ + if$ +} + +FUNCTION {format.thesis.type} +{ type empty$ + 'skip$ + { pop$ + "\btype" type * "}" * + } + if$ +} + + +FUNCTION {element.type} +{ bother #0 = + {"\begin{botherref}" write$ newline$} + {"\begin{" write$ + "b" + "conference" type$ = + {"inproceedings"} + { + "proceedings" type$ = + {"book"} + 'type$ + if$ + } + if$ + * write$ + "}[" write$ + src empty$ + {"author" write$} + {src write$ } + if$ + "]" write$ newline$ + } + if$ +} +FUNCTION {end.element.type} +{write$ newline$ + bother #0 = + {"\end{botherref}" write$ newline$} + {"\end{" write$ + "b" + "conference" type$ = + {"inproceedings"} + { + "proceedings" type$ = + {"book"} + 'type$ + if$ + } + if$ + * write$ + "}" write$ newline$ + } + if$ + "\endbibitem" write$ newline$ +} +FUNCTION {same.end} +{ add.period$ + format.doi output + %new.sentence + format.mrnumber output + %new.sentence + %format.url output + new.sentence + format.arxiv output + new.sentence + format.id output + format.bptnote output + format.bptok output + } + +FUNCTION {settings}{} + +FUNCTION {article} +{ output.bibitem + #1 'bother := + element.type + format.authors output.nonnull + format.year output + format.title "title" output.check + format.journal output + format.vol output + format.ppages output + new.sentence + bcomment.note + same.end + end.element.type +} + + +FUNCTION {manual} +{ output.bibitem + #1 'bother := + element.type + author empty$ + { organization empty$ + 'skip$ + { format.organization output.nonnull} + if$ + } + { format.authors output.nonnull} + if$ + format.year output + new.sentence + format.title "title" output.check + + format.edition output + author empty$ + { organization empty$ + 'skip$ + { format.address output} + if$ + } + { format.organization output + address empty$ + 'skip$ + { insert.comma } + if$ + format.address output + } + if$ + % new.sentence + bcomment.note + same.end + end.element.type +} + + +FUNCTION {patent} +{ #1 'bother := + output.bibitem + element.type + format.authors output.nonnull + format.year output + format.title "title" output.check + format.number output + new.sentence + bcomment.note + same.end + end.element.type +} + +FUNCTION { other } { patent } + +FUNCTION {book} +{ output.bibitem + #1 'bother := + element.type + author empty$ + { format.editors output} + { format.authors output.nonnull} + if$ + format.year output + format.title output + series empty$ + { + format.vol output + edition empty$ + 'new.sentence + 'insert.comma + if$ + format.edition output + new.sentence + } + { + format.edition output + new.sentence + format.series output + format.vol output + new.sentence + } + if$ + format.pub.address output + bcomment.note + same.end + end.element.type +} + +FUNCTION {booklet} +{ #1 'bother := + output.bibitem + element.type + format.authors output.nonnull + format.year output + format.title "title" output.check + format.howpublished output + address empty$ + 'new.sentence + 'insert.comma + if$ + format.address output + bcomment.note + same.end + end.element.type +} + +FUNCTION {inbook} +{ output.bibitem + #1 'bother := + element.type + author empty$ + { format.editors output} + { format.authors output.nonnull} + if$ + format.year output + format.title output + format.booktitle output + format.edition output + series empty$ + 'skip$ + {new.sentence} + if$ + format.series output + format.vol output + format.chapter output + chapter empty$ not + pages empty$ not + and + 'insert.comma + 'skip$ + if$ + format.ppages output + new.sentence + format.pub.address output + chap.note %output + new.sentence + same.end + end.element.type +} + +FUNCTION {incollection} +{ output.bibitem + #1 'bother := + element.type + format.authors output.nonnull + format.year output + format.title "title" output.check + format.booktitle "booktitle" output.check + format.edition output + make.editors output + series empty$ editor empty$ + or + 'skip$ + 'new.sentence + if$ + format.series output + format.vol output + format.chapter output + chapter empty$ not + pages empty$ not + and + 'insert.comma + 'skip$ + if$ + format.ppages output + format.pub.address output + bcomment.note + same.end + end.element.type +} + +FUNCTION {inproceedings} +{ output.bibitem + #1 'bother := + element.type + format.authors output.nonnull + format.year output + format.title "title" output.check + format.booktitle "booktitle" output.check + make.editors output + editor empty$ series empty$ + or + 'skip$ + 'new.sentence + if$ + format.series output + format.vol output + format.ppages output + new.sentence + publisher empty$ + {format.organization output} + {format.org output} + if$ + format.pub.address output + bcomment.note + same.end + end.element.type +} + +FUNCTION {conference} { inproceedings } + + +FUNCTION {mastersthesis} +{ #1 'bother := + output.bibitem + element.type + format.authors output.nonnull + format.year output + format.title "title" output.check + insert.comma + type empty$ + {"\btype{Master's thesis}" output.nonnull} + {format.type output} + if$ + school empty$ + 'skip$ + { insert.comma } + if$ + format.school output + address empty$ + 'skip$ + { insert.comma } + if$ + format.address output + bcomment.note + same.end + end.element.type +} + +FUNCTION {misc} +{ #1 'bother := + output.bibitem + element.type + author empty$ + { organization empty$ + 'skip$ + { format.org output.nonnull} + if$ + } + { format.authors output.nonnull} + if$ + format.year output + format.title "title" output.check + new.sentence + format.howpublished output + new.sentence + author empty$ + { organization empty$ + 'skip$ + { format.address output} + if$ + } + { format.organization output + address empty$ + 'skip$ + { insert.comma } + if$ + format.address output + } + if$ + new.sentence + bcomment.note + same.end + empty.misc.check + end.element.type +} + +FUNCTION {phdthesis} +{ #1 'bother := + output.bibitem + element.type + format.authors output.nonnull + format.year output + format.title "title" output.check + insert.comma + type empty$ + {"\btype{PhD thesis}" output.nonnull} + {format.type output} + if$ + school empty$ + 'skip$ + { insert.comma } + if$ + format.school output + address empty$ + 'skip$ + { insert.comma } + if$ + format.address output + bcomment.note + same.end + end.element.type +} + +FUNCTION {proceedings}{book} + +FUNCTION {techreport} +{ #1 'bother := + output.bibitem + element.type + format.authors output.nonnull + format.year output + format.title "title" output.check + format.tr.number output + format.institution output + new.sentence + address empty$ + 'skip$ + { insert.comma } + if$ + format.address output + bcomment.note + same.end + end.element.type +} + +FUNCTION {unpublished} +{ #1 'bother := + output.bibitem + element.type + format.authors output.nonnull + format.year output + format.title "title" output.check + bcomment.note + same.end + end.element.type +} + +FUNCTION {default.type} { unpublished } + + +READ + +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} + +%%%%% setting default options +FUNCTION {default.option.string} +{"sort=1,type=nameyear"} + +FUNCTION {set.default.opt} +{default.option.string 'list.string :=} + +EXECUTE {set.default.opt} +INTEGERS {length2} + + +FUNCTION {in.string}{ + l 'tmp1 := + v 'tmp2 := + + 'l := % chars + 'v := % string + l text.length$ 'length2 := + v text.length$ 'str.length := + + int 'save.num1 := + count 'save.num2 := + #1 'int := + #0 'count := + #0 'found := + + length2 str.length = + 'skip$ + { + l v = + {#1 'found :=} + { + { + count str.length = not + #0 str.length = not + and + } + { + count #1 + 'count := + v int length2 substring$ l = + { + #1 'found := + str.length 'count := % to finish while$ loop + } + 'skip$ + if$ + int #1 + 'int := + } + while$ + + } + if$ + } + if$ + save.num1 'int := + save.num2 'count := + tmp1 'l := + tmp2 'v := + + found +} + + +FUNCTION {split}{ + l 'tmp1 := + v 'tmp2 := + + 'l := % split by + 'v := % string to split + + l text.length$ 'length2 := + v text.length$ 'str.length := + + int 'save.num1 := + count 'save.num2 := + found 'save.num4 := + + #1 'int := + #0 'count := + #0 'found := + { + count str.length = not + #0 str.length = not + and + } + { + count #1 + 'count := + + v int length2 substring$ l = + { + v #1 int #1 - substring$ 'l := % surasta dalis + v int #1 + #100 substring$ 'v := % likusi dalis + #1 'found := + str.length 'count := % kad nutruktu ciklas + } + 'skip$ + if$ + int #1 + 'int := + } + while$ + save.num1 'int := + save.num2 'count := + + found #0 = + { + %l 'l := + "" 'l := + } + 'skip$ + if$ + save.num4 'found := + + v l + + tmp1 'l := + tmp2 'v := +} + +FUNCTION {add.option}{ + l 'tmp3 := + v 'tmp4 := + + + 'l := % option + 'v := % list + + v + v "" = + {""} + {","} + if$ + l * * + tmp3 'l := + tmp4 'v := +} + +FUNCTION {remove.option}{ + + %%%% issisaugoju originalius "s" ir "t" + l 'j := + v 'f := + + 'l := % option name + 'v := % list + + "" 'temp.str := % temporary list + + l text.length$ 'length2 := + v text.length$ 'str.length := + + int 'save.num1 := + count 'save.num2 := + done 'save.num3 := + + #1 'int := + #0 'count := + #0 'found := + + length2 str.length > + 'skip$ + { + #0 'done := + v 'f := + + {done #0 = } + { + + v "," in.string + { + v "," split + 'f := % rasta + 'v := % kas liko + + } + { + #1 'done := + v 'f := + } + if$ + + f l in.string + 'skip$ + { + temp.str f add.option 'temp.str := + } + if$ + } + while$ + + } + if$ + save.num1 'int := + save.num2 'count := + save.num3 'done := + + temp.str + j 'l := + f 'v := + +} + +FUNCTION {assign.opt}{ + % priskiriu options lauka, kad galeciau i(is)jungti "unsort" + "settings" type$ = + {options empty$ + 'skip$ + { + "" 'b := + "" 'tmp5 := + #0 'done := + + options "=" in.string % if options has '=' + { + options 'b := + b 'tmp5 := + + {done #0 = } + { + b "," in.string + { + b "," split + 'tmp5 := % rasta + 'b := % kas liko + } + { + #1 'done := + b 'tmp5 := + } + if$ + + tmp5 "=" in.string + { + tmp5 "=" split + 's := % before + 't := % after + list.string s remove.option 'list.string := + } + 'skip$ + if$ + + list.string tmp5 add.option 'list.string := + } + while$ + + } + 'skip$ + if$ + } + if$ + } + 'skip$ + if$ + +} + +ITERATE {assign.opt} + +INTEGERS { et.al.char.used } + +FUNCTION {initialize.et.al.char.used} +{ #0 'et.al.char.used := +} +EXECUTE {initialize.et.al.char.used} + +FUNCTION {format.lab.names.nameyear} +{ remove.braces 's := + s num.names$ 'numnames := + numnames #3 >% nuo kada daryti et~al. + { s #1 "{vv~}{ll}" format.name$ " et~al." * } + { + numnames #1 - 'namesleft := + #2 'nameptr := + s #1 "{vv~}{ll}" format.name$ + { namesleft #0 > } + { nameptr numnames = + { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { " et~al." * } + { " and " * s nameptr "{vv~}{ll}" format.name$ * } + if$ + } + { ", " * s nameptr "{vv~}{ll}" format.name$ * } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } + if$ +} + + +FUNCTION {format.lab.names.number} +{ remove.braces 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr "{ vv }{ ll }{ f }{ jj }" format.name$ 't := + + t sortify * " " * + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$} + +FUNCTION {format.lab.names.alpha} +{ 's := + s num.names$ 'numnames := + numnames #1 > + { numnames #4 > + { #3 'namesleft := } + { numnames 'namesleft := } + if$ + #1 'nameptr := + "" + { namesleft #0 > } + { nameptr numnames = + { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { "+" * + #1 'et.al.char.used := + } + { s nameptr "{v{}}{l{}}" format.name$ * } + if$ + } + { s nameptr "{v{}}{l{}}" format.name$ * } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + numnames #4 > + { "+" * + #1 'et.al.char.used := + } + 'skip$ + if$ + } + { s #1 "{v{}}{l{}}" format.name$ + duplicate$ text.length$ #2 < + { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ } + 'skip$ + if$ + } + if$ +} +FUNCTION {format.lab.names}{ + "type=nameyear" is.in.list + 'format.lab.names.nameyear + { + "type=alpha" is.in.list + 'format.lab.names.alpha + 'format.lab.names.number + if$ + } + if$ +} +FUNCTION {author.key.label} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.editor.key.label} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.key.organization.label} +{ author empty$ + { key empty$ + { organization empty$ + { cite$ #1 #3 substring$ } + { "The " #4 organization chop.word #3 text.prefix$ } + if$ + } + 'key + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {editor.key.organization.label} +{ editor empty$ + { key empty$ + { organization empty$ + { cite$ #1 #3 substring$ } + { "The " #4 organization chop.word #3 text.prefix$ } + if$ + } + 'key + if$ + } + { editor format.lab.names } + if$ +} + +FUNCTION {calc.short.authors} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.label + { type$ "proceedings" = + 'editor.key.organization.label + { type$ "manual" = + 'author.key.organization.label + 'author.key.label + if$ + } + if$ + } + if$ + 'short.list := +} + +FUNCTION {calc.label} +{ calc.short.authors + short.list + + "type=alpha" is.in.list + { + duplicate$ + year field.or.null purify$ #-1 #2 substring$ + * + 'label := + year field.or.null purify$ #-1 #4 substring$ + * + sortify 'sort.label := + } + { + "(" + * + year duplicate$ empty$ + short.list key field.or.null = or + { pop$ "" } + 'skip$ + if$ + * + 'label := + label 'sort.label := + } + if$ +} + +FUNCTION {sort.format.names.nameyear} +{ remove.braces 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + {% nameptr #1 > + % { " " * numnames int.to.str$ * " " *} + % 'skip$ + % if$ + s nameptr "{vv }{ll}" format.name$ 't := + nameptr numnames = + t "others" = + and + { "et al" * } + { t sortify * " " * + #3 numnames = + #2 numnames = + or + #2 nameptr = + and + {year empty$ + 'skip$ + {year * " " *} + if$ + } + 'skip$ + if$ + } + if$ + #3 numnames < + {#0 'namesleft := + "zzz " * + } + { + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + if$ + } + while$ +} + +FUNCTION {sort.format.names.number} +{ remove.braces 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr "{vv }{ll }{f }{jj}" format.name$ 't := + nameptr numnames = + t "others" = + and + { "et al" * } + { t sortify * " " *} + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {sort.format.names.alpha} +{ 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { nameptr #1 > + { " " * } + 'skip$ + if$ + s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't := + nameptr numnames = + t "others" = + and + { "et al" * } + { t sortify * } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {sort.format.names}{ + "type=nameyear" is.in.list + 'sort.format.names.nameyear + { + "type=alpha" is.in.list + 'sort.format.names.alpha + 'sort.format.names.number + if$ + } + if$ +} + +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$ + "zzz" + } + { 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$ + "z" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ + } + { author sort.format.names } + if$ +} + +FUNCTION {author.organization.sort} +{ author empty$ + { organization empty$ + { key empty$ + { "to sort, need author, organization, or key in " cite$ * warning$ + "z" + } + { key sortify } + if$ + } + { "The " #4 organization chop.word sortify } + if$ + } + { author sort.format.names } + if$ +} + +FUNCTION {editor.organization.sort} +{ editor empty$ + { organization empty$ + { key empty$ + { "to sort, need editor, organization, or key in " cite$ * warning$ + "z" + } + { key sortify } + if$ + } + { "The " #4 organization chop.word sortify } + if$ + } + { editor sort.format.names } + if$ +} + +FUNCTION {presort} +{ calc.label + sort.label sortify + " " + * + type$ "book" = + type$ "inbook" = + or + {author empty$ + 'editor.organization.sort + 'author.organization.sort + if$ + } + { type$ "proceedings" = + type$ "incollection" = + or + {author empty$ + 'editor.organization.sort + 'author.organization.sort + if$ + } + { type$ "manual" = + type$ "misc" = + or + 'author.organization.sort + 'author.sort + if$ + } + if$ + } + if$ + " " + * + year field.or.null sortify + * + " " + * + %%%% removing title from the sorting line + %title field.or.null sort.format.title + %* + #1 entry.max$ substring$ 'sort.label := +% sort.label top$ + sort.label * + #1 entry.max$ substring$ 'sort.key$ := + + %sort.key$ top$ +} + +ITERATE {presort} + +FUNCTION {bib.sort.order} +{ + "settings" type$ = + {"aaa"} + {"sort=0" is.in.list + {"bb"} + {"type=alpha" is.in.list + {sort.key$} + {sort.label} + if$ + } + if$ + } + if$ + 'sort.key$ := + %sort.key$ top$ +} + +ITERATE {bib.sort.order} + +SORT + + +INTEGERS { longest.label.width last.extra.num number.label } + +FUNCTION {initialize.longest.label} +{ "" 'longest.label := + #0 int.to.chr$ 'last.label := + "" 'j := + #0 'longest.label.width := + #0 'last.extra.num := + #0 'number.label := +} + +FUNCTION {forward.pass} +{ last.label "l" change.case$ label "l" change.case$ = + { 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} +{ j "b" = + { "a" 'extra.label := } + 'skip$ + if$ + extra.label 'j := + label extra.label * 'label := + %label top$ +} + +EXECUTE {initialize.longest.label} + +ITERATE {forward.pass} + +REVERSE {reverse.pass} + + +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" number.label int.to.str$ * "}" * write$ newline$ + "% BibTex style file: imsart-nameyear.bst, 2017-11-03" write$ newline$ + default.option.string "" = + 'skip$ + { + "% Default style options (" default.option.string * ")." * write$ newline$ + "% Used options (" list.string * ")." * write$ newline$ + } + if$ + +} +EXECUTE {begin.bib} + +EXECUTE {init.state.consts} + + +ITERATE {call.type$} + +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} + +EXECUTE {end.bib} diff --git a/inst/rmarkdown/templates/ims/skeleton/imsart-number.bst b/inst/rmarkdown/templates/ims/skeleton/imsart-number.bst new file mode 100644 index 000000000..5f240307d --- /dev/null +++ b/inst/rmarkdown/templates/ims/skeleton/imsart-number.bst @@ -0,0 +1,2331 @@ +%% This is file `imsart-number.bst' +%% +%% +%% You are free to use this style file as you see fit, provided +%% that you do not make changes to the file. +%% If you DO make changes, you are required to rename this file. +%% +%% It may be distributed under the terms of the LaTeX Project Public +%% License, as described in lppl.txt in the base LaTeX distribution. +%% Either version 1.0 or, at your option, any later version. +%% +%% TeX programming: Linas Stonys, VTeX, Lithuania, lstonys@vtex.lt +%% +%% This bibtex style produces structured bibliography (.bbl) file which could be +%% converted back into the database (.bib) format. +%% bibtex program must be invoked with the maximum allocation of memory (-w switch) +%% +%% This bibtex style could be used only with the imsart package +%% starting with version from 2009/08/13 + +%% 2010-02-01 - splited inits "A.D." -> "A. D." and "A.{\,}D." -> "A. D." +%% 2010-03-19 - fixed sorting. +%% 2011-01-07 - inserted options: sort, nameyear, alpha, number. +%% 2013-01-28 - added: arxiv, mrnumber. Changed tags. + +ENTRY + { address + author + arxiv + booktitle + bpt_note + bpt_ok + chapter + doi + edition + editor + howpublished + institution + isbn + journal + key + month + mrnumber + note + number + organization + pages + publisher + school + series + src + sortkey + title + type + volume + year + url + id + options + } + {} + { label extra.label sort.label short.list } + +INTEGERS { output.state before.all mid.sentence after.sentence + after.block between.elements } + +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := + #5 'between.elements := +} + +STRINGS { s t tmp1 tmp2 tmp3 tmp4 tmp5} +STRINGS { longest.label last.label list.string temp.str default.list} + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} + +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} + +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} + + +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { " " * write$ newline$} + { output.state after.block = + { add.period$ write$ + newline$ + % "\newblock " write$ + } + { output.state between.elements = + { ", " * write$ newline$} + { output.state before.all = + 'write$ + { add.period$ " " * write$ newline$} + if$ + } + 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 {insert.comma} +{ output.state before.all = + 'skip$ + { between.elements 'output.state := } + if$ +} +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state :=} + if$ + } + if$ +} + + +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} + +STRINGS { v l f j b ff} +INTEGERS { nameptr namesleft numnames bother} +INTEGERS {str.length count return save.num1 save.num2 save.num3 save.num4 int done} +FUNCTION {is.in.list}{ + 'f := + %%%% issisaugoju originalius "s" ir "t" + s 'j := + f 's := + t 'f := + list.string text.length$ 'str.length := + list.string 't := +% s text.length$ 'slen := + int 'save.num1 := + count 'save.num2 := + #1 'int := + #1 'count := + #0 'return := + + { count str.length = not + #0 str.length = not + and + } + { + count #1 + 'count := + t int #1 substring$ "," = + { + t #1 int substring$ s "," * = + { + #1 'return := + str.length 'count := + } + 'skip$ + if$ + + int #1 + 'int := + t int global.max$ substring$ 't := + #0 'int := + } + 'skip$ + if$ + int #1 + 'int := +% "count=" count int.to.str$ * " slen=" * str.length int.to.str$ * top$ + } + while$ + + save.num1 'int := + save.num2 'count := + + #0 return = + { s t = + {#1 'return :=} + 'skip$ + if$ + } + 'skip$ + if$ + %%%% grazinu originalius "s" ir "t" + j 's := + f 't := + + return +} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% formating bbl +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.tag} +{ 't := + duplicate$ empty$ + { pop$ "" } + { bother #0 = + { t "volume" = + {"\textbf{" swap$ * "}" * } + 'skip$ + if$ + } + { "\b" t * "{" * swap$ * "}" * } + if$ + } + if$ +} + +INTEGERS {sk} +FUNCTION {is.num} +{ chr.to.int$ + duplicate$ "0" chr.to.int$ < not + swap$ "9" chr.to.int$ > not and +} + +FUNCTION {byear} +{ duplicate$ empty$ + { pop$ "" } + {'t := + t text.length$ 'sk := + #5 sk = + {t #1 #4 substring$ 's := + t #5 #1 substring$ 'longest.label := + longest.label is.num not + {"\byear{" s * "}" * longest.label * } + {"\byear{" t * "}" * } + if$ + } + {t "year" make.tag + "type=nameyear" is.in.list + {extra.label *} + 'skip$ + if$ + } + if$ + } + if$ +} + + + +FUNCTION {format.address} +{address empty$ + { "" } + {address "address" make.tag } + if$ +} + +FUNCTION {format.organization} +{organization empty$ + { "" } + {organization "publisher" make.tag} + if$ +} + +FUNCTION {format.org} +{organization empty$ + { "" } + {organization "organization" make.tag add.period$} + if$ +} + + + + +FUNCTION {format.pub.address} +{ publisher empty$ + { "" } + { publisher "publisher" make.tag + address empty$ + 'skip$ + {", " * format.address * add.period$} + if$ + } + if$ +} + +FUNCTION {mk.tag} +{ 'temp.str := + duplicate$ empty$ + { pop$ "" } + { + b "nothing" = + 'skip$ + {"\b" temp.str * "{" * swap$ * "}" * } + if$ + } + if$ +} + +FUNCTION {space.after.dot} +{'t := + "" 'l := + "" 's := + { t empty$ not } + { t #1 #1 substring$ 's := + l s * 'l := + s "." = + { t #2 #1 substring$ " " = + 'skip$ + { + l " " * 'l := + t #2 #4 substring$ "{\,}" = + { + t #5 global.max$ substring$ 't := + } + 'skip$ + if$ + } + if$ + } + 'skip$ + + if$ + t #2 global.max$ substring$ 't := + } + while$ + l +} + +FUNCTION {format.author.editor} +{ 'b := + + b "editor" = + b "beditor" = + b "editor2" = + or or + {editor space.after.dot 's :=} + {author space.after.dot 's :=} + if$ + + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { + s nameptr "{vv}" format.name$ "particle" mk.tag 'v := + s nameptr "{ll}" format.name$ "snm" mk.tag 'l := + s nameptr "{f.}" format.name$ "inits" mk.tag 'f := + s nameptr "{ff}" format.name$ "fnm" mk.tag 'ff := + s nameptr "{jj}" format.name$ "suffix" mk.tag 'j := + + j empty$ + {"" 'j :=} + {" " j * 'j :=} + if$ + + v empty$ + {"" 'v :=} + {v " " * 'v :=} + if$ + + l "\bsnm{others}" = + { "et~al." "etal" make.tag * } + { + b "editor2" = + {"\beditor{" * ff * f * + ff "" = f "" = and + 'skip$ + {"~" * } + if$ + v * l * j * "}" * "" 't := + } + 'skip$ + if$ + + b "author" = + b "editor" = + or + {"\b" * b * "{" * v * l * + ff "" = f "" = and + 'skip$ + {",~" * } + if$ + ff * f * j * "}" * "" 't :=} + 'skip$ + if$ + + } + if$ + + namesleft #0 > + { namesleft #1 > + { namesleft #2 = + { s numnames "{ll}" format.name$ "others" = + {" " * t * } + {" \AND " * t * } + if$ + } + {", " * t * } + if$ + } + {""} + if$ + } + 't + + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + + +FUNCTION {format.editors} +{ editor empty$ + {""} + { + bother #0 = + {author empty$ + {"editor"} + {"nothing"} + if$ + } + {"editor"} + if$ + format.author.editor + editor num.names$ #1 > + { ", eds." * } + { ", ed." * } + if$ + } + if$ +} + +FUNCTION {format.authors} +{ author empty$ + {""} + {"author" format.author.editor} + if$ +} + +FUNCTION {make.editors} +{ editor empty$ + { "" } + { "(" + + bother #0 = + {author empty$ + {"editor"} + {"nothing"} + if$ + } + {"editor2"} + if$ + format.author.editor + * + editor num.names$ #1 > + { ", eds.)" * } + { ", ed.)" * } + if$ + } + if$ +} + + + +FUNCTION {cite.author.editor} +{ 's := + + s #1 "{vv~}{ll}" format.name$ + s num.names$ duplicate$ + #3 > + { pop$ " et~al." * } + { #3 = + { s #3 "{vv~}{ll}{ jj}{ f}" format.name$ "others" = + { " et~al." * } + { ", " * s #2 "{vv~}{ll}" format.name$ * + " and " * s #3 "{vv~}{ll}" format.name$ * + } + if$ + } + {s num.names$ #2 = + {s #2 "{vv~}{ll}{ jj}{ f}" format.name$ "others" = + { " et~al." * } + { " and " * s #2 "{vv~}{ll}" format.name$ * } + if$ + } + 'skip$ + if$ + } + if$ + } + if$ +} + + +FUNCTION {check.auth.edit.org} +{author empty$ + { + editor empty$ + { + organization empty$ + {""} + {organization} + if$ + } + {editor cite.author.editor} + if$ + } + {author cite.author.editor} + if$ +} + +FUNCTION {check.year} +{year empty$ + {""} + {year extra.label * + } + if$ +} + +FUNCTION {output.bibitem} +{ newline$ + "\bibitem" + "type=nameyear" is.in.list + { + "[\protect\citeauthoryear{" * write$ + check.auth.edit.org write$ + "}{" write$ + check.year write$ + "}]" + } + 'skip$ + if$ + "type=alpha" is.in.list + { + "[" * write$ + label write$ + "]" + } + 'skip$ + if$ + + "{" * write$ + cite$ write$ + "}" write$ + newline$ + "" before.all 'output.state := +} + +INTEGERS { multiresult char.num k } + + +FUNCTION {string.to.integer} +{ 't := + t text.length$ 'k := + #1 'char.num := + { t char.num #1 substring$ 's := + s is.num + s "." = + or + char.num k = not + and + } + {char.num #1 + 'char.num :=} + while$ + char.num #1 - 'char.num := + t #1 char.num substring$ +} + +FUNCTION {check.mrnumber} +{mrnumber 't := + "" + { t empty$ not } + { t #1 #2 substring$ "\#" = + { t #1 #2 substring$ * + t #2 global.max$ substring$ 't := + } + { + t #1 #1 substring$ "#" = + { "\#" * + t #2 global.max$ substring$ 't := + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + if$ + } + while$ +} + + +FUNCTION {remove.braces} +{'t := + "" + { t empty$ not } + { t #1 #1 substring$ "{" = + t #1 #1 substring$ "}" = + or + { + t #2 global.max$ substring$ 't := + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {format.mrnumber} +{ mrnumber empty$ + { "" } + { bother #0 = + {check.mrnumber} + {"\bmrnumber{" check.mrnumber * "}" * } + if$ + } + if$ +} + +INTEGERS { found } +FUNCTION {cut.info} +{ 't := + #0 'found := + "" 's := + "" 'v := + { t empty$ not } + { + t #1 #5 substring$ "info:" = + { + t #6 global.max$ substring$ 't := + #1 'found := + "}" 'v := + } + 'skip$ + if$ + + t #1 #1 substring$ "/" = + #1 found = + and + { + t #2 global.max$ substring$ 't := + s "={" * 's := + #0 'found := + + } + 'skip$ + if$ + + t #1 #2 substring$ ", " = + v "}" = + and + { + t #2 global.max$ substring$ 't := + s "}," * 's := + } + 'skip$ + if$ + s t #1 #1 substring$ * 's := + t #2 global.max$ substring$ 't := + } + while$ +s v * +} + +FUNCTION {format.id} +{ id empty$ + { "" } + { bother #0 = + { "" } + {"\bid{" id cut.info * "}" * } + if$ + } + if$ +} + +FUNCTION {format.journal} +{ journal empty$ + { "" } + { bother #0 = + {journal "t" change.case$} + {"\bjournal{" journal * "}" * } + if$ + } + if$ +} +FUNCTION {title.sep} +{ type$ "article" = + type$ "incollection" = + type$ "inproceedings" = + type$ "booklet" = + type$ "unpublished" = + or or or or + 'add.period$ + 'skip$ + if$ + + type$ "inbook" = + type$ "manual" = + or + edition empty$ not + and + {"," *} + { + edition empty$ + series empty$ not + and + 'add.period$ + 'skip$ + if$ + } + if$ + + type$ "book" = + { + edition empty$ not + series empty$ not + and + {"," *} + { + edition empty$ + series empty$ not + and + 'add.period$ + 'skip$ + if$ + } + if$ + } + 'skip$ + if$ + +} + +FUNCTION {format.title} +{ title empty$ + { "" } + { + title "title" make.tag + title.sep + } + if$ +} +FUNCTION {format.year} +{ year empty$ + {""} + { bother #0 = + {"(" year extra.label * * ")." *} + {"(" year byear * ")." *} + if$ + } + if$ +} + +FUNCTION {format.month} +{ month empty$ + {""} + { "\bmonth{" month * "}" *} + if$ +} +FUNCTION {format.type} +{ type empty$ + {""} + { "\btype{" type * "}" *} + if$ +} + +FUNCTION {formatpatent.date} +{ year empty$ + { month empty$ + { "" } + { "there's a month but no year in " cite$ * warning$} + + if$ + } + { month empty$ + { year byear} + {format.month " " * year byear *} + if$ + } + if$ +} +FUNCTION {format.btitle} +{ title "btitle" make.tag +} + + + +FUNCTION {format.note} +{ note empty$ + {""} + { note "note" make.tag} + if$ +} +FUNCTION {format.bptnote} +{bpt_note empty$ + {""} + {"\bptnote{" bpt_note * "}%" * } +if$ +} +FUNCTION {format.bptok} +{bpt_ok empty$ + {""} + {"\bptok{" bpt_ok * "}%" * } +if$ +} + +FUNCTION {add.note} +{ note empty$ + {""} + { note } + if$ +} +FUNCTION {format.chapter} +{chapter empty$ + {""} + {"\bchapter{" chapter * "}" * } +if$ +} + + +FUNCTION {chap.type} +{chapter empty$ + {""} + { type empty$ + { "Chapter "} + { type "Section" = + { "Section "} + { "Chapter "} + if$ + } + if$ + "\bchapter{" chapter * "}" * * + } +if$ +} + + +FUNCTION {chap.note} +{ format.note output + new.sentence +} + +FUNCTION {tie.or.space.connect} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ * * +} +FUNCTION {no.space.connect} +{ duplicate$ text.length$ #3 < + { "" } + { "" } + if$ + swap$ * * +} + + +%%%%%%%%%%%%%%%%%%%%%%%%%% patent names +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} +FUNCTION {format.series} +{ series empty$ + { "" } + { bother #0 = + {series} + {"\bseries{" series * "}" * } + if$ + } + if$ +} +FUNCTION {format.edition} +{ edition empty$ + { "" } + { output.state mid.sentence = + { edition "l" change.case$ } + { edition "t" change.case$ } + if$ + "edition" make.tag + " ed." * + } + if$ +} + + +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.isbn} +{ isbn empty$ + { "" } + {"\bisbn{" isbn * "}" *} + if$ +} + +FUNCTION {format.school} +{ school empty$ + {""} + {"\bpublisher{" school * "}" * } + if$ +} + +FUNCTION {format.institution} +{ institution empty$ + {""} + { bother #0 = + {institution} + { "techreport" type$ = + {"\bpublisher{" } + {"\binstitute{" } + if$ + + institution * "}" * + } + if$ + } + if$ +} +FUNCTION {format.howpublished} +{ howpublished empty$ + {""} + { howpublished "howpublished" make.tag } + if$ +} + +FUNCTION {format.vol} +{ volume empty$ + number empty$ + and + {""} + { volume empty$ + {number} + {volume} + if$ + "volume" make.tag + } + if$ +} + +FUNCTION {note.presented} + {note #1 #9 substring$ "presented" = + note #1 #9 substring$ "Presented" = + or} + + +FUNCTION {format.url} +{ url empty$ + { "" } + {"\url{" url * "}" * } + if$ +} + +FUNCTION {format.arxiv} +{ arxiv empty$ + { "" } + {"\arxiv{" arxiv * "}" * } + if$ +} + +FUNCTION {format.doi} +{ doi empty$ + {""} + {"\bdoi{" doi * "}" * } + if$ +} + +FUNCTION {format.ppages} +{ pages empty$ + {""} + {pages "pages" make.tag + add.period$ + } + if$ +} + + +FUNCTION {format.booktitle} +{ booktitle empty$ + { "" } + { bother #0 = + {"In " booktitle *} + {"In \bbooktitle{" booktitle * "}" *} + if$ + type$ "incollection" = + { series empty$ + volume empty$ + and + 'skip$ + { editor empty$ series empty$ not and + {"." *} + {"," *} + if$ + } + if$ + } + 'skip$ + if$ + + type$ "inproceedings" = + { series empty$ + editor empty$ +% volume empty$ not + and + 'skip$ + {editor empty$ + {"." *} + 'skip$ + if$ + } + if$ + } + 'skip$ + if$ + } + if$ +} + +FUNCTION {format.tr.number} +{ type empty$ + { "\btype{Technical Report}" } + { "\btype{" type * "}" * } + if$ + + number empty$ + 'skip$ + { " No. \bnumber{" number * "}" * * } + if$ + +% type empty$ not +% number empty$ + institution empty$ not + {"," *} + 'skip$ + if$ + +} + +FUNCTION {format.number} +{number empty$ + {""} + {"\bnumber{" number * "}" * } + if$ +} +INTEGERS { len } + +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} + + +FUNCTION {bcomment.note} +{note empty$ +'skip$ + {note "note" make.tag output add.period$} + if$ +} + +FUNCTION {empty.misc.check} +{ author empty$ title empty$ howpublished empty$ + month empty$ year empty$ note empty$ + and and and and and + { "all relevant fields are empty in " cite$ * warning$ } + 'skip$ + if$ +} + +FUNCTION {format.thesis.type} +{ type empty$ + 'skip$ + { pop$ + "\btype" type * "}" * + } + if$ +} + + +FUNCTION {element.type} +{ bother #0 = + {"\begin{botherref}" write$ newline$} + {"\begin{" write$ + "b" + "conference" type$ = + {"inproceedings"} + { + "proceedings" type$ = + {"book"} + 'type$ + if$ + } + if$ + * write$ + "}[" write$ + src empty$ + {"author" write$} + {src write$ } + if$ + "]" write$ newline$ + } + if$ +} +FUNCTION {end.element.type} +{write$ newline$ + bother #0 = + {"\end{botherref}" write$ newline$} + {"\end{" write$ + "b" + "conference" type$ = + {"inproceedings"} + { + "proceedings" type$ = + {"book"} + 'type$ + if$ + } + if$ + * write$ + "}" write$ newline$ + } + if$ + "\endbibitem" write$ newline$ +} +FUNCTION {same.end} +{ add.period$ + format.doi output + %new.sentence + format.mrnumber output + %new.sentence + %format.url output + new.sentence + format.arxiv output + new.sentence + format.id output + format.bptnote output + format.bptok output + } + +FUNCTION {settings}{} + +FUNCTION {article} +{ output.bibitem + #1 'bother := + element.type + format.authors output.nonnull + format.year output + format.title "title" output.check + format.journal output + format.vol output + format.ppages output + new.sentence + bcomment.note + same.end + end.element.type +} + + +FUNCTION {manual} +{ output.bibitem + #1 'bother := + element.type + author empty$ + { organization empty$ + 'skip$ + { format.organization output.nonnull} + if$ + } + { format.authors output.nonnull} + if$ + format.year output + new.sentence + format.title "title" output.check + + format.edition output + author empty$ + { organization empty$ + 'skip$ + { format.address output} + if$ + } + { format.organization output + address empty$ + 'skip$ + { insert.comma } + if$ + format.address output + } + if$ + % new.sentence + bcomment.note + same.end + end.element.type +} + + +FUNCTION {patent} +{ #1 'bother := + output.bibitem + element.type + format.authors output.nonnull + format.year output + format.title "title" output.check + format.number output + new.sentence + bcomment.note + same.end + end.element.type +} + +FUNCTION { other } { patent } + +FUNCTION {book} +{ output.bibitem + #1 'bother := + element.type + author empty$ + { format.editors output} + { format.authors output.nonnull} + if$ + format.year output + format.title output + series empty$ + { + format.vol output + edition empty$ + 'new.sentence + 'insert.comma + if$ + format.edition output + new.sentence + } + { + format.edition output + new.sentence + format.series output + format.vol output + new.sentence + } + if$ + format.pub.address output + bcomment.note + same.end + end.element.type +} + +FUNCTION {booklet} +{ #1 'bother := + output.bibitem + element.type + format.authors output.nonnull + format.year output + format.title "title" output.check + format.howpublished output + address empty$ + 'new.sentence + 'insert.comma + if$ + format.address output + bcomment.note + same.end + end.element.type +} + +FUNCTION {inbook} +{ output.bibitem + #1 'bother := + element.type + author empty$ + { format.editors output} + { format.authors output.nonnull} + if$ + format.year output + format.title output + format.booktitle output + format.edition output + series empty$ + 'skip$ + {new.sentence} + if$ + format.series output + format.vol output + format.chapter output + chapter empty$ not + pages empty$ not + and + 'insert.comma + 'skip$ + if$ + format.ppages output + new.sentence + format.pub.address output + chap.note %output + new.sentence + same.end + end.element.type +} + +FUNCTION {incollection} +{ output.bibitem + #1 'bother := + element.type + format.authors output.nonnull + format.year output + format.title "title" output.check + format.booktitle "booktitle" output.check + format.edition output + make.editors output + series empty$ editor empty$ + or + 'skip$ + 'new.sentence + if$ + format.series output + format.vol output + format.chapter output + chapter empty$ not + pages empty$ not + and + 'insert.comma + 'skip$ + if$ + format.ppages output + format.pub.address output + bcomment.note + same.end + end.element.type +} + +FUNCTION {inproceedings} +{ output.bibitem + #1 'bother := + element.type + format.authors output.nonnull + format.year output + format.title "title" output.check + format.booktitle "booktitle" output.check + make.editors output + editor empty$ series empty$ + or + 'skip$ + 'new.sentence + if$ + format.series output + format.vol output + format.ppages output + new.sentence + publisher empty$ + {format.organization output} + {format.org output} + if$ + format.pub.address output + bcomment.note + same.end + end.element.type +} + +FUNCTION {conference} { inproceedings } + + +FUNCTION {mastersthesis} +{ #1 'bother := + output.bibitem + element.type + format.authors output.nonnull + format.year output + format.title "title" output.check + insert.comma + type empty$ + {"\btype{Master's thesis}" output.nonnull} + {format.type output} + if$ + school empty$ + 'skip$ + { insert.comma } + if$ + format.school output + address empty$ + 'skip$ + { insert.comma } + if$ + format.address output + bcomment.note + same.end + end.element.type +} + +FUNCTION {misc} +{ #1 'bother := + output.bibitem + element.type + author empty$ + { organization empty$ + 'skip$ + { format.org output.nonnull} + if$ + } + { format.authors output.nonnull} + if$ + format.year output + format.title "title" output.check + new.sentence + format.howpublished output + new.sentence + author empty$ + { organization empty$ + 'skip$ + { format.address output} + if$ + } + { format.organization output + address empty$ + 'skip$ + { insert.comma } + if$ + format.address output + } + if$ + new.sentence + bcomment.note + same.end + empty.misc.check + end.element.type +} + +FUNCTION {phdthesis} +{ #1 'bother := + output.bibitem + element.type + format.authors output.nonnull + format.year output + format.title "title" output.check + insert.comma + type empty$ + {"\btype{PhD thesis}" output.nonnull} + {format.type output} + if$ + school empty$ + 'skip$ + { insert.comma } + if$ + format.school output + address empty$ + 'skip$ + { insert.comma } + if$ + format.address output + bcomment.note + same.end + end.element.type +} + +FUNCTION {proceedings}{book} + +FUNCTION {techreport} +{ #1 'bother := + output.bibitem + element.type + format.authors output.nonnull + format.year output + format.title "title" output.check + format.tr.number output + format.institution output + new.sentence + address empty$ + 'skip$ + { insert.comma } + if$ + format.address output + bcomment.note + same.end + end.element.type +} + +FUNCTION {unpublished} +{ #1 'bother := + output.bibitem + element.type + format.authors output.nonnull + format.year output + format.title "title" output.check + bcomment.note + same.end + end.element.type +} + +FUNCTION {default.type} { unpublished } + + +READ + +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} + +%%%%% setting default options +FUNCTION {default.option.string} +{"sort=1,type=number"} + +FUNCTION {set.default.opt} +{default.option.string 'list.string :=} + +EXECUTE {set.default.opt} +INTEGERS {length2} + + +FUNCTION {in.string}{ + l 'tmp1 := + v 'tmp2 := + + 'l := % chars + 'v := % string + l text.length$ 'length2 := + v text.length$ 'str.length := + + int 'save.num1 := + count 'save.num2 := + #1 'int := + #0 'count := + #0 'found := + + length2 str.length = + 'skip$ + { + l v = + {#1 'found :=} + { + { + count str.length = not + #0 str.length = not + and + } + { + count #1 + 'count := + v int length2 substring$ l = + { + #1 'found := + str.length 'count := % to finish while$ loop + } + 'skip$ + if$ + int #1 + 'int := + } + while$ + + } + if$ + } + if$ + save.num1 'int := + save.num2 'count := + tmp1 'l := + tmp2 'v := + + found +} + + +FUNCTION {split}{ + l 'tmp1 := + v 'tmp2 := + + 'l := % split by + 'v := % string to split + + l text.length$ 'length2 := + v text.length$ 'str.length := + + int 'save.num1 := + count 'save.num2 := + found 'save.num4 := + + #1 'int := + #0 'count := + #0 'found := + { + count str.length = not + #0 str.length = not + and + } + { + count #1 + 'count := + + v int length2 substring$ l = + { + v #1 int #1 - substring$ 'l := % surasta dalis + v int #1 + #100 substring$ 'v := % likusi dalis + #1 'found := + str.length 'count := % kad nutruktu ciklas + } + 'skip$ + if$ + int #1 + 'int := + } + while$ + save.num1 'int := + save.num2 'count := + + found #0 = + { + %l 'l := + "" 'l := + } + 'skip$ + if$ + save.num4 'found := + + v l + + tmp1 'l := + tmp2 'v := +} + +FUNCTION {add.option}{ + l 'tmp3 := + v 'tmp4 := + + + 'l := % option + 'v := % list + + v + v "" = + {""} + {","} + if$ + l * * + tmp3 'l := + tmp4 'v := +} + +FUNCTION {remove.option}{ + + %%%% issisaugoju originalius "s" ir "t" + l 'j := + v 'f := + + 'l := % option name + 'v := % list + + "" 'temp.str := % temporary list + + l text.length$ 'length2 := + v text.length$ 'str.length := + + int 'save.num1 := + count 'save.num2 := + done 'save.num3 := + + #1 'int := + #0 'count := + #0 'found := + + length2 str.length > + 'skip$ + { + #0 'done := + v 'f := + + {done #0 = } + { + + v "," in.string + { + v "," split + 'f := % rasta + 'v := % kas liko + + } + { + #1 'done := + v 'f := + } + if$ + + f l in.string + 'skip$ + { + temp.str f add.option 'temp.str := + } + if$ + } + while$ + + } + if$ + save.num1 'int := + save.num2 'count := + save.num3 'done := + + temp.str + j 'l := + f 'v := + +} + +FUNCTION {assign.opt}{ + % priskiriu options lauka, kad galeciau i(is)jungti "unsort" + "settings" type$ = + {options empty$ + 'skip$ + { + "" 'b := + "" 'tmp5 := + #0 'done := + + options "=" in.string % if options has '=' + { + options 'b := + b 'tmp5 := + + {done #0 = } + { + b "," in.string + { + b "," split + 'tmp5 := % rasta + 'b := % kas liko + } + { + #1 'done := + b 'tmp5 := + } + if$ + + tmp5 "=" in.string + { + tmp5 "=" split + 's := % before + 't := % after + list.string s remove.option 'list.string := + } + 'skip$ + if$ + + list.string tmp5 add.option 'list.string := + } + while$ + + } + 'skip$ + if$ + } + if$ + } + 'skip$ + if$ + +} + +ITERATE {assign.opt} + +INTEGERS { et.al.char.used } + +FUNCTION {initialize.et.al.char.used} +{ #0 'et.al.char.used := +} +EXECUTE {initialize.et.al.char.used} + +FUNCTION {format.lab.names.nameyear} +{ remove.braces 's := + s num.names$ 'numnames := + numnames #3 >% nuo kada daryti et~al. + { s #1 "{vv~}{ll}" format.name$ " et~al." * } + { + numnames #1 - 'namesleft := + #2 'nameptr := + s #1 "{vv~}{ll}" format.name$ + { namesleft #0 > } + { nameptr numnames = + { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { " et~al." * } + { " and " * s nameptr "{vv~}{ll}" format.name$ * } + if$ + } + { ", " * s nameptr "{vv~}{ll}" format.name$ * } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } + if$ +} + + +FUNCTION {format.lab.names.number} +{ remove.braces 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr "{ vv }{ ll }{ f }{ jj }" format.name$ 't := + + t sortify * " " * + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$} + +FUNCTION {format.lab.names.alpha} +{ 's := + s num.names$ 'numnames := + numnames #1 > + { numnames #4 > + { #3 'namesleft := } + { numnames 'namesleft := } + if$ + #1 'nameptr := + "" + { namesleft #0 > } + { nameptr numnames = + { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { "+" * + #1 'et.al.char.used := + } + { s nameptr "{v{}}{l{}}" format.name$ * } + if$ + } + { s nameptr "{v{}}{l{}}" format.name$ * } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + numnames #4 > + { "+" * + #1 'et.al.char.used := + } + 'skip$ + if$ + } + { s #1 "{v{}}{l{}}" format.name$ + duplicate$ text.length$ #2 < + { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ } + 'skip$ + if$ + } + if$ +} +FUNCTION {format.lab.names}{ + "type=nameyear" is.in.list + 'format.lab.names.nameyear + { + "type=alpha" is.in.list + 'format.lab.names.alpha + 'format.lab.names.number + if$ + } + if$ +} +FUNCTION {author.key.label} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.editor.key.label} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.key.organization.label} +{ author empty$ + { key empty$ + { organization empty$ + { cite$ #1 #3 substring$ } + { "The " #4 organization chop.word #3 text.prefix$ } + if$ + } + 'key + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {editor.key.organization.label} +{ editor empty$ + { key empty$ + { organization empty$ + { cite$ #1 #3 substring$ } + { "The " #4 organization chop.word #3 text.prefix$ } + if$ + } + 'key + if$ + } + { editor format.lab.names } + if$ +} + +FUNCTION {calc.short.authors} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.label + { type$ "proceedings" = + 'editor.key.organization.label + { type$ "manual" = + 'author.key.organization.label + 'author.key.label + if$ + } + if$ + } + if$ + 'short.list := +} + +FUNCTION {calc.label} +{ calc.short.authors + short.list + + "type=alpha" is.in.list + { + duplicate$ + year field.or.null purify$ #-1 #2 substring$ + * + 'label := + year field.or.null purify$ #-1 #4 substring$ + * + sortify 'sort.label := + } + { + "(" + * + year duplicate$ empty$ + short.list key field.or.null = or + { pop$ "" } + 'skip$ + if$ + * + 'label := + label 'sort.label := + } + if$ +} + +FUNCTION {sort.format.names.nameyear} +{ remove.braces 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + {% nameptr #1 > + % { " " * numnames int.to.str$ * " " *} + % 'skip$ + % if$ + s nameptr "{vv }{ll}" format.name$ 't := + nameptr numnames = + t "others" = + and + { "et al" * } + { t sortify * " " * + #3 numnames = + #2 numnames = + or + #2 nameptr = + and + {year empty$ + 'skip$ + {year * " " *} + if$ + } + 'skip$ + if$ + } + if$ + #3 numnames < + {#0 'namesleft := + "zzz " * + } + { + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + if$ + } + while$ +} + +FUNCTION {sort.format.names.number} +{ remove.braces 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr "{vv }{ll }{f }{jj}" format.name$ 't := + nameptr numnames = + t "others" = + and + { "et al" * } + { t sortify * " " *} + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {sort.format.names.alpha} +{ 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { nameptr #1 > + { " " * } + 'skip$ + if$ + s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't := + nameptr numnames = + t "others" = + and + { "et al" * } + { t sortify * } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {sort.format.names}{ + "type=nameyear" is.in.list + 'sort.format.names.nameyear + { + "type=alpha" is.in.list + 'sort.format.names.alpha + 'sort.format.names.number + if$ + } + if$ +} + +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$ + "zzz" + } + { 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$ + "z" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ + } + { author sort.format.names } + if$ +} + +FUNCTION {author.organization.sort} +{ author empty$ + { organization empty$ + { key empty$ + { "to sort, need author, organization, or key in " cite$ * warning$ + "z" + } + { key sortify } + if$ + } + { "The " #4 organization chop.word sortify } + if$ + } + { author sort.format.names } + if$ +} + +FUNCTION {editor.organization.sort} +{ editor empty$ + { organization empty$ + { key empty$ + { "to sort, need editor, organization, or key in " cite$ * warning$ + "z" + } + { key sortify } + if$ + } + { "The " #4 organization chop.word sortify } + if$ + } + { editor sort.format.names } + if$ +} + +FUNCTION {presort} +{ calc.label + sort.label sortify + " " + * + type$ "book" = + type$ "inbook" = + or + {author empty$ + 'editor.organization.sort + 'author.organization.sort + if$ + } + { type$ "proceedings" = + type$ "incollection" = + or + {author empty$ + 'editor.organization.sort + 'author.organization.sort + if$ + } + { type$ "manual" = + type$ "misc" = + or + 'author.organization.sort + 'author.sort + if$ + } + if$ + } + if$ + " " + * + year field.or.null sortify + * + " " + * + %%%% removing title from the sorting line + %title field.or.null sort.format.title + %* + #1 entry.max$ substring$ 'sort.label := +% sort.label top$ + sort.label * + #1 entry.max$ substring$ 'sort.key$ := + + %sort.key$ top$ +} + +ITERATE {presort} + +FUNCTION {bib.sort.order} +{ + "settings" type$ = + {"aaa"} + {"sort=0" is.in.list + {"bb"} + {"type=alpha" is.in.list + {sort.key$} + {sort.label} + if$ + } + if$ + } + if$ + 'sort.key$ := + %sort.key$ top$ +} + +ITERATE {bib.sort.order} + +SORT + + +INTEGERS { longest.label.width last.extra.num number.label } + +FUNCTION {initialize.longest.label} +{ "" 'longest.label := + #0 int.to.chr$ 'last.label := + "" 'j := + #0 'longest.label.width := + #0 'last.extra.num := + #0 'number.label := +} + +FUNCTION {forward.pass} +{ last.label "l" change.case$ label "l" change.case$ = + { 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} +{ j "b" = + { "a" 'extra.label := } + 'skip$ + if$ + extra.label 'j := + label extra.label * 'label := + %label top$ +} + +EXECUTE {initialize.longest.label} + +ITERATE {forward.pass} + +REVERSE {reverse.pass} + + +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" number.label int.to.str$ * "}" * write$ newline$ + "% BibTex style file: imsart-number.bst, 2017-11-03" write$ newline$ + default.option.string "" = + 'skip$ + { + "% Default style options (" default.option.string * ")." * write$ newline$ + "% Used options (" list.string * ")." * write$ newline$ + } + if$ + +} +EXECUTE {begin.bib} + +EXECUTE {init.state.consts} + + +ITERATE {call.type$} + +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} + +EXECUTE {end.bib} diff --git a/inst/rmarkdown/templates/ims/skeleton/imsart.cls b/inst/rmarkdown/templates/ims/skeleton/imsart.cls new file mode 100644 index 000000000..fa4c57a72 --- /dev/null +++ b/inst/rmarkdown/templates/ims/skeleton/imsart.cls @@ -0,0 +1,151 @@ +%% This is file `imsart.cls' +%% +%% LaTeX 2e class file for the processing of LaTeX2e files +%% of the following IMS/BS journals: +%% +%% The Annals of Probability +%% The Annals of Applied Probability +%% The Annals of Statistics +%% The Annals of Applied Statistics +%% Statistical Science +%% Probability Surveys +%% Statistics Surveys +%% Electronic Journal of Statistics +%% Bernoulli +%% Annales de l'Institut Henri Poincar\'e - Probabilit\'es et Statistiques +%% Brazilian Journal of Probability and Statistics +%% Bayesian Analysis +%% +%% Institute of Mathematical Statistics, U.S.A. +%% Bernoulli Society +%% Institut Henry Poincare +%% Brazilian Statistical Association +%% International Society for Bayesian Analysis +%% +%% Macros written by Vytas Statulevicius, VTeX, Lithuania +%% Maintained by Deimantas Galcius, VTeX, Lithuania +%% for Institute of Mathematical Statistics, U.S.A. +%% Please submit bugs or your comments to latex-support@vtex.lt +%% +%% The original distribution is located at: +%% http://www.e-publications.org/ims/support +%% +%% This class file loads standard "article.cls" with appropriate +%% settings and then style file "imsart.sty" with additional macros +%% +%% You are free to use this style file as you see fit, provided +%% that you do not make changes to the file. +%% If you DO make changes, you are required to rename this file. +%% +%% It may be distributed under the terms of the LaTeX Project Public +%% License, as described in lppl.txt in the base LaTeX distribution. +%% Either version 1.0 or, at your option, any later version. +%% +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% +%% +%% Bug fixes and changes: at end of file +% +% TeX programming: Vytas Statulevicius, VTeX, Lithuania. +% TeX programming: Deimantas Galcius, VTeX, Lithuania. +% TeX programming: Edgaras Sakuras, VTeX, Lithuania. +% Requires Latex2e, ver.2000.06 +% +\NeedsTeXFormat{LaTeX2e} +\ProvidesClass{imsart}[2020/08/23 driver class for package imsart.sty] +% +% set various options for different journals: +\DeclareOption{ps}{% + \PassOptionsToClass{10pt,oneside}{article}% + } +% +\DeclareOption{ss}{% + \PassOptionsToClass{10pt,oneside}{article}% + } +% +\DeclareOption{ejs}{% + \PassOptionsToClass{10pt,oneside}{article}% + } +% +\DeclareOption{aap}{% + \PassOptionsToClass{11pt,oneside,leqno}{article}% + \PassOptionsToPackage{leqno}{amsmath}% + } +% +\DeclareOption{aop}{% + \PassOptionsToClass{11pt,oneside,leqno}{article}% + \PassOptionsToPackage{leqno}{amsmath}% + } +% +\DeclareOption{aos}{% + \PassOptionsToClass{11pt,oneside,leqno}{article}% + \PassOptionsToPackage{leqno}{amsmath}% + } +% +\DeclareOption{aoas}{% + \PassOptionsToClass{11pt,oneside,leqno}{article}% + \PassOptionsToPackage{leqno}{amsmath}% + } +% +\DeclareOption{sts}{% + \PassOptionsToClass{11pt,oneside,leqno}{article}% + \PassOptionsToPackage{leqno}{amsmath}% + } +% +\DeclareOption{bj}{% + \PassOptionsToClass{10pt,oneside}{article}% + } +% +\DeclareOption{aihp}{% + \PassOptionsToClass{10pt,oneside,fleqn}{article}% + \PassOptionsToPackage{fleqn}{amsmath}% + \PassOptionsToPackage{numbers,sort&compress}{natbib}% + } +% +\DeclareOption{bjps}{% + \PassOptionsToClass{11pt,twoside}{article}% + } +% +\DeclareOption{ba}{% + \PassOptionsToClass{10pt,oneside}{article}% + } +% +\PassOptionsToPackage{cmex10}{amsmath} +% +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} +\ProcessOptions* +% +\LoadClass{article} +% +\IfFileExists{imsart.sty}% + {}% + {% + \ClassError{imsart}% + {The complimentary style file "imsart.sty" is required}% + {% + The complimentary style file "imsart.sty" is required\MessageBreak + You need to install file "imsart.sty" in your system\MessageBreak + File could be downloaded from http://www.e-publications.org/ims/support + }% + } +% +% Load additional macros and modifications for "article.cls" +\RequirePackage{imsart} +% +\endinput +%% +%% End of file `imsart.cls'. diff --git a/inst/rmarkdown/templates/ims/skeleton/imsart.sty b/inst/rmarkdown/templates/ims/skeleton/imsart.sty new file mode 100644 index 000000000..e93949f71 --- /dev/null +++ b/inst/rmarkdown/templates/ims/skeleton/imsart.sty @@ -0,0 +1,4637 @@ +%% This is file `imsart.sty' +%% +%% LaTeX 2e style file for the processing of LaTeX2e files +%% of the following IMS/BS journals: +%% +%% - The Annals of Probability +%% - The Annals of Applied Probability +%% - The Annals of Statistics +%% - The Annals of Applied Statistics +%% - Statistical Science +%% - Probability Surveys +%% - Statistics Surveys +%% - Electronic Journal of Statistics +%% - Bernoulli +%% - Annales de l'Institut Henri Poincar\'e - Probabilit\'es et Statistiques +%% - Brazilian Journal of Probability and Statistics +%% - Bayesian Analysis +%% +%% - Institute of Mathematical Statistics, U.S.A. +%% - Bernoulli Society +%% - Institut Henry Poincare +%% - Brazilian Statistical Association +%% - International Society for Bayesian Analysis +%% +%% Macros written by Vytas Statulevicius, VTeX, Lithuania +%% Maintained by TeX group members, VTeX, Lithuania +%% for Institute of Mathematical Statistics, U.S.A. +%% Please submit bugs or your comments to latex-support@vtex.lt +%% +%% The original distribution is located at: +%% https://www.e-publications.org/ims/support +%% +%% This style file contains additional macros and is designed to use +%% with standard "article.cls" +%% +%% You are free to use this style file as you see fit, provided +%% that you do not make changes to the file. +%% If you DO make changes, you are required to rename this file. +%% +%% It may be distributed under the terms of the LaTeX Project Public +%% License, as described in lppl.txt in the base LaTeX distribution. +%% Either version 1.0 or, at your option, any later version. +%% +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% +%% Bug fixes and changes: at end of file +% +% TeX programming: Vytas Statulevicius, VTeX, Lithuania. +% TeX programming: Deimantas Galcius, VTeX, Lithuania. +% TeX programming: Edgaras Sakuras, VTeX, Lithuania. +% Requires Latex2e, ver.2000.06 +% +\def\imsfmt@name{imsart} +\def\imsfmt@version{2020/11/02} +% +\ProvidesFile{imsart.sty}[\imsfmt@version\space IMS article style] +% +\RequirePackage{etoolbox} +% +% hyperref must be loaded after: +\@ifpackageloaded{hyperref}% + {\@latex@error{Package 'hyperref' must be loaded after 'imsart'!}\@ehc}% + {} +% +% Passoptions to hyperref: +\ifdefined\loadhyperrefoptions +\else + \def\loadhyperrefoptions{% + \PassOptionsToPackage{colorlinks,citecolor=blue,urlcolor=blue,% + linkcolor=blue,linktocpage=true}{hyperref}% + } +\fi +% +\loadhyperrefoptions +% +% General options: +% +% prints out \bid{doi={}} +\newif\if@print@bid@doi \@print@bid@doifalse +\DeclareOption{printbiddoi}{\global\@print@bid@doitrue} +% +% Put keywords as footnote +\newif\if@keywordsasfootnote +\DeclareOption{keywordsasfootnote}{\@keywordsasfootnotetrue} +% +% Put history as footnote +\newif\if@historyasfootnote +\DeclareOption{historyasfootnote}{\@historyasfootnotetrue} +% +% Put address as footnote +\newif\if@addressasfootnote +\DeclareOption{addressasfootnote}{\@addressasfootnotetrue} +% +% Put addresses at end of document +\newif\if@addressatend +\DeclareOption{addressatend}{\@addressatendtrue} +% +% Put "." after inline section headings: +\newif\if@autosecdot +\DeclareOption{autosecdot}{\@autosecdottrue} +\DeclareOption{noautosecdot}{\AtBeginDocument{\@autosecdotfalse}} +% +% do not print thanksref undefined marks +\newif\if@noundefthanksref +\DeclareOption{noundefthanksref}{\@noundefthanksreftrue} +% +% Load amsmath style with correct settings: +\newif\if@load@amsmath +\DeclareOption{amsmath}{\@load@amsmathtrue} +% +% Load amsthm style with correct settings: +\newif\if@load@amsthm +\DeclareOption{amsthm}{\@load@amsthmtrue} +% +% Load amsmath with leqno option +\newif\if@amsmath@leqno +% +% Load natbib with correct settings: +\newif\if@load@natbib +\DeclareOption{natbib}{\@load@natbibtrue} +% +% When hyperref is loaded, makes a hyperlink only from year component of the cite command: +\newif\if@linksfromyear\@linksfromyearfalse +\DeclareOption{linksfromyear}{\@linksfromyeartrue} +% +% enable writing to .aux +\newif\if@supertoc \@supertocfalse +\newif\if@changetoc \@changetocfalse +% +% for new thanksref syntax +\newif\if@updated@thanksref \@updated@thanksreffalse +% +% Information about journals +% +\def\set@generic{\def\@tempa{-generic}\ifx\journal@id\@tempa\let\affiliation\@gobble\fi} +\AtEndOfPackage{\set@generic} +% +\DeclareOption{ba}{% + \def\journal@id{-ba}% + \def\journal@name{Bayesian Analysis}% + \def\journal@issn@print{1936-0975}% + \def\journal@issn@electronic{1931-6690}% + \def\journal@url{https://bayesian.org/resources/bayesian-analysis/}% + \@balayouttrue + \@noundefthanksreftrue + \@updated@thanksreftrue + \@addressasfootnotetrue + } +% +\DeclareOption{ps}{% + \def\journal@id{-ps}% + \def\journal@name{Probability Surveys }% + \def\journal@issn{ISSN: 1549-5787}% + \def\journal@url{https://imstat.org/journals-and-publications/probability-surveys/}% + \AtEndOfPackage{\let\affiliation\@gobble}% + } +% +% Information about journals +\DeclareOption{ss}{% + \def\journal@id{-ss}% + \def\journal@name{Statistics Surveys }% + \def\journal@issn{ISSN: 1935-7516}% + \def\journal@url{https://imstat.org/journals-and-publications/statistics-surveys/}% + \AtEndOfPackage{\let\affiliation\@gobble}% + } +% +% Information about journals +\DeclareOption{ejs}{% + \def\journal@id{-ejs}% + \def\journal@name{Electronic Journal of Statistics }% + \def\journal@issn{ISSN: 1935-7524}% + \def\journal@url{https://imstat.org/journals-and-publications/electronic-journal-of-statistics/}% + \AtEndOfPackage{\let\affiliation\@gobble}% + } +% +% Options for the IMS journals: +% +\DeclareOption{aap}{% + \def\journal@id{-aap}% + \def\journal@name{Submitted to the Annals of Applied Probability }% + \def\journal@url{https://imstat.org/journals-and-publications/annals-of-applied-probability/}% + \set@page@layout{405bp}{646bp}% + \@twosidetrue + \input{leqno.clo}% formula numbers at left + \@amsmath@leqnotrue + \@historyasfootnotetrue + \@keywordsasfootnotetrue + \@imslayouttrue + \@autosecdottrue + \@print@bid@doitrue + \@updated@thanksreftrue +} +% +\DeclareOption{aop}{% + \def\journal@id{-aop}% + \def\journal@name{Submitted to the Annals of Probability }% + \def\journal@url{https://imstat.org/journals-and-publications/annals-of-probability/}% + \set@page@layout{405bp}{646bp}% + \@twosidetrue + \input{leqno.clo}% formula numbers at left + \@amsmath@leqnotrue + \@historyasfootnotetrue + \@keywordsasfootnotetrue + \@imslayouttrue + \@autosecdottrue + \@print@bid@doitrue + \@updated@thanksreftrue + } +% +\DeclareOption{aos}{% + \def\journal@id{-aos}% + \def\journal@name{Submitted to the Annals of Statistics }% + \def\journal@url{https://imstat.org/journals-and-publications/annals-of-statistics/}% + \set@page@layout{405bp}{646bp}% + \@twosidetrue + \input{leqno.clo}% formula numbers at left + \@amsmath@leqnotrue + \@historyasfootnotetrue + \@keywordsasfootnotetrue + \@imslayouttrue + \@autosecdottrue + \@print@bid@doitrue + \@updated@thanksreftrue + } +% +\DeclareOption{aoas}{% + \def\journal@id{-aoas}% + \def\journal@name{Submitted to the Annals of Applied Statistics }% + \def\journal@url{https://imstat.org/journals-and-publications/annals-of-applied-statistics/}% + \set@page@layout{405bp}{646bp}% + \@twosidetrue + \input{leqno.clo}% formula numbers at left + \@amsmath@leqnotrue + \@historyasfootnotetrue + \@keywordsasfootnotetrue + \@imslayouttrue + \@autosecdottrue + \@print@bid@doitrue + \@updated@thanksreftrue + } +% +\DeclareOption{sts}{% + \def\journal@id{-sts}% + \def\journal@name{Submitted to Statistical Science }% + \def\journal@url{https://imstat.org/journals-and-publications/statistical-science/}% + \set@page@layout{408.62625pt}{702.75pt}% twocol wd - 10pc + \@twosidetrue + \input{leqno.clo}% formula numbers at left + \@amsmath@leqnotrue + \@stslayouttrue + \AtEndPreamble{\if@twocolumn\set@page@layout{528.62625pt}{702.75pt}\fi}% + } +% +\DeclareOption{bj}{% + \def\journal@id{-bj}% + \def\journal@name{Submitted to Bernoulli}% + \def\journal@url{http://www.bernoulli-society.org/index.php/publications/bernoulli-journal/bernoulli-journal}% + \set@page@layout{34pc}{574pt}% + \@twosidetrue + \@bjlayouttrue + \AtEndOfPackage{\let\affiliation\@gobble}% + \@updated@thanksreftrue + } +% +\DeclareOption{aihp}{% + \def\journal@id{-aihp}% + \def\journal@name{Submitted to the Annales de l'Institut Henri Poincar\'e - + Probabilit\'es et Statistiques}% + \def\journal@url{https://imstat.org/journals-and-publications/annales-de-linstitut-henri-poincare/}% + \set@page@layout{169.475mm}{56pc}% + \@twosidetrue + \@aihplayouttrue + \AtEndOfPackage{\let\affiliation\@gobble}% + \@updated@thanksreftrue +} +% +\DeclareOption{bjps}{% + \def\journal@id{-bjps}% + \def\journal@name{Submitted to the Brazilian Journal of Probability and Statistics}% + \def\journal@url{https://imstat.org/journals-and-publications/brazilian-journal-of-probability-and-statistics/}% + \set@page@layout{405pt}{646pt}% + \@twosidetrue + \@historyasfootnotetrue + \@keywordsasfootnotetrue + \@addressatendtrue + \@bjpslayouttrue + \@updated@thanksreftrue + } +% +%% Layouts: +% IMS journals AAP, AOP, AOS has a different layout: +\newif\if@imslayout \@imslayoutfalse +% +% IMS STS journal layout also specific +\newif\if@stslayout \@stslayoutfalse +% +% BA journal layout also specific: +\newif\if@balayout \@balayoutfalse +% +% BS BJ journal layout also specific: +\newif\if@bjlayout \@bjlayoutfalse +% +% AIHP journal layout also specific: +\newif\if@aihplayout \@aihplayoutfalse +% +% BJPS journal layout also specific: +\newif\if@bjpslayout \@bjpslayoutfalse +% +% Spacing +\DeclareOption{doublespacing}{\doublespacing} +\DeclareOption{singlespacing}{\singlespacing} +% +\def\singlespacing{\renewcommand{\baselinestretch}{}\large\normalsize} +\def\doublespacing{\renewcommand{\baselinestretch}{1.6}\large\normalsize} +% +% Do not print id line at bottom of the page: +\DeclareOption{noinfoline}{\AtBeginDocument{\let\info@line\@empty}} +\DeclareOption{infoline}{\AtBeginDocument{\let\info@line\infoline@text}} +% +% Put lines numbers in margins +\newif\ifnumberlines@ \numberlines@false +\DeclareOption{linenumbers}{\numberlines@true} +\DeclareOption{nolinenumbers}{\numberlines@false} +% +% Combined options: +% +% Use this option for submission for pier review: +\DeclareOption{submission}{% + \singlespacing + \AtBeginDocument{\let\info@line\infoline@text}% + \numberlines@false + } +% +% use this option for pre-edition +\DeclareOption{preedit}{% + \doublespacing + \AtBeginDocument{% + \let\info@line\@empty + \set@preedit@page@layout + }% + \numberlines@false + } +% +% Initiate some info: +\def\journal@name{} +\def\journal@url{} +\def\journal@issn{} +\def\journal@id{-generic} +\def\paper@url{} +\def\info@line{} +\def\copyrightowner@text{} +\def\msc@url{https://mathscinet.ams.org/mathscinet/msc/msc2020.html} +% +% set@page@layout +% +% \set@page@layout{\textwidth}{\textheight} +\def\set@page@layout#1#2{% + \setlength\textwidth{#1}% + \@settopoint\textwidth + \setlength\textheight{#2}% + \@settopoint\textheight + % + % make side margins equal: + \setlength\@tempdima{\paperwidth}% + \addtolength\@tempdima{-\textwidth}% + \setlength\oddsidemargin{.5\@tempdima}% + \addtolength\oddsidemargin{-1in}% + \setlength\evensidemargin{\oddsidemargin}% + \@settopoint\oddsidemargin + \@settopoint\evensidemargin + % + % topmargin + \setlength\topmargin{\paperheight}% + \addtolength\topmargin{-2in}% + \addtolength\topmargin{-\headheight}% + \addtolength\topmargin{-\headsep}% + \addtolength\topmargin{-\textheight}% + \addtolength\topmargin{-\footskip}% this might be wrong! + \addtolength\topmargin{-.5\topmargin}% + \@settopoint\topmargin + % + % check if tw and th were not altered + \xdef\imsart@check@textwidth{\the\textwidth}% + \xdef\imsart@check@textheight{\the\textheight}% + \AtEndDocument{% + \@ifundefined{do@not@check@textbox@alter}% + {% + \ifdim\textwidth=\imsart@check@textwidth + \else + \PackageError{imsart}{\string\textwidth\space cannot be altered}\@ehc + \fi + \ifdim\textheight=\imsart@check@textheight + \else + \PackageError{imsart}{\string\textheight\space cannot be altered}\@ehc + \fi + }% + {}% + }% + } +% +\def\set@preedit@page@layout{% + \setlength\paperwidth{\textwidth}% + \addtolength\paperwidth{2in}% + \setlength\oddsidemargin{0in}% + \let\evensidemargin\oddsidemargin + \setlength\paperheight{\textheight}% + \addtolength\paperheight{2in}% + \addtolength\paperheight{\headheight}% + \addtolength\paperheight{\headsep}% + \setlength\topmargin{0in}% + } +% +% old ims and ims related layout +\newif\if@old@layout \@old@layoutfalse +\DeclareOption{oldlayout}{\@old@layouttrue} +% +% Load imsart.cnf with additional options: +\@input{\imsfmt@name.cnf} +% +% Execute options +\ExecuteOptions{} +\ProcessOptions +% +\if@old@layout + \if@imslayout + \set@page@layout{30pc}{550pt} + \@addressatendtrue + \fi + \if@aihplayout + \set@page@layout{39pc}{622pt}% 39pc * 52 line + \fi + \if@bjlayout + \set@page@layout{32pc}{526pt}% 32pc * 44 line + \fi + \if@bjpslayout + \set@page@layout{30pc}{550pt}% 30pc * 46 line + \fi + \if@stslayout + \set@page@layout{32pc}{658pt}% 32pc * 55 line + \AtEndPreamble{\if@twocolumn\set@page@layout{42pc}{658pt}\fi} + \fi +\fi +% +% dimensions +% +\setlength\parindent{12\p@} +\setlength\headsep{14\p@} +\setlength\footskip{14\p@} +\if@aihplayout + \setlength\footskip{24\p@} +\fi +\if@bjlayout + \setlength\parindent{10\p@} + \setlength\footskip{24\p@} +\fi +% +\setlength\smallskipamount{6\p@ \@plus 1\p@ \@minus 1\p@} +\setlength\medskipamount{12\p@ \@plus 3\p@ \@minus 3\p@} +\setlength\bigskipamount{18\p@ \@plus 3\p@ \@minus 3\p@} +% +% setpkgattr, getpkgattr, do@option@list +% +\def\sep@key@value#1=#2/?/#3{\setpkgattr{#3}{#1}{#2}} +\def\do@option@list#1#2{% + \@for\curr@option:={#2}\do{% + \expandafter\sep@key@value\curr@option/?/{#1}\relax + }% + } +\def\pkgattr@namedef{\long\gdef} +\def\pkgattr@namedef@def#1{\expandafter\pkgattr@namedef\csname #1\endcsname} +\protected\def\setpkgattr{\@ifnextchar[{\@setpkgattr}{\@@setpkgattr}} +\protected\def\getpkgattr#1#2{\csname #1@#2\endcsname} +\long\def\@setpkgattr[#1]#2#3#4{% + \pkgattr@namedef@def{#2@#3}{#4}% + } +\long\def\@@setpkgattr#1#2#3{% + \pkgattr@namedef@def{#1@#2}{#3}% + } +% +% newpseudoenvironment +% same as \newenvironment, but new environment do not have additional groups \bgroup \egroup +% (i.e. all definitions are not local +% +\let\org@begin\begin +\let\org@end\end +\def\begin#1{% + \@ifundefined{pseudo@#1}% + {\org@begin{#1}}% + {\csname pseudo@#1\endcsname[0]\relax}% + } +\def\end#1{% + \@ifundefined{pseudo@#1}% + {\org@end{#1}}% + {\csname pseudo@#1\endcsname[1]\relax}% + } +\def\newpseudoenvironment#1#2#3{% + \expandafter\gdef\csname pseudo@#1\endcsname[##1]{% + \relax + \ifcase##1\relax\def\@@next@@{#2}\or\def\@@next@@{#3}\else\let\@@next@@\relax\fi + \@@next@@ + }% + } +% +% pubyear, volume, paperno +% +\def\pubyear#1{\gdef\@pubyear{(#1) }\gdef\@copyrightyear{#1 }} +\def\@pubyear{} +\def\@copyrightyear{} +% +\def\volumetitle#1{\gdef\volume@title{#1 }} +% +\def\volume#1{\gdef\@volume{Vol. #1 }} +\gdef\@volume{} +% +\def\issue#1{\gdef\@issue{No. #1 }} +\gdef\@issue{} +% +\def\paperno#1{\gdef\@paperno{Paper no. #1 }} +\gdef\@paperno{00} +% +% firstpage, lastpage, pagerange +% +\newcounter{firstpage} +\newcounter{lastpage} +% +\def\firstpage#1{% + \def\@tempa{#1}% + \ifx\@tempa\@empty + \else + \global\c@firstpage=#1% + \global\c@lastpage=#1% + \global\c@page=#1 \ignorespaces\fi + } +% +\def\lastpage#1{% + \def\@tempa{#1}% + \ifx\@tempa\@empty + \else + \global\c@lastpage=#1% + \ignorespaces + \fi + } +% +\def\pagerange@sep{--} +% +\def\set@pagerange{% + \ifnum\c@firstpage=0% + \else + \ifnum\c@firstpage=\c@lastpage + \gdef\@pagerange{\thefirstpage}% + \else + \gdef\@pagerange{\thefirstpage\pagerange@sep\thelastpage}% + \fi + \fi + } +% +\def\@pagerange{} +% +\def\pagenumbering#1{% + \gdef\thefirstpage{\csname @#1\endcsname\c@firstpage}% + \gdef\thelastpage{\csname @#1\endcsname\c@lastpage}% + \gdef\thepage{\csname @#1\endcsname\c@page}% + } +% +% hyperref redefines \pagenumbering, so we must override hyperref definition: +\let\ims@pagenumbering\pagenumbering +% +% check last page +\newbool{checklpage} +\def\check@last@page{% + \ifbool{checklpage}% + {% + \ifnum0\number\c@lastpage>0\relax + \ifnum0\number\c@lastpage=\c@page + \else + \special{mt:error Wrong lastpage!}% + \@latex@error{Wrong lastpage: set to \number\c@lastpage, + should be \the\c@page!}\@ehc + \fi + \fi + }% + {}% + } +\AtEndDocument{\check@last@page} +% +% startlocaldefs, endlocaldefs +% +\def\startlocaldefs{\makeatletter} +\def\endlocaldefs{\makeatother} +% +% thanksref, thanksmark, thankslabel, thankstext +% to be safe with hyperref we will use original LaTeX definitions: +% +\def\saferef#1{\expandafter\safe@setref\csname r@#1\endcsname\@firstoftwo{#1}} +\let\safe@setref\@setref +% +\def\safelabel#1{% + \@bsphack + \protected@write\@auxout{}% + {\string\thanksnewlabel{#1}{{\@currentlabel}{\thepage}}}% + \@esphack + } +% +\long\def\safe@footnotetext#1{\insert\footins{% + \reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth \@parboxrestore + \color@begingroup + \def\@thefnmark{}% + \@makefntext{% + \rule\z@\footnotesep\ignorespaces #1\@finalstrut\strutbox}% + \color@endgroup + }}% +% +\long\def\orig@footnotetext#1{\insert\footins{% + \reset@font\footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth \@parboxrestore + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark + }% + \color@begingroup + \@makefntext{\rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% + \color@endgroup + }}% +% +\let\thanksnewlabel\newlabel +% +% we want to use various counters: +\def\usethankscounter#1{% + \@ifundefined{current@thankscounter}% + {\gdef\previous@thankscounter{#1}}% + {\xdef\previous@thankscounter{\current@thankscounter}}% + \def\current@thankscounter{#1}% + } +% +\def\restorethankscounter{\xdef\current@thankscounter{\previous@thankscounter}} +% +\newcounter{thanks} +\def\thethanks{\@fnsymbol\c@thanks} +\usethankscounter{thanks} +% +% address ref: +\newcounter{addressref} +\def\theaddressref{\arabic{addressref}} +% +\def\thanksmark@fmt#1{\@textsuperscript{\normalfont#1}} +\def\thanksref@sep{,} +% +% hooks for the hyperref: +\def\thankref@hyperlink#1{\saferef{#1thanks}} +\def\thanks@hypertarget#1{} +% +% printing the marks +\DeclareRobustCommand{\thanksref}{% + \@ifnextchar[{\@tempswatrue\@thanksref}{\@tempswafalse\@thanksref[]}% + } +\let\orig@thanksref\thanksref +% +\def\@thanksref[#1]#2{% + \if@tempswa% [] + \thanksmark@fmt{#1}% + \else + \let\@tempa\@empty + \thanksmark@fmt{\@for\@tempb:=#2\do{% + \csname thanksref@hook\endcsname + \@tempa + \let\@tempa\thanksref@sep + \edef\@tempb{\expandafter\@firstofone\@tempb\@empty}% + \thankref@hyperlink{\@tempb}% + }}% + \fi + } +% +% form and print mark +\def\thanksmark{\@ifnextchar[{\@tempswatrue\@thanksmark}{\@tempswafalse\@thanksmark[]}} +% +\def\@thanksmark[#1]#2{% + \@thankslabel[#1]{#2}% + \thanksmark@fmt{\expandafter\saferef{#2thanks}\thanks@hypertarget{#2}}% + } +% +% form only mark +\def\thankslabel{\@ifnextchar[{\@tempswatrue\@thankslabel}{\@tempswafalse\@thankslabel[]}} +% +\def\@thankslabel[#1]#2{% + \if@tempswa% [] + \protected@edef\@currentlabel{#1}% + \else + \refstepcounter{\current@thankscounter}% + \fi + \@ifundefined{temp@label@#2thanks}% + {\global\@namedef{temp@label@#2thanks}{}\safelabel{#2thanks}}% + {}% + } +% +% form a mark and place text in \@thanks: +\def\thankstext{\@ifnextchar[{\@tempswatrue\@thankstext}{\@tempswafalse\@thankstext[]}} +% +\def\@thankstext[#1]#2#3{% + \@thankslabel[#1]{#2}% + \protected@xdef\@thanks{\@thanks\protect\thanks@thefnmark{#2thanks}% + \protect\orig@footnotetext{\thanks@hypertarget{#2}#3}}% + } +% +\def\thanks@thefnmark#1{\begingroup\unrestored@protected@xdef\@thefnmark{\saferef{#1}}\endgroup} +% +% ST macro for creation customized enumeration system +\def\setvaluelist#1#2{% + \@tempcnta=0\relax + \@for\@curr@val:=#2\do{% + \advance\@tempcnta by 1\relax + \expandafter\protected@xdef\csname #1@item@\the\@tempcnta\endcsname{\@curr@val}% + }% + \expandafter\protected@xdef\csname #1@item@0\endcsname{\the\@tempcnta}% + } +\xdef\getitemvalue#1#2{\noexpand\csname #1@item@#2\endcsname} +% +% \ead, \printead +% +\RequirePackage{keyval} +% +\def\email@text{e-mail: } +\def\url@text{url: } +\def\fullurl@text{url: } +\def\ead@sep{;~} +\let\ead@size\relax +\def\printead@fmt#1{#1} +% +\newcounter{emailref} +\setvaluelist{emailmarks}{*,**,\textdagger,\textdaggerdbl} +\def\theemailref{\getitemvalue{emailmarks}{\the\c@emailref}} +\define@key{ead}{mark}[true]{% + \usethankscounter{emailref}% + \thankslabel{\ead@label}% + } +% +\if@old@layout +\else + \if@updated@thanksref + \setvaluelist{emailmarks}{*,\textdagger,\textdaggerdbl,% + \textsection,\textparagraph,||,**,\textdagger\textdagger,% + \textdaggerdbl\textdaggerdbl + } + \define@key{ead}{mark}[true]{% + \csxdef{ead@\ead@label @mark}{\the\c@author}% + \csxdef{author@\the\c@author @ead@mark}{\ead@label}% + } + \fi +\fi +% +% we are using keyval package +\define@key{ead}{email}[true]{\def\ead@type{email}} +\define@key{ead}{url}[true]{\def\@tempa{fullurl}\ifx\ead@type\@tempa\else\def\ead@type{url}\fi} +\define@key{ead}{label}{\def\ead@label{#1}} +% +\define@key{ead}{text}{% + \bgroup + \def\\{\string\break}% + \def\break{\string\break}% + \protected@edef\@currentlabel{#1}% + \safelabel{\ead@label @\ead@type text}% + \egroup + } +% +\define@key{ead}{nopdflink}[true]{% + \protected@edef\@currentlabel{nolink}% + \safelabel{\ead@label @nopdflink}% + } +% +\DeclareRobustCommand\ead[2][label= ,email]{{% + \def\ead@type{email}% default + \checkead@prefix#2://\end + \def\texttildelow{\noexpand\texttildelow}% + \setkeys{ead}{#1}% + \protected@edef\@currentlabel{#2}% + \safelabel{\ead@label @\ead@type}}% + } +% +\def\checkead@prefix#1://#2\end{\ifx.#2.\else\def\ead@type{fullurl}\fi} +% +\newif\ifnot@ead@star +\newif\if@printead@opt +% +\DeclareRobustCommand{\printead}{% + \@ifstar{\not@ead@starfalse\@printead}{\not@ead@startrue\@printead}% + } +% +\def\@printead{% + \@ifnextchar[{\@printead@opttrue\@@printead}{\@printead@optfalse\@@printead[]}% + } +% +\def\@@printead[#1]#2{{% + \if@printead@opt%[] + \def\ims@href@text{#1}% + \not@ead@starfalse + \fi + \let\prev@ead@text\relax + \let\@ead@sep\relax + \let\ead@text\relax + \let\ead@prefix\relax + \def\ead@type{}% + \@tempcnta=0% + \let\sv@ims@href\ims@href + \printead@fmt{% + \@for\ead@ref:=#2\do{% + \advance\@tempcnta by 1% + \let\ims@href\sv@ims@href + \@ead@sep\let\@ead@sep\ead@sep + \@ifundefined{r@\ead@ref @nopdflink}% + {}% + {\def\ims@href##1##2{##2}}% + \@ifundefined{r@\ead@ref @email}% + {}% + {\let\ead@text\email@text\def\ead@type{email}\def\ead@prefix{mailto:}}% + \@ifundefined{r@\ead@ref @url}% + {}% + {\let\ead@text\url@text\def\ead@type{url}\def\ead@prefix{http://}}% + \@ifundefined{r@\ead@ref @fullurl}% + {}% + {\let\ead@text\fullurl@text\def\ead@type{fullurl}\def\ead@prefix{}}% + \ifx\prev@ead@text\ead@text + \let\ead@text\relax + \fi + \csname printead@hook\endcsname + \if@printead@opt + \ifnum\@tempcnta>1% + \@latex@error{Command \@backslashchar printead[]{e1} could + have only one parameter "e1"!}\@eha + \fi + \else + \@ifundefined{r@\ead@ref @\ead@type text}% + {% + \def\ims@href@text{% + \@ifundefined{r@\ead@ref thanks}% + {}% + {\thanksref{\ead@ref}}% + \saferef{\ead@ref @\ead@type}% + }% + }% + {% + \def\ims@href@text{% + \@ifundefined{r@\ead@ref thanks}% + {}% + {\thanksref{\ead@ref}}% + \saferef{\ead@ref @\ead@type text}% + }% + }% + \fi + \ifnot@ead@star + \ead@text + \fi + \bgroup + \ead@size\def\null{}% + \@ifundefined{ead@\ead@ref @mark}% + {}% + {% + \usethankscounter{emailref}% + \thanksmark{\ead@ref}% + \restorethankscounter + \cslet{r@\ead@ref thanks}\relax + }% + \ifcsundef{r@\ead@ref @\ead@type}% + {\ims@href@text}% + {% + \ims@href{\ead@prefix\saferef{\ead@ref @\ead@type}}{\ims@href@text}% + }% + \egroup + \@ifundefined{ead@text}% + {}% + {\let\prev@ead@text\ead@text}% + }% + }% + }} +% +% \copyrightowner, \corref +\def\copyrightowner#1{\def\copyrightowner@text{#1}} +% +% for corresponding author +\def\corref#1{} +% +% normaltext, nohyphen, today +% +% normal text (justify) +\def\normaltext{% + \let\\=\@normalcr + \leftskip=\z@ + \@rightskip=\z@ + \rightskip=\@rightskip + \parfillskip=\@flushglue + } +% +% to switch off hyphenation +\def\nohyphen{% + \pretolerance=\@M + \tolerance=\@M + \hyphenpenalty=\@M + \exhyphenpenalty=\@M + } +% +% \@ifemptyhbox +\def\@ifnonempty#1{% + \setbox\@tempboxa\hbox{\ignorespaces #1}% + \ifdim\wd\@tempboxa>1pt #1\fi + } +% +% pagestyle{imsheadings} \thispagestyle{copyright} +\if@twoside + \def\ps@imsheadings{% + \def\@oddfoot{\hfill\info@line}% + \let\@evenfoot\@oddfoot + \def\@evenhead{% + \runninghead@size + \rlap{\pagenumber@size\thepage}\evenhead@fmt{\leftmark}% + }% + \def\@oddhead{% + \runninghead@size + \oddhead@fmt{\rightmark}\llap{\pagenumber@size\thepage}% + }% + } +\else + \def\ps@imsheadings{% + \def\@oddfoot{\hfill\info@line}% + \let\@evenfoot\@oddfoot + \def\@evenhead{% + \runninghead@size\hfill\leftmark/\rightmark\hfill + \llap{\pagenumber@size\thepage}% + }% + \def\@oddhead{% + \runninghead@size\hfill\leftmark/\rightmark\hfill + \llap{\pagenumber@size\thepage}% + }% + } +\fi +% +\def\ps@copyright{% + \let\@mkboth\@gobbletwo + \def\@evenhead{\parbox[t]{\textwidth}{\copyright@size\copyright@text}}% + \let\@oddhead\@evenhead + \def\@oddfoot{\hfill\pagenumber@size\thepage\hfill\llap{\info@line}}% + \let\@evenfoot\@oddfoot + } +% +\def\evenhead@fmt#1{\hfill#1\hfill} +\def\oddhead@fmt#1{\hfill#1\hfill} +% +% url@fmt +% +\def\journalurl#1{\def\journal@url{#1}} +\def\paperurl#1{\def\paper@url{#1}} +% +% DOI +% +\def\doi#1{% + \gdef\@doi{#1}% + \gdef\doi@text{\url@fmt{DOI: }{\ttfamily}{#1}{\doi@base\@doi}}% + } +% +\let\@doi\relax +% +\if@old@layout + \def\doi@base{http://dx.doi.org/} +\else + \def\doi@base{https://doi.org/} +\fi +\@onlypreamble\doi +% +\protected\def\relateddoi{\@ifnextchar[{\@tempswatrue\@relateddoi}{\@tempswafalse\@relateddoi[]}} +\def\@relateddoi[#1]#2#3{\protect\ims@href{\doi@base#3}{#3}} +% +\protected\def\relateddois{% + \@ifnextchar[{\@tempswatrue\@relateddois}{\@tempswafalse\@relateddois[]}% + } +\def\@relateddois[#1]#2#3{% + \@thankslabel[#1]{#2}% + \bgroup + \protected@xdef\@thanks{\@thanks\protect\thanks@thefnmark{#2thanks}% + \protect\@footnotetext{\thanks@hypertarget{#2}#3}}% + \egroup + } +% +% arXiv +% +\def\arxiv#1{% + \gdef\@arxiv{#1}% + \thankstext[]{fm@arXiv}{\protect\url@fmt{arXiv: }{}{#1}{\arxiv@base\@arxiv}}% + }% +% +\let\@arxiv\relax +\@onlypreamble\arxiv +% +% https://arxiv.org/abs/math.PR/0603300 +\def\arxiv@base{https://arxiv.org/abs/} +% +% {url}{text} +\def\ims@href#1#2{#2} +% +% {prefix}{font}{text}{url} +\def\url@fmt#1#2#3#4{% + \edef\@tempa{#3}% + \ifx\@tempa\@empty + \else + #1{#2\ims@href{#4}{#3}}% + \fi + } +% +% LIST ENVIRONMENTS +% +\parsep=\z@ +\topsep=\smallskipamount +\partopsep=\z@ +\itemsep=\z@ +\labelsep=.5em +% +\def\@listI{% + \leftmargin=\leftmargini + \parsep=\z@ + \topsep=\smallskipamount + \itemsep=\z@ + } +% +\def\list@parindent{1pc} +% +% quotation +\let\quotation@size\footnotesize +\def\quotation@itemindent{\list@parindent} +\def\quotation@parindent{\list@parindent} +\def\quotation@leftmargin{\list@parindent} +\let\quotation@rightmargin\z@ +\let\quotation@topsep\smallskipamount +% +\def\quotation{% + \list{}{% + \quotation@size + \listparindent=\quotation@parindent + \itemindent=\quotation@itemindent + \rightmargin=\quotation@rightmargin + \leftmargin=\quotation@leftmargin + \partopsep=\z@ + \topsep=\quotation@topsep + \parsep=\z@ + }% + \item[\Q@strut]\relax + } +\def\endquotation{\endlist} +% +\def\Q@strut{\leavevmode\hbox{\vrule height9pt depth1pt width0pt}} +% +% quote +\let\quote@size\footnotesize +\def\quote@indent{\z@} +\def\quote@leftmargin{2pc} +\def\quote@rightmargin{2pc} +\let\quote@topsep\smallskipamount +% +\def\quote{% + \list{}{% + \quote@size + \listparindent=\quote@indent + \itemindent=\listparindent + \rightmargin=\quote@rightmargin + \leftmargin=\quote@leftmargin + \partopsep=\z@ + \topsep=\quote@topsep + \parsep=\z@ + }% + \item\relax + } +\def\endquote{\endlist} +% +% table, figure +% +\def\fnum@table{\tablename~\thetable} +\setlength\belowcaptionskip{4\p@} +% +\renewenvironment{table} + {% + \let\@makecaption\@maketablecaption + \csname starttable@hook\endcsname + \@float{table}% + } + {\end@float} +\renewenvironment{table*} + {% + \let\@makecaption\@maketablecaption + \csname starttable@hook\endcsname + \@dblfloat{table}% + } + {\end@dblfloat} +% +\long\def\@maketablecaption#1#2{% + \tablecaption@shape\tablecaption@size + {\tablename@size #1}\tablename@skip #2\par + \vskip\belowcaptionskip + } +% +\setpkgattr{tablecaption}{shape}{\centering} +\setpkgattr{tablecaption}{size}{\footnotesize\itshape} +\setpkgattr{tablename}{size}{\scshape} +\setpkgattr{tablename}{skip}{\endgraf} +% +% figure : use \@makecaption: +\renewcommand\figurename{Fig} +% +\long\def\@makecaption#1#2{% + \vskip\abovecaptionskip + \figurecaption@size + \sbox\@tempboxa{{\figurename@size #1}\figurename@skip #2}% + \ifdim \wd\@tempboxa >\hsize + {\figurename@size #1}\figurename@skip #2\par + \else + \global \@minipagefalse + \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% + \fi + \vskip\belowcaptionskip + } +% +\setpkgattr{figurecaption}{size}{\footnotesize\itshape} +\setpkgattr{figurename}{size}{\scshape} +\setpkgattr{figurename}{skip}{.~} +% +\def\@floatboxreset{% + \reset@font + \@setminipage + \singlespacing + \ifcsundef{\@captype @size}% + {\footnotesize}% + {% + \csuse{\@captype @size}% + }% + \centering + } +% +\if@aihplayout + \setpkgattr{tablecaption}{size}{\footnotesize} + \setpkgattr{figurecaption}{size}{\footnotesize} +\fi +% +\if@bjlayout + \let\savehline\hline + \def\thline{\noalign{\vskip3pt}\savehline\noalign{\vskip3pt}}% + \setpkgattr{starttable}{hook}{\let\hline\thline} +\fi +% +\if@bjpslayout + \let\savehline\hline + \def\thline{\noalign{\vskip3pt}\savehline\noalign{\vskip3pt}}% + \setpkgattr{starttable}{hook}{\let\hline\thline} + \setpkgattr{tablename}{size}{\bfseries\upshape} + \setpkgattr{tablename}{skip}{\enskip} + \setpkgattr{figurename}{size}{\bfseries\upshape} + \setpkgattr{figurename}{skip}{\enskip} + \def\figurename{Figure} + \setpkgattr{tablecaption}{shape}{} +\fi +% +\if@stslayout + \let\savehline\hline + \def\thline{\noalign{\vskip3pt}\savehline\noalign{\vskip4pt}}% + \setpkgattr{starttable}{hook}{\let\hline\thline} +\fi +% +% FOOTNOTE +% +\renewcommand\@makefntext[1]{\parindent=12pt\@makefnmark #1} +% +\def\@makefnmark{\@textsuperscript{\normalfont\@thefnmark}} +% +% SECTION commands: +% from latex.ltx: +% Two improvements: +% 1. if section command is defined as "inline" the '.' will be inserted after heading; +% 2. section* will write to toc and will appear in pdf bookmarks +% +% dirty trick... +\def\@startsection#1#2#3#4#5#6{% + \if@noskipsec \leavevmode \fi + \par + \@tempskipa #4\relax + \@afterindenttrue + \ifdim \@tempskipa <\z@ + \@tempskipa=-\@tempskipa \@afterindentfalse + \fi + \if@nobreak + \everypar{}% + \else + \addpenalty\@secpenalty\addvspace\@tempskipa + \fi + \@ifstar + {\def\ssection@level{#2}\@ssect{#3}{#4}{#5}{#6}}% + {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}% + } +% +% Trick for the hyperref: +\def\setaftersec@dot#1{% + \if@autosecdot + \setbox0=\hbox{#1}% + \ifdim\wd0>0\p@ + \def\aftersec@dot{.}% + \else + \def\aftersec@dot{}% + \fi + \fi + } +\let\aftersec@dot\relax +% +% section - will add hook for the dot after section heading +\def\@sect#1#2#3#4#5#6[#7]#8{% + \ifnum #2>\c@secnumdepth + \let\@svsec\@empty + \else + \refstepcounter{#1}% + \protected@edef\@svsec{\@seccntformat{#1}\relax}% + \fi + \@tempskipa #5\relax + \ifdim \@tempskipa>\z@ + \begingroup + #6{% + \@hangfrom{\hskip #3\relax\@svsec}% + \interlinepenalty \@M #8\@@par + }% + \endgroup + \csname #1mark\endcsname{#7}% + \addcontentsline{toc}{#1}{% + \ifnum #2>\c@secnumdepth + \else + \protect\numberline{\csname the#1\endcsname}% + \fi + #7% + }% + \else + \setaftersec@dot{#8}% + \def\@svsechd{% + #6{\hskip #3\relax \@svsec #8\aftersec@dot}% + \csname #1mark\endcsname{#7}% + \addcontentsline{toc}{#1}{% + \ifnum #2>\c@secnumdepth + \else + \protect\numberline{\csname the#1\endcsname}% + \fi + #7% + }% + }% + \fi + \@xsect{#5}% + } +% +% section* - will add hook for the dot after section heading and \contentsline +\def\@ssect#1#2#3#4#5{% + \@tempskipa #3\relax + \ifdim \@tempskipa>\z@ + \begingroup + #4{% + \@hangfrom{\hskip #1}% + \interlinepenalty=\@M #5\@@par + }% + \endgroup + \else + \setaftersec@dot{#5}% + \def\@svsechd{#4{\hskip #1\relax #5\aftersec@dot}}% + \fi + \ifnum\ssection@level=1\phantomsection\addcontentsline{toc}{section}{#5}\fi + \@xsect{#3}% + } +% +% Block adding to contents for the next command only: +\def\nocontentsline{% + \let\@@addcontentsline\addcontentsline + \ifx\hyper@anchor\@undefined + \def\addcontentsline##1##2##3{\let\addcontentsline\@@addcontentsline}% + \else + \def\addcontentsline##1##2##3##4{\let\addcontentsline\@@addcontentsline}% + \fi + } +% +\protected\def\qq#1{% + \bgroup + \ifx.#1.\relax + \ifmmode + \mbox{\normalfont\textbf{???}}% + \else + \normalfont\textbf{???}% + \fi + \else + \ifmmode + \mbox{\normalfont\textbf{#1}}% + \else + \normalfont\textbf{#1}% + \fi + \fi + \egroup + } +% +% \phantomsection is defined in hyperref +\let\phantomsection\relax +% +% FRONTMATTER SETTINGS +% +% FRONT MATTER FORMATTING PARAMETERS +% +\setpkgattr{frontmatter}{style}{\centering} +\setpkgattr{title}{style}{\centering\def\\{\break}} +\setpkgattr{author}{style}{\centering} +\setpkgattr{address}{style}{\centering} +\setpkgattr{abstract}{style}{\normaltext} +\setpkgattr{keyword}{style}{\normaltext} +\setpkgattr{history}{style}{\normaltext} +% +% FRONT MATTER SKIPS +\setpkgattr{title}{skip}{18\p@} +\setpkgattr{atltitle}{skip}{14\p@} +\setpkgattr{authors}{skip}{12pt} +\setpkgattr{dedicated}{skip}{12\p@} +\setpkgattr{address}{skip}{6\p@ plus 1\p@ minus 1\p@} +\setpkgattr{affiliation}{skip}{6\p@ plus 1\p@ minus 1\p@} +\setpkgattr{abstract}{skip}{10\p@} +\setpkgattr{abstractname}{skip}{:\enskip} +\setpkgattr{keyword}{skip}{10\p@} +\setpkgattr{history}{skip}{10\p@} +\setpkgattr{frontmatter}{cmd}{% + \vskip20\p@ plus 3\p@ minus 3\p@ + \@afterindentfalse\@afterheading + } +\setpkgattr{firstpage}{cmd}{} +% +% FRONT MATTER DIMENSIONS +\setpkgattr{abstract}{width}{.8\textwidth} +\setpkgattr{abstract}{indent}{0\p@} +\setpkgattr{keyword}{width}{.8\textwidth} +\setpkgattr{keyword}{indent}{0\p@} % +\setpkgattr{history}{width}{.8\textwidth} +% +% FRONT MATTER FONTS +\setpkgattr{dochead}{size}{\Large\bfseries} +\setpkgattr{title}{size}{\LARGE\bfseries} +\setpkgattr{author}{size}{\normalsize\bfseries} +\setpkgattr{fnms}{size}{} +\setpkgattr{snm}{size}{} +\setpkgattr{address}{size}{\footnotesize\itshape\mdseries} +\setpkgattr{affiliation}{size}{\footnotesize\itshape\mdseries} +\setpkgattr{dedicated}{size}{\normalsize\itshape} +\setpkgattr{ead}{size}{\upshape\ttfamily} +\setpkgattr{abstract}{size}{\footnotesize\upshape\mdseries} +\setpkgattr{abstractname}{size}{\bfseries} +\setpkgattr{keyword}{size}{\footnotesize\upshape\mdseries} +\setpkgattr{keywordname}{size}{\bfseries} +\setpkgattr{history}{size}{\footnotesize\mdseries} +\setpkgattr{copyright}{size}{\footnotesize\raggedright} +\setpkgattr{runninghead}{size}{\footnotesize\itshape} +\setpkgattr{pagenumber}{size}{\footnotesize\upshape} +\setpkgattr{thebibliography}{size}{\normalsize} +% +% FRONT MATTER CASE +\setpkgattr{dochead}{case}{} +\setpkgattr{title}{case}{} +\setpkgattr{runninghead}{case}{} +% +% TEXT, etc. +\setpkgattr{doi}{text}{\url@fmt{url: }{\ttfamily}{\paper@url}{\paper@url}} +\setpkgattr{copyright}{text}{% + \url@fmt{}{\bfseries}{\journal@name}{\journal@url}\break + \@ifundefined{volume@title}{}{\textbf{\volume@title}\break}% + \@ifnonempty{\@volume\@pubyear\@pagerange\break}% + \@ifnonempty{\journal@issn\break}% + \doi@text + } +% +\setpkgattr{infoline}{text}{% + \lower12pt% + \hbox{% + \footnotesize\ttfamily\imsfmt@name\journal@id\ + ver. \imsfmt@version\ file: \jobname.tex\ date: \today + }% + } +\setpkgattr{copyright}{owner}{$\copyright$~\@copyrightyear \copyrightowner@text} +\setpkgattr{author}{prefix}{} +\setpkgattr{keyword}{postfix}{\unskip.} +% +\def\abstractname{Abstract} +% +% HISTORY +\setpkgattr{history}{prefix}{} +\setpkgattr{history}{postfix}{.} +\setpkgattr{received}{prefix}{Received~} +\setpkgattr{received}{postfix}{} +\setpkgattr{revised}{prefix}{; revised~} +\setpkgattr{revised}{postfix}{} +\setpkgattr{accepted}{prefix}{; accepted~} +\setpkgattr{accepted}{postfix}{} +% +% FRONTMATTER STUFF +% +% COUNTERS, ETC +\newcounter{author} +\newcounter{address} +\newdimen\sv@mathsurround +\def\author@num{0} +% +% RUNNING HEAD +\def\runtitle#1{\gdef\@runtitle{\runninghead@case{#1}}} +\def\@runtitle{} +\def\runauthor#1{{\def\etal{et al.}\gdef\@runauthor{\runninghead@case{#1}}}} +\def\@runauthor{} +% +\newdimen\sv@parindent +\sv@parindent\parindent +% +\newbox\fm@box +\newdimen\fm@size +% +\let\hy@frontmatter\relax +\let\hy@endfrontmatter\relax +\let\tableofcontents@fmt\relax +% +% FRONTMATTER +% +\def\frontmatter{% + \global\c@author=\z@ + \global\c@address=\z@ + \renewcommand\thefootnote{\@fnsymbol\c@footnote}% + % + \if@changetoc + \let\old@tableofcontents\tableofcontents + \def\tableofcontents{\let\tableofcontents@fmt\old@tableofcontents}% + \fi + % + \def\pdftitle##1{\write@pdfinfo{\user@hy@title}{##1}}% + \def\pdfauthor##1{\write@pdfinfo{\user@hy@author}{##1}}% + \def\pdfsubject##1{\write@pdfinfo{\user@hy@subject}{##1}}% + \def\pdfkeywords##1{\write@pdfinfo{\user@hy@keywords}{##1}}% + % + \if@supertoc + \addtocontents{toc}{\protect\contentsline{begintocitem}{}{}{}}% + \addtocontents{toc}{\protect\contentsline{jobname}{\jobname}{}{}}% + \ifx\@doi\relax \else\addtocontents{toc}{\protect\contentsline{doi}{\@doi}{}{}}\fi + \ifx\@arxiv\relax + \else + \addtocontents{toc}{\protect\contentsline{arxiv}{\@arxiv}{}{}}% + \fi + \fi + % + \sv@mathsurround=\mathsurround \m@th + \parindent=\z@ + \hy@frontmatter + \global\let\maketitle\relax + \open@fm \ignorespaces + } +% +% ENDFRONTMATTER +% +\def\endfrontmatter{% + \global\@topnum=\z@ + \set@pagerange + \csname form@runauthors\endcsname + \markboth{\@runauthor}{\@runtitle}% + \thispagestyle{copyright}% + % + \put@fmt@data + % + \close@fm + % + \firstpage@cmd + % + \write@pdfinfo{\hy@author}{\the\authors@list}% + \write@pdfinfo{\hy@subject}{\journal@name\@copyrightyear\@volume\@issue\@pagerange}% + \write@pdfinfo{\hy@keywords}{\the\keywords@list}% + % + \if@supertoc + \addtocontents{toc}{\protect\contentsline{author}{\the\authors@list}{\thepage}{}}% + \addtocontents{toc}{\protect\contentsline{endtocitem}{}{}{}}% + \fi + % + \write\@mainaux{\string\gdef\string\author@num{\the\c@author}}% + \hy@endfrontmatter + \global\mathsurround\sv@mathsurround + \global\c@footnote=\z@ + \global\let\@thanks\@empty + \let\title\relax + \let\author\relax + \let\address\relax + \let\frontmatter\relax + \let\endfrontmatter\relax + \let\@maketitle\relax + \let\@@maketitle\relax + \aftergroup\frontmatter@cmd + } +% +\def\put@fmt@data{% + \copyright@fmt + \@thanks + \abstract@fmt + \keyword@fmt + \history@fmt + \tableofcontents@fmt + } +% +\newdimen\t@xtheight +\def\init@settings{% + \splittopskip=\topskip + \splitmaxdepth=\maxdepth + \t@xtheight=\textheight + \advance\t@xtheight by -\splittopskip + } +% +\def\no@harm{% + \let\thanks=\@gobble + \let\thanksref=\@gobble + \let~\space + \def\ead[##1]##2{}% + \let\\=\@empty + \def\protect{\noexpand\protect\noexpand}% + } +% +\def\open@fm{% + \global\setbox\fm@box=\vbox\bgroup + \hsize=\textwidth + \frontmatter@style + } +% +\def\close@fm{% + \par + \egroup + \fm@size=\dp\fm@box + \advance\fm@size by \ht\fm@box + \@whiledim\fm@size>\t@xtheight \do{% + \global\setbox\@tempboxa=\vsplit\fm@box to \t@xtheight + \unvbox\@tempboxa + \fm@size=\dp\fm@box + \advance\fm@size by \ht\fm@box + }% + \if@twocolumn + \emergencystretch=1pc \twocolumn[\unvbox\fm@box] + \else + \unvbox\fm@box + \fi + } +% +% DOCHEAD +\def\dochead#1{% + \bgroup + \dochead@size + \leavevmode\vphantom{\strut}\dochead@case{#1}\par + \egroup + \setpkgattr{title}{skip}{8\p@}% + } +% +% TITLE +\def\title@endhook{} +\def\title@correctionnote#1{% + \thanksref{CoRreCtIoNnOtE}% + \g@addto@macro\title@endhook{\thankstext{CoRreCtIoNnOtE}{#1}}% + } +\def\title#1{% + \vglue\title@skip + % check if we are in {frontmatter} + \def\reserved@a{frontmatter}% + \ifx\reserved@a\@currenvir \else \hy@frontmatter\fi + \bgroup + \no@harm + \let\correctionnote\@gobble + \xdef\@argi{#1}% + \xdef\@title{#1}% + \egroup + \write@pdfinfo{\hy@title}{\@argi}% + \if@supertoc + \addtocontents{toc}{\protect\contentsline{title}{\@argi}{\thepage}{}}% + \fi + \bgroup + \let\correctionnote\title@correctionnote + \title@style\title@size\title@case{#1}\par + \egroup + \title@endhook + } +% +% ATLTITLE +% +\def\atltitle#1{% + \vglue\atltitle@skip + \bgroup + \title@size #1\par + \egroup + } +% +% AUTHOR +% +% AUG - author block +\def\smart@par{\ifhmode\par\fi} +\newenvironment{aug}{}{\smart@par} +% +\def\and{\unskip~and~} +% +\def\author{\@ifnextchar[{\author@fmt}{\author@fmt[]}} +% +\def\author@fmt[#1]#2{% + \stepcounter{author}% + \author@fmt@init + \let\author@fmt@init\relax + \bgroup + \def\degs##1{##1}% + \def\fnms##1{##1}% + \def\inits##1{}% + \def\snm##1{##1}% + \def\roles##1{##1}% + \@tempcnta=\author@num\relax + \ifnum\c@author=\@tempcnta + \def\author@sep{ and }% + \else + \def\author@sep{, }% + \fi + \ifnum\c@author=1% + \addto@authors@list{#2}% + \else + \addto@authors@list{\author@sep #2}% + \fi + \def\inits##1{{\inits@size{##1}}}% + \def\fnms##1{{\fnms@size{##1}}}% + \def\snm##1{\snm@size{##1}}% + \if@old@layout + \else + \if@updated@thanksref + \def\thanksref##1{% + \edef\author@direct@thanksref{##1}% + \def\thanksref{\@latex@error{only one \string\thanksref\space + is allowed inside \string\author}{??}}% + }% + \fi + \fi + \noindent#2% + \if@old@layout + \thanksref{#1}% + \else + \if@updated@thanksref + \ifx.#1.% + \let\tmp@author@thanksrefs\@empty + \edef\tmp@sep{}% + \else + \appto\tmp@author@thanksrefs{#1}% + \edef\tmp@sep{,}% + \fi + \@ifundefined{author@direct@thanksref}% + {}% + {% + \eappto\tmp@author@thanksrefs{\tmp@sep\author@direct@thanksref}% + \edef\tmp@sep{,}% + }% + \@ifundefined{author@\the\c@author @ead@mark}% + {}% + {% + \eappto\tmp@author@thanksrefs + {\tmp@sep\csname author@\the\c@author @ead@mark\endcsname}% + }% + \ifx\tmp@author@thanksrefs\@empty + \else + \expandafter\orig@thanksref\expandafter{\tmp@author@thanksrefs}% + \fi + \else + \if@stslayout + \else + \thanksref{#1}% + \fi + \fi + \fi + \egroup + } +% +\def\author@fmt@init{% + \vskip\authors@skip + \noindent\leavevmode\author@style\author@size\author@prefix + } +% +\let\author@fmt@init@def\author@fmt@init +% +% DEDICATED +\def\dedicated#1{% + \vskip\dedicated@skip + \bgroup + \dedicated@size #1\par + \egroup + } +% +% ADDRESS +\def\address{\@ifnextchar[{\address@fmt}{\address@fmt[]}} +% +\def\address@fmt[#1]#2{% + \smart@par + \let\author@fmt@init\author@fmt@init@def + \vskip\address@skip + \bgroup + \address@style\address@size\leavevmode + \ifx.#1.% + \else + \usethankscounter{addressref}% + \thanksmark{#1}% + \restorethankscounter + \fi + #2\par + \egroup + } +% +% AFFILIATION +% +\def\affiliation{\@ifnextchar[{\affiliation@fmt}{\affiliation@fmt[]}} +% +\def\affiliation@fmt[#1]#2{% + \smart@par + \let\author@fmt@init\author@fmt@init@def + \vskip\affiliation@skip + \def\affiliation@skip{\z@}% + \bgroup + \affiliation@size + \leavevmode + \ifx.#1.% + \else + \usethankscounter{addressref}\thanksmark{#1}\restorethankscounter + \fi + #2\par + \egroup + } +% +% CONTRIBUTOR +% write as index entry: +% \contributor{Author, F.}{University} +% \indexentry{Author, F., \textit{Some University}}{} +% +\let\contributor\@gobbletwo +\if@supertoc + \def\contributor#1#2{% + \addtocontents{idx}{\protect\indexentry{#1, \protect\textit{#2}}{}}% + } +\fi +% +% COPYRIGHTOWNER +% +\def\copyright@fmt{% + \@ifundefined{\copyrightowner@text}{}{\safe@footnotetext{\copyright@owner}}% + } +% +% ABSTRACT +% +\newbox\abstract@box +% +\define@key{abstract}{language}{\set@loc@hyphenation{#1}\set@loc@abstractname{#1}} +% +\gdef\abstract{\@ifnextchar[{\@abstract}{\@abstract[]}} +% +\def\@abstract[#1]{% + \setkeys{abstract}{#1}% + \global\setbox\abstract@box=\vbox\bgroup + \ifvoid\abstract@box + \else + \unvbox\abstract@box + \vskip\abstract@skip + \fi + \@tempdima=\textwidth + \advance\@tempdima by -\abstract@width + \divide\@tempdima by 2% + \abstract@style + \leftskip=\@tempdima + \rightskip=\@tempdima + \abstract@size + \parindent=\sv@parindent + \noindent\hskip\abstract@indent + {\abstractname@size\abstractname\abstractname@skip}\ignorespaces + } +% +\def\endabstract{\par\egroup} +% +\def\abstract@fmt{% + \ifvoid\abstract@box + \else + \vskip\abstract@skip + \unvbox\abstract@box + \fi + } +% +\def\set@loc@hyphenation#1{% + \@ifundefined{l@#1}% + {}% + {\expandafter\language\csname l@#1\endcsname}% + } +% +\def\set@loc@abstractname#1{% + \def\abstractname@english{Abstract}% + \def\abstractname@german{Zusammenfassung}% + \def\abstractname@french{R\'esum\'e}% + \def\abstractname@spanish{Resumen.}% + \@ifundefined{abstractname@#1}% + {\@latex@error{Language '#1` is not supported!}{}}% + {\edef\abstractname{\csname abstractname@#1\endcsname}}% + } +% +% HISTORY: received, revised, accepted +% +\def\history@exist{0} +% +\def\received#1{\def\@tempa{#1}\ifx\@tempa\@empty\else\gdef\@received{#1}\gdef\history@exist{1}\fi} +\def\@received{\@nil} +\def\revised#1{\def\@tempa{#1}\ifx\@tempa\@empty\else\gdef\@revised{#1}\gdef\history@exist{1}\fi} +\def\@revised{\@nil} +\def\accepted#1{\def\@tempa{#1}\ifx\@tempa\@empty\else\gdef\@accepted{#1}\gdef\history@exist{1}\fi} +\def\@accepted{\@nil} +% +\def\empty@data{\@nil} +% +\def\history@fmt{% + \ifcase\history@exist + \else + \bgroup + \nobreak + \vskip\history@skip + \nobreak + \history@style + \history@size + \@tempdima=\textwidth + \advance\@tempdima by -\history@width + \divide\@tempdima by 2% + \leftskip=\@tempdima + \rightskip=\@tempdima + \leavevmode + \history@prefix + \ifx\@received\empty@data + \else + \received@prefix\@received \received@postfix + \fi + \ifx\@revised\empty@data + \else + \revised@prefix\@revised \revised@postfix + \fi + \ifx\@accepted\empty@data + \else + \accepted@prefix\@accepted \accepted@postfix + \fi + \history@postfix\par + \egroup + \gdef\history@exist{0}% + \fi + } +% +\def\sday#1{#1} +\def\smonth#1{% + \@ifundefined{month@item@#1}% + {\@latex@error{there is no month number #1!}{??}}% + {\getitemvalue{month}{#1}}% + }% +\def\syear#1{#1} +\setvaluelist{month}{January,February,March,April,May,June,% + July,August,September,October,November,December} +% +% KEYWORDS +% +\newbox\keyword@box +\newdimen\pre@kwd@depth +% +\setpkgattr{keyword}{AMS}{AMS 2000 subject classifications:} +\setpkgattr{keyword}{MSC}{\ims@href{\msc@url}{MSC2020 subject classifications}:} +\setpkgattr{keyword}{MSC2010}{MSC 2010 subject classifications:} +\setpkgattr{keyword}{MSC2020}{\ims@href{\msc@url}{MSC2020 subject classifications}:} +% +\setpkgattr{keyword}{KWD}{Keywords and phrases:} +% key=class +\setpkgattr[default]{keyword}{class}{KWD} +% +% \keyword@class -> KWD +% \keyword@KWD -> AMS 2000... +% +\gdef\keyword{\@ifnextchar[{\@keyword}{\@keyword[class=KWD]}} +% +\gdef\@keyword[#1]{% + \do@option@list{keyword}{#1}% + \def\keyword@name{\csname keyword@\keyword@class\endcsname}% + \let\kwd@sep\relax + % + \global\setbox\keyword@box=\vbox\bgroup + \ifvoid\keyword@box + \else + \unvbox\keyword@box + \vskip-\pre@kwd@depth\vtop to\pre@kwd@depth{}% + \fi + \@tempdima=\textwidth + \advance\@tempdima by -\keyword@width + \divide\@tempdima by 2% + \keyword@style + \leftskip=\@tempdima + \rightskip=\@tempdima + \keyword@size + \parindent=\sv@parindent + \noindent\hskip\keyword@indent + {\keywordname@size\keyword@name}\space\hskip.1pt% + } +% +\def\endkeyword{\keyword@postfix\par\global\pre@kwd@depth\prevdepth\egroup} +% +\def\keyword@fmt{% + \ifvoid\keyword@box + \else + \vskip\keyword@skip + \unvbox\keyword@box + \fi + } +% +% \kwd[; ]{foo} +\def\sep{\unskip\string, } +\newif\if@firstkeywordinlist \@firstkeywordinlisttrue +% +\DeclareRobustCommand*\kwd{\@ifnextchar[\@kwd{\@kwd[\kwd@sep]}} +\def\@kwd[#1]#2{% + \unskip#1{#2}% + \if@firstkeywordinlist + \addto@keywords@list{#2}% + \@firstkeywordinlistfalse + \else + \addto@keywords@list{, #2}% + \fi + \let\kwd@sep\sep + } +% +% \maketitle +% if \frontmatter is not used, we will redefine \maketitle +% +\def\local@maketitle{% + \global\@topnum=\z@ + \set@pagerange + \markboth{\@runauthor}{\@runtitle}% + \thispagestyle{copyright}% + % + \put@fmt@data + % + \write@pdfinfo{\hy@author}{\the\authors@list}% + \write@pdfinfo{\hy@keywords}{\the\keywords@list}% + \hy@endfrontmatter + \global\mathsurround=\sv@mathsurround + \global\c@footnote=\z@ + \global\let\@thanks\@empty + \let\title\relax + \let\author\relax + \let\address\relax + \let\frontmatter\relax + \let\endfrontmatter\relax + \let\@maketitle\relax + \let\@@maketitle\relax + \normalfont\normaltext + \parindent=\sv@parindent + \frontmatter@cmd + } +% +\AtBeginDocument{\let\maketitle\local@maketitle} +% +% PROCESS LAYOUT OPTIONS +% +% Put keywords as footnote +\if@keywordsasfootnote + \newtoks\keyword@toks + \newpseudoenvironment{keyword}{\gdef\keyword@exist{1}\get@keyword@toks}{} + \def\get@keyword@toks#1\end{% + \keyword@toks=\expandafter{\the\keyword@toks\keyword#1\endkeyword}% + \@gobble + } + \def\keyword@exist{0} + \gdef\keyword#1{\@ifnextchar[{\@keyword}{\@keyword[class=KWD]}} + \gdef\@keyword[#1]{% + \do@option@list{keyword}{#1}% + \def\keyword@name{\csname keyword@\keyword@class\endcsname}% + \let\kwd@sep\relax + \keyword@style + \keyword@size + \parindent=\sv@parindent + \pre@kwd + \hbox{\keywordname@size\keyword@name}\space\hskip.1pt% + }% + \gdef\endkeyword{\keyword@postfix\gdef\pre@kwd{\par\leavevmode}} + \let\pre@kwd\relax + \def\keyword@fmt{\ifcase\keyword@exist\else\safe@footnotetext{\the\keyword@toks}\fi} +\fi +% +% Put history as footnote +\if@historyasfootnote + % + \def\history@fmt{% + \ifcase\history@exist + \else + \safe@footnotetext{% + \nobreak + \history@style + \history@size + \leavevmode + \history@prefix + \ifx\@received\empty@data + \else + \received@prefix\@received \received@postfix + \fi + \ifx\@revised\empty@data + \else + \revised@prefix\@revised \revised@postfix + \fi + \ifx\@accepted\empty@data + \else + \accepted@prefix\@accepted \accepted@postfix + \fi + \history@postfix + }% + \fi + } +\fi +% +% Put address as footnote +\if@addressasfootnote + \def\address@fmt[#1]#2{% + \ifx.#1.% + \safe@footnotetext{#2}% + \else + \usethankscounter{addressref}% + \bgroup + \def\\{\hfill\break}% + \thankstext{#1}{#2}% + \egroup + \restorethankscounter + \fi + } +\fi +% +% Put address at end +\if@addressatend + % + \def\address{\@ifnextchar[{\address@fmt}{\address@fmt[default]}} + % + % \def\address@ref@A=1 + % \newtoks\@address@1 + % \@address@1={#2} + % + \def\address@fmt[#1]#2{% + \stepcounter{address}% + \expandafter\protected@xdef\csname address@ref@#1\endcsname{\the\c@address}% + \expandafter\newtoks\csname @address@\the\c@address\endcsname + \expandafter\expandafter\expandafter\global\csname @address@\the\c@address\endcsname={#2}} + % + \let\safe@phantomsection\@gobble + % + % print address by number: \printaddressnum{1} + \def\printaddressnum#1{% + \xdef\@tmp{#1}% + \bgroup + \@ifundefined{@address@#1}% + {\@latex@error{Error: there are no address with number '#1'!}{??}}% + {% + \address@size + \ifnum#1=1% + \safe@phantomsection{\addcontentsline{toc}{section}{Author's addresses}}% + \fi + \begin{tabular}[t]{@{}l@{}}% + \expandafter\expandafter\expandafter\the\csname @address@\@tmp\endcsname + \end{tabular}% + }% + \egroup + } + % + % print all addresses: + \def\address@par{\par\vskip3pt} + % + \def\printaddresses{% + \vskip\address@skip + \def\last@right@glue{\par}% + \ifodd\c@address + \def\last@right@glue{\hfill\hbox{}\address@par}% + \fi + \ifnum\c@address=1% + \def\last@right@glue{\address@par}% + \fi + \@tempcnta=0% + \bgroup + \parindent=\z@ + \@whilenum{\@tempcnta<\c@address}\do{% + \advance\@tempcnta by \@ne + \ifodd\@tempcnta + \def\left@glue{}% + \def\right@glue{}% odd + \else + \def\left@glue{\hfill}% + \def\right@glue{\address@par}% even + \fi + \ifnum\@tempcnta=\c@address + \let\left@glue\hfill + \let\right@glue\last@right@glue% last member + \fi + \left@glue\expandafter\printaddressnum{\the\@tempcnta}\right@glue + }% + \egroup + } + % + % invoke \printaddresses at end of document: + \let\old@enddocument\enddocument + \def\enddocument{\printaddresses\old@enddocument} +\fi +% +% settings from in-house packages +\def\declaremathsizes@as@in@mathtime{% + \DeclareMathSizes{5}{6}{6}{6}% + \DeclareMathSizes{6}{6}{6}{6}% + \DeclareMathSizes{7}{6.8}{6}{6}% + \DeclareMathSizes{8}{8}{6.8}{6}% + \DeclareMathSizes{9}{9}{7.6}{6}% + \DeclareMathSizes{10}{10}{7.6}{6}% + \DeclareMathSizes{10.95}{10.95}{7.6}{6}% + \DeclareMathSizes{12}{12}{9}{7}% + \DeclareMathSizes{14.4}{14.4}{10}{8}% + \DeclareMathSizes{17.28}{17.28}{12}{9}% + \DeclareMathSizes{20.74}{20.74}{14.4}{10}% + \DeclareMathSizes{24.88}{24.88}{17.28}{12}% + } +% +\def\ims@common@float@settings{% + % float parameters: + \setlength\floatsep{18\p@ \@plus 6\p@ \@minus 2\p@}% + \setlength\textfloatsep{18\p@ \@plus 6\p@ \@minus 2\p@}% + \setlength\intextsep{18\p@ \@plus 6\p@ \@minus 2\p@}% + \setlength\dblfloatsep{18\p@ \@plus 6\p@ \@minus 2\p@}% + \setlength\dbltextfloatsep{24\p@ \@plus 6\p@ \@minus 2\p@}% + % For floats on a separate float page or column: + \setlength\@fptop{0\p@ \@plus 1fil}% + \setlength\@fpsep{8\p@ \@plus 1000fil}% + \setlength\@fpbot{0\p@ \@plus 1fil}% + \setlength\@dblfptop{0\p@ \@plus 1fil}% + \setlength\@dblfpsep{8\p@ \@plus 1000fil}% + \setlength\@dblfpbot{0\p@ \@plus 1fil}% + % float counters: + \setcounter{topnumber}{5}% + \renewcommand\topfraction{.99}% + \setcounter{bottomnumber}{5}% + \renewcommand\bottomfraction{.99}% + \setcounter{totalnumber}{10}% + \renewcommand\textfraction{.05}% + \renewcommand\floatpagefraction{.9}% + \setcounter{dbltopnumber}{5}% + \renewcommand\dbltopfraction{.99}% + \renewcommand\dblfloatpagefraction{.8}% + } +% +\def\set@amsgen@frenchspacing{% + \def\frenchspacing{\sfcode`\.1006\sfcode`\?1005\sfcode`\!1004% + \sfcode`\:1003\sfcode`\;1002\sfcode`\,1001 }% + } +% +% Set up parameters for the BA journal layout: +\if@balayout + \RequirePackage{fix-cm} + \AtBeginDocument{\RequirePackage{fixltx2e}} + % + \setlength{\parskip}{0.5\baselineskip} + \setlength{\parindent}{15pt} + \setlength{\paperwidth}{8.5in} + \setlength{\paperheight}{11in} + \set@page@layout{5.25in}{7.6in} + \advance\topmargin by-7\p@ + % + \setpkgattr{title}{size}{\sffamily\LARGE\bfseries} + \setpkgattr{title}{skip}{-16pt} + \setpkgattr{author}{size}{\normalsize} + \setpkgattr{authors}{skip}{16pt} + \setpkgattr{abstractname}{size}{\sffamily\bfseries} + \setpkgattr{keywordname}{size}{\sffamily\bfseries} + \setpkgattr{abstractname}{skip}{.\enskip\enskip} + \setpkgattr{keyword}{KWD}{Keywords:} + % + \setpkgattr{abstract}{width}{115mm} + \setpkgattr{keyword}{width}{115mm} + \setpkgattr{keyword}{style}{} + \setpkgattr{history}{width}{115mm} + % + \setpkgattr{abstract}{size}{\small\upshape\mdseries} + \setpkgattr{keyword}{size}{\small\upshape\mdseries\rightskip=\the\rightskip plus1.0fil} + % + \setpkgattr{ead}{size}{\upshape} + \setpkgattr{abstract}{skip}{22\p@} + \setpkgattr{keyword}{skip}{8.5\p@} + % + \setpkgattr{frontmatter}{cmd}{% + \vskip10\p@ plus 3\p@ minus 3\p@ + \@afterindentfalse\@afterheading + } + % + \setpkgattr{copyright}{size}{\small\raggedright} + % + \gdef\volume#1{\gdef\@volume{#1}}% + \gdef\issue#1{\gdef\@issue{#1}}% + % + \def\doi#1{% + \gdef\@doi{#1}% + \gdef\doi@text{\url@fmt{DOI: }{\upshape}{#1}{\doi@base\@doi}}% + } + % + \def\address@fmt[#1]#2{% + \ifx.#1.% + \safe@footnotetext{#2}% + \else + \bgroup + \def\\{\hfill\break}% + \thankstext{#1}{#2}% + \egroup + \fi + } + % + \def\ps@copyright{% + \let\@mkboth\@gobbletwo + \def\@evenhead{\parbox[t]{\textwidth}{\copyright@size\issuedata@text}}% + \let\@oddhead\@evenhead + \def\@oddfoot{% + \rlap{\parbox[t]{\textwidth}{\copyright@size\copyright@text}}% + \hfill\llap{\vbox to0pc{\hbox{\info@line\hss}}}% + }% + \let\@evenfoot\@oddfoot + } + % + \setpkgattr{infoline}{text}{\lower36pt\hbox{\footnotesize\ttfamily\imsfmt@name\journal@id\ + ver. \imsfmt@version\ file: \jobname.tex\ date: \today}} + % + \def\ps@imsheadings{% + \def\@oddfoot{\hfill\info@line}% + \let\@evenfoot\@oddfoot + \def\@evenhead{% + \runninghead@size{\pagenumber@size\thepage}\hfill {\runningtitle@size \rightmark}% + }% + \def\@oddhead{% + \runninghead@size{\runningauthor@size \leftmark} \hfill {\pagenumber@size\thepage}% + }% + } + % + \setpkgattr{runninghead}{size}{\normalsize} + \setpkgattr{pagenumber}{size}{\upshape} + \setpkgattr{runningtitle}{size}{\bfseries\slshape} + \setpkgattr{runningauthor}{size}{\slshape} + % + \AtBeginDocument{% + \setpkgattr{section}{numbersep}{\enskip}% + \setpkgattr{subsection}{numbersep}{\enskip}% + \setpkgattr{subsubsection}{numbersep}{}% + \setpkgattr{paragraph}{numbersep}{}% + \setpkgattr{subparagraph}{numbersep}{}% + \renewcommand\section{% + \@startsection + {section}% + {1}% + {\z@}% + {-\baselineskip}% + {.25\baselineskip}% + {\Large\sffamily\bfseries\mathversion{bold}\raggedright}% + }% + \renewcommand\subsection{% + \@startsection + {subsection}% + {2}% + {\z@}% + {-\baselineskip}% + {.25\baselineskip}% + {\large\sffamily\bfseries\mathversion{bold}\raggedright}% + }% + \renewcommand\subsubsection{% + \@startsection + {subsubsection}% + {3}% + {\z@}% + {-\baselineskip}% + {.25\baselineskip}% + {\sffamily\bfseries\mathversion{bold}\raggedright}% + }% + \setcounter{secnumdepth}{2}% + \renewcommand\paragraph{% + \@startsection + {paragraph}% + {4}% + {\z@}% + {\medskipamount}% + {-1em}% + {\sffamily\bfseries}% + }% + \renewcommand\subparagraph{% + \@startsection + {subparagraph}% + {5}% + {\z@}% + {\medskipamount}% + {-1em}% + {\sffamily\itshape}% + }% + % Supplement + \def\articletitle{\csuse{@title}}% + \let\specialsection\section + \@namedef{specialsection*}{\section*}% + \def\stitle@fmt#1{#1}% + % Supplement case for BA: + % macroses: \stitle, \slink[doi], \sdatatype, \sfilename. + \def\stitlepost#1{\gdef\@stitlepost{#1}}% + \stitlepost{\space}% + \def\slink@doi@fmt{% + \url@fmt{DOI: }{}{\slink@doi}{\doi@base\slink@doi}% + \@ifundefined{supp@label}% + {}% + {% + \expandafter\xdef\csname\supp@label @doi\endcsname{\slink@doi}% + \expandafter\xdef\csname\supp@label @url\endcsname{\doi@base\slink@doi}% + }% + }% + \def\endsupplement{% + \noindent + \@ifundefined{@stitle}{}{\stitle@fmt{\@stitle}}% + \@stitlepost + \ifnum\slink@data@exists>\z@(\fi + \@ifundefined{slink@doi}{}{\slink@doi@fmt}% + \@ifundefined{slink@url}{}{\slink@url@fmt}% + \@ifundefined{@sdatatype}{}{; \@sdatatype}% + \ifnum\slink@data@exists>\z@)\else\unskip\fi. + \@ifundefined{@sdescription}{}{\@sdescription}% + \par + }% + \setpkgattr{email}{text}{}% + % + \appto\set@natbib{\setlength\bibsep{6pt}}% + % + \csdef{copyrightowner@text}{International Society for Bayesian Analysis}% + \def\journal@issn{$\copyright$~\ims@href{https://www.imstat.org}{\copyrightowner@text}, + \@copyrightyear}% + \setpkgattr{issuedata}{text}{% + \ims@href{\journal@url}{\journal@name}% + \space\@pubyear + \hskip5pc% + \@ifnonempty{\textbf{\@volume}, Number \@issue, pp. \@pagerange}% + }% + \setpkgattr{copyright}{text}{\copyright@owner \hfill \doi@text}% + \setpkgattr{copyright}{owner}{$\copyright$~\@copyrightyear \copyrightowner@text}% + } + \def\@floatboxreset{% + \reset@font + \@setminipage + \singlespacing + \centering + } + % Table + \def\fnum@table{\tablename~\thetable:} + \setpkgattr{tablecaption}{shape}{} + \setpkgattr{tablecaption}{size}{\normalsize} + \setpkgattr{tablename}{size}{} + \setpkgattr{tablename}{skip}{\space} + % + \long\def\@maketablecaption#1#2{% + \vskip\belowcaptionskip + \tablecaption@shape\tablecaption@size + \sbox\@tempboxa{{\tablename@size #1}\tablename@skip #2}% + \ifdim\wd\@tempboxa>\hsize + {\tablename@size #1}\tablename@skip #2\par + \else + \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% + \fi + } + % Figure + \setpkgattr{figurename}{size}{} + \setpkgattr{figurecaption}{size}{\normalsize} + \setpkgattr{figurename}{skip}{:\space} + \def\figurename{Figure} + % + \AtBeginDocument{% + \@ifpackageloaded{amsmath}{\allowdisplaybreaks}{}% + } + % Acknowledgements + \setpkgattr{acknowledgement}{name}{Acknowledgments} + \setpkgattr{acknowledgement}{size}{\small} + \setpkgattr{acknowledgementname}{fmt}{\noindent\normalfont\sffamily\bfseries} + \newenvironment{acknowledgement}% + {% + \vskip0.5\baselineskip + \acknowledgement@size + {\acknowledgementname@fmt\acknowledgement@name}\par + \begingroup\parindent 0pt\parskip 0.5\baselineskip + }% + {\endgroup} + % + \ifcsvoid{bibdir}{\gdef\bibdir{}}{} + \def\bibliography#1{% + \if@filesw + \immediate\write\@auxout{\string\bibdata{\bibdir#1}}% + \fi + \@input@{\jobname.bbl}% + } + \def\bibliographystyle#1{% + \ifx\@begindocumenthook\@undefined + \else + \expandafter\AtBeginDocument + \fi + {% + \if@filesw + \immediate\write\@auxout{\string\bibstyle{\bibdir#1}}% + \fi + }} + \partopsep=2.1\p@ \@plus1\p@ \@minus\z@ + \AtBeginDocument{% + \def\@listi{% + \leftmargin=\leftmargini + \parsep=4\p@ \@plus2\p@ \@minus\z@ + \topsep=8\p@ \@plus2\p@ \@minus4\p@ + \itemsep=4\p@ \@plus2\p@ \@minus\z@ + }% + } + \renewcommand\footnoterule{\kern8\p@ \hrule\@width.4\columnwidth \kern2.6\p@} + \setlength\footskip{25\p@} + \renewcommand\normalsize{% + \@setfontsize\normalsize\@xpt{12\p@ \@plus .3\p@ \@minus .3\p@}% + \abovedisplayskip=10\p@ \@plus2\p@ \@minus5\p@ + \abovedisplayshortskip=\z@ \@plus3\p@ + \belowdisplayshortskip=6\p@ \@plus3\p@ \@minus3\p@ + \belowdisplayskip=\abovedisplayskip + \let\@listi\@listI + } + \normalsize + \renewcommand\small{% + \@setfontsize\small\@ixpt{11\p@ \@plus .2\p@ \@minus .2\p@}% + \abovedisplayskip=8.5\p@ \@plus3\p@ \@minus4\p@ + \abovedisplayshortskip=\z@ \@plus2\p@ + \belowdisplayshortskip=4\p@ \@plus2\p@ \@minus2\p@ + \def\@listi{% + \leftmargin=\leftmargini + \topsep=4\p@ \@plus2\p@ \@minus2\p@ + \parsep=2\p@ \@plus\p@ \@minus\p@ + \itemsep=\parsep + }% + \belowdisplayskip=\abovedisplayskip + } + \flushbottom + % +\fi % end if@balayout +% +% Set up parameters for the IMS journals (AOP, AAP, AOS) layout: +\if@imslayout + \RequirePackage[T1]{fontenc} + \RequirePackage{times} + \RequirePackage[scaled=.9]{helvet} + \RequirePackage{textcomp} + \RequirePackage{textcase} + \def\@xipt{11} + \def\@xivpt{14} + \def\@xvipt{16} + \def\@xviiipt{18} + \def\@xxpt{20} + \def\@xxivpt{24} + \declaremathsizes@as@in@mathtime + \renewcommand\normalsize{% + \@setfontsize\normalsize\@xipt{13\p@ plus .5\p@ minus .5\p@}% + \abovedisplayskip 7\p@ \@plus3\p@ \@minus3\p@ + \belowdisplayskip\abovedisplayskip + \abovedisplayshortskip\abovedisplayskip + \belowdisplayshortskip\abovedisplayskip + \let\@listi\@listI + } + \normalfont\normalsize + \renewcommand\small{% + \@setfontsize\small\@xpt{12pt plus .3pt minus .3pt}% + \abovedisplayskip 6\p@ \@plus2\p@ \@minus2\p@ + \belowdisplayskip \abovedisplayskip + \abovedisplayshortskip\abovedisplayskip + \belowdisplayshortskip\abovedisplayskip + } + \renewcommand\footnotesize{% + \@setfontsize\footnotesize\@ixpt{11pt plus .2\p@ minus .2\p@}% + \abovedisplayskip 6\p@ \@plus2\p@ \@minus2\p@ + \belowdisplayskip \abovedisplayskip + \abovedisplayshortskip\abovedisplayskip + \belowdisplayshortskip\abovedisplayskip + } + \renewcommand\scriptsize{\@setfontsize\scriptsize\@viiipt\@xpt} + \renewcommand\tiny{\@setfontsize\tiny\@vipt\@viipt} + \renewcommand\large{\@setfontsize\large\@xiipt{14}} + \renewcommand\Large{\@setfontsize\Large\@xivpt{16}} + \renewcommand\LARGE{\@setfontsize\LARGE\@xvipt{18}} + \renewcommand\huge{\@setfontsize\huge\@xviiipt{20}} + \renewcommand\Huge{\@setfontsize\Huge\@xxpt{24}} + % lists + \def\labelitemi{\textbullet} + \def\labelitemii{\textendash} + \def\labelitemiii{\textasteriskcentered} + \def\labelitemiv{{\footnotesize +}} + \def\labelenumi{\theenumi.} + \def\labelenumii{\theenumii)} + \def\labelenumiii{\theenumiii.} + \def\labelenumiv{\theenumiv.} + \setlength\leftmargini{1em} + \setlength\leftmarginii{1em} + \setlength\leftmarginiii{1.02em} + \setlength\leftmarginiv{0.96em} + \setlength\labelsep{.5em} + \setlength\labelwidth{\leftmargini} + \addtolength\labelwidth{-\labelsep} + \def\enumerate@listi{% + \labelwidth=.75em + \leftmargin=\labelwidth + \advance\leftmargin by \labelsep + } + \def\@listI{% + \leftmargin=\leftmargini + \listparindent=12\p@ + \topsep=\smallskipamount + \csletcs{\@currenvir @list@addons}{\@currenvir @listi}% + \preto\@trivlist{% + \def\makelabel##1{{\hfill\normalfont ##1}}% + \csuse{\@currenvir @list@addons}}% + } + \def\enumerate@listii{% + \labelwidth=.777em + \leftmargin=\labelwidth + \advance\leftmargin by \labelsep + } + \if@old@layout + \else + \def\longlist@listii{% + \leftmargin=\labelwidth + \advance\leftmargin by \labelsep + } + \fi + \def\@listii{% + \leftmargin=\leftmarginii + \listparindent=12\p@ + \topsep=\z@ + \csletcs{\@currenvir @list@addons}{\@currenvir @listii}% + \preto\@trivlist{% + \def\makelabel##1{{\hfill\normalfont ##1}}% + \csuse{\@currenvir @list@addons}% + }% + }% + \def\enumerate@listiii{% + \labelwidth=1.084em + \leftmargin=\labelwidth + \advance\leftmargin by \labelsep + } + \if@old@layout + \else + \def\longlist@listiii{% + \leftmargin=\labelwidth + \advance\leftmargin by \labelsep + } + \fi + \def\@listiii{% + \leftmargin=\leftmarginiii + \labelwidth=\leftmarginiii + \advance\labelwidth by -\labelsep + \listparindent=12\p@ + \topsep=\z@ + \csletcs{\@currenvir @list@addons}{\@currenvir @listiii}% + \preto\@trivlist{% + \def\makelabel##1{{\hfill\normalfont ##1}}% + \csuse{\@currenvir @list@addons}}% + } + \def\enumerate@listiv{% + \labelwidth=.917em + \leftmargin=\labelwidth + \advance\leftmargin by \labelsep + } + \def\@listiv{% + \leftmargin=\leftmarginiv + \labelwidth=\leftmarginiv + \advance\labelwidth by -\labelsep + \listparindent=12\p@ + \topsep=\z@ + \csletcs{\@currenvir @list@addons}{\@currenvir @listiv}% + \preto\@trivlist{% + \def\makelabel##1{{\hfill\normalfont ##1}}% + \csuse{\@currenvir @list@addons}% + }% + } + % longlist + \newcounter{longlist} + \def\thelonglist{\@roman\c@longlist} + \def\labellonglist{(\thelonglist)} + \def\longlist{\@ifnextchar[{\@longlist}{\@longlist[]}} + \def\@longlist[#1]{% + \list + {\labellonglist}% + {% + \usecounter{longlist}% + \ifx.#1.% + \setcounter{longlist}{3}% + \settowidth\labelwidth{\labellonglist}% + \setcounter{longlist}{0}% + \else + \settowidth{\labelwidth}{#1}% + \fi + \topsep=\smallskipamount + \itemindent=\labelwidth + \advance\itemindent by \labelsep + \advance\itemindent by 1pc% + \leftmargin=\z@ + }% + } + \let\endlonglist =\endlist + % + \setlength\topskip{10\p@} + \setlength\maxdepth{.5\topskip} + % + \setlength\smallskipamount{6.5\p@ \@plus 1\p@ \@minus 1\p@} + \setlength\medskipamount{13\p@ \@plus 3\p@ \@minus 3\p@} + \setlength\bigskipamount{19.5\p@ \@plus 3\p@ \@minus 3\p@} + % PAGE-BREAKING PENALTIES + \clubpenalty=10000 + \widowpenalty=10000 + \tolerance=800 + \hbadness=800 + \emergencystretch=3\p@ + \hfuzz=1pt + \AtBeginDocument{\interdisplaylinepenalty=100} + % + \arraycolsep=1.2\p@ + \setlength\tabbingsep{6\p@} + \jot=6\p@ + \@ifundefined{mathindent}% + {\newskip\mathindent}% + {} + \mathindent=2pc + \AtBeginDocument{% + \@ifundefined{@mathmargin}% + {}% + {\@mathmargin=\mathindent}% + } + \setlength\thinmuskip{2.5mu} + \setlength\medmuskip{3.5mu plus 1.5mu minus 2mu} + \setlength\thickmuskip{3.75mu plus 1.5mu} + \setlength\mathsurround{0.1\p@} + % + \setlength{\parskip}{\z@} + % + \if@old@layout + \setlength\marginparsep{10\p@} + \setlength\marginparwidth{59\p@} + \else + \setlength\marginparsep{25\p@} + \setlength\marginparwidth{120\p@} + \fi + % + \AtEndOfPackage{% + \appto\set@natbib{% + \let\save@NAT@bibsetnum\NAT@bibsetnum + \def\bibsection{\specialsection*{\refname}}% + \setlength\bibsep{\z@ \@plus .5\p@ \@minus .5\p@}% + \setlength\bibindent{20\p@}% + \preto\bibitem@fin{% + \clubpenalty=\@M + \widowpenalty=\@M + }% + \def\NAT@bibsetnum{% + \labelsep=5\p@ + \NAT@openbibtrue + \topsep=\z@ + \save@NAT@bibsetnum + }% + }% + } + \setpkgattr{title}{skip}{12\p@} + \setpkgattr{frontmatter}{cmd}{\vskip20\p@ plus 3\p@ minus 3\p@} + % + \setpkgattr{abstract}{width}{23pc} + \setpkgattr{abstract}{indent}{16pt\@gobble}% 2em and remove abstract name + % + \setpkgattr{title}{size}{\normalsize\bfseries\mathversion{bold}\spaceskip.5em} + \setpkgattr{author}{size}{\normalsize\scshape} + \setpkgattr{affiliation}{size}{\normalsize\itshape} + \if@old@layout + \setpkgattr{address}{size}{\scriptsize\scshape} + \setpkgattr{ead}{size}{\upshape} + \setpkgattr{email}{text}{E-mail: } + \else + \setpkgattr{abstract}{skip}{14\p@} + \setpkgattr{address}{skip}{8\p@} + \setpkgattr{address}{size}{\scriptsize\itshape} + \setpkgattr{ead}{size}{} + \setpkgattr{ead}{sep}{; } + \setpkgattr{email}{text}{} + \setcounter{secnumdepth}{5} + \setcounter{tocdepth}{6} + \fi + \setpkgattr{keywordname}{size}{\itshape} + \setpkgattr{runninghead}{size}{\footnotesize} + \setpkgattr{pagenumber}{size}{\small} + \setpkgattr{copyright}{size}{\fontsize{6}{7}\selectfont\raggedright} + \setpkgattr{thebibliography}{size}{\footnotesize} + % + \setpkgattr{dochead}{case}{\MakeUppercase} + \setpkgattr{title}{case}{\MakeUppercase} + \setpkgattr{runninghead}{case}{\MakeUppercase} + % + \setpkgattr{author}{prefix}{By~} + % + \setpkgattr{copyright}{text}{% + \url@fmt{}{\itshape}{\journal@name}{\journal@url}\break + \@ifnonempty{\@copyrightyear\@volume\@issue\@pagerange\break}\doi@text + } + % + \setpkgattr{url}{text}{URL: } + \setpkgattr{fullurl}{text}{URL: } + \def\volume#1{\gdef\@volume{Vol. #1, }} + \def\issue#1{\gdef\@issue{No. #1, }} + \def\pubyear#1{\gdef\@pubyear{#1,}\gdef\@copyrightyear{#1 }} + % + \def\abstractname{} + % + \def\put@fmt@data{% + \copyright@fmt + \history@fmt + \@thanks + \keyword@fmt + \abstract@fmt + } + % + \def\contentsname@cmd{\specialsection*{\contentsname}} + % + \setlength\footnotesep{7\p@} + \setlength{\skip\footins}{18\p@ \@plus 4\p@ \@minus 2\p@} + \skip\@mpfootins = \skip\footins + % + \set@amsgen@frenchspacing + % + \ims@common@float@settings +\fi +% +% Set up parameters for the STS journal layout: +% +\if@stslayout + \def\@xipt{11} + \def\@xivpt{14} + \def\@xvipt{16} + \def\@xviiipt{18} + \def\@xxpt{20} + \def\@xxivpt{24} + \renewcommand\normalsize{% + \@setfontsize\normalsize\@xipt{13\p@ plus .5\p@ minus .5\p@}% + \abovedisplayskip=7\p@ \@plus3\p@ \@minus3\p@ + \belowdisplayskip=\abovedisplayskip + \abovedisplayshortskip=\abovedisplayskip + \belowdisplayshortskip=\abovedisplayskip + } + \renewcommand\small{% + \@setfontsize\small\@xpt{12pt plus .3pt minus .3pt}% + \abovedisplayskip=6\p@ \@plus2\p@ \@minus2\p@ + \belowdisplayskip=\abovedisplayskip + \abovedisplayshortskip=\abovedisplayskip + \belowdisplayshortskip=\abovedisplayskip + } + \renewcommand\footnotesize{% + \@setfontsize\footnotesize\@ixpt{11pt plus .2\p@ minus .2\p@}% + \abovedisplayskip=6\p@ \@plus2\p@ \@minus2\p@ + \belowdisplayskip=\abovedisplayskip + \abovedisplayshortskip=\abovedisplayskip + \belowdisplayshortskip=\abovedisplayskip + } + \renewcommand\Large{\@setfontsize\Large\@xivpt{16}} + \renewcommand\Large{\@setfontsize\Large\@xivpt{16}} + \renewcommand\LARGE{\@setfontsize\LARGE\@xvipt{18}} + \renewcommand\huge{\@setfontsize\huge\@xviiipt{20}} + \renewcommand\Huge{\@setfontsize\Huge\@xxpt{24}} + \RequirePackage[T1]{fontenc} + \RequirePackage{times} + \RequirePackage[scaled=.9]{helvet} + \RequirePackage{textcomp} + \RequirePackage{textcase} + % + \setlength\columnsep{2pc} + \setlength\columnseprule{0\p@} + \setlength\footskip{24\p@} + \setlength\parskip{0\p@} + \setlength\topskip{10\p@} + % + \declaremathsizes@as@in@mathtime + \DeclareMathSizes{\@xxivpt}{\@xxivpt}{16}{12} + % page-breaking penalties + \clubpenalty=10000 + \widowpenalty=10000 + \emergencystretch=3\p@ + \hbadness=800 + \tolerance=800 + % + \setlength\smallskipamount{6.5\p@ \@plus 1\p@ \@minus 1\p@} + \setlength\medskipamount{13\p@ \@plus 3\p@ \@minus 3\p@} + \setlength\bigskipamount{19.5\p@ \@plus 3\p@ \@minus 3\p@} + % + \marginparpush=5\p@ + \marginparsep=25\p@ + \marginparwidth=120\p@ + % frontmatter settings + \setpkgattr{frontmatter}{style}{\raggedright} + \setpkgattr{title}{style}{\noindent\raggedright} + \setpkgattr{author}{style}{\noindent\raggedright} + \setpkgattr{address}{style}{\raggedright} + % + \setpkgattr{title}{skip}{6\p@} + \setpkgattr{authors}{skip}{10pt} + \setpkgattr{address}{skip}{\z@} + \setpkgattr{abstract}{skip}{36\p@} + \setpkgattr{abstractname}{skip}{. } + \setpkgattr{keyword}{skip}{8\p@} + % + \setpkgattr{abstract}{width}{28pc} + \setpkgattr{keyword}{width}{28pc} + % + \setpkgattr{dochead}{size}{\sffamily\Large\bfseries\spaceskip.5em} + \setpkgattr{title}{size}{% + \sffamily\fontsize{26}{26}\selectfont + \bfseries\mathversion{bold}\spaceskip.5em% + } + \setpkgattr{author}{size}{\sffamily\fontsize{13}{13}\selectfont\bfseries} + \setpkgattr{address}{size}{\small\itshape} + \setpkgattr{affiliation}{size}{\small\mdseries} + \setpkgattr{ead}{size}{} + \setpkgattr{abstract}{size}{\normalsize\upshape} + \setpkgattr{abstractname}{size}{\itshape} + \setpkgattr{keyword}{size}{\normalsize\mdseries\upshape} + \setpkgattr{keywordname}{size}{\itshape} + \setpkgattr{thebibliography}{size}{\footnotesize} + \setpkgattr{copyright}{size}{\normalfont\mdseries\fontsize{6}{7}\selectfont\raggedright} + \setpkgattr{runninghead}{size}{\footnotesize} + \setpkgattr{runninghead}{case}{\MakeUppercase} + \setpkgattr{pagenumber}{size}{\small\bfseries} + % + \setpkgattr{keyword}{KWD}{Key words and phrases:} + \setpkgattr{ead}{text}{\hbox{e-mail:}\ } + \setpkgattr{url}{text}{URL: } + \setpkgattr{fullurl}{text}{URL: } + % + \setcounter{secnumdepth}{5} + \setcounter{tocdepth}{6} + % + \def\thethanks{\@arabic\c@thanks} + % \printead: + \def\printead@fmt#1{\ifnot@ead@star (#1)\else #1\fi} + % all addresses are combined: + \newtoks\address@toks + \def\address@exist{0} + \def\address{\@ifnextchar[{\@address}{\@address[]}} + \def\@address[#1]#2{% + \gdef\address@exist{1}% + \begingroup + \no@harm + \xdef\@act{\global\noexpand\address@toks{\the\address@toks#2\ }}\@act + \endgroup + } + \def\address@fmt{% + \ifcase\address@exist + \else + \safe@footnotetext{\hskip-\parindent\address@style\address@size\the\address@toks}% + \fi + } + \def\put@fmt@data{% + \copyright@fmt + \address@fmt + \@thanks + \abstract@fmt + \keyword@fmt + \if@twocolumn + \frontmatter@cmd + \fi + } + \def\firstpage@cmd{% + \if@twocolumn + \markboth{\@runauthor}{\@runtitle}% + \address@fmt + \@thanks + \fi + } + % footnotes + \setlength\footnotesep{7\p@} + \setlength{\skip\footins}{18\p@ \@plus 4\p@ \@minus 2\p@} + \skip\@mpfootins = \skip\footins + % + \arraycolsep=1.2\p@ + \arrayrulewidth=1\p@ + \AtBeginDocument{\interdisplaylinepenalty=100} + \jot=6\p@ + \@ifundefined{mathindent}% + {\newskip\mathindent}% + {} + \mathindent=2pc + \AtBeginDocument{% + \mathindent=2pc + \@ifundefined{@mathmargin}% + {}% + {\@mathmargin=\mathindent}% + } + \setlength\medmuskip{3.5mu plus 1.5mu minus 2mu} + \setlength\thickmuskip{3.75mu plus 1.5mu} + \setlength\thinmuskip{2.5mu} + \setlength\mathsurround{0.1\p@} + % lists + \let\quotation@size\relax + \def\quotation@leftmargin{2pc} + \def\quotation@rightmargin{2pc} + \def\quotation@itemindent{\z@} + \let\quote@size\relax + \topsep=\smallskipamount + \def\labelenumii{\theenumii)} + \def\labelitemiv{{\footnotesize +}} + \def\@listi{\leftmargin=\leftmargini} + \def\@listii{% + \leftmargin=\leftmarginii + \labelwidth=\leftmarginii + \advance\labelwidth by -\labelsep + \topsep=\z@ + } + \let\@listI\@listi + % longlist + \newcounter{longlist} + \def\thelonglist{\@roman\c@longlist} + \def\labellonglist{\thelonglist)} + \def\longlist{\@ifnextchar[{\@longlist}{\@longlist[]}} + \def\@longlist[#1]{% + \list + {\labellonglist}% + {% + \usecounter{longlist}% + \ifx.#1.% + \setcounter{longlist}{3}% + \settowidth\labelwidth{\labellonglist}% + \setcounter{longlist}{0}% + \else + \settowidth{\labelwidth}{#1}% + \fi + \topsep=\smallskipamount + \itemindent=\labelwidth + \advance\itemindent by \labelsep + \advance\itemindent by 1pc% + \leftmargin=\z@ + }% + } + \let\endlonglist =\endlist + % + \set@amsgen@frenchspacing + % + \ims@common@float@settings +\fi +% +% Set up parameters for the BJ journal layout: +% +\if@bjlayout + \RequirePackage[T1]{fontenc} + \RequirePackage{times} + \RequirePackage[scaled=.9]{helvet} + \RequirePackage{textcomp} + \def\@xipt{11} + \def\@xivpt{14} + \def\@xvipt{16} + \def\@xviiipt{18} + \def\@xxpt{20} + \def\@xxivpt{24} + \declaremathsizes@as@in@mathtime + \renewcommand\normalsize{% + \@setfontsize\normalsize\@xpt{12\p@ \@plus .3\p@ \@minus .3\p@}% + \abovedisplayskip=10\p@ \@plus2\p@ \@minus2\p@ + \abovedisplayshortskip=6\p@ \@plus 2\p@ + \belowdisplayskip=\abovedisplayskip + \belowdisplayshortskip=\abovedisplayshortskip + \let\@listi\@listI + } + \normalsize + \renewcommand\small{% + \@setfontsize\small\@ixpt{11\p@ plus .2\p@ minus .2\p@}% + \abovedisplayskip=7.5\p@ \@plus4\p@ \@minus1\p@ + \belowdisplayskip=\abovedisplayskip + \abovedisplayshortskip=\abovedisplayskip + \belowdisplayshortskip=\abovedisplayskip + } + \renewcommand\footnotesize{% + \@setfontsize\footnotesize\@viiipt{10\p@ plus .1pt minus .1pt}% + \abovedisplayskip=6\p@ \@plus4\p@ \@minus1\p@ + \belowdisplayskip=\abovedisplayskip + \abovedisplayshortskip=\abovedisplayskip + \belowdisplayshortskip=\abovedisplayskip + } + \renewcommand\Large{\@setfontsize\Large\@xivpt{16}} + \renewcommand\LARGE{\@setfontsize\LARGE\@xvipt{18}} + \renewcommand\huge{\@setfontsize\huge\@xviiipt{20}} + \renewcommand\Huge{\@setfontsize\Huge\@xxpt{24}} + % + \setpkgattr{frontmatter}{style}{\raggedright} + \setpkgattr{title}{style}{\noindent\raggedright} + \setpkgattr{author}{style}{\noindent\raggedright} + \setpkgattr{address}{style}{\raggedright} + % + \setpkgattr{title}{skip}{10\p@} + \setpkgattr{abstract}{skip}{16\p@} + \setpkgattr{abstractname}{skip}{} + \setpkgattr{address}{skip}{6\p@\def\address@skip{0pt}} + % + \setpkgattr{abstract}{width}{\textwidth} + \setpkgattr{keyword}{width}{\textwidth} + \setpkgattr{history}{width}{\textwidth} + % + \setpkgattr{dochead}{size}{\normalsize\MakeUppercase} + \setpkgattr{title}{size}{\fontsize{21}{26}\selectfont} + \setpkgattr{author}{size}{\normalsize} + \setpkgattr{fnms}{size}{\uppercase} + \setpkgattr{snm}{size}{\uppercase} + % + \setpkgattr{address}{size}{\small\itshape} + \setpkgattr{abstract}{size}{\small\upshape} + \setpkgattr{keyword}{size}{\small\upshape} + \setpkgattr{keywordname}{size}{\itshape} + \setpkgattr{history}{size}{\raggedright\small\itshape} + % + \setpkgattr{runninghead}{size}{\normalsize\itshape} + \setpkgattr{pagenumber}{size}{\normalsize\upshape} + \setpkgattr{copyright}{size}{\normalsize} + \setpkgattr{footline}{size}{\footnotesize} + % + \setpkgattr{email}{text}{E-mail:~} + \setpkgattr{copyright}{text}{\url@fmt{}{\itshape}{\journal@name}{\journal@url}\ + \textbf{\@volume}\@issue\@pubyear\ \@pagerange\\\doi@text} + \setpkgattr{history}{postfix}{} + \setpkgattr{revised}{prefix}{ and revised~} + \setpkgattr{keyword}{postfix}{} + \def\sep{\unskip\string; }% + % + \setpkgattr{keyword}{KWD}{Keywords:} + % + \def\put@fmt@data{% + \copyright@fmt + \@thanks + \abstract@fmt + \keyword@fmt + \tableofcontents@fmt + } + % invoke \printhistory at end of document: + \let\old@enddocument\enddocument + \def\enddocument{\history@fmt\old@enddocument} + % + \def\volume#1{\gdef\@volume{#1}} + \def\issue#1{\gdef\@issue{(#1)}} + \def\pubyear#1{\gdef\@pubyear{, #1, }\gdef\@copyrightyear{, #1, }} + % + \def\abstractname{} + % lists + \def\labelitemi{\textbullet} + \def\labelitemii{\textendash} + \def\labelitemiii{\textasteriskcentered} + \def\labelitemiv{{\footnotesize +}} + \def\labelenumi{\theenumi.} + \def\labelenumii{\theenumii)} + \def\labelenumiii{\theenumiii.} + \def\labelenumiv{\theenumiv.} + \def\itemize@listii{% + \itemsep=\z@ + \topsep=\z@ + } + \appto\@listii{% + \csuse{\@currenvir @listii}% + } + % + \def\evenhead@fmt#1{\hfill#1} + \def\oddhead@fmt#1{#1\hfill} + % + \def\fnum@table{\tablename~\thetable.} + % + \long\def\@maketablecaption#1#2{% + \small + \textbf{#1}\enskip #2\par + \vskip\belowcaptionskip + } + % + \setcounter{secnumdepth}{5} + \setcounter{tocdepth}{6} + % + \setlength\medskipamount{12\p@ \@plus 3\p@ \@minus 2\p@} + \setlength\bigskipamount{18\p@ \@plus 3\p@ \@minus 2\p@} + \setlength\marginparsep{25\p@} + \setlength\marginparwidth{120\p@} + % + \renewcommand\figurename{Figure} + % + \long\def\@makecaption#1#2{% + \vskip\abovecaptionskip + \small + \textbf{#1}. #2\par + \vskip\belowcaptionskip + } + % + \AtBeginDocument{\interdisplaylinepenalty=100} + \arraycolsep=1.2\p@ + \columnsep=12\p@ + \jot=6\p@ + \@ifundefined{mathindent}% + {\newskip\mathindent}% + {} + \mathindent=2pc + \setlength\medmuskip{3.5mu plus 1.5mu minus 2mu} + \setlength\thickmuskip{3.75mu plus 1.5mu} + \setlength\thinmuskip{2.5mu} + \setlength\tabbingsep{6\p@} + % + \let\footnoterule\relax + \setlength\footnotesep{7\p@} + \setlength{\skip\footins}{18\p@ \@plus 4\p@ \@minus 2\p@} + \skip\@mpfootins = \skip\footins + \setlength{\parskip}{\z@} + % PAGE-BREAKING PENALTIES + \clubpenalty=10000 + \tolerance=800 + \widowpenalty=10000 + % + \set@amsgen@frenchspacing + % + \ims@common@float@settings +\fi +% +% Set up parameters for the AIHP journal layout: +% +\if@aihplayout + % + \def\@xipt{11} + \def\@xivpt{14} + \def\@xvipt{16} + \def\@xviiipt{18} + \def\@xxpt{20} + \def\@xxivpt{24} + % + \renewcommand\normalsize{% + \@setfontsize\normalsize\@xpt{12\p@ \@plus .3\p@ \@minus .3\p@}% + \abovedisplayskip=10\p@ \@plus 2\p@ \@minus2\p@ + \abovedisplayshortskip=6\p@ \@plus 2\p@ + \belowdisplayshortskip=6\p@ \@plus 2\p@ + \belowdisplayskip=\abovedisplayskip + \let\@listi\@listI + } + \renewcommand\small{% + \@setfontsize\small\@ixpt{11\p@ \@plus .2\p@ \@minus .2\p@}% + \abovedisplayskip=7.5\p@ \@plus 4\p@ \@minus 1\p@ + \belowdisplayskip=\abovedisplayskip + \abovedisplayshortskip=\abovedisplayskip + \belowdisplayshortskip=\abovedisplayskip + } + \renewcommand\footnotesize{% + \@setfontsize\footnotesize\@viiipt{10\p@ \@plus .1\p@ \@minus .1\p@}% + \abovedisplayskip=6\p@ \@plus 4\p@ \@minus 1\p@ + \belowdisplayskip=\abovedisplayskip + \abovedisplayshortskip=\abovedisplayskip + \belowdisplayshortskip=\abovedisplayskip + } + \renewcommand\Large{\@setfontsize\Large\@xivpt{16}} + \renewcommand\LARGE{\@setfontsize\LARGE\@xvipt{18}} + \renewcommand\huge{\@setfontsize\huge\@xviiipt{20}} + \renewcommand\Huge{\@setfontsize\Huge\@xxpt{24}} + % + \RequirePackage[T1]{fontenc} + \RequirePackage{times} + \RequirePackage[scaled=.9]{helvet} + \RequirePackage{textcomp} + % + % FRONT MATTER SKIPS + \setpkgattr{title}{skip}{64\p@} + \setpkgattr{authors}{skip}{14\p@} + \if@old@layout + \setpkgattr{address}{skip}{12\p@} + \else + \setpkgattr{address}{skip}{12\p@\def\address@skip{0pt}} + \fi + \setpkgattr{abstractname}{skip}{.\enskip} + \setpkgattr{history}{skip}{4\p@} + \setpkgattr{abstract}{skip}{16\p@} + % + \setpkgattr{fline}{cmd}{\vskip22\p@ \hrule} + \setpkgattr{lline}{cmd}{\vskip10\p@ \hrule} + % + % FRONT MATTER DIMENSIONS + \setpkgattr{abstract}{width}{\textwidth} + \setpkgattr{abstract}{indent}{\z@} + \setpkgattr{keyword}{width}{\textwidth} + \setpkgattr{keyword}{indent}{\z@} % + % + % FRONT MATTER FONTS + \setpkgattr{title}{size}{\huge} + \setpkgattr{author}{size}{\Large} + \setpkgattr{abstract}{size}{\small\upshape} + \setpkgattr{keywordname}{size}{\itshape} + \setpkgattr{thebibliography}{size}{\footnotesize} + \setcounter{tocdepth}{6} + % + \def\put@fmt@data{% + \copyright@fmt + \@thanks + \history@fmt + \fline@cmd + \abstract@fmt + \keyword@fmt + \lline@cmd + \tableofcontents@fmt + } + % + \setpkgattr{keyword}{KWD}{Keywords:} + \setpkgattr{keyword}{MSC2010}{MSC:} + \setpkgattr{keyword}{postfix}{\unskip} + \setpkgattr{email}{text}{E-mail: } + % + \def\theaddressref{\alph{addressref}} + % + \def\labelitemii{\textendash} + \def\labelitemiv{{\footnotesize +}} + % + \arraycolsep=1.2\p@ + \setlength\tabbingsep{6\p@} + \jot=6\p@ + \@ifundefined{mathindent}% + {\newskip\mathindent}% + {} + \mathindent=2pc + \AtBeginDocument{% + \mathindent=2pc + \@ifundefined{@mathmargin}% + {}% + {\@mathmargin=\mathindent}% + } + \setlength\medmuskip{3.5mu plus 1.5mu minus 2mu} + \setlength\thickmuskip{3.75mu plus 1.5mu} + \setlength\thinmuskip{2.5mu} + \setlength\mathsurround{0.1\p@} + \columnsep=12\p@ + \setlength\footnotesep{7\p@} + \setlength{\skip\footins}{18\p@ \@plus 4\p@ \@minus 2\p@} + \skip\@mpfootins = \skip\footins + \setlength{\parskip}{\z@} + \setlength\marginparsep{25\p@} + \setlength\marginparwidth{120\p@} + % + % PAGE-BREAKING PENALTIES + \clubpenalty=10000 + \widowpenalty=10000 + \emergencystretch=3\p@ + \hbadness=800 + \tolerance=800 + \AtBeginDocument{\interdisplaylinepenalty=100} + % + \set@amsgen@frenchspacing + % + \ims@common@float@settings +\fi +% +% Set up parameters for the BJPS journal layout: +% +\if@bjpslayout + \def\@xipt{11} + \def\@xivpt{14} + \def\@xvipt{16} + \def\@xviiipt{18} + \def\@xxpt{20} + \def\@xxivpt{24} + \declaremathsizes@as@in@mathtime + \renewcommand\normalsize{% + \@setfontsize\normalsize\@xipt{13\p@ plus .5\p@ minus .5\p@}% + \abovedisplayskip=7\p@ \@plus3\p@ \@minus3\p@ + \belowdisplayskip=\abovedisplayskip + \abovedisplayshortskip=\abovedisplayskip + \belowdisplayshortskip=\abovedisplayskip + } + \renewcommand\small{% + \@setfontsize\small\@xpt{12pt plus .3pt minus .3pt}% + \abovedisplayskip=6\p@ \@plus2\p@ \@minus2\p@ + \belowdisplayskip=\abovedisplayskip + \abovedisplayshortskip=\abovedisplayskip + \belowdisplayshortskip=\abovedisplayskip + } + \renewcommand\footnotesize{% + \@setfontsize\footnotesize\@ixpt{11pt plus .2\p@ minus .2\p@}% + \abovedisplayskip=6\p@ \@plus2\p@ \@minus2\p@ + \belowdisplayskip=\abovedisplayskip + \abovedisplayshortskip=\abovedisplayskip + \belowdisplayshortskip=\abovedisplayskip + } + \renewcommand\scriptsize{\@setfontsize\scriptsize\@viiipt\@xpt} + \renewcommand\Large{\@setfontsize\Large\@xivpt{16}} + \renewcommand\LARGE{\@setfontsize\LARGE\@xvipt{18}} + \renewcommand\huge{\@setfontsize\huge\@xviiipt{20}} + \renewcommand\Huge{\@setfontsize\Huge\@xxpt{24}} + % + \RequirePackage[T1]{fontenc} + \RequirePackage{times} + \RequirePackage[scaled=.9]{helvet} + \RequirePackage{textcomp} + \normalfont\normalsize + % + \setlength\topskip{10\p@} + \setlength\footnotesep{7\p@} + \setlength{\skip\footins}{18\p@ \@plus 4\p@ \@minus 2\p@} + \skip\@mpfootins = \skip\footins + % + \marginparpush=5pt + \marginparwidth=120pt + \marginparsep=25pt + % + \setlength\smallskipamount{6.5\p@ \@plus 1\p@ \@minus 1\p@} + \setlength\medskipamount{13\p@ \@plus 3\p@ \@minus 3\p@} + \setlength\bigskipamount{19.5\p@ \@plus 3\p@ \@minus 3\p@} + % + \clubpenalty=10000 + \widowpenalty=10000 + \tolerance=800 + \hbadness=800 + \AtBeginDocument{\interdisplaylinepenalty=100} + % + \jot=6\p@ + \@ifundefined{mathindent}% + {\newskip\mathindent}% + {} + \mathindent=2pc + \AtBeginDocument{% + \@ifundefined{@mathmargin}% + {}% + {\@mathmargin=\mathindent}% + } + \setlength\mathsurround{0.1\p@} + \setlength\thinmuskip{2.5mu} + \setlength\medmuskip{3.5mu plus 1.5mu minus 2mu} + \setlength\thickmuskip{3.75mu plus 1.5mu} + % + \setpkgattr{keyword}{AMS}{AMS 2000 subject classifications.} + \setpkgattr{keyword}{KWD}{Keywords and phrases.} + \setpkgattr{keyword}{MSC}{\ims@href{\msc@url}{MSC2020 subject classifications}.} + \setpkgattr{keyword}{MSC2020}{\ims@href{\msc@url}{MSC2020 subject classifications}.} + % + \setpkgattr{abstractname}{skip}{.\enskip} + % + \setpkgattr{title}{size}{\Large\bfseries\mathversion{bold}} + \setpkgattr{address}{size}{\scriptsize} + \setpkgattr{keywordname}{size}{\itshape} + \setpkgattr{runninghead}{size}{\footnotesize} + \setpkgattr{pagenumber}{size}{\small} + \setpkgattr{thebibliography}{size}{\footnotesize} + \setpkgattr{keyword}{postfix}{\unskip.} + % + \setpkgattr{copyright}{text}{\url@fmt{}{\itshape}{\journal@name}{\journal@url}\break + \@ifnonempty{\@volume\@pubyear\@pagerange\break}% + \@ifnonempty{\journal@issn\break}\doi@text + }% + \setpkgattr{email}{text}{E-mail: } + \setpkgattr{url}{text}{URL: } + \setpkgattr{fullurl}{text}{URL: } + \setcounter{tocdepth}{6} + \def\thethanks{\@arabic\c@thanks} + \def\theaddressref{\alph{addressref}} + % + \arraycolsep=1.2\p@ + \setlength\tabbingsep{6\p@} + % + \def\labelenumi{\theenumi.} + \def\labelenumii{\theenumii)} + \def\labelenumiii{\theenumiii.} + \def\labelenumiv{\theenumiv.} + \def\labelitemi{\textbullet} + \def\labelitemii{\textendash} + \def\labelitemiii{\textasteriskcentered} + \def\labelitemiv{{\footnotesize +}} + % + \topsep=\smallskipamount + % + \def\@listi{\leftmargin=\leftmargini} + % + \def\@listii{% + \leftmargin=\leftmarginii + \labelwidth=\leftmarginii + \advance\labelwidth by -\labelsep + \topsep=\z@ + }% + % + \set@amsgen@frenchspacing + % + \ims@common@float@settings +\fi +% +% smart \MR +% code suggested by Vilmos Prokaj +% solves the problem when MR is in a format: +% \MR{MR1037262 (91i:60148)} +% Without MR this macro removes the MR prefix if it +% is present unchange the argument otherwise +\def\woMR#1{\w@MR#1MR#1MR\relax} +\def\w@MR#1MR#2MR#3\relax{#2} +% +% this splits MR... (...) +\def\@MR#1 #2\relax#3{% + \href{https://www.ams.org/mathscinet-getitem?mr=#1}% + {\MRfixed{#3}}% + }% +% +\def\MRfixed{MR\woMR} +% +\let\MR\MRfixed +% +% interaction with hyperref +% +\def\test@hyperref{\@ifundefined{Hy@SetCatcodes}{}{\imsart@hyperref@settings}} +% +\AtBeginDocument{\test@hyperref} +% +\def\imsart@hyperref@settings{% + % hooks for the \thanksref, \thankstext: + \def\thankref@hyperlink##1{% + \edef\@tempx{##1thanks}% + \hbox{\hyperlink{##1}{\saferef{\@tempx}}}% + }% + \def\thanks@hypertarget##1{\smash{\raise\baselineskip\hbox{\protect\hypertarget{##1}{}}}}% + % redefine pagenumbering + \let\pagenumbering\ims@pagenumbering + % activate href + \let\ims@href\href + \let\safe@phantomsection\phantomsection + % put document info + \def\write@pdfinfo##1##2{\protected@write\@auxout{\no@harm}{\string\gdef\string##1{##2}}}% + \@ifundefined{hy@title}{}{\pdfstringdef\@pdftitle{\hy@title}}% + \@ifundefined{hy@author}{}{\pdfstringdef\@pdfauthor{\hy@author}}% + \@ifundefined{hy@subject}{}{\pdfstringdef\@pdfsubject{\hy@subject}}% + \@ifundefined{hy@keywords}{}{\pdfstringdef\@pdfkeywords{\hy@keywords}}% + % + \@ifundefined{user@hy@title}{}{\global\let\@pdftitle\user@hy@title}% + \@ifundefined{user@hy@author}{}{\global\let\@pdfauthor\user@hy@author}% + \@ifundefined{user@hy@subject}{}{\global\let\@pdfsubject\user@hy@subject}% + \@ifundefined{user@hy@keywords}{}{\global\let\@pdfkeywords\user@hy@keywords}% + % + % MathSciNet: + % \def\MR##1{\href{https://www.ams.org/mathscinet-getitem?mr=##1}{MR##1}} + % MR with hyperef + \def\MR##1{\@MR##1 \relax{##1}}% + } +% +\def\write@pdfinfo#1#2{} +% +\newtoks\authors@list +\def\addto@authors@list#1{% + \begingroup + \no@harm + \xdef\@act{\global\noexpand\authors@list{\the\authors@list#1}}% + \@act + \endgroup + } +% +\newtoks\keywords@list +\def\addto@keywords@list#1{% + \begingroup + \no@harm + \xdef\@act{\global\noexpand\keywords@list{\the\keywords@list#1}}\@act + \endgroup + } +% +% SECTION, SUBSECTION ETC. +% we do not like article appearance: +% +\renewcommand\section{% + \@startsection + {section}% + {1}% + {\z@}% + {-\bigskipamount}% + {\medskipamount}% + {\raggedright\bfseries\mathversion{bold}}% + } +\renewcommand\subsection{% + \@startsection + {subsection}% + {2}% + {\z@}% + {-\bigskipamount}% + {\medskipamount}% + {\raggedright\bfseries\itshape\mathversion{bold}}% + } +\renewcommand\subsubsection{% + \@startsection + {subsubsection}% + {3}% + {\z@}% + {-\bigskipamount}% + {\medskipamount}% + {\raggedright\itshape}% + } +\renewcommand\paragraph{% + \@startsection + {paragraph}% + {4}% + {\z@}% + {\medskipamount}% + {-1em}% + {\bfseries}% + } +\renewcommand\subparagraph{% + \@startsection + {subparagraph}% + {5}% + {\z@}% + {\medskipamount}% + {-1em}% + {\itshape}% + } +% Format for the counter: +\def\section@numbersep{.} +\def\subsection@numbersep{.} +\def\subsubsection@numbersep{.} +\def\paragraph@numbersep{.} +\def\subparagraph@numbersep{.} +% +\def\@seccntformat#1{{% + \csname #1@prefix\endcsname + \csname the#1\endcsname + \csname#1@numbersep\endcsname\enspace + }} +% +\let\specialsection\section +% +\@namedef{specialsection*}{\section*} +% +% sections: bjpslayout +% +\if@bjpslayout + \renewcommand\section{% + \@startsection + {section}% + {1}% + {\z@}% + {-\bigskipamount}% + {\medskipamount}% + {\large\bfseries\mathversion{bold}\raggedright}% + } + \renewcommand\subsection{% + \@startsection + {subsection}% + {2}% + {\z@}% + {-\medskipamount}% + {\smallskipamount}% + {\bfseries\mathversion{bold}\raggedright}% + } + \renewcommand\subsubsection{% + \@startsection + {subsubsection}% + {3}% + {\z@}% + {\medskipamount}% + {-10pt}% + {\normalsize\itshape}% + } + % + \def\subsubsection@prefix{\upshape} + % + \def\section@numbersep{} + \def\subsection@numbersep{} + \def\subsubsection@numbersep{} + \def\paragraph@numbersep{} + \def\subparagraph@numbersep{} +\fi +% +% sections: IMS layout +% +\if@imslayout + \renewcommand\section{% + \@startsection + {section}% + {1}% + {\parindent}% + {\medskipamount}% + {-10pt}% + {\normalsize\upshape\bfseries\mathversion{bold}}% + } + \renewcommand\subsection{% + \@startsection + {subsection}% + {2}% + {\parindent}% + {\medskipamount}% + {-10pt}% + {\subsection@shape}% + } + \def\subsection@shape{\normalsize\itshape} + \def\subsection@prefix{\upshape} + \renewcommand\subsubsection{% + \@startsection + {subsubsection}% + {3}% + {\parindent}% + {\medskipamount}% + {-10pt}% + {\normalsize\itshape}% + } + \def\subsubsection@prefix{\upshape} + \renewcommand\paragraph{% + \@startsection + {paragraph}% + {4}% + {\z@}% + {\smallskipamount}% + {-10pt}% + {\normalsize\itshape}% + } + \renewcommand\subparagraph{% + \@startsection + {subparagraph}% + {5}% + {\z@}% + {0.1pt}% + {-1em}% + {\normalsize\itshape}% + } + % must be used for the appendix \section and \thebibliography + \renewcommand\specialsection{% + \@startsection + {section}% + {1}% + {\z@}% + {\medskipamount}% + {\smallskipamount}% + {\let\@hangfrom\noindent\normalsize\centering\MakeTextUppercase}% + } +\fi +% +% sections: STS layout +% +\if@stslayout + \def\sec@raggedright{% + \def\\{\hfill\break}% + \@rightskip=\@flushglue + \rightskip=\@rightskip + \leftskip=\z@skip + \parindent=\z@ + } + % last line will centered to page width + \def\fl@hangfrom#1{\noindent {#1}} + \def\TO@fl{\let\@hangfrom\fl@hangfrom} + % + \renewcommand\section{% + \@startsection + {section}% + {1}% + {\z@}% + {\medskipamount}% + {\smallskipamount}% + {\centering\TO@fl\normalsize\sffamily\bfseries\mathversion{bold}\MakeTextUppercase}% + } + \renewcommand\subsection{% + \@startsection + {subsection}% + {2}% + {\z@}% + {\smallskipamount}% + {\smallskipamount}% + {\normalsize\sffamily\bfseries\mathversion{bold}\sec@raggedright}% + } + \renewcommand\subsubsection{% + \@startsection + {subsubsection}% + {3}% + {\parindent}% + {\smallskipamount}% + {-.5em}% + {\normalsize\itshape}% + } + \renewcommand\paragraph{% + \@startsection + {paragraph}% + {4}% + {\parindent}% + {\z@}% + {-4pt}% + {\normalsize\itshape}% + } + \renewcommand\subparagraph{% + \@startsection + {subparagraph}% + {5}% + {\z@}% + {0.1pt}% + {-1em}% + {\normalsize\itshape}% + } + % must be used for the \thebibliography + \renewcommand\specialsection{% + \@startsection + {section}% + {1}% + {\z@}% + {\bigskipamount}% + {\smallskipamount}% + {\normalsize\centering\MakeTextUppercase}% + } + % Format for the counter: + \def\section@numbersep{.} + \def\subsection@numbersep{} + \def\subsubsection@numbersep{} + \def\paragraph@numbersep{} + \def\subparagraph@numbersep{} +\fi +% +% sections: BJ layout +% +\if@bjlayout + \renewcommand\section{% + \@startsection + {section}% + {1}% + {\z@}% + {-\bigskipamount}% + {\medskipamount}% + {\Large\bfseries\mathversion{bold}\raggedright}% + } + \renewcommand\subsection{% + \@startsection + {subsection}% + {2}% + {\z@}% + {-\bigskipamount}% + {\medskipamount}% + {\large\bfseries\mathversion{bold}\raggedright}% + } + \renewcommand\subsubsection{% + \@startsection + {subsubsection}% + {3}% + {\z@}% + {-\medskipamount}% + {\smallskipamount}% + {\itshape\raggedright}% + } +\fi +% +% sections: AIHP layout +% +\if@aihplayout + \renewcommand\section{% + \@startsection + {section}% + {1}% + {\z@}% + {-\bigskipamount}% + {\medskipamount}% + {\bfseries\mathversion{bold}\raggedright}% + } + \renewcommand\subsection{% + \@startsection + {subsection}% + {2}% + {\z@}% + {-\medskipamount}% + {\medskipamount}% + {\itshape\raggedright}% + } + \renewcommand\subsubsection{% + \@startsection + {subsubsection}% + {3}% + {\z@}% + {-\medskipamount}% + {.01\p@}% + {\itshape\raggedright}% + } + \renewcommand\paragraph{% + \@startsection + {paragraph}% + {4}% + {\z@}% + {\medskipamount}% + {-10pt}% + {\itshape}% + } + \renewcommand\subparagraph{% + \@startsection + {subparagraph}% + {5}% + {\parindent}% + {0.1pt}% + {-1em}% + {\itshape}% + } +\fi +% +% \thanksref will not print "??" if label is undefined +% +\if@noundefthanksref + % + \AtBeginDocument{\let\sv@thankref@hyperlink\thankref@hyperlink}% + % + \def\thanksref@hook{% + \@ifundefined{r@\@tempb thanks}% + {% + \let\thankref@hyperlink\@gobble + \let\@tempa\@empty + }% + {\let\thankref@hyperlink\sv@thankref@hyperlink}% + } + % +\fi +% +% loading of amsmath +% +\def\set@amsthm{% + \def\ims@thmshape{0}% + \if@imslayout \def\ims@thmshape{1}\fi + \if@stslayout \def\ims@thmshape{1}\fi + \if@bjlayout \def\ims@thmshape{2}\fi + \if@aihplayout \def\ims@thmshape{3}\fi + \if@bjpslayout \def\ims@thmshape{3}\fi + \ifcase\ims@thmshape + \or %1 + \thm@notefont{\upshape}% + \newtheoremstyle{plain}% + {\medskipamount}% + {\medskipamount}% + {\itshape}% + {\parindent}% + {\scshape}% + {.}% + {1em}% + {}% + \newtheoremstyle{definition}% + {\medskipamount}% + {\medskipamount}% + {\normalfont}% + {\parindent}% + {\scshape}% + {.}% + {1em}% + {}% + \newtheoremstyle{remark}% + {\medskipamount}% + {\medskipamount}% + {\normalfont}% + {\parindent}% + {\scshape}% + {.}% + {1em}% + {}% + % + \renewenvironment{proof}[1][\proofname]% + {% + \par + \pushQED{\qed}% + \normalfont + \topsep=\medskipamount + \trivlist + \labelsep.5em% + \item[\hskip\labelsep\hskip\parindent \scshape ##1\@addpunct{.}]\ignorespaces + }{% + \popQED + \endtrivlist + \@endpefalse + }% + \or %2 + \newtheoremstyle{plain}% + {\medskipamount}% + {\medskipamount}% + {\itshape}% + {\z@}% + {\bfseries}% + {.}% + {1em}% + {}% + \newtheoremstyle{definition}% + {\medskipamount}% + {\medskipamount}% + {\itshape}% + {\z@}% + {\bfseries\itshape}% + {.}% + {1em}% + {}% + \newtheoremstyle{remark}% + {\medskipamount}% + {\medskipamount}% + {\normalfont}% + {\z@}% + {\bfseries\itshape}% + {.}% + {1em}% + {}% + % + \renewenvironment{proof}[1][\proofname]% + {% + \par + \pushQED{\qed}% + \normalfont + \topsep=\medskipamount\relax + \trivlist + \item[\hskip\labelsep \itshape\bfseries ##1\@addpunct{.}]\ignorespaces + }{% + \popQED + \endtrivlist + \@endpefalse + }% + \or %3 + \renewenvironment{proof}[1][\proofname]% + {% + \par + \pushQED{\qed}% + \normalfont + \topsep=\medskipamount\relax + \trivlist + \item[\hskip\labelsep \bfseries ##1\@addpunct{.}]\ignorespaces + }{% + \popQED + \endtrivlist + \@endpefalse + }% + \if@bjpslayout + \newtheoremstyle{remark}% + {\smallskipamount}% + {\smallskipamount}% + {\normalfont}% + {\z@}% + {\bfseries}% + {.}% + {.5em}% + {}% + \fi + \else + \fi + } +% +\if@load@amsmath + \if@amsmath@leqno + \PassOptionsToPackage{leqno}{amsmath} + \fi + \RequirePackage[cmex10]{amsmath} +\fi +% +% loading of amsthm +% +\if@load@amsthm + \RequirePackage{amsthm} + \set@amsthm +\else + \AtBeginDocument{\@ifpackageloaded{amsthm}{\set@amsthm}{}} +\fi +% +% thebibliography, loading natbib +% +% \citefix -- fixes \NAT@citex (to make a hyperlink from year component in cite command). +\def\citefix{% + \def\NAT@citex[##1][##2]##3{% + \NAT@sort@cites{##3}% + \let\@citea\@empty + \@cite{% + \let\NAT@nm\@empty + \let\NAT@year\@empty + \@for\@citeb:=\NAT@cite@list\do{% + \edef\@citeb{\expandafter\@firstofone\@citeb}% + \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi + \@ifundefined{b@\@citeb\@extra@b@citeb}% + {% + \@citea + {\reset@font\bfseries ?}% + \NAT@citeundefined + \PackageWarning{natbib}{Citation `\@citeb' on page + \thepage \space undefined}% + \def\NAT@date{}% + }% + {% + \let\NAT@last@nm=\NAT@nm + \let\NAT@last@yr=\NAT@year + \NAT@parse{\@citeb}% + \ifNAT@longnames + \@ifundefined{bv@\@citeb\@extra@b@citeb}% + {% + \let\NAT@name=\NAT@all@names + \global\@namedef{bv@\@citeb\@extra@b@citeb}{}% + }% + {}% + \fi + \ifNAT@full + \let\NAT@nm\NAT@all@names + \else + \let\NAT@nm\NAT@name + \fi + \ifNAT@swa + \ifcase\NAT@ctype + \if\relax\NAT@date\relax + \@citea\NAT@nmfmt{\NAT@nm}% + \hyper@natlinkstart{\@citeb\@extra@b@citeb}% + \NAT@date\hyper@natlinkend + \else + \ifx\NAT@last@nm\NAT@nm\NAT@yrsep + \ifx\NAT@last@yr\NAT@year + \hyper@natlinkstart{\@citeb\@extra@b@citeb}\NAT@exlab + \hyper@natlinkend + \else + \unskip\ + \hyper@natlinkstart{\@citeb\@extra@b@citeb}\NAT@date + \hyper@natlinkend + \fi + \else + \@citea\NAT@nmfmt{\NAT@nm}% + \NAT@aysep\ + \hyper@natlinkstart{\@citeb\@extra@b@citeb}% + \NAT@date\hyper@natlinkend + \fi + \fi + \or + \@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}% + \NAT@nmfmt{\NAT@nm}\hyper@natlinkend + \or + \@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}% + \NAT@date\hyper@natlinkend + \or + \@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}% + \NAT@alias\hyper@natlinkend + \fi + \def\@citea{\NAT@sep\ }% + \else + \ifcase\NAT@ctype + \if\relax\NAT@date\relax + \@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}% + \NAT@nmfmt{\NAT@nm}\hyper@natlinkend + \else + \ifx\NAT@last@nm\NAT@nm\NAT@yrsep + \ifx\NAT@last@yr\NAT@year + \hyper@natlinkstart{\@citeb\@extra@b@citeb}\NAT@exlab + \hyper@natlinkend + \else + \unskip\ + \hyper@natlinkstart{\@citeb\@extra@b@citeb}\NAT@date + \hyper@natlinkend + \fi + \else + \@citea\NAT@nmfmt{\NAT@nm}% + \ \NAT@@open\if*##1*\else##1\ \fi + \hyper@natlinkstart{\@citeb\@extra@b@citeb}% + \NAT@date\hyper@natlinkend + \fi + \fi + \or + \@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}% + \NAT@nmfmt{\NAT@nm}\hyper@natlinkend + \or + \@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}% + \NAT@date\hyper@natlinkend + \or + \@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}% + \NAT@alias\hyper@natlinkend + \fi + \if\relax\NAT@date\relax + \def\@citea{\NAT@sep\ }% + \else + \def\@citea{\NAT@@close\NAT@sep\ }% + \fi + \fi + }% + }% + \ifNAT@swa + \else + \if*##2*\else\NAT@cmt##2\fi + \if\relax\NAT@date\relax\else\NAT@@close\fi + \fi + }{##1}{##2}% + }% + \let\@citex\NAT@citex + } +% +\def\set@natbib{% + \if@linksfromyear \citefix \fi + \let\bibfont\thebibliography@size + \setlength\bibsep{0pt}% + } +% +\if@load@natbib + \RequirePackage{natbib} +\else + \let\xxx@thebibliography\thebibliography + \def\thebibliography{\thebibliography@size\xxx@thebibliography} + \g@addto@macro\@openbib@code{\itemsep\z@} +\fi +\AtBeginDocument{\@ifpackageloaded{natbib}{\set@natbib}{}} +% +% thebibliography - structured +% +% Common macros: +% +% Setting a "style" for a command: +% \set@bibl@cmd{bvolume} == \def\bvolume#1{{\bvolume@style #1}} +% +\def\set@bibl@cmd#1{\expandafter\def\csname #1\endcsname##1{{\csname #1@style\endcsname##1}}} +% +\let\endbibitem\relax +% +% bauthor, beditor +% +\def\bbl@bauthor#1{% + \csname bauthor@hook\endcsname + {% + \let\binits\@firstofone + \let\bsnm\@firstofone + \let\bfnm\@gobble + \let\bparticle\@firstofone + \let\bsuffix\@firstofone + \bauthor@style + #1% + }} +% +\def\bbl@beditor#1{{% + \let\binits\@firstofone + \let\bsnm\@firstofone + \let\bfnm\@gobble + \let\bparticle\@firstofone + \let\bsuffix\@firstofone + \beditor@style + #1% + }} +% +% bid +% \bid{MR={},doi={},...} +% +\if@print@bid@doi + \let\bid@mr@arg\@empty + \let\bid@doi@arg\@empty + \define@key{bid}{mr}{\edef\bid@mr@arg{#1}} + \define@key{bid}{doi}{\edef\bid@doi@arg{#1}} + \def\bid@MR#1{\ \MR{#1}\ignorespaces} + \def\bid@doiurl#1{\ \ims@href{\doi@base#1}{#1}\ignorespaces} +\else + \define@key{bid}{mr}{\MR{#1}} + \define@key{bid}{doi}{} +\fi +\define@key{bid}{pubmed}{} +\define@key{bid}{pmcid}{} +\define@key{bid}{pmid}{} +\define@key{bid}{mid}{} +\define@key{bid}{issn}{} +\define@key{bid}{pii}{} +% +\def\bbl@bid#1{% + \setkeys{bid}{#1}% + \if@print@bid@doi + \ifx\bid@mr@arg\@empty + \else + \expandafter\bid@MR\expandafter{\bid@mr@arg}% + \fi + \ifx\bid@doi@arg\@empty + \else + \expandafter\bid@doiurl\expandafter{\bid@doi@arg}% + \fi + \fi +} +% +% for compatibility with old bibtex style +\def\bdoi#1{\ignorespaces} +% +% common@pub@types +% +\def\common@pub@types{% + \def\AND{and }% + \let\betal\@firstofone + \set@bibl@cmd{btitle}% + \let\byear\@firstofone + \let\bpages\@firstofone + \let\bmisc\@firstofone + \let\bnote\@firstofone + \let\banumber\@firstofone + \let\bmrnumber\MR + \let\bid\bbl@bid + \set@bibl@cmd{bvolume}% + \csname common@pub@types@hook\endcsname + } +% +% default styles +% +\setpkgattr{bauthor}{style}{\scshape} +\setpkgattr{beditor}{style}{\scshape} +% +\setpkgattr{bjournal}{style}{\itshape} +\setpkgattr{bbooktitle}{style}{\itshape} +\setpkgattr{bseries}{style}{\itshape} +% +\setpkgattr{bvolume}{style}{\bfseries} +% +% barticle +% +\def\barticle{\@ifnextchar[{\@barticle}{\@barticle[]}} +% +\def\@barticle[#1]{% + \common@pub@types + \let\bauthor\bbl@bauthor + \set@bibl@cmd{bjournal}% + } +% +% bbook +% +\def\bbook{\@ifnextchar[{\@bbook}{\@bbook[]}} +% +\def\@bbook[#1]{% + \common@pub@types + \let\bauthor\bbl@bauthor + \let\beditor\bbl@beditor + \let\bedition\@firstofone + \set@bibl@cmd{bseries}% + \let\bpublisher\@firstofone + \let\baddress\@firstofone + \let\blocation\@firstofone + \let\bisbn\@gobble + % + \let\btitle@style\itshape + } +% +% bincollection +% +\def\bincollection{\@ifnextchar[{\@bincollection}{\@bincollection[]}} +% +\def\@bincollection[#1]{% + \common@pub@types + \let\bauthor\bbl@bauthor + \let\beditor\bbl@beditor + \set@bibl@cmd{bbooktitle}% + \let\bchapter\@firstofone + \let\bedition\@firstofone + \set@bibl@cmd{bseries}% + \let\bpublisher\@firstofone + \let\baddress\@firstofone + \let\blocation\@firstofone + \let\bisbn\@gobble + \def\bauthor@hook{\let\beditor@style\relax}% + } +% +% binproceedings +% +\def\binproceedings{\@ifnextchar[{\@binproceedings}{\@binproceedings[]}} +% +\def\@binproceedings[#1]{% + \common@pub@types + \let\bauthor\bbl@bauthor + \let\beditor\bbl@beditor + \set@bibl@cmd{bbooktitle}% + \set@bibl@cmd{bseries}% + \let\borganization\@firstofone + \let\bpublisher\@firstofone + \let\baddress\@firstofone + \let\blocation\@firstofone + \let\bisbn\@gobble + } +% +% binbook +% +\def\binbook{\@ifnextchar[{\@binbook}{\@binbook[]}} +% +\def\@binbook[#1]{% + \common@pub@types + \let\bauthor\bbl@bauthor + \let\beditor\bbl@beditor + \set@bibl@cmd{bbooktitle}% + \let\bchapter\@firstofone + \let\bedition\@firstofone + \set@bibl@cmd{bseries}% + \let\bpublisher\@firstofone + \let\baddress\@firstofone + \let\blocation\@firstofone + \let\bisbn\@gobble + % + \let\btitle@style\itshape + } +% +% bproceedings +% +\def\bproceedings{\@ifnextchar[{\@bproceedings}{\@bproceedings[]}} +% +\def\@bproceedings[#1]{% + \common@pub@types + \let\bauthor\bbl@bauthor + \let\beditor\bbl@beditor + \let\bedition\@firstofone + \set@bibl@cmd{bseries}% + \let\bpublisher\@firstofone + \let\borganization\@firstofone + \let\baddress\@firstofone + \let\blocation\@firstofone + \let\bisbn\@gobble + % + \let\btitle@style\itshape + } +% +% btechreport +% +\def\btechreport{\@ifnextchar[{\@btechreport}{\@btechreport[]}} +% +\def\@btechreport[#1]{% + \common@pub@types + \let\bauthor\bbl@bauthor + \let\btype\@firstofone + \let\bnumber\@firstofone + \let\binstitution\@firstofone + \let\bpublisher\@firstofone + \let\baddress\@firstofone + \let\blocation\@firstofone + } +% +% bmanual +% +\def\bmanual{\@ifnextchar[{\@bmanual}{\@bmanual[]}} +% +\def\@bmanual[#1]{% + \common@pub@types + \let\bauthor\bbl@bauthor + \let\bedition\@firstofone + \let\borganization\@firstofone + \let\bpublisher\@firstofone + \let\baddress\@firstofone + \let\blocation\@firstofone + \let\bisbn\@gobble + } +% +% mastersthesis +% +\def\bmastersthesis{\@ifnextchar[{\@bmastersthesis}{\@bmastersthesis[]}} +% +\def\@bmastersthesis[#1]{% + \common@pub@types + \let\bauthor\bbl@bauthor + \let\bschool\@firstofone + \let\bpublisher\@firstofone + \let\btype\@firstofone + \let\baddress\@firstofone + \let\blocation\@firstofone + } +% +% phdthesis +% +\def\bphdthesis{\@ifnextchar[{\@bphdthesis}{\@bphdthesis[]}} +% +\def\@bphdthesis[#1]{% + \common@pub@types + \let\bauthor\bbl@bauthor + \let\bpublisher\@firstofone + \let\bschool\@firstofone + \let\btype\@firstofone + \let\baddress\@firstofone + \let\blocation\@firstofone + } +% +% bbooklet +% +\def\bbooklet{\@ifnextchar[{\@bbooklet}{\@bbooklet[]}} +% +\def\@bbooklet[#1]{% + \common@pub@types + \let\bauthor\bbl@bauthor + \let\bhowpublished\@firstofone + \let\baddress\@firstofone + \let\blocation\@firstofone + } +% +% bunpublished +% +\def\bunpublished{\@ifnextchar[{\@bunpublished}{\@bunpublished[]}} +% +\def\@bunpublished[#1]{% + \common@pub@types + \let\bauthor\bbl@bauthor + } +% +% bmisc +% +\def\bmisc{\@ifnextchar[{\@bmisc}{\@bmisc[]}} +% +\def\@bmisc[#1]{% + \common@pub@types + \let\bauthor\bbl@bauthor + \let\bhowpublished\@firstofone + } +% +% \bptok +% +\def\bptok#1{\ignorespaces} +% +\ifx\OrigBibText\undefined \long\def\OrigBibText#1\endOrigBibText{}\fi +% +% appendix +% +\if@imslayout + % + % appendix mess up everything in this layout: + % + \renewcommand\appendix{% + \par + \def\subsection@shape{\normalsize\upshape\bfseries\mathversion{bold}}% + \let\section\specialsection + \def\section{\@ifnextchar*{\@appsectionstar}{\@appsectionnostar}}% + \def\section@prefix{\appendixname\ }% + \def\section@numbersep{:}% + \setcounter{section}{0}% + \setcounter{subsection}{0}% + \gdef\thesection{\@Alph\c@section}% + } + % + % \section*{Appendix} -> APPENDIX + \def\@appsectionstar*#1{% + \ifx.#1.% + \specialsection*{\appendixname}% + \else + \specialsection*{\appendixname: #1}% + \fi + \setcounter{section}{1}% + } + % + % \section{} -> APPENDIX A + % \section{proof} -> APPENDIX A: PROOF + \def\@appsectionnostar#1{% + \ifx.#1.% + \def\section@numbersep{}\specialsection[\appendixname\ \thesection]{}% + \else + \def\section@numbersep{:}\specialsection{#1}% + \fi + } + % + % dirty trick with \thebibliography + \let\old@thebibliography\thebibliography + \def\thebibliography{\let\section\specialsection\old@thebibliography} + % +\else + % + \renewcommand\appendix{% + \par + \let\old@section\section + \def\section{\@ifnextchar*{\@appsectionstar}{\@appsectionnostar}}% + \def\section@prefix{\appendixname\ }% + \def\section@numbersep{:}% + \setcounter{section}{0}% + \setcounter{subsection}{0}% + \gdef\thesection{\@Alph\c@section}% + } + % + \def\@appsectionstar*#1{% + \old@section*{#1}% + \setcounter{section}{1}% + } + % + \def\@appsectionnostar#1{% + \ifx.#1.% + \def\section@numbersep{}\old@section[\appendixname\ \thesection]{}% + \else + \def\section@numbersep{:}\old@section{#1}% + \fi + } +\fi +% +% supplement +% +%\begin{supplement}[id=suppA] +% \sname{Supplement A} +% \stitle{} +% \slink[doi]{} +% \slink[url]{https://lib.stat.cmu.edu/aoas/???/???} +% \sdatatype{.zip} +% \sfilename{foo.zip} +% \sdescription{} +%\end{supplement} +% \thesuppdoi{suppA} +% \ref{suppA} +% \hyperlink{suppA}{text} +% +\def\slink@data@exists{0} +\def\supplement@name{Supplementary Material} +% +\def\sname#1{\def\@sname{#1}\def\@currentlabel{#1}} +\def\stitle#1{\def\@stitle{#1}} +\def\sdatatype#1{\def\@sdatatype{#1}\xdef\slink@data@exists{1}} +\def\sfilename#1{} +\def\slink[#1]#2{\expandafter\def\csname slink@#1\endcsname{#2}\xdef\slink@data@exists{1}} +\def\sdescription#1{\def\@sdescription{#1}} +% +\def\suppsection@fmt{\specialsection*{\supplement@name}} +% +\def\slink@doi@fmt{% + \url@fmt{doi: }{}{\slink@doi}{\doi@base\slink@doi}% + \@ifundefined{supp@label}% + {}% + {% + \expandafter\xdef\csname\supp@label @doi\endcsname{\slink@doi}% + \expandafter\xdef\csname\supp@label @url\endcsname{\doi@base\slink@doi}% + }% + } +% +\def\slink@url@fmt{% + \url@fmt{}{}{\slink@url}{\slink@url}% + \@ifundefined{supp@label}% + {}% + {\expandafter\xdef\csname\supp@label @url\endcsname{\slink@url}}% + } +% +\def\thesuppdoi#1{% + \@ifundefined{#1@doi}% + {\@latex@error{Undefined supplement id=#1}{??}}% + {% + \def\@tempx{\csname #1@doi\endcsname}% + \@ifundefined{#1@url}% + {\def\@tempy{\doi@base\csname #1@url\endcsname}}% + {\def\@tempy{\csname #1@url\endcsname}}% + \url@fmt{DOI: }{}{\@tempx}{\@tempy}% + }% + } +% +\define@key{supplement}{id}{\def\supp@label{#1}} +% +\long\def\supplement{\@ifnextchar[{\@supplement}{\@supplement[]}} +% +\long\def\@supplement[#1]{% + \suppsection@fmt + \global\let\suppsection@fmt\smallskip + \setkeys{supplement}{#1}% + } +% +\def\stitle@fmt#1{\textbf{#1\ }} +% +\def\endsupplement{% + \@ifundefined{@sname}% + {}% + {% + \@ifundefined{supp@label}% + {}% + {\hypertarget{\supp@label}{}\label{\supp@label}}\textbf{\@sname: }% + }% + \@ifundefined{@stitle}% + {}% + {\stitle@fmt{\@stitle}}% + % + \\ + \ifnum\slink@data@exists>\z@(\fi + \@ifundefined{slink@doi}{}{\slink@doi@fmt}% + \@ifundefined{slink@url}{}{\slink@url@fmt}% + \@ifundefined{@sdatatype}{}{; \@sdatatype}% + \ifnum\slink@data@exists>\z@). \fi + \@ifundefined{@sdescription}{}{\@sdescription}% + \par + } +% +% TOC in "article" class is a mess: +% +% for hyperref +\def\toclevel@title{0} +% +\newcommand*\l@title[2]{} +\newcommand*\l@author[2]{} +\newcommand*\l@doi[2]{} +\newcommand*\l@arxiv[2]{} +\newcommand*\l@jobname[2]{} +\newcommand*\l@begintocitem[2]{} +\newcommand*\l@endtocitem[2]{} +% +\@ifclassloaded{article}{\@changetoctrue}{} +% +\if@changetoc + % + \@ifundefined{contentsname@cmd}{\def\contentsname@cmd{\section*{\contentsname}}}{} + % + \renewcommand\tableofcontents{% + \nocontentsline + \contentsname@cmd + \@starttoc{toc}% + } + % + \renewcommand*\l@section{\@dottedtocline{1}{\z@}{1.5em}} + % +\fi +% +% number lines +% +\ifnumberlines@ + % + \long\def\l@addto@macro#1#2{% + \toks@\expandafter{#1#2}% + \edef#1{\the\toks@}% + } + % + \setpkgattr{numberlines}{size}{\scriptsize\ttfamily} + \setpkgattr{numberlines}{skip}{24\p@} + % + \def\numberlines@hook{% + \l@addto@macro\@evenhead\put@numberlines@box + \l@addto@macro\@oddhead\put@numberlines@box + } + % + \g@addto@macro\ps@imsheadings\numberlines@hook + \g@addto@macro\ps@copyright\numberlines@hook + % + \newbox\numberlines@box + \newskip\numberlines@box@skip + % + \def\set@numberlines@box{% + \setlength\numberlines@box@skip\headsep + \addtolength\numberlines@box@skip{5\p@}% + % + \setbox\numberlines@box\vtop to\textheight{% + \parindent=\z@ + \vskip\z@ + \@tempcnta=0% + \@tempdima=\z@ + \loop + \advance\@tempcnta by 1% + \advance\@tempdima by \baselineskip + \hbox to\textwidth{% + \llap{\numberlines@size\the\@tempcnta\kern\numberlines@skip}% + \hfill + \rlap{\numberlines@size\kern\numberlines@skip\the\@tempcnta}% + }% + \ifdim\@tempdima<\textheight\repeat + \vss + }% + % + \ht\numberlines@box=\z@ + \dp\numberlines@box=\z@ + } + % + \def\put@numberlines@box{\lower\numberlines@box@skip\hbox to\z@{\hss\copy\numberlines@box}} + % + \AtBeginDocument{\set@numberlines@box} + % +\fi +% +% INITIALIZATION +% +% Read local configuration file (if exist): +% imsart.cnf imsart-ps.cnf +% +\@input{\imsfmt@name\journal@id.cnf} +\@input{\imsfmt@name-vtex.cnf} +% +\@twosidetrue +\pagenumbering{arabic} +\frenchspacing +\init@settings +\pagestyle{imsheadings} +% +\endinput +%% +%% End of file `imsart.sty'. diff --git a/inst/rmarkdown/templates/ims/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/ims/skeleton/skeleton.Rmd new file mode 100644 index 000000000..0025114f8 --- /dev/null +++ b/inst/rmarkdown/templates/ims/skeleton/skeleton.Rmd @@ -0,0 +1,414 @@ +--- +title: A sample article with some additional note +thanks: # delete thanks field if not require, here notes for title + - ref: T1 + text: A sample additional note to the title. +runtitle: A sample running head title +author: + - name: First + surname: Author + email: first@somewhere.com + label: e1 + addressLabel: A + sepNext: "," # use "," or \and; the last author not need this field + - name: Second + surname: Author + email: second@somewhere.com + label: e2,mark + addressLabel: B + sepNext: \and + - name: Third + surname: Author + email: third@somewhere.com + label: e3,mark + addressLabel: B +affiliation: + - label: A + name: Department, University or Company Name + authorsLabels: e1 + - label: B + name: Department, University or Company Name + authorsLabels: e2,e3 +abstract: | + The abstract should summarize the contents of the paper. + It should be clear, descriptive, self-explanatory and not longer + than 200 words. It should also be suitable for publication in + abstracting services. Formulas should be used as sparingly as + possible within the abstract. The abstract should not make + reference to results, bibliography or formulas in the body + of the paper---it should be self-contained. + + This is a sample input file. Comparing it with the output it + generates can show you how to produce a simple document of + your own. +keyword-subclass: | + \begin{keyword}[class=MSC2020] % It must be define for aap, aop, aos journals. For aoas, sts is not used + \kwd[Primary ]{00X00} + \kwd{00X00} + \kwd[; secondary ]{00X00} + \end{keyword} +keywords: + - First keyword + - Second keyword + +predefined-theoremstyle: true # use in section Environments for Axiom, Theorem, etc +bibliography: ims.bib +biblio-style: imsart-nameyear # alternative: imsart-number +output: + rticles::ims_article: + journal: aoas # aap, aoas, aop, aos, sts. See documentation + toc: false # Please use for articles with 50 pages and more +--- + +# Introduction +This template helps you to create a properly formatted \LaTeXe\ manuscript. + + + + +Prepare your paper in the same style as used in this sample .pdf file. +Try to avoid excessive use of italics and bold face. +Please do not use any \LaTeXe\ or \TeX\ commands that affect the layout +or formatting of your document (i.e., commands like \verb|\textheight|, +\verb|\textwidth|, etc.). + +# Section headings + +Here are some sub-sections: + +## A sub-section + +Regular text. + +### A sub-sub-section + +Regular text. + +# Text + +## Lists + +The following is an example of an *itemized* list, two levels deep. + +* This is the first item of an itemized list. Each item + in the list is marked with a "tick." The document + style determines what kind of tick mark is used. +* This is the second item of the list. It contains another + list nested inside it. + - This is the first item of an itemized list that + is nested within the itemized list. + - This is the second item of the inner list. \LaTeX\ + allows you to nest lists deeper than you really should. +- This is the third item of the list. + +The following is an example of an *enumerated* list of one level. + +\begin{longlist} +\item This is the first item of an enumerated list. +\item This is the second item of an enumerated list. +\end{longlist} + +The following is an example of an *enumerated* list, two levels deep. +\begin{longlist} +\item[1.] +This is the first item of an enumerated list. Each item +in the list is marked with a ``tick.''. The document +style determines what kind of tick mark is used. +\item[2.] +This is the second item of the list. It contains another +list nested inside of it. +\begin{longlist} +\item +This is the first item of an enumerated list that +is nested within. +\item +This is the second item of the inner list. \LaTeX\ +allows you to nest lists deeper than you really should. +\end{longlist} +This is the rest of the second item of the outer list. +\item[3.] +This is the third item of the list. +\end{longlist} + +## Punctuation + +Dashes come in three sizes: a hyphen, an intra-word dash like "$U$-statistics" or "the time-homogeneous model"; +a medium dash (also called an "en-dash") for number ranges or between two equal entities like "1--2" or "Cauchy--Schwarz inequality"; +and a punctuation dash (also called an "em-dash") in place of a comma, semicolon, +colon or parentheses---like this. + +Generating an ellipsis \ldots\ with the right spacing +around the periods requires a special command. + +## Citation + +Simple author and year cite: @billingsley2013convergence. +Multiple bibliography items cite: \cite{billingsley2013convergence,bourbaki1966general} or [@billingsley2013convergence; @bourbaki1966general]. +Author only cite: \citeauthor{ethier1985markov}. +Year only cite: \citeyear{prokhorov1956convergence} or [-@prokhorov1956convergence]. + +# Fonts + +Please use text fonts in text mode, e.g.: +\begin{itemize} +\item[]\textrm{Roman} +\item[]\textit{Italic} +\item[]\textbf{Bold} +\item[]\textsc{Small Caps} +\item[]\textsf{Sans serif} +\item[]\texttt{Typewriter} +\end{itemize} +Please use mathematical fonts in mathematical mode, e.g.: +\begin{itemize} +\item[] $\mathrm{ABCabc123}$ +\item[] $\mathit{ABCabc123}$ +\item[] $\mathbf{ABCabc123}$ +\item[] $\boldsymbol{ABCabc123\alpha\beta\gamma}$ +\item[] $\mathcal{ABC}$ +\item[] $\mathbb{ABC}$ +\item[] $\mathsf{ABCabc123}$ +\item[] $\mathtt{ABCabc123}$ +\item[] $\mathfrak{ABCabc123}$ +\end{itemize} +Note that \verb|\mathcal, \mathbb| belongs to capital letters-only font typefaces. + +# Notes + +Footnotes[^1] +pose no problem.[^2] + +[^1]: This is an example of a footnote. +[^2]: Note that footnote number is after punctuation. + +# Quotations + +Text is displayed by indenting it from the left margin. There are short quotations + +> This is a short quotation. It consists of a +> single paragraph of text. There is no paragraph +> indentation. + +and longer ones. + + + +::: {.quotation data-latex=""} +This is a longer quotation. It consists of two paragraphs +of text. The beginning of each paragraph is indicated +by an extra indentation. + +This is the second paragraph of the quotation. It is just +as dull as the first paragraph. +::: + +# Environments + +## Examples for *`plain`-style environments* + +::: {.axiom data-latex=""} +\label{ax1} +This is the body of Axiom \ref{ax1}. +::: + +::: {.proof data-latex=""} +This is the body of the proof of the axiom above. +::: + +::: {.claim data-latex=""} +\label{cl1} +This is the body of Claim \ref{cl1}. Claim \ref{cl1} is numbered after +Axiom \ref{ax1} because we used \verb|[axiom]| in \verb|\newtheorem|. +::: + +::: {.theorem data-latex=""} +\label{th1} +This is the body of Theorem \ref{th1}. Theorem \ref{th1} numbering is +dependent on section because we used \verb|[section]| after \verb|\newtheorem|. +::: + +::: {.theorem data-latex="[Title of the theorem]"} +\label{th2} +This is the body of Theorem \ref{th2}. Theorem \ref{th2} has additional title. +::: + +::: {.lemma data-latex=""} +\label{le1} +This is the body of Lemma \ref{le1}. Lemma \ref{le1} is numbered after +Theorem \ref{th2} because we used \verb|[theorem]| in \verb|\newtheorem|. +::: + +::: {.proof data-latex="[Proof of Lemma \ref{le1}]"} +This is the body of the proof of Lemma \ref{le1}. +::: + +## Examples for *`remark`*-style environments +::: {.definition data-latex=""} +\label{de1} +This is the body of Definition \ref{de1}. Definition \ref{de1} is numbered after +Lemma \ref{le1} because we used \verb|[theorem]| in \verb|\newtheorem|. +::: + +::: {.example data-latex=""} +This is the body of the example. Example is unnumbered because we used \verb|\newtheorem*| +instead of \verb|\newtheorem|. +::: + +::: {.fact data-latex=""} +This is the body of the fact. Fact is unnumbered because we used \verb|\newtheorem*| +instead of \verb|\newtheorem|. +::: + +# Tables and figures +Cross-references to labeled tables: As you can see in Table\ref{tab:mtc} +and also in Table\ref{parset}. + +```{r mtc, echo = FALSE} +knitr::kable(mtcars, caption = "Table caption", format = "latex", vline = "", linesep = "") +``` + +\begin{table} +\caption{Sample posterior estimates for each model} +\label{parset} +% +\begin{tabular}{@{}lcrcrrr@{}} +\hline +&& & &\multicolumn{3}{c}{Quantile} \\ +\cline{5-7} +Model &Parameter & +\multicolumn{1}{c}{Mean} & +Std. dev.& +\multicolumn{1}{c}{2.5\%} & +\multicolumn{1}{c}{50\%}& +\multicolumn{1}{c@{}}{97.5\%} \\ +\hline +{Model 0} & $\beta_0$ & $-$12.29 & 2.29 & $-$18.04 & $-$11.99 & $-$8.56 \\ + & $\beta_1$ & 0.10 & 0.07 & $-$0.05 & 0.10 & 0.26 \\ + & $\beta_2$ & 0.01 & 0.09 & $-$0.22 & 0.02 & 0.16 \\[6pt] +{Model 1} & $\beta_0$ & $-$4.58 & 3.04 & $-$11.00 & $-$4.44 & 1.06 \\ + & $\beta_1$ & 0.79 & 0.21 & 0.38 & 0.78 & 1.20 \\ + & $\beta_2$ & $-$0.28 & 0.10 & $-$0.48 & $-$0.28 & $-$0.07 \\[6pt] +{Model 2} & $\beta_0$ & $-$11.85 & 2.24 & $-$17.34 & $-$11.60 & $-$7.85 \\ + & $\beta_1$ & 0.73 & 0.21 & 0.32 & 0.73 & 1.16 \\ + & $\beta_2$ & $-$0.60 & 0.14 & $-$0.88 & $-$0.60 & $-$0.34 \\ + & $\beta_3$ & 0.22 & 0.17 & $-$0.10 & 0.22 & 0.55 \\ +\hline +\end{tabular} +% +\end{table} + + +```{r,echo=FALSE,fig.cap="Figure caption\\label{penG}"} +plot(1:10) +``` + +Sample of cross-reference to figure. +Figure\ref{penG} shows that it is not easy to get something on paper. + +# Equations and the like + +Two equations: +\begin{equation} + C_{s} = K_{M} \frac{\mu/\mu_{x}}{1-\mu/\mu_{x}} \label{ccs} +\end{equation} +and +\begin{equation} + G = \frac{P_{\mathrm{opt}} - P_{\mathrm{ref}}}{P_{\mathrm{ref}}} 100(\%). +\end{equation} + +Equation arrays: +\begin{eqnarray} + \frac{dS}{dt} & = & - \sigma X + s_{F} F,\\ + \frac{dX}{dt} & = & \mu X,\\ + \frac{dP}{dt} & = & \pi X - k_{h} P,\\ + \frac{dV}{dt} & = & F. +\end{eqnarray} +One long equation: +\begin{eqnarray} + \mu_{\text{normal}} & = & \mu_{x} \frac{C_{s}}{K_{x}C_{x}+C_{s}} \nonumber\\ + & = & \mu_{\text{normal}} - Y_{x/s}\bigl(1-H(C_{s})\bigr)(m_{s}+\pi /Y_{p/s})\\ + & = & \mu_{\text{normal}}/Y_{x/s}+ H(C_{s}) (m_{s}+ \pi /Y_{p/s}).\nonumber +\end{eqnarray} + + + + + +::: {.appendix data-latex=""} +# Title {.unnumbered #appn} + +Appendices should be provided in \verb|{appendix}| environment, +before Acknowledgements. + +If there is only one appendix, +then please refer to it in text as \ldots\ in the \hyperref[appn]{Appendix}. +::: + + + + + +::: {.appendix data-latex=""} +# Title of the first appendix {#appA} +If there are more than one appendix, then please refer to it +as \ldots\ in Appendix \ref{appA}, Appendix \ref{appB}, etc. + +# Title of the second appendix {#appB} + +## First subsection of Appendix \protect\ref{appB} +Use the standard \LaTeX\ commands for headings in \verb|{appendix}|. +Headings and other objects will be numbered automatically. + +\begin{equation} +\mathcal{P}=(j_{k,1},j_{k,2},\dots,j_{k,m(k)}). \label{path} +\end{equation} + +Sample of cross-reference to the formula (\ref{path}) in Appendix \ref{appB}. +::: + + + + + + + +## Acknowledgements {.unnumbered} + +The authors would like to thank the anonymous referees, an Associate +Editor and the Editor for their constructive comments that improved the +quality of this paper. + +The first author was supported by NSF Grant DMS-??-??????. + +The second author was supported in part by NIH Grant ???????????. + + + + + + + + +\begin{supplement} +\stitle{Title of Supplement A} +\sdescription{Short description of Supplement A.} +\end{supplement} +\begin{supplement} +\stitle{Title of Supplement B} +\sdescription{Short description of Supplement B.} +\end{supplement} + + + + + + + + + + + + + + + + diff --git a/inst/rmarkdown/templates/ims/template.yaml b/inst/rmarkdown/templates/ims/template.yaml new file mode 100644 index 000000000..678261f73 --- /dev/null +++ b/inst/rmarkdown/templates/ims/template.yaml @@ -0,0 +1,4 @@ +name: Institute of Mathematical Statistics +description: > + Template for creating an article for submission to any of the Journals in IMS +create_dir: true diff --git a/man/article.Rd b/man/article.Rd index 0082d7629..0c981ae25 100644 --- a/man/article.Rd +++ b/man/article.Rd @@ -15,6 +15,7 @@ \alias{ctex} \alias{elsevier_article} \alias{frontiers_article} +\alias{ims_article} \alias{jasa_article} \alias{lipics_article} \alias{mdpi_article} @@ -79,6 +80,14 @@ elsevier_article( frontiers_article(..., keep_tex = TRUE) +ims_article( + journal = c("aoas", "aap", "aop", "aos", "sts"), + keep_tex = TRUE, + citation_package = "natbib", + md_extensions = c("-autolink_bare_uris"), + ... +) + jasa_article( ..., keep_tex = TRUE, @@ -123,6 +132,8 @@ tf_article(..., keep_tex = TRUE, citation_package = "natbib") } \arguments{ \item{..., keep_tex, latex_engine, citation_package, highlight, fig_caption, md_extensions, template}{Arguments passed to \code{rmarkdown::\link{pdf_document}()}.} + +\item{journal}{one of \code{"aoas"}, \code{"aap"}, \code{"aop"}, \code{"aos"}, \code{"sts"} for \code{ims_article}} } \value{ An R Markdown output format. @@ -212,6 +223,21 @@ custom Pandoc LaTeX template and different default values for other arguments \url{https://www.frontiersin.org/about/author-guidelines}. } +\section{\code{ims_article}}{ + Format for creating submissions to the Institute of Mathematical Statistics +\href{https://imstat.org/}{IMS} journals and publications. Adapted from +\url{https://github.com/vtex-soft/texsupport.ims-aoas}. + +The argument \code{journal} accepts the acronym of any of the +\href{https://www.e-publications.org/ims/support/ims-instructions.html}{journals} in IMS: +\itemize{ + \item \code{aap}: The Annals of Applied Probability + \item \code{aoas}: The Annals of Applied Statistics + \item \code{aop}: The Annals of Probability + \item \code{aos}: The Annals of Statistics + \item \code{sts}: Statistical Science} +} + \section{\code{jasa_article}}{ Format for creating submissions to the Journal of the Acoustical Society of America. Adapted from diff --git a/tests/testit/test-formats.R b/tests/testit/test-formats.R index b0a598b1f..27cacd25d 100644 --- a/tests/testit/test-formats.R +++ b/tests/testit/test-formats.R @@ -1,4 +1,4 @@ -test_format <- function(name, os_skip = NULL) { +test_format <- function(name, output_options = NULL, os_skip = NULL) { # don't run on CRAN due to complicated dependencies (Pandoc/LaTeX packages) if (!identical(Sys.getenv("NOT_CRAN"), "true")) return() @@ -18,8 +18,9 @@ test_format <- function(name, os_skip = NULL) { create_dir = FALSE, edit = FALSE ) - message('Rendering the ', name, ' format...') - output_file <- rmarkdown::render(testdoc, quiet = TRUE) + message('Rendering the ', name, ' format...', + if(!is.null(output_options)) " (with output options)") + output_file <- rmarkdown::render(testdoc, output_options = output_options, quiet = TRUE) assert(paste(name, "format works"), { file.exists(output_file) }) @@ -44,8 +45,11 @@ if (xfun::is_linux()) test_format("ctex") # only on linux due to fonts requireme test_format("elsevier") test_format("frontiers") test_format("ieee") +test_format("ims") +test_format("ims", output_options = list(journal = "aap")) test_format("jasa") test_format("joss") +test_format("joss", output_options = list(journal = "JOSE")) test_format("jss") test_format("lipics") test_format("mdpi")