diff --git a/DESCRIPTION b/DESCRIPTION index 839292fe4..ba883f470 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -100,8 +100,9 @@ Suggests: fixest, flextable, forecast, - ftExtra, gamm4, + geomtextpath, + ggplot2, ggdag, glmmTMB (>= 1.1.10), graphics, diff --git a/papers/JOSE/cover_letter.Rmd b/papers/JOSE/cover_letter.Rmd deleted file mode 100644 index 4251c050a..000000000 --- a/papers/JOSE/cover_letter.Rmd +++ /dev/null @@ -1,29 +0,0 @@ ---- -output: pdf_document ---- - -Dear Dr. Vazire, - -We are pleased to submit this paper to *Collabra: Psychology*. - -The paper, titled "Check your outliers! An introduction to identifying statistical outliers in R with *easystats*", provides an overview of current recommendations and best practices regarding the diagnosis and treatment of outliers, a common issue faced by researchers---and a potential source of scientific malpractice. - -It explains the key approaches, highlights recommendations, and shows how users can adopt them in their R analysis with a single function. The manuscript covers univariate, multivariate, and model-based statistical outlier detection methods, their recommended threshold, standard output, and plotting method, among other things. - -Beyond acting like a concise review of outlier treatment procedures and practical tutorial, we also introduce a new outlier-detection method that relies on a consensus-based approach. In this sense, the paper fits well with the "Methodology and Research Practice in Psychology" section of the journal, as it essentially communicates to psychologists how to easily follow some of the best practices in the detection of statistical outlier using currently available open source and free software. This makes the manuscript relevant to data science, behavioural science, and good research and statistical practices more generally. - -As Associated Editor, we would like to suggest Jeffrey Girard, as he is familiar with the *easystats* and R ecosystems, as well as good statistical practices. Additionally, we would like to request a streamlined review, as the manuscript has been rejected within the previous 365 days from the journal *Mathematics*. Accordingly, we provide in this submission a detailed letter that includes prior reviews, the decision letter, as well as how we addressed the reviewers' comments. We have in this regard integrated most of the changes suggested by the reviewers. Note that the previous editors and reviewers have not given their permission for their comments to be openly available at *Collabra: Psychology*. However, although an open review was requested, the reviewers did not sign their reviews. - -Our current submission is original and has been neither published elsewhere nor is currently under consideration for publication elsewhere. All authors have contributed substantially to the software and manuscript. All authors gave final approval to the manuscript and accept to be accountable. We have no conflicts of interest to disclose. We have also read the Transparency and Openness policy of the Editorial Policies of *Collabra: Psychology*. - -Thank you for considering our submission. - -On the behalf of all authors, - -Rémi Thériault - -Department of Psychology, - -Université du Québec à Montréal, - -Montréal, Québec, Canada \ No newline at end of file diff --git a/papers/JOSE/cover_letter.pdf b/papers/JOSE/cover_letter.pdf deleted file mode 100644 index 15650f828..000000000 Binary files a/papers/JOSE/cover_letter.pdf and /dev/null differ diff --git a/papers/JOSE/paper.Rmd b/papers/JOSE/paper.Rmd deleted file mode 100644 index 56a893b1c..000000000 --- a/papers/JOSE/paper.Rmd +++ /dev/null @@ -1,296 +0,0 @@ ---- -title: "Check your outliers! An introduction to identifying statistical outliers in R with *easystats*" -tags: - - R - - univariate outliers - - multivariate outliers - - robust detection methods - - easystats -authors: - - name: Rémi Thériault - orcid: 0000-0003-4315-6788 - affiliation: 1 - - name: Mattan S. Ben-Shachar - orcid: 0000-0002-4287-4801 - affiliation: 2 - - name: Indrajeet Patil - orcid: 0000-0003-1995-6531 - affiliation: 3 - - name: Daniel Lüdecke - orcid: 0000-0002-8895-3206 - affiliation: 4 - - name: Brenton M. Wiernik - orcid: 0000-0001-9560-6336 - affiliation: 5 - - name: Dominique Makowski - orcid: 0000-0001-5375-9967 - affiliation: 6 -affiliations: - - index: 1 - name: Department of Psychology, Université du Québec à Montréal, Montréal, Québec, Canada - - index: 2 - name: Independent Researcher, Ramat Gan, Israel - - index: 3 - name: Center for Humans and Machines, Max Planck Institute for Human Development, Berlin, Germany - - index: 4 - name: Institute of Medical Sociology, University Medical Center Hamburg-Eppendorf, Germany - - index: 5 - name: Independent Researcher, Tampa, FL, USA - - index: 6 - name: School of Psychology, University of Sussex, Brighton, UK -correspondence: theriault.remi@courrier.uqam.ca. -type: article -status: submit -date: 7 June 2023 -bibliography: paper.bib -simplesummary: | - The *{performance}* package from the *easystats* ecosystem makes it easy to - diagnose outliers in R and according to current best practices thanks to the - `check_outiers()` function. -keywords: | - univariate outliers; multivariate outliers; robust detection methods; R; easystats -acknowledgement: | - *{performance}* is part of the collaborative - [*easystats*](https://github.com/easystats/easystats) ecosystem - [@easystatspackage]. Thus, we thank all - [members of easystats](https://github.com/orgs/easystats/people), - contributors, and users alike. -authorcontributions: | - R.T. drafted the paper; all authors contributed to both the writing of the - paper and the conception of the software. -funding: | - This research received no external funding. -conflictsofinterest: | - The authors declare no conflict of interest. -abbreviations: - - short: SOD - long: Statistical outlier detection - - short: SEM - long: Structural equation modelling - - short: SD - long: Standard deviation - - short: MAD - long: Median absolute deviation - - short: IQR - long: Interquartile range - - short: HDI - long: Highest density interval - - short: BCI - long: Bias corrected and accelerated interval - - short: MCD - long: Minimum covariance determinant - - short: ICS - long: invariant coordinate selection - - short: OSF - long: Open Science Framework -output: - rticles::joss_article: - journal: "JOSE" -csl: apa.csl ---- - -```{r setup, include=FALSE} -knitr::opts_chunk$set( - echo = TRUE, - comment = "#>", - out.width = "100%", - dpi = 300, - warning = FALSE -) - -library(performance) -library(see) -library(datawizard) -``` - -# Summary - -Beyond the challenge of keeping up-to-date with current best practices regarding the diagnosis and treatment of outliers, an additional difficulty arises concerning the mathematical implementation of the recommended methods. Here, we provide an overview of current recommendations and best practices and demonstrate how they can easily and conveniently be implemented in the R statistical computing software, using the *{performance}* package of the *easystats* ecosystem. We cover univariate, multivariate, and model-based statistical outlier detection methods, their recommended threshold, standard output, and plotting methods. We conclude by reviewing the different theoretical types of outliers, whether to exclude or winsorize them, and the importance of transparency. - -# Statement of Need - -Real-life data often contain observations that can be considered *abnormal* when compared to the main population. The cause of it can be hard to assess and the boundaries of "abnormal", difficult to define---they may belong to a different distribution (originating from a different generative process) or simply be extreme cases, statistically rare but not impossible. - -Nonetheless, the improper handling of these outliers can substantially affect statistical model estimations, biasing effect estimations and weakening the models' predictive performance. It is thus essential to address this problem in a thoughtful manner. Yet, despite the existence of established recommendations and guidelines, many researchers still do not treat outliers in a consistent manner, or do so using inappropriate strategies [@simmons2011false; @leys2013outliers]. - -One possible reason is that researchers are not aware of the existing recommendations, or do not know how to implement them using their analysis software. In this paper, we show how to follow current best practices for automatic and reproducible statistical outlier detection (SOD) using R and the *{performance}* package [@ludecke2021performance], which is part of the *easystats* ecosystem of packages that build an R framework for easy statistical modeling, visualization, and reporting [@easystatspackage]. Installation instructions can be found on [GitHub](https://github.com/easystats/performance) or its [website](https://easystats.github.io/performance/), and its list of dependencies on [CRAN](https://cran.r-project.org/package=performance). - -The instructional materials that follow are aimed at an audience of researchers who want to follow good practices, and are appropriate for advanced undergraduate students, graduate students, professors, or professionals having to deal with the nuances of outlier treatment. - -# Identifying Outliers - -Although many researchers attempt to identify outliers with measures based on the mean (e.g., _z_ scores), those methods are problematic because the mean and standard deviation themselves are not robust to the influence of outliers and those methods also assume normally distributed data (i.e., a Gaussian distribution). Therefore, current guidelines recommend using robust methods to identify outliers, such as those relying on the median as opposed to the mean [@leys2019outliers; @leys2013outliers; @leys2018outliers]. - -Nonetheless, which exact outlier method to use depends on many factors. In some cases, eye-gauging odd observations can be an appropriate solution, though many researchers will favour algorithmic solutions to detect potential outliers, for example, based on a continuous value expressing the observation stands out from the others. - -One of the factors to consider when selecting an algorithmic outlier detection method is the statistical test of interest. Identifying observations the regression model does not fit well can help find information relevant to our specific research context. This approach, known as model-based outliers detection (as outliers are extracted after the statistical model has been fit), can be contrasted with distribution-based outliers detection, which is based on the distance between an observation and the "center" of its population. Various quantification strategies of this distance exist for the latter, both univariate (involving only one variable at a time) or multivariate (involving multiple variables). - -When no method is readily available to detect model-based outliers, such as for structural equation modelling (SEM), looking for multivariate outliers may be of relevance. For simple tests (_t_ tests or correlations) that compare values of the same variable, it can be appropriate to check for univariate outliers. However, univariate methods can give false positives since _t_ tests and correlations, ultimately, are also models/multivariable statistics. They are in this sense more limited, but we show them nonetheless for educational purposes. - -Importantly, whatever approach researchers choose remains a subjective decision, which usage (and rationale) must be transparently documented and reproducible [@leys2019outliers]. Researchers should commit (ideally in a preregistration) to an outlier treatment method before collecting the data. They should report in the paper their decisions and details of their methods, as well as any deviation from their original plan. These transparency practices can help reduce false positives due to excessive researchers' degrees of freedom (i.e., choice flexibility throughout the analysis). In the following section, we will go through each of the mentioned methods and provide examples on how to implement them with R. - -## Univariate Outliers - -Researchers frequently attempt to identify outliers using measures of deviation from the center of a variable's distribution. One of the most popular such procedure is the _z_ score transformation, which computes the distance in standard deviation (SD) from the mean. However, as mentioned earlier, this popular method is not robust. Therefore, for univariate outliers, it is recommended to use the median along with the Median Absolute Deviation (MAD), which are more robust than the interquartile range or the mean and its standard deviation [@leys2019outliers; @leys2013outliers]. - -Researchers can identify outliers based on robust (i.e., MAD-based) _z_ scores using the `check_outliers()` function of the *{performance}* package, by specifying `method = "zscore_robust"`.^[Note that `check_outliers()` only checks numeric variables.] Although @leys2013outliers suggest a default threshold of 2.5 and @leys2019outliers a threshold of 3, *{performance}* uses by default a less conservative threshold of ~3.29.^[3.29 is an approximation of the two-tailed critical value for _p_ < .001, obtained through `qnorm(p = 1 - 0.001 / 2)`. We chose this threshold for consistency with the thresholds of all our other methods.] That is, data points will be flagged as outliers if they go beyond +/- ~3.29 MAD. Users can adjust this threshold using the `threshold` argument. - -Below we provide example code using the `mtcars` dataset, which was extracted from the 1974 *Motor Trend* US magazine. The dataset contains fuel consumption and 10 characteristics of automobile design and performance for 32 different car models (see `?mtcars` for details). We chose this dataset because it is accessible from base R and familiar to many R users. We might want to conduct specific statistical analyses on this data set, say, _t_ tests or structural equation modelling, but first, we want to check for outliers that may influence those test results. - -Because the automobile names are stored as column names in `mtcars`, we first have to convert them to an ID column to benefit from the `check_outliers()` ID argument. Furthermore, we only really need a couple columns for this demonstration, so we choose the first four (`mpg` = Miles/(US) gallon; `cyl` = Number of cylinders; `disp` = Displacement; `hp` = Gross horsepower). Finally, because there are no outliers in this dataset, we add two artificial outliers before running our function. - -```{r z_score} -library(performance) - -# Create some artificial outliers and an ID column -data <- rbind(mtcars[1:4], 42, 55) -data <- cbind(car = row.names(data), data) - -outliers <- check_outliers(data, method = "zscore_robust", ID = "car") -outliers -``` - -What we see is that `check_outliers()` with the robust _z_ score method detected two outliers: cases 33 and 34, which were the observations we added ourselves. They were flagged for two variables specifically: `mpg` (Miles/(US) gallon) and `cyl` (Number of cylinders), and the output provides their exact _z_ score for those variables. - -We describe how to deal with those cases in more details later in the paper, but should we want to exclude these detected outliers from the main dataset, we can extract row numbers using `which()` on the output object, which can then be used for indexing: - -```{r} -which(outliers) - -data_clean <- data[-which(outliers), ] -``` - -Other univariate methods are available, such as using the interquartile range (IQR), or based on different intervals, such as the Highest Density Interval (HDI) or the Bias Corrected and Accelerated Interval (BCI). These methods are documented and described in the function's [help page](). - -## Multivariate Outliers - -Univariate outliers can be useful when the focus is on a particular variable, for instance the reaction time, as extreme values might be indicative of inattention or non-task-related behavior^[ Note that they might not be the optimal way of treating reaction time outliers [@ratcliff1993methods; @van1995statistical]]. - -However, in many scenarios, variables of a data set are not independent, and an abnormal observation will impact multiple dimensions. For instance, a participant giving random answers to a questionnaire. In this case, computing the _z_ score for each of the questions might not lead to satisfactory results. Instead, one might want to look at these variables together. - -One common approach for this is to compute multivariate distance metrics such as the Mahalanobis distance. Although the Mahalanobis distance is very popular, just like the regular _z_ scores method, it is not robust and is heavily influenced by the outliers themselves. Therefore, for multivariate outliers, it is recommended to use the Minimum Covariance Determinant, a robust version of the Mahalanobis distance [MCD, @leys2018outliers; @leys2019outliers]. - -In *{performance}*'s `check_outliers()`, one can use this approach with `method = "mcd"`.^[Our default threshold for the MCD method is defined by `stats::qchisq(p = 1 - 0.001, df = ncol(x))`, which again is an approximation of the critical value for _p_ < .001 consistent with the thresholds of our other methods.] - -```{r multivariate} -outliers <- check_outliers(data, method = "mcd") -outliers -``` - -Here, we detected 9 multivariate outliers (i.e,. when looking at all variables of our dataset together). - -Other multivariate methods are available, such as another type of robust Mahalanobis distance that in this case relies on an orthogonalized Gnanadesikan-Kettenring pairwise estimator [@gnanadesikan1972robust]. These methods are documented and described in the function's [help page](https://easystats.github.io/performance/reference/check_outliers.html). - -## Model-Based Outliers - -Working with regression models creates the possibility of using model-based SOD methods. These methods rely on the concept of *leverage*, that is, how much influence a given observation can have on the model estimates. If few observations have a relatively strong leverage/influence on the model, one can suspect that the model's estimates are biased by these observations, in which case flagging them as outliers could prove helpful (see next section, "Handling Outliers"). - -In {performance}, two such model-based SOD methods are currently available: Cook's distance, for regular regression models, and Pareto, for Bayesian models. As such, `check_outliers()` can be applied directly on regression model objects, by simply specifying `method = "cook"` (or `method = "pareto"` for Bayesian models).^[Our default threshold for the Cook method is defined by `stats::qf(0.5, ncol(x), nrow(x) - ncol(x))`, which again is an approximation of the critical value for _p_ < .001 consistent with the thresholds of our other methods.] - -Currently, most lm models are supported (with the exception of `glmmTMB`, `lmrob`, and `glmrob` models), as long as they are supported by the underlying functions `stats::cooks.distance()` (or `loo::pareto_k_values()`) and `insight::get_data()` (for a full list of the 225 models currently supported by the `insight` package, see https://easystats.github.io/insight/#list-of-supported-models-by-class). Also note that although `check_outliers()` supports the pipe operators (`|>` or `%>%`), it does not support `tidymodels` at this time. We show a demo below. - -```{r model} -model <- lm(disp ~ mpg * disp, data = data) -outliers <- check_outliers(model, method = "cook") -outliers -``` - -Using the model-based outlier detection method, we identified a single outlier. - -Table 1 below summarizes which methods to use in which cases, and with what threshold. The recommended thresholds are the default thresholds. - -```{r table1_prep, echo=FALSE} -df <- data.frame( - `Statistical Test` = c( - "Supported regression model", - "Structural Equation Modeling (or other unsupported model)", - "Simple test with few variables (*t* test, correlation, etc.)"), - `Diagnosis Method` = c( - "**Model-based**: Cook (or Pareto for Bayesian models)", - "**Multivariate**: Minimum Covariance Determinant (MCD)", - "**Univariate**: robust *z* scores (MAD)"), - `Recommended Threshold` = c( - "_qf(0.5, ncol(x), nrow(x) - ncol(x))_ (or 0.7 for Pareto)", - "_qchisq(p = 1 - 0.001, df = ncol(x))_", - "_qnorm(p = 1 - 0.001 / 2)_, ~ 3.29"), - `Function Usage` = c( - '_check_outliers(model, method = "cook")_', - '_check_outliers(data, method = "mcd")_', - '_check_outliers(data, method = "zscore_robust")_'), - check.names = FALSE -) -``` - -### Table 1 - -_Summary of Statistical Outlier Detection Methods Recommendations_ - -```{r table1_print, echo=FALSE, message=FALSE, eval=FALSE} -x <- flextable::flextable(df, cwidth = 1.25) -x <- flextable::theme_apa(x) -x <- flextable::font(x, fontname = "Latin Modern Roman", part = "all") -x <- flextable::fontsize(x, size = 10, part = "all") -ftExtra::colformat_md(x) - -``` - -![](table1.jpg) - -All `check_outliers()` output objects possess a `plot()` method, meaning it is also possible to visualize the outliers using the generic `plot()` function on the resulting outlier object after loading the {see} package (Figure 1). - -```{r model_fig, fig.cap = "Visual depiction of outliers based on Cook's distance (leverage and standardized residuals), based on the fitted model."} -plot(outliers) -``` - -## Cook's Distance vs. MCD - -@leys2018outliers report a preference for the MCD method over Cook's distance. This is because Cook's distance removes one observation at a time and checks its corresponding influence on the model each time [@cook1977detection], and flags any observation that has a large influence. In the view of these authors, when there are several outliers, the process of removing a single outlier at a time is problematic as the model remains "contaminated" or influenced by other possible outliers in the model, rendering this method suboptimal in the presence of multiple outliers. - -However, distribution-based approaches are not a silver bullet either, and there are cases where the usage of methods agnostic to theoretical and statistical models of interest might be problematic. For example, a very tall person would be expected to also be much heavier than average, but that would still fit with the expected association between height and weight (i.e., it would be in line with a model such as `weight ~ height`). In contrast, using multivariate outlier detection methods there may flag this person as being an outlier---being unusual on two variables, height and weight---even though the pattern fits perfectly with our predictions. - -Finally, unusual observations happen naturally: extreme observations are expected even when taken from a normal distribution. While statistical models can integrate this "expectation", multivariate outlier methods might be too conservative, flagging too many observations despite belonging to the right generative process. For these reasons, we believe that model-based methods are still preferable to the MCD when using supported regression models. Additionally, if the presence of multiple outliers is a significant concern, regression methods that are more robust to outliers should be considered---like _t_ regression or quantile regression---as they render their precise identification less critical [@mcelreath2020statistical]. - -## Composite Outlier Score - -The *{performance}* package also offers an alternative, consensus-based approach that combines several methods, based on the assumption that different methods provide different angles of looking at a given problem. By applying a variety of methods, one can hope to "triangulate" the true outliers (those consistently flagged by multiple methods) and thus attempt to minimize false positives. - -In practice, this approach computes a composite outlier score, formed of the average of the binary (0 or 1) classification results of each method. It represents the probability that each observation is classified as an outlier by at least one method. The default decision rule classifies rows with composite outlier scores superior or equal to 0.5 as outlier observations (i.e., that were classified as outliers by at least half of the methods). In *{performance}*'s `check_outliers()`, one can use this approach by including all desired methods in the corresponding argument. - -```{r multimethod, fig.cap = "Visual depiction of outliers using several different statistical outlier detection methods."} -outliers <- check_outliers(model, method = c("zscore_robust", "mcd", "cook")) -which(outliers) -``` - -Outliers (counts or per variables) for individual methods can then be obtained through attributes. For example: - -```{r} -attributes(outliers)$outlier_var$zscore_robust -``` - -An example sentence for reporting the usage of the composite method could be: - -> Based on a composite outlier score [see the 'check_outliers()' function in the 'performance' R package, @ludecke2021performance] obtained via the joint application of multiple outliers detection algorithms [(a) median absolute deviation (MAD)-based robust _z_ scores, @leys2013outliers; (b) Mahalanobis minimum covariance determinant (MCD), @leys2019outliers; and (c) Cook's distance, @cook1977detection], we excluded two participants that were classified as outliers by at least half of the methods used. - -# Handling Outliers - -The above section demonstrated how to identify outliers using the `check_outliers()` function in the *{performance}* package. But what should we do with these outliers once identified? Although it is common to automatically discard any observation that has been marked as "an outlier" as if it might infect the rest of the data with its statistical ailment, we believe that the use of SOD methods is but one step in the get-to-know-your-data pipeline; a researcher or analyst's _domain knowledge_ must be involved in the decision of how to deal with observations marked as outliers by means of SOD. Indeed, automatic tools can help detect outliers, but they are nowhere near perfect. Although they can be useful to flag suspect data, they can have misses and false alarms, and they cannot replace human eyes and proper vigilance from the researcher. If you do end up manually inspecting your data for outliers, it can be helpful to think of outliers as belonging to different types of outliers, or categories, which can help decide what to do with a given outlier. - -## Error, Interesting, and Random Outliers - -@leys2019outliers distinguish between error outliers, interesting outliers, and random outliers. _Error outliers_ are likely due to human error and should be corrected before data analysis or outright removed since they are invalid observations. _Interesting outliers_ are not due to technical error and may be of theoretical interest; it might thus be relevant to investigate them further even though they should be removed from the current analysis of interest. _Random outliers_ are assumed to be due to chance alone and to belong to the correct distribution and, therefore, should be retained. - -It is recommended to _keep_ observations which are expected to be part of the distribution of interest, even if they are outliers [@leys2019outliers]. However, if it is suspected that the outliers belong to an alternative distribution, then those observations could have a large impact on the results and call into question their robustness, especially if significance is conditional on their inclusion, so should be removed. - -We should also keep in mind that there might be error outliers that are not detected by statistical tools, but should nonetheless be found and removed. For example, if we are studying the effects of X on Y among teenagers and we have one observation from a 20-year-old, this observation might not be a _statistical outlier_, but it is an outlier in the _context_ of our research, and should be discarded. We could call these observations *undetected* error outliers, in the sense that although they do not statistically stand out, they do not belong to the theoretical or empirical distribution of interest (e.g., teenagers). In this way, we should not blindly rely on statistical outlier detection methods; doing our due diligence to investigate undetected error outliers relative to our specific research question is also essential for valid inferences. - -## Winsorization - -_Removing_ outliers can in this case be a valid strategy, and ideally one would report results with and without outliers to see the extent of their impact on results. This approach however can reduce statistical power. Therefore, some propose a _recoding_ approach, namely, winsorization: bringing outliers back within acceptable limits [e.g., 3 MADs, @tukey1963less]. However, if possible, it is recommended to collect enough data so that even after removing outliers, there is still sufficient statistical power without having to resort to winsorization [@leys2019outliers]. - -The _easystats_ ecosystem makes it easy to incorporate this step into your workflow through the `winsorize()` function of *{datawizard}*, a lightweight R package to facilitate data wrangling and statistical transformations [@patil2022datawizard]. This procedure will bring back univariate outliers within the limits of 'acceptable' values, based either on the percentile, the _z_ score, or its robust alternative based on the MAD. - -## The Importance of Transparency - -Finally, it is a critical part of a sound outlier treatment that regardless of which SOD method used, it should be reported in a reproducible manner. Ideally, the handling of outliers should be specified *a priori* with as much detail as possible, and preregistered, to limit researchers' degrees of freedom and therefore risks of false positives [@leys2019outliers]. This is especially true given that interesting outliers and random outliers are often times hard to distinguish in practice. Thus, researchers should always prioritize transparency and report all of the following information: (a) how many outliers were identified (including percentage); (b) according to which method and criteria, (c) using which function of which R package (if applicable), and (d) how they were handled (excluded or winsorized, if the latter, using what threshold). If at all possible, (e) the corresponding code script along with the data should be shared on a public repository like the Open Science Framework (OSF), so that the exclusion criteria can be reproduced precisely. - -# References \ No newline at end of file diff --git a/papers/JOSE/paper.bib b/papers/JOSE/paper.bib deleted file mode 100644 index a7cdbb87d..000000000 --- a/papers/JOSE/paper.bib +++ /dev/null @@ -1,162 +0,0 @@ -@article{leys2019outliers, - title = {How to Classify, Detect, and Manage Univariate and Multivariate Outliers, With Emphasis on Pre-Registration},author = {Leys, Christophe and Delacre, Marie and Mora, Youri L. and Lakens, Daniël and Ley, Christophe}, - journal = {International Review of Social Psychology}, - year = {2019}, - doi = {10.5334/irsp.289} -} - -@article{leys2013outliers, - title = {Detecting outliers: Do not use standard deviation around the mean, use absolute deviation around the median}, - author = {Christophe Leys and Christophe Ley and Olivier Klein and Philippe Bernard and Laurent Licata}, - journal = {Journal of Experimental Social Psychology}, - volume = {49}, - number = {4}, - pages = {764-766}, - year = {2013}, - doi = {10.1016/j.jesp.2013.03.013}, - url = {https://doi.org/10.1016/j.jesp.2013.03.013} -} - -@article{leys2018outliers, - title = {Detecting multivariate outliers: Use a robust variant of the Mahalanobis distance}, - journal = {Journal of Experimental Social Psychology}, - volume = {74}, - pages = {150-156}, - year = {2018}, - issn = {0022-1031}, - doi = {10.1016/j.jesp.2017.09.011}, - url = {https://www.sciencedirect.com/science/article/pii/S0022103117302123}, - author = {Christophe Leys and Olivier Klein and Yves Dominicy and Christophe Ley}, -} - -@article{simmons2011false, - author = {Joseph P. Simmons and Leif D. Nelson and Uri Simonsohn}, - title ={False-Positive Psychology: Undisclosed Flexibility in Data Collection and Analysis Allows Presenting Anything as Significant}, - journal = {Psychological Science}, - volume = {22}, - number = {11}, - pages = {1359-1366}, - year = {2011}, - doi = {10.1177/0956797611417632}, - URL = {https://doi.org/10.1177/0956797611417632}, -} - -@software{easystatspackage, - title = {{easystats}: Streamline Model Interpretation, Visualization, and Reporting}, - author = {Daniel Lüdecke and Dominique Makowski and Mattan S. Ben-Shachar and Indrajeet Patil and Brenton M. Wiernik and Etienne Bacher and Rémi Thériault}, - date = {2023-02-04T22:06:06Z}, - origdate = {2019-01-28T10:39:29Z}, - url = {https://easystats.github.io/easystats/} -} - -@Article{ludecke2021performance, - author = {Daniel Lüdecke and Mattan S. Ben-Shachar and Indrajeet Patil and Philip Waggoner and Dominique Makowski}, - title = {{performance}: An {R} package for assessment, comparison and testing of statistical models}, - volume = {6}, - number = {60}, - journal = {Journal of Open Source Software}, - year = {2021}, - pages = {3139}, - doi = {10.21105/joss.03139}, - url = {https://doi.org/10.21105/joss.03139} - } - -@Article{patil2022datawizard, - title = {{datawizard}: An {R} package for easy data preparation and statistical transformations}, - author = {Indrajeet Patil and Dominique Makowski and Mattan S. Ben-Shachar and Brenton M. Wiernik and Etienne Bacher and Daniel Lüdecke}, - journal = {Journal of Open Source Software}, - year = {2022}, - volume = {7}, - number = {78}, - pages = {4684}, - doi = {10.21105/joss.04684}, - } - -@article{cook1977detection, - author = {R. Dennis Cook}, - title = {Detection of Influential Observation in Linear Regression}, - journal = {Technometrics}, - volume = {19}, - number = {1}, - pages = {15-18}, - year = {1977}, - publisher = {Taylor & Francis}, - doi = {10.1080/00401706.1977.10489493} -} - -@book{iglewicz1993outliers, - title = {How to detect and handle outliers (Vol. 16)}, - publisher = {Asq Press}, - author = {Iglewicz, B. and Hoaglin, D. C}, - year = {1993} -} - -@article{gnanadesikan1972robust, - title = {Robust estimates, residuals, and outlier detection with multiresponse data}, - author = {Gnanadesikan, R. and Kettenring, J. R}, - doi = {10.2307/2528963}, - journal = {Biometrics}, - pages = {81-124}, - year = {1972} -} - -@article{hubert2018mcd, - author = {Hubert, Mia and Debruyne, Michiel and Rousseeuw, Peter J.}, - title = {Minimum covariance determinant and extensions}, - journal = {Wiley Interdisciplinary Reviews: Computational Statistics}, - volume = {10}, - number = {3}, - pages = {e1421}, - doi = {10.1002/wics.1421}, - url = {https://doi.org/10.1002/wics.1421}, - year = {2018} -} - -@article{tukey1963less, - title={Less vulnerable confidence and significance procedures for location based on a single sample: Trimming/Winsorization 1}, - author={Tukey, John W and McLaughlin, Donald H}, - journal={Sankhy{\=a}: The Indian Journal of Statistics, Series A}, - pages={331--352}, - year={1963}, - publisher={JSTOR} -} - -@article{van1995statistical, - title={Statistical mimicking of reaction time data: Single-process models, parameter variability, and mixtures}, - author={Van Zandt, Trisha and Ratcliff, Roger}, - journal={Psychonomic Bulletin \& Review}, - volume={2}, - number={1}, - pages={20--54}, - year={1995}, - publisher={Springer}, - doi = {10.3758/BF03214411} -} - -@article{ratcliff1993methods, - title={Methods for dealing with reaction time outliers.}, - author={Ratcliff, Roger}, - journal={Psychological bulletin}, - volume={114}, - number={3}, - pages={510}, - year={1993}, - publisher={American Psychological Association}, - doi = {10.1037/0033-2909.114.3.510} -} - -@book{mcelreath2020statistical, - title={Statistical rethinking: A Bayesian course with examples in {R} and Stan}, - author={McElreath, Richard}, - year={2020}, - publisher={CRC press} -} - -@Manual{rcore, - title = {{R}: A Language and Environment for Statistical Computing}, - author = {{R Core Team}}, - organization = {R Foundation for Statistical Computing}, - address = {Vienna, Austria}, - year = {2021}, - url = {https://www.R-project.org/} -} \ No newline at end of file diff --git a/papers/JOSE/paper.log b/papers/JOSE/paper.log deleted file mode 100644 index 6147576d4..000000000 --- a/papers/JOSE/paper.log +++ /dev/null @@ -1,1133 +0,0 @@ -This is XeTeX, Version 3.141592653-2.6-0.999995 (TeX Live 2023) (preloaded format=xelatex 2023.10.4) 5 OCT 2023 12:10 -entering extended mode - restricted \write18 enabled. - %&-line parsing enabled. -**paper.tex -(./paper.tex -LaTeX2e <2023-06-01> patch level 1 -L3 programming layer <2023-08-29> -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/base/article.cls -Document Class: article 2023/05/17 v1.4n Standard LaTeX document class -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/base/size10.clo -File: size10.clo 2023/05/17 v1.4n Standard LaTeX file (size option) -) -\c@part=\count181 -\c@section=\count182 -\c@subsection=\count183 -\c@subsubsection=\count184 -\c@paragraph=\count185 -\c@subparagraph=\count186 -\c@figure=\count187 -\c@table=\count188 -\abovecaptionskip=\skip48 -\belowcaptionskip=\skip49 -\bibindent=\dimen140 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/marginnote/marginnote.sty -Package: marginnote 2018/08/09 1.4b non floating margin notes for LaTeX -\c@mn@abspage=\count189 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/graphics/graphicx.sty -Package: graphicx 2021/09/16 v1.2d Enhanced LaTeX Graphics (DPC,SPQR) -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/graphics/keyval.sty -Package: keyval 2022/05/29 v1.15 key=value parser (DPC) -\KV@toks@=\toks17 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/graphics/graphics.sty -Package: graphics 2022/03/10 v1.4e Standard LaTeX Graphics (DPC,SPQR) -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/graphics/trig.sty -Package: trig 2021/08/11 v1.11 sin cos tan (DPC) -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/graphics-cfg/graphics.cfg -File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration -) -Package graphics Info: Driver file: xetex.def on input line 107. -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/graphics-def/xetex.def -File: xetex.def 2022/09/22 v5.0n Graphics/color driver for xetex -)) -\Gin@req@height=\dimen141 -\Gin@req@width=\dimen142 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/xcolor/xcolor.sty -Package: xcolor 2022/06/12 v2.14 LaTeX color extensions (UK) -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/graphics-cfg/color.cfg -File: color.cfg 2016/01/02 v1.6 sample color configuration -) -Package xcolor Info: Driver file: xetex.def on input line 227. -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/graphics/mathcolor.ltx) -Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1353. -Package xcolor Info: Model `RGB' extended on input line 1369. -Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1371. -Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1372. -Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1373. -Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1374. -Package xcolor Info: Model `Gray' substituted by `gray' on input line 1375. -Package xcolor Info: Model `wave' substituted by `hsb' on input line 1376. -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/preprint/authblk.sty -Package: authblk 2001/02/27 1.3 (PWD) -\affilsep=\skip50 -\@affilsep=\skip51 -\c@Maxaffil=\count190 -\c@authors=\count191 -\c@affil=\count192 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/etoolbox/etoolbox.sty -Package: etoolbox 2020/10/05 v2.5k e-TeX tools for LaTeX (JAW) -\etb@tempcnta=\count193 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/titlesec/titlesec.sty -Package: titlesec 2021/07/05 v2.14 Sectioning titles -\ttl@box=\box51 -\beforetitleunit=\skip52 -\aftertitleunit=\skip53 -\ttl@plus=\dimen143 -\ttl@minus=\dimen144 -\ttl@toksa=\toks18 -\titlewidth=\dimen145 -\titlewidthlast=\dimen146 -\titlewidthfirst=\dimen147 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/tools/calc.sty -Package: calc 2017/05/25 v4.3 Infix arithmetic (KKT,FJ) -\calc@Acount=\count194 -\calc@Bcount=\count195 -\calc@Adimen=\dimen148 -\calc@Bdimen=\dimen149 -\calc@Askip=\skip54 -\calc@Bskip=\skip55 -LaTeX Info: Redefining \setlength on input line 80. -LaTeX Info: Redefining \addtolength on input line 81. -\calc@Ccount=\count196 -\calc@Cskip=\skip56 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/pgf/frontendlayer/tikz.sty (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex -\pgfutil@everybye=\toks19 -\pgfutil@tempdima=\dimen150 -\pgfutil@tempdimb=\dimen151 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def -\pgfutil@abb=\box52 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/pgf.revision.tex) -Package: pgfrcs 2023-01-15 v3.1.10 (3.1.10) -)) -Package: pgf 2023-01-15 v3.1.10 (3.1.10) -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex -Package: pgfsys 2023-01-15 v3.1.10 (3.1.10) -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex -\pgfkeys@pathtoks=\toks20 -\pgfkeys@temptoks=\toks21 -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/utilities/pgfkeyslibraryfiltered.code.tex -\pgfkeys@tmptoks=\toks22 -)) -\pgf@x=\dimen152 -\pgf@y=\dimen153 -\pgf@xa=\dimen154 -\pgf@ya=\dimen155 -\pgf@xb=\dimen156 -\pgf@yb=\dimen157 -\pgf@xc=\dimen158 -\pgf@yc=\dimen159 -\pgf@xd=\dimen160 -\pgf@yd=\dimen161 -\w@pgf@writea=\write3 -\r@pgf@reada=\read2 -\c@pgf@counta=\count197 -\c@pgf@countb=\count198 -\c@pgf@countc=\count199 -\c@pgf@countd=\count266 -\t@pgf@toka=\toks23 -\t@pgf@tokb=\toks24 -\t@pgf@tokc=\toks25 -\pgf@sys@id@count=\count267 -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg -File: pgf.cfg 2023-01-15 v3.1.10 (3.1.10) -) -Driver file for pgf: pgfsys-xetex.def -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-xetex.def -File: pgfsys-xetex.def 2023-01-15 v3.1.10 (3.1.10) -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.def -File: pgfsys-dvipdfmx.def 2023-01-15 v3.1.10 (3.1.10) -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def -File: pgfsys-common-pdf.def 2023-01-15 v3.1.10 (3.1.10) -) -\pgfsys@objnum=\count268 -))) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex -File: pgfsyssoftpath.code.tex 2023-01-15 v3.1.10 (3.1.10) -\pgfsyssoftpath@smallbuffer@items=\count269 -\pgfsyssoftpath@bigbuffer@items=\count270 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex -File: pgfsysprotocol.code.tex 2023-01-15 v3.1.10 (3.1.10) -)) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex -Package: pgfcore 2023-01-15 v3.1.10 (3.1.10) -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex -\pgfmath@dimen=\dimen162 -\pgfmath@count=\count271 -\pgfmath@box=\box53 -\pgfmath@toks=\toks26 -\pgfmath@stack@operand=\toks27 -\pgfmath@stack@operation=\toks28 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code.tex) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonometric.code.tex) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerarithmetics.code.tex) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex -\c@pgfmathroundto@lastzeros=\count272 -)) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/math/pgfint.code.tex) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex -File: pgfcorepoints.code.tex 2023-01-15 v3.1.10 (3.1.10) -\pgf@picminx=\dimen163 -\pgf@picmaxx=\dimen164 -\pgf@picminy=\dimen165 -\pgf@picmaxy=\dimen166 -\pgf@pathminx=\dimen167 -\pgf@pathmaxx=\dimen168 -\pgf@pathminy=\dimen169 -\pgf@pathmaxy=\dimen170 -\pgf@xx=\dimen171 -\pgf@xy=\dimen172 -\pgf@yx=\dimen173 -\pgf@yy=\dimen174 -\pgf@zx=\dimen175 -\pgf@zy=\dimen176 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex -File: pgfcorepathconstruct.code.tex 2023-01-15 v3.1.10 (3.1.10) -\pgf@path@lastx=\dimen177 -\pgf@path@lasty=\dimen178 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex -File: pgfcorepathusage.code.tex 2023-01-15 v3.1.10 (3.1.10) -\pgf@shorten@end@additional=\dimen179 -\pgf@shorten@start@additional=\dimen180 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex -File: pgfcorescopes.code.tex 2023-01-15 v3.1.10 (3.1.10) -\pgfpic=\box54 -\pgf@hbox=\box55 -\pgf@layerbox@main=\box56 -\pgf@picture@serial@count=\count273 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex -File: pgfcoregraphicstate.code.tex 2023-01-15 v3.1.10 (3.1.10) -\pgflinewidth=\dimen181 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex -File: pgfcoretransformations.code.tex 2023-01-15 v3.1.10 (3.1.10) -\pgf@pt@x=\dimen182 -\pgf@pt@y=\dimen183 -\pgf@pt@temp=\dimen184 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex -File: pgfcorequick.code.tex 2023-01-15 v3.1.10 (3.1.10) -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex -File: pgfcoreobjects.code.tex 2023-01-15 v3.1.10 (3.1.10) -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex -File: pgfcorepathprocessing.code.tex 2023-01-15 v3.1.10 (3.1.10) -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex -File: pgfcorearrows.code.tex 2023-01-15 v3.1.10 (3.1.10) -\pgfarrowsep=\dimen185 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex -File: pgfcoreshade.code.tex 2023-01-15 v3.1.10 (3.1.10) -\pgf@max=\dimen186 -\pgf@sys@shading@range@num=\count274 -\pgf@shadingcount=\count275 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex -File: pgfcoreimage.code.tex 2023-01-15 v3.1.10 (3.1.10) -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex -File: pgfcoreexternal.code.tex 2023-01-15 v3.1.10 (3.1.10) -\pgfexternal@startupbox=\box57 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex -File: pgfcorelayers.code.tex 2023-01-15 v3.1.10 (3.1.10) -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex -File: pgfcoretransparency.code.tex 2023-01-15 v3.1.10 (3.1.10) -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex -File: pgfcorepatterns.code.tex 2023-01-15 v3.1.10 (3.1.10) -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/basiclayer/pgfcorerdf.code.tex -File: pgfcorerdf.code.tex 2023-01-15 v3.1.10 (3.1.10) -))) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex -File: pgfmoduleshapes.code.tex 2023-01-15 v3.1.10 (3.1.10) -\pgfnodeparttextbox=\box58 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.tex -File: pgfmoduleplot.code.tex 2023-01-15 v3.1.10 (3.1.10) -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65.sty -Package: pgfcomp-version-0-65 2023-01-15 v3.1.10 (3.1.10) -\pgf@nodesepstart=\dimen187 -\pgf@nodesepend=\dimen188 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18.sty -Package: pgfcomp-version-1-18 2023-01-15 v3.1.10 (3.1.10) -)) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/pgf/utilities/pgffor.sty (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/pgf/utilities/pgfkeys.sty (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex)) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/pgf/math/pgfmath.sty (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex)) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex -Package: pgffor 2023-01-15 v3.1.10 (3.1.10) -\pgffor@iter=\dimen189 -\pgffor@skip=\dimen190 -\pgffor@stack=\toks29 -\pgffor@toks=\toks30 -)) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex -Package: tikz 2023-01-15 v3.1.10 (3.1.10) -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothandlers.code.tex -File: pgflibraryplothandlers.code.tex 2023-01-15 v3.1.10 (3.1.10) -\pgf@plot@mark@count=\count276 -\pgfplotmarksize=\dimen191 -) -\tikz@lastx=\dimen192 -\tikz@lasty=\dimen193 -\tikz@lastxsaved=\dimen194 -\tikz@lastysaved=\dimen195 -\tikz@lastmovetox=\dimen196 -\tikz@lastmovetoy=\dimen197 -\tikzleveldistance=\dimen198 -\tikzsiblingdistance=\dimen199 -\tikz@figbox=\box59 -\tikz@figbox@bg=\box60 -\tikz@tempbox=\box61 -\tikz@tempbox@bg=\box62 -\tikztreelevel=\count277 -\tikznumberofchildren=\count278 -\tikznumberofcurrentchild=\count279 -\tikz@fig@count=\count280 -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex -File: pgfmodulematrix.code.tex 2023-01-15 v3.1.10 (3.1.10) -\pgfmatrixcurrentrow=\count281 -\pgfmatrixcurrentcolumn=\count282 -\pgf@matrix@numberofcolumns=\count283 -) -\tikz@expandcount=\count284 -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex -File: tikzlibrarytopaths.code.tex 2023-01-15 v3.1.10 (3.1.10) -))) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/hyperref/hyperref.sty -Package: hyperref 2023-07-08 v7.01b Hypertext links for LaTeX -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty -Package: ltxcmds 2020-05-10 v1.25 LaTeX kernel commands for general use (HO) -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/iftex/iftex.sty -Package: iftex 2022/02/03 v1.0f TeX engine tests -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty -Package: pdftexcmds 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO) -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/infwarerr/infwarerr.sty -Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO) -) -Package pdftexcmds Info: \pdf@primitive is available. -Package pdftexcmds Info: \pdf@ifprimitive is available. -Package pdftexcmds Info: \pdfdraftmode not found. -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/kvsetkeys/kvsetkeys.sty -Package: kvsetkeys 2022-10-05 v1.19 Key value parser (HO) -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/kvdefinekeys/kvdefinekeys.sty -Package: kvdefinekeys 2019-12-19 v1.6 Define keys (HO) -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/pdfescape/pdfescape.sty -Package: pdfescape 2019/12/09 v1.15 Implements pdfTeX's escape features (HO) -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/hycolor/hycolor.sty -Package: hycolor 2020-01-27 v1.10 Color options for hyperref/bookmark (HO) -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/letltxmacro/letltxmacro.sty -Package: letltxmacro 2019/12/03 v1.6 Let assignment for LaTeX macros (HO) -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/auxhook/auxhook.sty -Package: auxhook 2019-12-17 v1.6 Hooks for auxiliary files (HO) -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/hyperref/nameref.sty -Package: nameref 2023-08-07 v2.53 Cross-referencing by name of section -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/refcount/refcount.sty -Package: refcount 2019/12/15 v3.6 Data extraction from label references (HO) -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/gettitlestring/gettitlestring.sty -Package: gettitlestring 2019/12/15 v1.6 Cleanup title references (HO) -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/kvoptions/kvoptions.sty -Package: kvoptions 2022-06-15 v3.15 Key value format for package options (HO) -)) -\c@section@level=\count285 -) -\@linkdim=\dimen256 -\Hy@linkcounter=\count286 -\Hy@pagecounter=\count287 -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/hyperref/pd1enc.def -File: pd1enc.def 2023-07-08 v7.01b Hyperref: PDFDocEncoding definition (HO) -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/intcalc/intcalc.sty -Package: intcalc 2019/12/15 v1.3 Expandable calculations with integers (HO) -) -\Hy@SavedSpaceFactor=\count288 -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/hyperref/puenc.def -File: puenc.def 2023-07-08 v7.01b Hyperref: PDF Unicode definition (HO) -) -Package hyperref Info: Hyper figures OFF on input line 4167. -Package hyperref Info: Link nesting OFF on input line 4172. -Package hyperref Info: Hyper index ON on input line 4175. -Package hyperref Info: Plain pages OFF on input line 4182. -Package hyperref Info: Backreferencing OFF on input line 4187. -Package hyperref Info: Implicit mode ON; LaTeX internals redefined. -Package hyperref Info: Bookmarks ON on input line 4434. -\c@Hy@tempcnt=\count289 -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/url/url.sty -\Urlmuskip=\muskip16 -Package: url 2013/09/16 ver 3.4 Verb mode for urls, etc. -) -LaTeX Info: Redefining \url on input line 4772. -\XeTeXLinkMargin=\dimen257 -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/bitset/bitset.sty -Package: bitset 2019/12/09 v1.3 Handle bit-vector datatype (HO) -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/bigintcalc/bigintcalc.sty -Package: bigintcalc 2019/12/15 v1.5 Expandable calculations on big integers (HO) -)) -\Fld@menulength=\count290 -\Field@Width=\dimen258 -\Fld@charsize=\dimen259 -Package hyperref Info: Hyper figures OFF on input line 6051. -Package hyperref Info: Link nesting OFF on input line 6056. -Package hyperref Info: Hyper index ON on input line 6059. -Package hyperref Info: backreferencing OFF on input line 6066. -Package hyperref Info: Link coloring OFF on input line 6071. -Package hyperref Info: Link coloring with OCG OFF on input line 6076. -Package hyperref Info: PDF/A mode OFF on input line 6081. -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/base/atbegshi-ltx.sty -Package: atbegshi-ltx 2021/01/10 v1.0c Emulation of the original atbegshi -package with kernel methods -) -\Hy@abspage=\count291 -\c@Item=\count292 -\c@Hfootnote=\count293 -) -Package hyperref Info: Driver (autodetected): hxetex. -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/hyperref/hxetex.def -File: hxetex.def 2023-07-08 v7.01b Hyperref driver for XeTeX -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/stringenc/stringenc.sty -Package: stringenc 2019/11/29 v1.12 Convert strings between diff. encodings (HO) -) -\pdfm@box=\box63 -\c@Hy@AnnotLevel=\count294 -\HyField@AnnotCount=\count295 -\Fld@listcount=\count296 -\c@bookmark@seq@number=\count297 -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/rerunfilecheck/rerunfilecheck.sty -Package: rerunfilecheck 2022-07-10 v1.10 Rerun checks for auxiliary files (HO) -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/base/atveryend-ltx.sty -Package: atveryend-ltx 2020/08/19 v1.0a Emulation of the original atveryend package -with kernel methods -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/uniquecounter/uniquecounter.sty -Package: uniquecounter 2019/12/15 v1.4 Provide unlimited unique counter (HO) -) -Package uniquecounter Info: New unique counter `rerunfilecheck' on input line 285. -) -\Hy@SectionHShift=\skip57 -) -Package hyperref Info: Option `colorlinks' set `true' on input line 12. -Package hyperref Info: Option `breaklinks' set `true' on input line 12. -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/caption/caption.sty -Package: caption 2023/08/05 v3.6o Customizing captions (AR) -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/caption/caption3.sty -Package: caption3 2023/07/31 v2.4d caption3 kernel (AR) -\caption@tempdima=\dimen260 -\captionmargin=\dimen261 -\caption@leftmargin=\dimen262 -\caption@rightmargin=\dimen263 -\caption@width=\dimen264 -\caption@indent=\dimen265 -\caption@parindent=\dimen266 -\caption@hangindent=\dimen267 -Package caption Info: Standard document class detected. -) -\c@caption@flags=\count298 -\c@continuedfloat=\count299 -Package caption Info: hyperref package is loaded. -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty -Package: tcolorbox 2023/09/26 version 6.1.0 text color boxes -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/tools/verbatim.sty -Package: verbatim 2022-07-02 v1.5u LaTeX2e package for verbatim enhancements -\every@verbatim=\toks31 -\verbatim@line=\toks32 -\verbatim@in@stream=\read3 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/environ/environ.sty -Package: environ 2014/05/04 v0.3 A new way to define environments -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/trimspaces/trimspaces.sty -Package: trimspaces 2009/09/17 v1.1 Trim spaces around a token list -) -\@envbody=\toks33 -) -\tcb@titlebox=\box64 -\tcb@upperbox=\box65 -\tcb@lowerbox=\box66 -\tcb@phantombox=\box67 -\c@tcbbreakpart=\count300 -\c@tcblayer=\count301 -\c@tcolorbox@number=\count302 -\tcb@temp=\box68 -\tcb@temp=\box69 -\tcb@temp=\box70 -\tcb@temp=\box71 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/amsfonts/amssymb.sty -Package: amssymb 2013/01/14 v3.01 AMS font symbols -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/amsfonts/amsfonts.sty -Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support -\@emptytoks=\toks34 -\symAMSa=\mathgroup4 -\symAMSb=\mathgroup5 -LaTeX Font Info: Redeclaring math symbol \hbar on input line 98. -LaTeX Font Info: Overwriting math alphabet `\mathfrak' in version `bold' -(Font) U/euf/m/n --> U/euf/b/n on input line 106. -)) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/amsmath/amsmath.sty -Package: amsmath 2023/05/13 v2.17o AMS math features -\@mathmargin=\skip58 -For additional information on amsmath, use the `?' option. -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/amsmath/amstext.sty -Package: amstext 2021/08/26 v2.01 AMS text -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/amsmath/amsgen.sty -File: amsgen.sty 1999/11/30 v2.0 generic functions -\@emptytoks=\toks35 -\ex@=\dimen268 -)) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/amsmath/amsbsy.sty -Package: amsbsy 1999/11/29 v1.2d Bold Symbols -\pmbraise@=\dimen269 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/amsmath/amsopn.sty -Package: amsopn 2022/04/08 v2.04 operator names -) -\inf@bad=\count303 -LaTeX Info: Redefining \frac on input line 234. -\uproot@=\count304 -\leftroot@=\count305 -LaTeX Info: Redefining \overline on input line 399. -LaTeX Info: Redefining \colon on input line 410. -\classnum@=\count306 -\DOTSCASE@=\count307 -LaTeX Info: Redefining \ldots on input line 496. -LaTeX Info: Redefining \dots on input line 499. -LaTeX Info: Redefining \cdots on input line 620. -\Mathstrutbox@=\box72 -\strutbox@=\box73 -LaTeX Info: Redefining \big on input line 722. -LaTeX Info: Redefining \Big on input line 723. -LaTeX Info: Redefining \bigg on input line 724. -LaTeX Info: Redefining \Bigg on input line 725. -\big@size=\dimen270 -LaTeX Font Info: Redeclaring font encoding OML on input line 743. -LaTeX Font Info: Redeclaring font encoding OMS on input line 744. -\macc@depth=\count308 -LaTeX Info: Redefining \bmod on input line 905. -LaTeX Info: Redefining \pmod on input line 910. -LaTeX Info: Redefining \smash on input line 940. -LaTeX Info: Redefining \relbar on input line 970. -LaTeX Info: Redefining \Relbar on input line 971. -\c@MaxMatrixCols=\count309 -\dotsspace@=\muskip17 -\c@parentequation=\count310 -\dspbrk@lvl=\count311 -\tag@help=\toks36 -\row@=\count312 -\column@=\count313 -\maxfields@=\count314 -\andhelp@=\toks37 -\eqnshift@=\dimen271 -\alignsep@=\dimen272 -\tagshift@=\dimen273 -\tagwidth@=\dimen274 -\totwidth@=\dimen275 -\lineht@=\dimen276 -\@envbody=\toks38 -\multlinegap=\skip59 -\multlinetaggap=\skip60 -\mathdisplay@stack=\toks39 -LaTeX Info: Redefining \[ on input line 2953. -LaTeX Info: Redefining \] on input line 2954. -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/iftex/ifxetex.sty -Package: ifxetex 2019/10/25 v0.7 ifxetex legacy package. Use iftex instead. -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/iftex/ifluatex.sty -Package: ifluatex 2019/10/25 v1.5 ifluatex legacy package. Use iftex instead. -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/seqsplit/seqsplit.sty -Package: seqsplit 2006/08/07 v0.1 Splitting long sequences (DNA, RNA, proteins, etc.) -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/base/fixltx2e.sty -Package: fixltx2e 2016/12/29 v2.1a fixes to LaTeX (obsolete) -Applying: [2015/01/01] Old fixltx2e package on input line 46. - -Package fixltx2e Warning: fixltx2e is not required with releases after 2015 -(fixltx2e) All fixes are now in the LaTeX kernel. -(fixltx2e) See the latexrelease package for details. - -Already applied: [0000/00/00] Old fixltx2e package on input line 53. -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/biblatex/biblatex.sty -Package: biblatex 2023/03/05 v3.19 programmable bibliographies (PK/MW) -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/logreq/logreq.sty -Package: logreq 2010/08/04 v1.0 xml request logger -\lrq@indent=\count315 -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/logreq/logreq.def -File: logreq.def 2010/08/04 v1.0 logreq spec v1.0 -)) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/base/ifthen.sty -Package: ifthen 2022/04/13 v1.1d Standard LaTeX ifthen package (DPC) -) -\c@tabx@nest=\count316 -\c@listtotal=\count317 -\c@listcount=\count318 -\c@liststart=\count319 -\c@liststop=\count320 -\c@citecount=\count321 -\c@citetotal=\count322 -\c@multicitecount=\count323 -\c@multicitetotal=\count324 -\c@instcount=\count325 -\c@maxnames=\count326 -\c@minnames=\count327 -\c@maxitems=\count328 -\c@minitems=\count329 -\c@citecounter=\count330 -\c@maxcitecounter=\count331 -\c@savedcitecounter=\count332 -\c@uniquelist=\count333 -\c@uniquename=\count334 -\c@refsection=\count335 -\c@refsegment=\count336 -\c@maxextratitle=\count337 -\c@maxextratitleyear=\count338 -\c@maxextraname=\count339 -\c@maxextradate=\count340 -\c@maxextraalpha=\count341 -\c@abbrvpenalty=\count342 -\c@highnamepenalty=\count343 -\c@lownamepenalty=\count344 -\c@maxparens=\count345 -\c@parenlevel=\count346 -\blx@tempcnta=\count347 -\blx@tempcntb=\count348 -\blx@tempcntc=\count349 -\c@blx@maxsection=\count350 -\blx@maxsegment@0=\count351 -\blx@notetype=\count352 -\blx@parenlevel@text=\count353 -\blx@parenlevel@foot=\count354 -\blx@sectionciteorder@0=\count355 -\blx@sectionciteorderinternal@0=\count356 -\blx@entrysetcounter=\count357 -\blx@biblioinstance=\count358 -\labelnumberwidth=\skip61 -\labelalphawidth=\skip62 -\biblabelsep=\skip63 -\bibitemsep=\skip64 -\bibnamesep=\skip65 -\bibinitsep=\skip66 -\bibparsep=\skip67 -\bibhang=\skip68 -\blx@bcfin=\read4 -\blx@bcfout=\write4 -\blx@langwohyphens=\language3 -\c@mincomprange=\count359 -\c@maxcomprange=\count360 -\c@mincompwidth=\count361 -Package biblatex Info: Trying to load biblatex default data model... -Package biblatex Info: ... file 'blx-dm.def' found. -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/biblatex/blx-dm.def -File: blx-dm.def 2023/03/05 v3.19 biblatex localization (PK/MW) -) -Package biblatex Info: Trying to load biblatex custom data model... -Package biblatex Info: ... file 'biblatex-dm.cfg' not found. -\c@afterword=\count362 -\c@savedafterword=\count363 -\c@annotator=\count364 -\c@savedannotator=\count365 -\c@author=\count366 -\c@savedauthor=\count367 -\c@bookauthor=\count368 -\c@savedbookauthor=\count369 -\c@commentator=\count370 -\c@savedcommentator=\count371 -\c@editor=\count372 -\c@savededitor=\count373 -\c@editora=\count374 -\c@savededitora=\count375 -\c@editorb=\count376 -\c@savededitorb=\count377 -\c@editorc=\count378 -\c@savededitorc=\count379 -\c@foreword=\count380 -\c@savedforeword=\count381 -\c@holder=\count382 -\c@savedholder=\count383 -\c@introduction=\count384 -\c@savedintroduction=\count385 -\c@namea=\count386 -\c@savednamea=\count387 -\c@nameb=\count388 -\c@savednameb=\count389 -\c@namec=\count390 -\c@savednamec=\count391 -\c@translator=\count392 -\c@savedtranslator=\count393 -\c@shortauthor=\count394 -\c@savedshortauthor=\count395 -\c@shorteditor=\count396 -\c@savedshorteditor=\count397 -\c@labelname=\count398 -\c@savedlabelname=\count399 -\c@institution=\count400 -\c@savedinstitution=\count401 -\c@lista=\count402 -\c@savedlista=\count403 -\c@listb=\count404 -\c@savedlistb=\count405 -\c@listc=\count406 -\c@savedlistc=\count407 -\c@listd=\count408 -\c@savedlistd=\count409 -\c@liste=\count410 -\c@savedliste=\count411 -\c@listf=\count412 -\c@savedlistf=\count413 -\c@location=\count414 -\c@savedlocation=\count415 -\c@organization=\count416 -\c@savedorganization=\count417 -\c@origlocation=\count418 -\c@savedoriglocation=\count419 -\c@origpublisher=\count420 -\c@savedorigpublisher=\count421 -\c@publisher=\count422 -\c@savedpublisher=\count423 -\c@language=\count424 -\c@savedlanguage=\count425 -\c@origlanguage=\count426 -\c@savedoriglanguage=\count427 -\c@pageref=\count428 -\c@savedpageref=\count429 -\shorthandwidth=\skip69 -\shortjournalwidth=\skip70 -\shortserieswidth=\skip71 -\shorttitlewidth=\skip72 -\shortauthorwidth=\skip73 -\shorteditorwidth=\skip74 -\locallabelnumberwidth=\skip75 -\locallabelalphawidth=\skip76 -\localshorthandwidth=\skip77 -\localshortjournalwidth=\skip78 -\localshortserieswidth=\skip79 -\localshorttitlewidth=\skip80 -\localshortauthorwidth=\skip81 -\localshorteditorwidth=\skip82 -Package biblatex Info: Trying to load enhanced support for Unicode engines... -Package biblatex Info: ... file 'blx-unicode.def' found. -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/biblatex/blx-unicode.def) -Package biblatex Info: Trying to load compatibility code... -Package biblatex Info: ... file 'blx-compat.def' found. -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/biblatex/blx-compat.def -File: blx-compat.def 2023/03/05 v3.19 biblatex compatibility (PK/MW) -) -Package biblatex Info: Trying to load generic definitions... -Package biblatex Info: ... file 'biblatex.def' found. -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/biblatex/biblatex.def -File: biblatex.def 2023/03/05 v3.19 biblatex compatibility (PK/MW) -\c@textcitecount=\count430 -\c@textcitetotal=\count431 -\c@textcitemaxnames=\count432 -\c@biburlbigbreakpenalty=\count433 -\c@biburlbreakpenalty=\count434 -\c@biburlnumpenalty=\count435 -\c@biburlucpenalty=\count436 -\c@biburllcpenalty=\count437 -\biburlbigskip=\muskip18 -\biburlnumskip=\muskip19 -\biburlucskip=\muskip20 -\biburllcskip=\muskip21 -\c@smartand=\count438 -) -Package biblatex Info: Trying to load bibliography style 'numeric'... -Package biblatex Info: ... file 'numeric.bbx' found. -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/biblatex/bbx/numeric.bbx -File: numeric.bbx 2023/03/05 v3.19 biblatex bibliography style (PK/MW) -Package biblatex Info: Trying to load bibliography style 'standard'... -Package biblatex Info: ... file 'standard.bbx' found. -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/biblatex/bbx/standard.bbx -File: standard.bbx 2023/03/05 v3.19 biblatex bibliography style (PK/MW) -\c@bbx:relatedcount=\count439 -\c@bbx:relatedtotal=\count440 -)) -Package biblatex Info: Trying to load citation style 'numeric'... -Package biblatex Info: ... file 'numeric.cbx' found. -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/biblatex/cbx/numeric.cbx -File: numeric.cbx 2023/03/05 v3.19 biblatex citation style (PK/MW) -Package biblatex Info: Redefining '\cite'. -Package biblatex Info: Redefining '\parencite'. -Package biblatex Info: Redefining '\footcite'. -Package biblatex Info: Redefining '\footcitetext'. -Package biblatex Info: Redefining '\smartcite'. -Package biblatex Info: Redefining '\supercite'. -Package biblatex Info: Redefining '\textcite'. -Package biblatex Info: Redefining '\textcites'. -Package biblatex Info: Redefining '\cites'. -Package biblatex Info: Redefining '\parencites'. -Package biblatex Info: Redefining '\smartcites'. -) -Package biblatex Info: Trying to load configuration file... -Package biblatex Info: ... file 'biblatex.cfg' found. -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/biblatex/biblatex.cfg -File: biblatex.cfg -) -Package biblatex Info: XeTeX detected. -(biblatex) Assuming input encoding 'utf8'. -Package biblatex Info: Document encoding is UTF8 .... -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/l3kernel/expl3.sty -Package: expl3 2023-08-29 L3 programming layer (loader) -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/l3backend/l3backend-xetex.def -File: l3backend-xetex.def 2023-04-19 L3 backend support: XeTeX -\g__graphics_track_int=\count441 -\l__pdf_internal_box=\box74 -\g__pdf_backend_object_int=\count442 -\g__pdf_backend_annotation_int=\count443 -\g__pdf_backend_link_int=\count444 -)) -Package biblatex Info: ... and expl3 -(biblatex) 2023-08-29 L3 programming layer (loader) -(biblatex) is new enough (at least 2020/04/06), -(biblatex) setting 'casechanger=expl3'. -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/biblatex/blx-case-expl3.sty (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/l3packages/xparse/xparse.sty -Package: xparse 2023-08-29 L3 Experimental document command parser -) -Package: blx-case-expl3 2023/03/05 v3.19 expl3 case changing code for biblatex -)) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/geometry/geometry.sty -Package: geometry 2020/01/02 v5.9 Page Geometry -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/iftex/ifvtex.sty -Package: ifvtex 2019/10/25 v1.7 ifvtex legacy package. Use iftex instead. -) -\Gm@cnth=\count445 -\Gm@cntv=\count446 -\c@Gm@tempcnt=\count447 -\Gm@bindingoffset=\dimen277 -\Gm@wd@mp=\dimen278 -\Gm@odd@mp=\dimen279 -\Gm@even@mp=\dimen280 -\Gm@layoutwidth=\dimen281 -\Gm@layoutheight=\dimen282 -\Gm@layouthoffset=\dimen283 -\Gm@layoutvoffset=\dimen284 -\Gm@dimlist=\toks40 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty -Package: fancyhdr 2022/11/09 v4.1 Extensive control of page headers and footers -\f@nch@headwidth=\skip83 -\f@nch@O@elh=\skip84 -\f@nch@O@erh=\skip85 -\f@nch@O@olh=\skip86 -\f@nch@O@orh=\skip87 -\f@nch@O@elf=\skip88 -\f@nch@O@erf=\skip89 -\f@nch@O@olf=\skip90 -\f@nch@O@orf=\skip91 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/xelatex/mathspec/mathspec.sty -Package: mathspec 2016/12/22 v0.2b LaTeX Package (Mathematics font selection for XeLaTeX) -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/fontspec/fontspec.sty -Package: fontspec 2022/01/15 v2.8a Font selection for XeLaTeX and LuaLaTeX -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty -Package: fontspec-xetex 2022/01/15 v2.8a Font selection for XeLaTeX and LuaLaTeX -\l__fontspec_script_int=\count448 -\l__fontspec_language_int=\count449 -\l__fontspec_strnum_int=\count450 -\l__fontspec_tmp_int=\count451 -\l__fontspec_tmpa_int=\count452 -\l__fontspec_tmpb_int=\count453 -\l__fontspec_tmpc_int=\count454 -\l__fontspec_em_int=\count455 -\l__fontspec_emdef_int=\count456 -\l__fontspec_strong_int=\count457 -\l__fontspec_strongdef_int=\count458 -\l__fontspec_tmpa_dim=\dimen285 -\l__fontspec_tmpb_dim=\dimen286 -\l__fontspec_tmpc_dim=\dimen287 -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/base/fontenc.sty -Package: fontenc 2021/04/29 v2.0v Standard LaTeX package -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/xkeyval/xkeyval.sty -Package: xkeyval 2022/06/16 v2.9 package option processing (HA) -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/xkeyval/xkeyval.tex (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/xkeyval/xkvutils.tex -\XKV@toks=\toks41 -\XKV@tempa@toks=\toks42 -) -\XKV@depth=\count459 -File: xkeyval.tex 2014/12/03 v2.7a key=value parser (HA) -)) -\c@eu@=\count460 -\c@eu@i=\count461 -\c@mkern=\count462 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/microtype/microtype.sty -Package: microtype 2023/03/13 v3.1a Micro-typographical refinements (RS) -\MT@toks=\toks43 -\MT@tempbox=\box75 -\MT@count=\count463 -LaTeX Info: Redefining \noprotrusionifhmode on input line 1059. -LaTeX Info: Redefining \leftprotrusion on input line 1060. -\MT@prot@toks=\toks44 -LaTeX Info: Redefining \rightprotrusion on input line 1078. -LaTeX Info: Redefining \textls on input line 1368. -\MT@outer@kern=\dimen288 -LaTeX Info: Redefining \textmicrotypecontext on input line 1988. -\MT@listname@count=\count464 -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/microtype/microtype-xetex.def -File: microtype-xetex.def 2023/03/13 v3.1a Definitions specific to xetex (RS) -LaTeX Info: Redefining \lsstyle on input line 238. -) -Package microtype Info: Loading configuration file microtype.cfg. -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/microtype/microtype.cfg -File: microtype.cfg 2023/03/13 v3.1a microtype main configuration file (RS) -)) -Package hyperref Info: Option `unicode' set `true' on input line 154. -Package hyperref Info: Option `breaklinks' set `true' on input line 154. -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/grffile/grffile.sty -Package: grffile 2019/11/11 v2.1 Extended file name support for graphics (legacy) -Package grffile Info: This package is an empty stub for compatibility on input line 40. -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/parskip/parskip.sty -Package: parskip 2021-03-14 v2.0h non-zero parskip adjustments -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty -Package: fancyvrb 2023/01/19 4.5a verbatim text (tvz,hv) -\FV@CodeLineNo=\count465 -\FV@InFile=\read5 -\FV@TabBox=\box76 -\c@FancyVerbLine=\count466 -\FV@StepNumber=\count467 -\FV@OutFile=\write5 -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/framed/framed.sty -Package: framed 2011/10/22 v 0.96: framed or shaded text with page breaks -\OuterFrameSep=\skip92 -\fb@frw=\dimen289 -\fb@frh=\dimen290 -\FrameRule=\dimen291 -\FrameSep=\dimen292 -) -\cslhangindent=\skip93 -\csllabelwidth=\skip94 -\cslentryspacingunit=\skip95 -\@quotelevel=\count468 -\@quotereset=\count469 -(./paper.aux) -\openout1 = `paper.aux'. - -LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 284. -LaTeX Font Info: ... okay on input line 284. -LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 284. -LaTeX Font Info: ... okay on input line 284. -LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 284. -LaTeX Font Info: ... okay on input line 284. -LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 284. -LaTeX Font Info: ... okay on input line 284. -LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 284. -LaTeX Font Info: Trying to load font information for TS1+cmr on input line 284. -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/base/ts1cmr.fd -File: ts1cmr.fd 2023/04/13 v2.5m Standard LaTeX font definitions -) -LaTeX Font Info: ... okay on input line 284. -LaTeX Font Info: Checking defaults for TU/lmr/m/n on input line 284. -LaTeX Font Info: ... okay on input line 284. -LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 284. -LaTeX Font Info: ... okay on input line 284. -LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 284. -LaTeX Font Info: ... okay on input line 284. -LaTeX Font Info: Checking defaults for PD1/pdf/m/n on input line 284. -LaTeX Font Info: ... okay on input line 284. -LaTeX Font Info: Checking defaults for PU/pdf/m/n on input line 284. -LaTeX Font Info: ... okay on input line 284. -Package hyperref Info: Link coloring ON on input line 284. -(./paper.out) (./paper.out) -\@outlinefile=\write6 -\openout6 = `paper.out'. - -Package caption Info: Begin \AtBeginDocument code. -Package caption Info: End \AtBeginDocument code. -Package biblatex Info: Trying to load language 'english'... -Package biblatex Info: ... file 'english.lbx' found. -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/biblatex/lbx/english.lbx -File: english.lbx 2023/03/05 v3.19 biblatex localization (PK/MW) -) -Package biblatex Info: XeTeX detected. -(biblatex) Assuming input encoding 'utf8'. -Package biblatex Info: Automatic encoding selection. -(biblatex) Assuming data encoding 'utf8'. -\openout4 = `paper.bcf'. - -Package biblatex Info: Trying to load bibliographic data... -Package biblatex Info: ... file 'paper.bbl' not found. -No file paper.bbl. -Package biblatex Info: Reference section=0 on input line 284. -Package biblatex Info: Reference segment=0 on input line 284. -*geometry* driver: auto-detecting -*geometry* detected driver: xetex -*geometry* verbose mode - [ preamble ] result: -* driver: xetex -* paper: a4paper -* layout: -* layoutoffset:(h,v)=(0.0pt,0.0pt) -* modes: includemp -* h-part:(L,W,R)=(28.45274pt, 526.376pt, 42.67912pt) -* v-part:(T,H,B)=(99.58464pt, 660.10394pt, 85.35826pt) -* \paperwidth=597.50787pt -* \paperheight=845.04684pt -* \textwidth=387.33861pt -* \textheight=660.10394pt -* \oddsidemargin=95.22015pt -* \evensidemargin=95.22015pt -* \topmargin=-60.28131pt -* \headheight=62.59596pt -* \headsep=25.0pt -* \topskip=10.0pt -* \footskip=30.0pt -* \marginparwidth=128.0374pt -* \marginparsep=11.0pt -* \columnsep=10.0pt -* \skip\footins=9.0pt plus 4.0pt minus 2.0pt -* \hoffset=0.0pt -* \voffset=0.0pt -* \mag=1000 -* \@twocolumnfalse -* \@twosidefalse -* \@mparswitchfalse -* \@reversemargintrue -* (1in=72.27pt=25.4mm, 1cm=28.453pt) - -LaTeX Info: Redefining \microtypecontext on input line 284. -Package microtype Info: Applying patch `item' on input line 284. -Package microtype Info: Applying patch `toc' on input line 284. -Package microtype Info: Applying patch `eqnum' on input line 284. -Package microtype Info: Applying patch `footnote' on input line 284. -Package microtype Info: Applying patch `verbatim' on input line 284. -Package microtype Info: Character protrusion enabled (level 2). -Package microtype Info: Using protrusion set `basicmath'. -Package microtype Info: No adjustment of tracking. -Package microtype Info: No adjustment of spacing. -Package microtype Info: No adjustment of kerning. -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/microtype/mt-LatinModernRoman.cfg -File: mt-LatinModernRoman.cfg 2021/02/21 v1.1 microtype config. file: Latin Modern Roman (RS) -) -LaTeX Font Info: Font shape `TU/lmss/m/it' in size <17.28> not available -(Font) Font shape `TU/lmss/m/sl' tried instead on input line 285. -Package microtype Info: Loading generic protrusion settings for font family -(microtype) `lmss' (encoding: TU). -(microtype) For optimal results, create family-specific settings. -(microtype) See the microtype manual for details. -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/microtype/mt-cmr.cfg -File: mt-cmr.cfg 2013/05/19 v2.2 microtype config. file: Computer Modern Roman (RS) -) -LaTeX Font Info: Trying to load font information for U+msa on input line 285. -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/amsfonts/umsa.fd -File: umsa.fd 2013/01/14 v3.01 AMS symbols A -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/microtype/mt-msa.cfg -File: mt-msa.cfg 2006/02/04 v1.1 microtype config. file: AMS symbols (a) (RS) -) -LaTeX Font Info: Trying to load font information for U+msb on input line 285. -(c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/amsfonts/umsb.fd -File: umsb.fd 2013/01/14 v3.01 AMS symbols B -) (c:/Users/rempsyc/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/microtype/mt-msb.cfg -File: mt-msb.cfg 2005/06/01 v1.0 microtype config. file: AMS symbols (b) (RS) -) - -Package hyperref Warning: Suppressing link with empty target on input line 311. - - -Package hyperref Warning: Suppressing link with empty target on input line 311. - - -Package hyperref Warning: Suppressing link with empty target on input line 311. - -File: D:/Rpackages/rticles/rmarkdown/templates/joss/resources/JOSE-logo.png Graphic file (type bmp) - - -Package fancyhdr Warning: \headheight is too small (62.59596pt): -(fancyhdr) Make it at least 64.31554pt, for example: -(fancyhdr) \setlength{\headheight}{64.31554pt}. -(fancyhdr) You might also make \topmargin smaller to compensate: -(fancyhdr) \addtolength{\topmargin}{-1.71957pt}. - -LaTeX Font Info: Font shape `TU/lmss/m/it' in size <8> not available -(Font) Font shape `TU/lmss/m/sl' tried instead on input line 376. -[1 - -] -File: D:/Rpackages/rticles/rmarkdown/templates/joss/resources/JOSE-logo.png Graphic file (type bmp) - - -Package fancyhdr Warning: \headheight is too small (62.59596pt): -(fancyhdr) Make it at least 64.31554pt, for example: -(fancyhdr) \setlength{\headheight}{64.31554pt}. -(fancyhdr) You might also make \topmargin smaller to compensate: -(fancyhdr) \addtolength{\topmargin}{-1.71957pt}. - -[2] -LaTeX Font Info: Font shape `TU/lmtt/bx/n' in size <10> not available -(Font) Font shape `TU/lmtt/b/n' tried instead on input line 466. - -Overfull \hbox (32.66139pt too wide) in paragraph at lines 482--482 -[]\TU/lmtt/m/n/10 #> -----------------------------------------------------------------------------[] - [] - - -Overfull \hbox (32.66139pt too wide) in paragraph at lines 491--491 -[]\TU/lmtt/m/n/10 #> -----------------------------------------------------------------------------[] - [] - -File: D:/Rpackages/rticles/rmarkdown/templates/joss/resources/JOSE-logo.png Graphic file (type bmp) - - -Package fancyhdr Warning: \headheight is too small (62.59596pt): -(fancyhdr) Make it at least 64.31554pt, for example: -(fancyhdr) \setlength{\headheight}{64.31554pt}. -(fancyhdr) You might also make \topmargin smaller to compensate: -(fancyhdr) \addtolength{\topmargin}{-1.71957pt}. - -[3] -File: D:/Rpackages/rticles/rmarkdown/templates/joss/resources/JOSE-logo.png Graphic file (type bmp) - - -Package fancyhdr Warning: \headheight is too small (62.59596pt): -(fancyhdr) Make it at least 64.31554pt, for example: -(fancyhdr) \setlength{\headheight}{64.31554pt}. -(fancyhdr) You might also make \topmargin smaller to compensate: -(fancyhdr) \addtolength{\topmargin}{-1.71957pt}. - -[4] -File: table1.jpg Graphic file (type bmp) - -File: D:/Rpackages/rticles/rmarkdown/templates/joss/resources/JOSE-logo.png Graphic file (type bmp) - - -Package fancyhdr Warning: \headheight is too small (62.59596pt): -(fancyhdr) Make it at least 64.31554pt, for example: -(fancyhdr) \setlength{\headheight}{64.31554pt}. -(fancyhdr) You might also make \topmargin smaller to compensate: -(fancyhdr) \addtolength{\topmargin}{-1.71957pt}. - -[5] -File: paper_files/figure-latex/model_fig-1.pdf Graphic file (type pdf) - -File: D:/Rpackages/rticles/rmarkdown/templates/joss/resources/JOSE-logo.png Graphic file (type bmp) - - -Package fancyhdr Warning: \headheight is too small (62.59596pt): -(fancyhdr) Make it at least 64.31554pt, for example: -(fancyhdr) \setlength{\headheight}{64.31554pt}. -(fancyhdr) You might also make \topmargin smaller to compensate: -(fancyhdr) \addtolength{\topmargin}{-1.71957pt}. - -[6] -File: D:/Rpackages/rticles/rmarkdown/templates/joss/resources/JOSE-logo.png Graphic file (type bmp) - - -Package fancyhdr Warning: \headheight is too small (62.59596pt): -(fancyhdr) Make it at least 64.31554pt, for example: -(fancyhdr) \setlength{\headheight}{64.31554pt}. -(fancyhdr) You might also make \topmargin smaller to compensate: -(fancyhdr) \addtolength{\topmargin}{-1.71957pt}. - -[7] -File: D:/Rpackages/rticles/rmarkdown/templates/joss/resources/JOSE-logo.png Graphic file (type bmp) - - -Package fancyhdr Warning: \headheight is too small (62.59596pt): -(fancyhdr) Make it at least 64.31554pt, for example: -(fancyhdr) \setlength{\headheight}{64.31554pt}. -(fancyhdr) You might also make \topmargin smaller to compensate: -(fancyhdr) \addtolength{\topmargin}{-1.71957pt}. - -[8] -Underfull \hbox (badness 1584) in paragraph at lines 928--934 -[]\TU/lmr/m/n/10 Simmons, J. P., Nelson, L. D., & Simonsohn, U. (2011). False-positive psy- - [] - - -Underfull \hbox (badness 3049) in paragraph at lines 928--934 -\TU/lmr/m/n/10 chology: Undisclosed flexibility in data collection and analysis allows pre- - [] - - -Underfull \hbox (badness 3735) in paragraph at lines 928--934 -\TU/lmr/m/n/10 senting anything as significant. \TU/lmr/m/it/10 Psychological Science\TU/lmr/m/n/10 , \TU/lmr/m/it/10 22\TU/lmr/m/n/10 (11), 1359–1366. - [] - -File: D:/Rpackages/rticles/rmarkdown/templates/joss/resources/JOSE-logo.png Graphic file (type bmp) - - -Package fancyhdr Warning: \headheight is too small (62.59596pt): -(fancyhdr) Make it at least 64.31554pt, for example: -(fancyhdr) \setlength{\headheight}{64.31554pt}. -(fancyhdr) You might also make \topmargin smaller to compensate: -(fancyhdr) \addtolength{\topmargin}{-1.71957pt}. - -[9] (./paper.aux) - *********** -LaTeX2e <2023-06-01> patch level 1 -L3 programming layer <2023-08-29> - *********** -Package rerunfilecheck Info: File `paper.out' has not changed. -(rerunfilecheck) Checksum: 18F584A1BC96404D165BE4F0A067B822;2146. -Package logreq Info: Writing requests to 'paper.run.xml'. -\openout1 = `paper.run.xml'. - - ) -Here is how much of TeX's memory you used: - 36640 strings out of 477589 - 751637 string characters out of 5817003 - 1940416 words of memory out of 5000000 - 57291 multiletter control sequences out of 15000+600000 - 564989 words of font info for 90 fonts, out of 8000000 for 9000 - 14 hyphenation exceptions out of 8191 - 84i,12n,87p,1194b,850s stack positions out of 10000i,1000n,20000p,200000b,200000s - -Output written on paper.pdf (9 pages). diff --git a/papers/JOSE/paper.pdf b/papers/JOSE/paper.pdf deleted file mode 100644 index b886b69e7..000000000 Binary files a/papers/JOSE/paper.pdf and /dev/null differ diff --git a/papers/JOSE/paper_files/figure-latex/model_fig-1.pdf b/papers/JOSE/paper_files/figure-latex/model_fig-1.pdf deleted file mode 100644 index 26d212b03..000000000 Binary files a/papers/JOSE/paper_files/figure-latex/model_fig-1.pdf and /dev/null differ diff --git a/papers/JOSE/apa.csl b/papers/preprint/apa.csl similarity index 100% rename from papers/JOSE/apa.csl rename to papers/preprint/apa.csl diff --git a/papers/JOSE/arxiv.sty b/papers/preprint/arxiv.sty similarity index 100% rename from papers/JOSE/arxiv.sty rename to papers/preprint/arxiv.sty diff --git a/papers/preprint/bst/sn-apacite.bst b/papers/preprint/bst/sn-apacite.bst new file mode 100644 index 000000000..be1dc5309 --- /dev/null +++ b/papers/preprint/bst/sn-apacite.bst @@ -0,0 +1,5364 @@ +%% +%% This is file `apacite.bst', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% apacite.dtx (with options: `bibstyle') +%% +%% This is a generated file. +%% +%% Copyright (C) 1994-2013 Erik Meijer and any individual authors listed +%% elsewhere in this file. +%% +%% This file is part of the `apacite' package. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% The `apacite' package consists of the files apacite.dtx and +%% apacite.ins, and the following generated files: +%% apacite.sty, apacdoc.sty, apacite.drv, +%% apacite.bst, apacitex.bst, apacann.bst, apacannx.bst, +%% apa5ex.bib, apacxmpl.tex, +%% english.apc, dutch.apc, finnish.apc, french.apc, +%% german.apc, ngerman.apc, greek.apc, norsk.apc, +%% spanish.apc, swedish.apc. +%% +%% This work has the LPPL maintenance status `maintained' +%% +%% The Current Maintainer of this work is Erik Meijer +%% +%% This file may only be distributed together with a copy of the +%% source files of the apacite package, i.e., apacite.dtx and +%% apacite.ins. You may however distribute the apacite package without +%% the generated files. +%% +%% apacite.bst +%% [2013/07/21 v6.03 APA bibliography style] +%% apacite.bst : reference list according to APA manual +%% Written by Erik Meijer + +FUNCTION {identify.apacite.version} +{ % Put identifying string in the .blg file + "apacite.bst" + " [2013/07/21 v6.03 APA bibliography style]" + * top$ +} +ENTRY + { address + annote + annotate + author + booktitle + chair + chapter + day + doi + edition + editor + englishtitle + firstkey + howpublished + institution + journal + key + keywords + lastchecked + month + nihms + note + number + organization + originaladdress + originalbooktitle + originaledition + originaleditor + originaljournal + originalnumber + originalpages + originalpublisher + originalvolume + originalyear + pages + pmcid + publisher + school + series + symposium + text + title + translator + type + url + urldate + volume + year + eprint + archive + archivePrefix + primaryClass + eid + adsurl + adsnote + version + } + { cite.order %% order of first citation + title.number %% for sorting titles + cite.initials %% dummy (0-1) indicating whether or not + %% initials of the 1st author must + %% be used for citing + cite.num.names.full %% number of names to be cited for full and + cite.num.names.short %% short cite + add.to.year %% For a, b, c, etc. after year + %% in multiple citations with same author-year + } + { year.label %% For sorting entries by year + author.year.sort.label %% For sorting entries and checking whether + %% initials should be added, how many authors + %% should be cited and whether a, b, etc. + %% after year is necessary + title.sort.label %% for sorting titles + citeorder.sort.label %% for sorting by citation order + type.2 %% Replacement for type with misc entries and + %% entries that revert to misc. + } +INTEGERS { len pos name.max old.number numnames numnames.old + nameptr lastname format.num.names cite.initials.old + cite.num.names.old add.to.year.old forward + multiresult dot brace.level + } + +STRINGS { s t u old.label field + aut1f aut1s aut1f.old aut1s.old + aut2 aut2.old + aut3 aut3.old + aut4 aut4.old + aut5 aut5.old + aut6 aut6.old + year.label.old + } +FUNCTION {test} { #0 } +FUNCTION {dump.stack} +{ "---- STACK {" cite$ * "} ----" * top$ + stack$ + "---- END STACK {" cite$ * "} ----" * top$ +} +FUNCTION {make.index} { #0 } +FUNCTION {unsorted} { #0 } +MACRO {jan} {"{\APACmonth{01}}"} +MACRO {feb} {"{\APACmonth{02}}"} +MACRO {mar} {"{\APACmonth{03}}"} +MACRO {apr} {"{\APACmonth{04}}"} +MACRO {may} {"{\APACmonth{05}}"} +MACRO {jun} {"{\APACmonth{06}}"} +MACRO {jul} {"{\APACmonth{07}}"} +MACRO {aug} {"{\APACmonth{08}}"} +MACRO {sep} {"{\APACmonth{09}}"} +MACRO {oct} {"{\APACmonth{10}}"} +MACRO {nov} {"{\APACmonth{11}}"} +MACRO {dec} {"{\APACmonth{12}}"} +MACRO {winter} {"{\APACmonth{13}}"} +MACRO {spring} {"{\APACmonth{14}}"} +MACRO {summer} {"{\APACmonth{15}}"} +MACRO {fall} {"{\APACmonth{16}}"} +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % issues warning if field is empty + % call with + % "field" field warning.if.empty + % Note that the first field must be between quotes + % because it is the fieldname for use in the warning message. + % +FUNCTION {warning.if.empty} +{ empty$ + { "No " swap$ * " in " * cite$ * warning$ } + { pop$ } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % issues warning if title, type, and howpublished are empty + % +FUNCTION {check.relevant.fields} +{ title empty$ + type empty$ and + howpublished empty$ and + { "No title, type, and howpublished in " cite$ * warning$ } + 'skip$ + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % delivers 1 if (both editor and translator + % not empty and not equal to each other) + % 0 if (editor or translator empty) or + % (editor = translator) + % +FUNCTION {editor.ne.trans} +{ translator empty$ + { #0 } + { editor empty$ + { #0 } + { translator editor = + { #0 } + { #1 } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {conv.int.to.str} +{ duplicate$ #10 < + { "0000" swap$ int.to.str$ * } + { duplicate$ #100 < + { "000" swap$ int.to.str$ * } + { duplicate$ #1000 < + { "00" swap$ int.to.str$ * } + { duplicate$ #10000 < + { "0" swap$ int.to.str$ * } + { int.to.str$ } + if$ + } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {ref.type} +{ type$ "article" = + type$ "magazine" = + type$ "newspaper" = + type$ "book" = + type$ "techreport" = + type$ "unpublished" = + type$ "misc" = + type$ "booklet" = + type$ "manual" = + type$ "proceedings" = + or + or + or + or + or + or + or + or + or + { #1 } + { type$ "incollection" = + type$ "phdthesis" = + type$ "mastersthesis" = + type$ "lecture" = + type$ "inbook" = + type$ "inproceedings" = + type$ "conference" = + type$ "intechreport" = + or + or + or + or + or + or + or + { #2 } + { type$ "literal" = + { #3 } + { #0 } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {is.atype} +{ type$ "article" = + type$ "magazine" = + type$ "newspaper" = + type$ "incollection" = + type$ "inbook" = + type$ "inproceedings" = + type$ "conference" = + type$ "intechreport" = + type$ "manual" = + or + or + or + or + or + or + or + or + { #1 } + { journal empty$ not + % + type$ "phdthesis" = + type$ "mastersthesis" = + or + % + and + { #1 } + { type$ "misc" = + type empty$ not and + { type "\bibmessage" = + type "\bibcomputerprogram" = + type "\bibcomputerprogrammanual" = + type "\bibcomputerprogramandmanual" = + type "\bibcomputersoftware" = + type "\bibcomputersoftwaremanual" = + type "\bibcomputersoftwareandmanual" = + type "\bibprogramminglanguage" = + or + or + or + or + or + or + or + { #1 } + { #0 } + if$ + } + { #0 } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % connects two strings with connect string + % if one of them empty, then connect string + % is left out + % + % call with S1 S2 connectstring connect.check + % +FUNCTION {connect.check} +{ 'u := + % + % if S2 = "" + % + duplicate$ empty$ + % + % then remove S2 + % + { pop$ + % + % S1 is on top of stack. + % if it is empty, it is replaced by the empty string "" + % + duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ + } + % + % else swap S1 and S2 so that S1 can be checked + % + { swap$ + % + % if S1 is empty, remove S1 so that S2 is left on the + % stack and is the result is given + % + duplicate$ empty$ + { pop$ } + % + % now the real work starts: + % push the connect string "C" + % so that top of stack is "C" "S1" "S2" + % concatenate, so that top of stack is + % "S1+C" "S2" + % + { u * + % + % swap and concatenate + % + swap$ * + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % connects two strings with space ("\ ") + % if length of second is 4 or larger, + % connects them with non-breaking space ("tie", "~") + % if length of second smaller than 4 + % + % call with S1 S2 tie.or.space.connect + % result: "S1\ S2" or "S1~S2" + % +FUNCTION {tie.or.space.connect} +{ duplicate$ text.length$ #4 < + { "~" } + { "\ " } + if$ + swap$ * * +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % connects two strings with comma (", ") + % if one of them is empty, the comma is left out + % + % call with S1 S2 connect.with.comma.check + % result: "S1, S2" + % +FUNCTION {connect.with.comma.check} +{ ", " connect.check } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % connects two strings with semicolon ("; ") + % if one of them is empty, semicolon is left out + % + % call with S1 S2 connect.with.semicolon.check + % result: "S1; S2" + % +FUNCTION {connect.with.semicolon.check} +{ "; " connect.check } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % connects two strings with colon (": ") + % if one of them is empty, colon is left out + % + % call with S1 S2 connect.with.colon.check + % result: "S1: S2" + % +FUNCTION {connect.with.colon.check} +{ ": " connect.check } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % connects two strings with space ("\ ") + % + % call with S1 S2 connect.with.space.check + % result: "S1\ S2" + % +FUNCTION {connect.with.space.check} +{ "\ " connect.check } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % encloses string in pre- and postfix string + % call with + % prefix postfix S enclose.check + % delivers empty string if S empty + % +FUNCTION {enclose.check} +{ duplicate$ empty$ + { pop$ pop$ pop$ + "" + } + { swap$ * * } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % emphasizes top of stack + % call with + % "string" emphasize.check + % +FUNCTION {emphasize.check} +{ "\Bem{" swap$ + "}" swap$ + enclose.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % brackets top of stack + % call with + % "string" bracket + % +FUNCTION {bracket.check} +{ "[" swap$ + "]" swap$ + enclose.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % parenthesizes top of stack + % call with + % "string" parenthesize + % +FUNCTION {parenthesize.check} +{ "(" swap$ + ")" swap$ + enclose.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % checks whether argument is "multiresult": + % whether it contains '-', '+', or ',' characters + % used with pages to check whether pp. or p. must be used + % +FUNCTION {multi.result.check} +{ 't := + #0 'multiresult := + % + % while (not multiresult) and (length(t) > 1) do + % + { multiresult not + t text.length$ #1 > + and + } + % + % if t(1-2) = "--" or t(1) = "+" or "," + % then multiresult = 1 + % else t = t(2-last) + % + { t #1 #2 substring$ 's := + "--" s = + { #1 'multiresult := } + { t #1 #1 substring$ 's := + "+" s = + "," s = + or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + if$ + } + while$ + multiresult +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % Checks whether an author is a corporate author, i.e., + % whether the field starts with "{\bibcorporate". + % Call with + % field is.bibcorporate + % +FUNCTION {is.bibcorporate} +{ #1 #14 substring$ "{\bibcorporate" = } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {remove.spaces} +{ % Remove spaces from string. + % Works best if string only contains alphanumeric characters and spaces. + 's := % The original string + s text.length$ 'len := % Its length (no. of characters) + "" 't := % Initialize the transformed string + #0 'pos := + % + % while (pos < len) do + % + { pos len < } + { pos #1 + 'pos := + s pos #1 substring$ 'u := + % + % u is the pos-th character in s + % If it is a space, move to next character, + % else copy character to output. + % + u " " = + 'skip$ + { t u * 't := } + if$ + } + while$ + % + % Now push the result back on the stack + t +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % end block by writing what's left on the stack and + % starting a new line + % +FUNCTION {output.end.block} +{ write$ + newline$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % end block by adding a period and writing what's left + % on the stack and starting a new line + % +FUNCTION {output.dot.end.block} +{ add.period$ + output.end.block +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % starting new block by writing what's left on the stack, + % starting a new line and adding some extra space or + % whatever is more defined in \newblock + % +FUNCTION {output.new.block} +{ output.end.block + "\newblock" write$ newline$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % starting new block by writing what's left on the stack, + % starting a new line and adding some extra space or + % whatever is more defined in \newblock + % +FUNCTION {output.dot.new.block} +{ add.period$ + output.new.block +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {start.new.block} +{ "\unskip\ " write$ newline$ + "\newblock " write$ newline$ +} + +FUNCTION {sort.name.format.classic} { "{ll{}}{ f{}}{ vv{}}{ jj{}}" } + +FUNCTION {cite.name.format.classic} { "{ll}" } + +FUNCTION {author.name.format.classic} { "{ll}{, f{.}.}{ vv}{, jj}" } + +FUNCTION {index.name.format.classic} { "{ll}{, f{.}.}{ vv}{, jj}" } + +FUNCTION {sort.name.format} { "{vv{}}{ll{}}{ f{}}{ jj{}}" } + +FUNCTION {cite.name.format} { "{vv }{ll}" } + +FUNCTION {cite.initials.name.format} { "{f{.}.~~}{vv }{ll}{ jj}" } + +FUNCTION {author.name.format} { "{vv }{ll}{, f{.}.}{, jj}" } + +FUNCTION {editor.name.format} { "{f{.}.~~}{vv }{ll}{ jj}" } + +FUNCTION {index.name.format} { "{vv }{ll}{, f{.}.}{, jj}" } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {init.initials} +{ "yyyyy" 'aut1f.old := + "yyyyy" 'aut1s.old := + #0 'cite.initials.old := +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {update.no.initials} +{ 'field := + field 'aut1f.old := + field 'aut1s.old := + #0 'cite.initials.old := +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {check.add.initials.aut} +{ % + % If last name is equal to previous last name + % but initials are different, then initials should + % be cited. If initials are also the same, initials + % should be cited if that is the case for the previous + % author . + % + aut1s aut1s.old = + { aut1f aut1f.old = + { cite.initials.old 'cite.initials := } + { #1 'cite.initials := + aut1f 'aut1f.old := + aut1s 'aut1s.old := + cite.initials 'cite.initials.old := + } + if$ + } + { % + % Different last name. + aut1f 'aut1f.old := + aut1s 'aut1s.old := + cite.initials 'cite.initials.old := + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {check.add.initials.field} +{ 'field := + field #1 cite.initials.name.format format.name$ 'aut1f := + field #1 cite.name.format format.name$ 'aut1s := + % + % Now do the actual work + % + check.add.initials.aut +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {check.add.initials} +{ % + % Check whether author or editor or other field acts as author. + % Initials are only relevant with author or editor. + % + firstkey empty$ not + { key empty$ not + { % + % Both key and firstkey are nonempty. + % Then, key is treated as last name of first author, + % and firstkey is treated as last name + initials of + % first author . + % + firstkey sortify remove.spaces 'aut1f := + key sortify remove.spaces 'aut1s := + check.add.initials.aut + } + { firstkey sortify remove.spaces update.no.initials } + if$ + } + { key empty$ not + { key sortify remove.spaces update.no.initials } + { % + % No key or firstkey, so find out which field + % to use as author. + % + % Check reference type: + % if result is 1 then possibly editor acts as author + % 2 then editor does not act as author + % 3 then key should have been used + % 0 then unknown reference type + ref.type #2 = + { % + % Format first author with and without initials + author empty$ + { title.sort.label update.no.initials } + { author check.add.initials.field } + if$ + } + { % + % Format first author with and without initials + author empty$ + { editor empty$ + { title.sort.label update.no.initials } + { editor check.add.initials.field } + if$ + } + { author check.add.initials.field } + if$ + } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {tentative.cite.num.names.field} +{ 'field := + field num.names$ 'numnames := + numnames #3 < + { % + % 1 or 2 names: always cite all of them. + numnames 'cite.num.names.full := + numnames 'cite.num.names.short := + } + { numnames #6 < + { % + % 3-5 names: cite all of them the first time, + % only the first name later times + numnames 'cite.num.names.full := + #1 'cite.num.names.short := + } + { % + % 6 or more names: cite only the first name + #1 'cite.num.names.full := + #1 'cite.num.names.short := + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {tentative.cite.num.names} +{ % + % Check whether author or editor or other field acts as author. + % Number of names is only relevant with author or editor. + % + firstkey empty$ not + { + #1 'cite.num.names.full := + #1 'cite.num.names.short := + } + { key empty$ not + { + #1 'cite.num.names.full := + #1 'cite.num.names.short := + } + { % + % No key or firstkey, so find out which field + % to use as author. + % + % Check reference type: + % if result is 1 then possibly editor acts as author + % 2 then editor does not act as author + % 3 then key should have been used + % 0 then unknown reference type + ref.type #2 = + { % + % Format first author with and without initials + author empty$ + { + #1 'cite.num.names.full := + #1 'cite.num.names.short := + } + { author tentative.cite.num.names.field } + if$ + } + { % + % Format first author with and without initials + author empty$ + { editor empty$ + { + #1 'cite.num.names.full := + #1 'cite.num.names.short := + } + { editor tentative.cite.num.names.field } + if$ + } + { author tentative.cite.num.names.field } + if$ + } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {init.cite.num.names} +{ #0 'cite.num.names.old := + #0 'numnames.old := + "yyyy" 'year.label.old := + #0 'add.to.year.old := + "" 'aut1f.old := + "" 'aut2.old := + "" 'aut3.old := + "" 'aut4.old := + "" 'aut5.old := + "" 'aut6.old := +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {update.cite.num.names} +{ cite.num.names.short 'cite.num.names.old := + numnames 'numnames.old := + year.label 'year.label.old := + add.to.year 'add.to.year.old := + aut1f 'aut1f.old := + aut2 'aut2.old := + aut3 'aut3.old := + aut4 'aut4.old := + aut5 'aut5.old := + aut6 'aut6.old := +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.6.authors} +{ % + % First author: with initials. + % + field #1 cite.initials.name.format format.name$ 'aut1f := + % + % Second and later authors: without initials. + % + numnames #1 > + name.max #1 > + and + { % + % 2nd author + field #2 cite.name.format format.name$ 'aut2 := + % + numnames #2 > + name.max #2 > + and + { % + % 3nd author + field #3 cite.name.format format.name$ 'aut3 := + % + numnames #3 > + name.max #3 > + and + { % + % 4th author + field #4 cite.name.format format.name$ 'aut4 := + % + numnames #4 > + name.max #4 > + and + { % + % 5th author + field #5 cite.name.format format.name$ 'aut5 := + % + numnames #5 > + name.max #5 > + and + { % + % 6th author + field #6 cite.name.format format.name$ 'aut6 := + } + { % + % 5 authors: 6 is empty + % + "" 'aut6 := + } + if$ + } + { % + % 4 authors: 5-6 are empty + % + "" 'aut5 := + "" 'aut6 := + } + if$ + } + { % + % 3 authors: 4-6 are empty + % + "" 'aut4 := + "" 'aut5 := + "" 'aut6 := + } + if$ + } + { % + % 2 authors: 3-6 are empty + % + "" 'aut3 := + "" 'aut4 := + "" 'aut5 := + "" 'aut6 := + } + if$ + } + { % + % Only 1 author: 2-6 are empty + % + "" 'aut2 := + "" 'aut3 := + "" 'aut4 := + "" 'aut5 := + "" 'aut6 := + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {change.add.to.year} +{ + forward #1 = + { % + % Moving forward: this add.to.year number must be 1 higher than + % previous. + % + add.to.year.old #0 > + { add.to.year.old #1 + 'add.to.year := } + { #2 'add.to.year := } + if$ + } + { % + % Moving backward: this add.to.year number must be 1 lower than + % previous. + % + add.to.year.old #1 - 'add.to.year := + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {definitive.cite.num.names.1.or.2} +{ % + numnames numnames.old = + { % + % Same number of names: ambiguity could arise. Check whether current + % and previous have the same author(s). + % + aut1f aut1f.old = + { % + % Same first author: if the second author is also the same or if + % there is only one author, a's and b's should be added. + % + aut2 aut2.old = + numnames #2 = + and + % + numnames #1 = + or + { % + % Same author(s): add to year. + % + change.add.to.year + } + { % + % Different second author: no ambiguity possible. + % + skip$ + } + if$ + } + { % + % Different first author: no ambiguity possible. + % + skip$ + } + if$ + } + { % + % Different number of names: no ambiguity possible. + % + skip$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {definitive.cite.num.names.3.or.more} +{ % + % Check whether current and previous have the same first author. + % + aut1f aut1f.old = + { % + % Same first author: check second author + % + aut2 aut2.old = + { % + % Same 1st & 2nd author: check 3rd. + % + aut3 aut3.old = + { % + % Same 1st-3rd authors: check 4th. + % + numnames.old #3 = + { numnames #3 = + { % + % Both current and previous have 3 authors, which are + % the same, so both have identical author-year + % combinations, so ambiguity should be resolved by + % a's and b's. Check whether more authors were + % necessary for previous one. + % + change.add.to.year + cite.num.names.short cite.num.names.old < + { cite.num.names.old + 'cite.num.names.short := + } + 'skip$ + if$ + } + { % + % Previous has 3 authors, current has more, with same + % first 3, so at least 4 must be used for current to + % make a difference. + % + cite.num.names.short #4 < + { #4 'cite.num.names.short := } + 'skip$ + if$ + } + if$ + } + { numnames #3 = + { % + % Current has 3 authors, previous has more, with same + % first 3, so all 3 of current must be used. + % + numnames 'cite.num.names.short := + } + { % + % Same 1st-3rd author and both current and previous + % have at least 4 authors: check 4th. + % + aut4 aut4.old = + { % + % Same 1st-4th authors: check 5th. + % + numnames.old #4 = + { numnames #4 = + { % + % Both current and previous have 4 authors, + % which are the same, so both have + % identical author-year combinations, so + % ambiguity should be resolved by a's and + % b's. Check whether more authors were + % necessary for previous one. + % + change.add.to.year + cite.num.names.short cite.num.names.old < + { cite.num.names.old + 'cite.num.names.short := + } + 'skip$ + if$ + } + { % + % Previous has 4 authors, current has more, + % with same first 4, so at least 5 must be + % used for current to make a difference. + % + cite.num.names.short #5 < + { #5 'cite.num.names.short := } + 'skip$ + if$ + } + if$ + } + { numnames #4 = + { % + % Current has 4 authors, previous has more, + % with same first 4, so all 4 of current + % must be used. + % + numnames 'cite.num.names.short := + } + { % + % Same 1st-4th author and both current and + % previous have at least 5 authors: check + % 5th. + % + aut5 aut5.old = + { % + % Same 1st-5th authors: check 6th. + % + numnames.old #5 = + { numnames #5 = + { % + % Both current and previous + % have 5 authors, which are the + % same, so both have identical + % author-year combinations, so + % ambiguity should be resolved + % by a's and b's. Check whether + % more authors were necessary + % for previous one. + % + change.add.to.year + cite.num.names.short + cite.num.names.old < + { cite.num.names.old + 'cite.num.names.short := + } + 'skip$ + if$ + } + { % + % Previous has 5 authors, + % current has more, with same + % first 5, so at least 6 must + % be used for current to make + % a difference. + % + cite.num.names.short #6 < + { #6 'cite.num.names.short := } + 'skip$ + if$ + } + if$ + } + { numnames #5 = + { % + % Current has 5 authors, + % previous has more, with same + % first 5, so all 5 of current + % must be used. + % + numnames 'cite.num.names.short := + } + { % + % Same 1st-5th author and both + % current and previous have at + % least 6 authors. If one has + % 6 authors and the other has + % more or the 6th is different, + % 6 should be used (which is + % the maximum). + % + numnames #6 > + numnames.old #6 = + and + % + numnames #6 = + numnames.old #6 > + and + % + or + % + aut6 aut6.old = + not + % + or + { #6 cite.num.names.short < + { #6 + 'cite.num.names.short + := + } + 'skip$ + if$ + } + { % + % The first 6 authors are + % the same and either both + % have 6 or both have more. + % So for all practical + % purposes they have + % identical author-year + % combination, so ambiguity + % should be resolved by a's + % and b's. Check whether + % more authors were + % necessary for previous + % one. + % + change.add.to.year + cite.num.names.short + cite.num.names.old + < + { cite.num.names.old + 'cite.num.names.short + := + } + 'skip$ + if$ + } + if$ + } + if$ + } + if$ + } + { % + % Different 5th author: citing 5 authors is + % sufficient for this comparison. + % + cite.num.names.short #5 < + { #5 'cite.num.names.short := } + 'skip$ + if$ + } + if$ + } + if$ + } + if$ + } + { % + % Different 4th author: citing 4 authors is + % sufficient for this comparison. + % + cite.num.names.short #4 < + { #4 'cite.num.names.short := } + 'skip$ + if$ + } + if$ + } + if$ + } + if$ + } + { % + % Different 3rd author: citing 3 authors is sufficient for this + % comparison. + % + cite.num.names.short #3 < + { #3 'cite.num.names.short := } + 'skip$ + if$ + } + if$ + } + { % + % Different 2nd author: citing 2 authors is sufficient for this + % comparison. + % + cite.num.names.short #2 < + { #2 'cite.num.names.short := } + 'skip$ + if$ + } + if$ + } + { % + % Different first author: no ambiguity, move to next entry. + % + skip$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {definitive.cite.num.names.field} +{ 'field := + field num.names$ 'numnames := + % + % Format authors + % + format.6.authors + % + % Now compare authors with authors of previous entry. + % + cite.num.names.short numnames.old > + { % + % The previous entry has less authors than already defined + % necessary to be cited. No ambiguity is possible and we're ready. + % + skip$ + } + { % + % Both previous and current entry have at least one author . + % + year.label year.label.old = + { % + % Same year label: possibly ambiguous citation. + % + % First check: current and/or previous have 1 or + % 2 authors. + % + numnames #3 < + numnames.old #3 < + or + % + { definitive.cite.num.names.1.or.2 } + { definitive.cite.num.names.3.or.more } + if$ + } + { % + % Different year label: everything's fine, + % move to next entry. + % + skip$ + } + if$ + } + if$ + % + % If during the previous process the name maximum is exceeded + % (which was not checked), correct this. NOTE: If the name + % maximum is smaller than 6, this could lead to ambiguous + % citations if, e.g., the year and the first 5 authors are + % the same, but the 6th author is different. + % + cite.num.names.short name.max > + { name.max 'cite.num.names.short := } + 'skip$ + if$ + % + % For a "full" cite, the number of names should always be at least + % as large as for a "short" cite. + % + cite.num.names.full cite.num.names.short < + { cite.num.names.short 'cite.num.names.full := } + 'skip$ + if$ + % + % Update "old" variables for next entry. + % + update.cite.num.names +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {definitive.cite.no.names} +{ % + % The formatted field that acts as author is on top + % of the stack. + 'aut1f := + "" 'aut2 := + "" 'aut3 := + "" 'aut4 := + "" 'aut5 := + "" 'aut6 := + #1 'numnames := + % + year.label year.label.old = + { % + % Same year label: possibly ambiguous citation. + % + definitive.cite.num.names.1.or.2 + } + { % + % Different year label: everything's fine, + % move to next entry. + % + skip$ + } + if$ + % + % Update "old" variables for next entry. + % + update.cite.num.names +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {definitive.cite.num.names} +{ % + % Check whether author or editor or other field acts as author. + % Number of names is only relevant with author or editor. + % + firstkey empty$ not + { firstkey sortify remove.spaces definitive.cite.no.names } + { key empty$ not + { key sortify remove.spaces definitive.cite.no.names } + { % + % No key or firstkey, so find out which field + % to use as author. + % + % Check reference type: + % if result is 1 then possibly editor acts as author + % 2 then editor does not act as author + % 3 then key should have been used + % 0 then unknown reference type + ref.type #2 = + { % + % Format first author with and without initials + author empty$ + { title.sort.label definitive.cite.no.names } + { author definitive.cite.num.names.field } + if$ + } + { % + % Format first author with and without initials + author empty$ + { editor empty$ + { title.sort.label definitive.cite.no.names } + { editor definitive.cite.num.names.field } + if$ + } + { author definitive.cite.num.names.field } + if$ + } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.tentative.year.sort.label} +{ % + % Implicit or explicit ``no date'' is put at the front + % (the year zero; years B.C. will imply complications) + % because these are possibly old works. + % ``In press'' is put at the end. + % + year empty$ + { "0000" 'year.label := } + { year "\bibnodate" = + year "l" change.case$ "no date" = or + year "l" change.case$ "n.d." = or + { "0000" 'year.label := } + { year "\BIP" = + year "l" change.case$ "in press" = or + year "l" change.case$ "forthcoming" = or + { "9999" 'year.label := } + { % It is not checked whether the year field + % makes sense. + year sortify remove.spaces 'year.label := + } + if$ + } + if$ + } + if$ + % + % Push year sort label on the stack + year.label +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {month.number.day} +{ month empty$ + { "" } + { month sortify remove.spaces + % + % Add the day when available. + day empty$ + 'skip$ + { "/" * + day sortify remove.spaces * + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.name.sort.label} +{ % + % Author or editor-acting-as-author available. + % => Make tentative "short cite with initials" author + % label (L1) of one of the forms + % "Last1 F1" + % "Last1 F1 Last2" + % "Last1 F1 zzzz" ("zzzz" representing et al.) + % => If more than 2 'authors': make label (L2) for 2nd-6th authors + % of one of the forms + % "Last2 Last3" + % "Last2 Last3 Last4" + % "Last2 Last3 Last4 Last5" + % "Last2 Last3 Last4 Last5 Last6" + % "Last2 Last3 Last4 Last5 Last6 zzzz" + % + % Then format year label (L3) of one of the forms: + % "0000" (missing year or explicit 'no date') + % "9999" ('in press') + % year (otherwise; don't use originalyear here yet) + % + % From earlier sorting of titles, we have title number. Convert + % to string, which gives title label (L4) . + % + % Then tentative sorting label (author.year.sort.label) is a + % concatenation of + % L1 + % " " + % L3 + % " " + % L2 + % " " + % L4 + % + % The name field is on top of the stack. + 'field := + % + % numnames is the total number of names contained in field + field num.names$ 'numnames := + % + % Format first author + field #1 sort.name.format format.name$ + % + % Format the second author if there are two, or else "zzzz" = et al. + numnames #1 = + 'skip$ + { numnames #2 = + { % + % Two authors: format second author + field #2 "{ll{}}" format.name$ 's := + s "others" = + { " zzzz" * } % Add "et al."-substitute + { " " * s * } % Add second author + if$ + } + { " zzzz" * } % 3 or more authors: add "et al."-substitute + if$ + } + if$ + " " * % Add spaces + make.tentative.year.sort.label * % Add year (L3). + " " * % Add spaces + % + % Now build up L2 if applicable + numnames #3 < + 'skip$ + { % + % Treat last author slightly differently + numnames name.max > + { name.max 'lastname := + " zzzz" % Push "et al."-substitute on stack + } + { numnames 'lastname := + "" % Push empty string on stack + } + if$ + % + % Names 2 to "last" - 1 + "" % Push empty string on stack + #2 'nameptr := + { nameptr lastname < } + { % Add name no. nameptr + field nameptr "{ll{}}" format.name$ * + " " * + nameptr #1 + 'nameptr := + } + while$ + % + % "Last" author + field lastname "{ll{}}" format.name$ 's := + s "others" = + { "zzzz" * } % Add "et al."-substitute + { s * } % Add last author + if$ + % + swap$ * % Add the previously formatted empty string or + % "et al."-substitute if there are many authors. + * % Add L2 to the earlier labels. + } + if$ + % + " " * % Add spaces + title.number conv.int.to.str * % Add sorted title number (L4). + sortify % Clean up and convert to lowercase + " " * % Add spaces + month.number.day * % Add month and day when available + 'author.year.sort.label := % Assign result to sort label. +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.field.year.sort.label} +{ % + % 'field' acts as first author (L1), subsequent authors + % are empty (L2). + % + % Then format year label (L3) of one of the forms: + % "0000" (missing year or explicit 'no date') + % "9999" ('in press') + % year (otherwise; don't use originalyear here yet) + % + % From earlier sorting of titles, we have title number. Convert + % to string, which gives title label (L4) . + % + % Then tentative sorting label (author.year.sort.label) is a + % concatenation of + % L1 + % " " + % L3 + % " " + % L2 + % " " + % L4 + % + % 'field' is on top of the stack. It is already supposed to be cleaned + % (i.e., sortified and space-removed), so this is already L1. + " " * % Add spaces to L1 + make.tentative.year.sort.label * % Add year (L3). + " " * % Add spaces + " " * % L2 is empty, add spaces + title.number conv.int.to.str * % Add sorted title number (L4). + sortify % Clean up and convert to lowercase + " " * % Add spaces + month.number.day * % Add month and day when available + 'author.year.sort.label := % Assign result to sort label. +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.author.editor.sort.label} +{ author empty$ + { editor empty$ + { % + % Use what has previously been stored in title.sort.label + % as author substitute . + title.sort.label make.field.year.sort.label + } + { editor make.name.sort.label } + if$ + } + { author make.name.sort.label } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.author.sort.label} +{ author empty$ + { % + % Use what has previously been stored in title.sort.label + % as author substitute . + title.sort.label make.field.year.sort.label + } + { author make.name.sort.label } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.tentative.sort.label} +{ % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % General strategy: + % + % Ordinary situation: author or editor-acting-as-author + % available. + % => Make tentative "short cite with initials" author + % label (L1) of one of the forms + % "Last1 F1" + % "Last1 F1 Last2" + % "Last1 F1 zzzz" ("zzzz" representing et al.) + % => If more than 2 'authors': make label (L2) for 2nd-6th authors + % of one of the forms + % "Last2 Last3" + % "Last2 Last3 Last4" + % "Last2 Last3 Last4 Last5" + % "Last2 Last3 Last4 Last5 Last6" + % "Last2 Last3 Last4 Last5 Last6 zzzz" + % When key is available (overrules author and editor fields): + % => L1 = key, L2 = "" + % No author, editor, and key: define title or substitute as key + % and format as key. + % + % Then format year label (L3) of one of the forms: + % "0000" (missing year or explicit 'no date') + % "9999" ('in press') + % year (otherwise; don't use originalyear here yet) + % + % From earlier sorting of titles, we have title number. Convert + % to string, which gives title label (L4) . + % + % Then tentative sorting label (author.year.sort.label) is a + % concatenation of + % L1 + % " " + % L3 + % " " + % L2 + % " " + % L4 + % + % This can then be sorted, from which it can be derived + % whether initials are necessary, how many names must + % be used for short and full citations, and whether "a"'s and + % "b"'s etc. are necessary behind the year labels. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % key and firstkey overrule author information + % + firstkey empty$ not + { key empty$ not + { % + % Both key and firstkey available: + % for sorting and checking initials, treat key as last + % name and firstkey as initials. + % + key sortify remove.spaces + " " * + firstkey sortify remove.spaces * + make.field.year.sort.label + } + { firstkey sortify remove.spaces make.field.year.sort.label } + if$ + } + { key empty$ not + { key sortify remove.spaces make.field.year.sort.label } + { % + % No key or firstkey, so find out which field + % to use as author. + % + % Check reference type: + % if result is 1 then possibly editor acts as author + % 2 then editor does not act as author + % 3 then key should have been used + % 0 then unknown reference type + ref.type + duplicate$ #1 = + { pop$ + make.author.editor.sort.label + } + { duplicate$ #2 = + { pop$ + make.author.sort.label + } + { #3 = + { "no key in " cite$ * warning$ + make.author.editor.sort.label + } + { make.author.editor.sort.label } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + % + author.year.sort.label 'sort.key$ := +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.definitive.name.sort.label} +{ % + % Author or editor-acting-as-author available. + % => Make author-with-initials label (L1) of one of the forms + % "Last1 F1 Last2 F2 ... LastN FN" + % "Last1 F1 Last2 F2 ... Last6 F6 zzzz" + % (where N <= 6 is the total number of authors, and + % "zzzz" represents et al. if there are more than 6 authors) + % No author, editor, and key: define title or substitute as sort key. + % + % The name field is on top of the stack. + 'field := + % + % numnames is the total number of names contained in field + field num.names$ 'numnames := + % + % If there are more than 6 authors, only 6 are mentioned. + numnames name.max > + { name.max 'format.num.names := } + { numnames 'format.num.names := } + if$ + % Initialize stack with empty string + "" + % + % Cycle over authors. + #1 'nameptr := + { nameptr format.num.names < } + { % Format author and add spaces + field nameptr sort.name.format format.name$ * + " " * + nameptr #1 + 'nameptr := + } + while$ + % Format last author that must be formatted + field nameptr sort.name.format format.name$ * + % Add et al. if necessary + nameptr numnames < + { " zzzz" * } + 'skip$ + if$ + sortify % Clean up and change case + " " * % Add spaces + year.label * % Add year + " " * % Add spaces + title.number conv.int.to.str * % Add sorted title number + " " * % Add spaces + month.number.day * % Add month and day when available + 'author.year.sort.label := % Assign result to sort label. +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.definitive.field.year.sort.label} +{ % + % 'field' acts as author (L1). + % + % Then format year label (L2) of one of the forms: + % "0000" (missing year or explicit `no date') + % "9999" (`in press') + % year (otherwise; don't use originalyear here yet) + % + % From earlier sorting of titles, we have title number. Convert + % to string, which gives title label (L3) . + % + % Then tentative sorting label (author.year.sort.label) is a + % concatenation of + % L1 + % " " + % L2 + % " " + % L3 + % + % 'field' is on top of the stack. It is already supposed to be cleaned + % (i.e., sortified and space-removed), so this is already L1. + " " * % Add spaces + year.label * % Add year + " " * % Add spaces + title.number conv.int.to.str * % Add sorted title number + " " * % Add spaces + month.number.day * % Add month and day when available + 'author.year.sort.label := % Assign result to sort label. +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.definitive.author.editor.sort.label} +{ author empty$ + { editor empty$ + { % + % Use what has previously been stored in title.sort.label + % as author substitute . + title.sort.label make.definitive.field.year.sort.label + } + { editor make.definitive.name.sort.label } + if$ + } + { author make.definitive.name.sort.label } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.definitive.author.sort.label} +{ author empty$ + { % + % Use what has previously been stored in title.sort.label + % as author substitute . + title.sort.label make.definitive.field.year.sort.label + } + { author make.definitive.name.sort.label } + if$ +} +FUNCTION {make.final.sort.key} +{ ref.type #2 = + { make.definitive.author.sort.label } + { make.definitive.author.editor.sort.label } + if$ + unsorted + { citeorder.sort.label 'sort.key$ := } + { author.year.sort.label 'sort.key$ := } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + { s } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {chop.articles} +{ 's := + "a " #2 + "an " #3 + "the " #4 + s + chop.word + chop.word + chop.word +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.sort.title} +{ % + % Remove non-alphanumeric characters and change to lower case . + sortify + % + % Remove "a ", "an ", and "the " from the front . + chop.articles #1 entry.max$ substring$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.sort.title} +{ title empty$ + { text empty$ + { type empty$ + { howpublished empty$ + { note empty$ + { url empty$ + { " " } + { url format.sort.title } + if$ + } + { note format.sort.title } + if$ + } + { howpublished format.sort.title } + if$ + } + { type format.sort.title } + if$ + } + { text format.sort.title } + if$ + } + { title format.sort.title } + if$ + remove.spaces + 'title.sort.label := + title.sort.label 'sort.key$ := +} +FUNCTION {make.title.number} +{ title.sort.label old.label = + { + old.number 'title.number := + } + { + old.number #1 + 'title.number := + title.number 'old.number := + title.sort.label 'old.label := + } + if$ +} +FUNCTION {make.citeorder.number} +{ old.number #1 + 'cite.order := + cite.order 'old.number := + cite.order conv.int.to.str 'citeorder.sort.label := +} + +FUNCTION {last.part.name.format.classic} { "{ll}" } + +FUNCTION {von.junior.name.format.classic} { "{ vv}{, jj}" } + +FUNCTION {last.part.name.format} { "{vv }{ll}" } + +FUNCTION {initials.with.space.name.format} { "{f.}" } + +FUNCTION {von.last.junior.name.format} { "{vv }{ll}{ jj}" } + +FUNCTION {von.junior.name.format} { "{, jj}" } + +FUNCTION {one.complete.name.format} { "{vv }{ll}{, jj}{, ff}" } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {string.length} +{ #0 'pos := + % If the next character exists, i.e., is not empty, + % add 1 to the string length. + % We cannot use empty$ because " " empty$ is true. + { duplicate$ pos #1 + #1 substring$ "" = not } + { pos #1 + 'pos := } + while$ + pop$ pos +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {transform.spaces.and.hyphens} +{ 's := % The original string + s string.length 'len := % Its length (no. of characters) + "" 't := % Initialize the transformed string + #1 'pos := + #0 'brace.level := + % + % while (pos < len) do + % + { pos len < } + { % First, check whether we are at brace level 0 + brace.level #0 = + { + % At least two characters left: check for ". ", ".~", and ".-". + % If so, replace and shift two positions. + s pos #2 substring$ ". " = + s pos #2 substring$ ".~" = or + { t "." * 't := + pos #2 + 'pos := + } + { s pos #2 substring$ ".-" = + { t "\BHBI " * 't := + pos #2 + 'pos := + } + { % neither is true, copy one character and shift one position + t s pos #1 substring$ * 't := + % Check whether we need to increase brace level. + % Note that this is not sophisticated: it does not capture + % \{, \verb+}+, etc. + % Note also that unbalanced braces cause problems. + s pos #1 substring$ "{" = + { brace.level #1 + 'brace.level := } + 'skip$ + if$ + pos #1 + 'pos := + } + if$ + } + if$ + } + { % Not at brace level 0: copy result literally + t s pos #1 substring$ * 't := + % Check whether we need to increase or decrease brace level. + % Note that this is not sophisticated: it does not capture + % \{, \verb+}+, etc. + s pos #1 substring$ "{" = + { brace.level #1 + 'brace.level := } + { s pos #1 substring$ "}" = + { brace.level #1 - 'brace.level := } + 'skip$ + if$ + } + if$ + pos #1 + 'pos := + } + if$ + } + while$ + % + pos len = + { % Last character, copy + t s pos #1 substring$ * 't := + } + { % pos = len + 1, so s ends with ". " or ".-" + % This should not have happened, but make the best out of it. + % Push last two characters of s on the stack, i.e., ". " or ".-". + s len #1 - #2 substring$ + % Remove "\BPBI " or "\BHBI " from t + t text.length$ 'len := % Length of t (no. of characters) + t #1 len #6 - substring$ + % Concatenate and assign to t + swap$ * 't := + } + if$ + % + % Now push the result back on the stack + t +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.initials.with.hyphen} +{ % Format initials. + % Call with + % field authornumber format.initials.with.hyphen + % e.g. + % author #1 format.initials.with.hyphen + % Instead of field, a string may also be used. + % + % First, format initials in the default way, retaining spaces + % and hyphens. + initials.with.space.name.format format.name$ + transform.spaces.and.hyphens +} + +FUNCTION {format.last.part.name} +{ % Format a name with last.part.name.format, + % as part of more complicated things. + % Call with + % field authornumber format.last.part.name + % e.g. + % author #1 format.last.part.name + % Instead of field, a string may also be used. + last.part.name.format format.name$ +} + +FUNCTION {format.von.last.junior.name} +{ % Format a name with von.last.junior.name.format, + % for citing or as part of more complicated things. + % Call with + % field authornumber format.von.last.junior.name + % e.g. + % author #1 format.von.last.junior.name + % Instead of field, a string may also be used. + von.last.junior.name.format format.name$ +} + +FUNCTION {format.von.junior.name} +{ % Format a name with von.last.junior.name.format, + % for citing or as part of more complicated things. + % Call with + % field authornumber format.von.junior.name + % e.g. + % author #1 format.von.junior.name + % Instead of field, a string may also be used. + von.junior.name.format format.name$ +} + +FUNCTION {format.cite.initials.name} +{ % Format a name for citing with initials. + % Call with + % field authornumber format.cite.initials.name + % e.g. + % author #1 format.cite.initials.name + % Instead of field, a string may also be used. + % + % First, extract the complete name, format it in the canonical form, + % and push on the stack. + one.complete.name.format format.name$ + % + % Format the initials and push on the stack. + duplicate$ #1 format.initials.with.hyphen + % + % Format the von-last-junior part and push on the stack. + swap$ #1 format.von.last.junior.name + % + % Connect with "~" hyphen (if they're both non-empty). + "~" connect.check +} + +FUNCTION {format.author.name} +{ % Format an author name for the reference list. + % Call with + % field authornumber format.author.name + % e.g. + % author #1 format.author.name + % Instead of field, a string may also be used. + % + % First, extract the complete name, format it in the canonical form, + % and push on the stack. + one.complete.name.format format.name$ + % + % Make two copies of the name, format the last name and push on the stack. + duplicate$ duplicate$ #1 format.last.part.name + % + % Format the initials and push on the stack. + swap$ #1 format.initials.with.hyphen + % + % Connect with last name. + connect.with.comma.check + % + % Format the von-junior part and connect with initials. + swap$ #1 format.von.junior.name "" connect.check +} + +FUNCTION {format.editor.name} +{ % Format a name for the reference list as an editor. + % Call with + % field authornumber format.editor.name + % e.g. + % author #1 format.editor.name + % Instead of field, a string may also be used. + % + format.cite.initials.name +} + +FUNCTION {format.index.name} +{ % Format an author name for the index. + % Call with + % field authornumber format.index.name + % e.g. + % author #1 format.index.name + % Instead of field, a string may also be used. + % + format.author.name +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FUNCTION {comma.between.two} { "\BCBT {}" } + +FUNCTION {comma.between.names} { ", " } + +FUNCTION {comma.before.last} { "\BCBL {}" } + +FUNCTION {dots.before.last} { "\BDBL {}" } + +FUNCTION {and.before.last} { "\ \BBA {} " } + +FUNCTION {no.and.before.last} { " " } + +FUNCTION {et.al.string.cite} { "\ \protect \BOthers {.}" } + +FUNCTION {et.al.string} { "\ \BOthers {.}" } + +FUNCTION {et.al.string.period} { "\ \BOthersPeriod {.}" } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {add.name.index} +{ % + % + make.index + { "%" * write$ newline$ + % Check for corporate author + field is.bibcorporate + { "\corporateAX{" } + { "\AX{" } + if$ + write$ + field nameptr sort.name.format format.name$ sortify write$ newline$ + "@" write$ + field nameptr format.index.name + "}%" * write$ newline$ + } + { "%" * write$ newline$ } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.name.cite.label} +{ 'field := + 'format.num.names := + % + field num.names$ 'numnames := % numnames is the total number of names + % contained in field + % + % It is implicit in the APA manual that if "et al." would refer + % to exactly one author, then this author should be named + % instead of "et al." + % + format.num.names numnames #1 - = + { numnames 'format.num.names := } + 'skip$ + if$ + % + % Format first author: with or without initials + % + #1 'nameptr := + cite.initials #1 = + { field nameptr format.cite.initials.name } + { field nameptr cite.name.format format.name$ } + if$ + add.name.index % Add index entry when desired. + % + numnames #1 = + 'skip$ + { format.num.names #1 = + { % + % First author et al. + % + et.al.string.cite write$ + } + { numnames #2 = + { % + % Given that format.num.names > 1, it is 2. + % Format second author. + % + #2 'nameptr := + field nameptr cite.name.format format.name$ 's := + % + % Check if 2nd author is explicit "others". + % If so, insert "et al." string. + % + s "others" = + { et.al.string.cite write$ } % First et al. + { % + % First \& Second + % + and.before.last write$ + s + add.name.index % Add index entry when desired. + } + if$ + } + { % + % 3 or more names, 2 or more must be cited + % + % for nameptr := 2 to format.num.names - 1 do + % + #2 'nameptr := + { nameptr format.num.names < } + { % + % Put comma between consecutive authors + % + comma.between.names write$ + % + % Format and add next author + % + field nameptr cite.name.format format.name$ + add.name.index % Add index entry when desired. + % + % Move to next author + % + nameptr #1 + 'nameptr := + } + while$ + % + % nameptr = format.num.names + % Format this author. + % + field nameptr cite.name.format format.name$ 's := + % + format.num.names numnames = + { % + % This is also the last author. Add (optional) comma. + % + comma.before.last write$ + % + % Check if this author is explicit "others". + % If so, insert "et al." string. + % + s "others" = + { et.al.string.cite write$ } + { and.before.last write$ + s + add.name.index % Add index entry when desired. + } + if$ + } + { % + % This is not the last author. + % Add comma, author name, and "et al." + % + comma.between.names write$ + s + add.name.index % Add index entry when desired. + % + comma.before.last et.al.string.cite * write$ + } + if$ + } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.title.cite.label} +{ % + % Formatting: check if formatted as article title or + % as book title, and insert this formatting. + % + is.atype + { "\APACciteatitle {" } + { "\APACcitebtitle {" } + if$ + % + title empty$ + { text empty$ + { type empty$ + { howpublished empty$ + { note empty$ + { url empty$ + { cite$ } + { url } + if$ + } + { note } + if$ + } + { howpublished } + if$ + } + { type } + if$ + } + { text } + if$ + } + { title } + if$ + % + % Connect with formatting. + % + * "}" * + % + % Write to output + % + write$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.author.editor.cite.label} +{ author empty$ + { editor empty$ + { % + % No author or editor: + % Use title or other description as citation label. + % + make.title.cite.label + "}{%" write$ newline$ + make.title.cite.label + } + { cite.num.names.full editor make.name.cite.label + "}{%" write$ newline$ + cite.num.names.short editor make.name.cite.label + } + if$ + } + { cite.num.names.full author make.name.cite.label + "}{%" write$ newline$ + cite.num.names.short author make.name.cite.label + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.author.cite.label} +{ author empty$ + { % + % No author: + % Use title or other description as citation label. + % + make.title.cite.label + "}{%" write$ newline$ + make.title.cite.label + } + { cite.num.names.full author make.name.cite.label + "}{%" write$ newline$ + cite.num.names.short author make.name.cite.label + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.definitive.year.supplement} +{ % + % Add "a", "b", etc. when necessary. + % + add.to.year #0 = + { "" } + { "{\protect " + year empty$ + { "\BCntND " * } + { year "\bibnodate" = + year "l" change.case$ "no date" = or + year "l" change.case$ "n.d." = or + { "\BCntND " * } + { year "\BIP" = + year "l" change.case$ "in press" = or + year "l" change.case$ "forthcoming" = or + { "\BCntIP " * } + { "\BCnt " * } + if$ + } + if$ + } + if$ + "{" * add.to.year int.to.str$ * "}}" * + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {protect.year} +{ year empty$ + { "{\protect \bibnodate {}}" } + { year "\bibnodate" = + year "l" change.case$ "no date" = or + year "l" change.case$ "n.d." = or + { "{\protect \bibnodate {}}" } + { year "\BIP" = + year "l" change.case$ "in press" = or + year "l" change.case$ "forthcoming" = or + { "{\protect \BIP {}}" } + { year } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.definitive.year.label} +{ "{\protect \APACyear {" + originalyear empty$ + { protect.year } + { originalyear "\bibnodate" = % date of original publication unknown + originalyear "l" change.case$ "no date" = or + originalyear "l" change.case$ "n.d." = or + { translator empty$ + { protect.year } + { "{\protect \BTRANSL {}}~" protect.year * } + if$ + } + { year empty$ + { originalyear "/{\protect \bibnodate {}}" * } % 1923/n.d. + { originalyear year = + { protect.year } + { originalyear "/" * protect.year * } % 1923/1961 + if$ + } + if$ + } + if$ + } + if$ + * "}}%" * write$ newline$ + % + % Add "a", "b", etc. when necessary. + % + "{\protect \APACexlab {" "}}" + make.definitive.year.supplement enclose.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.cite.labels} +{ newline$ + % + % Write a few lines for testing purposes. + % + test + { "\bibitem [] {} \fullciteA {" cite$ * "}" * write$ newline$ + "\bibitem [] {} \citeA {" cite$ * "}" * write$ newline$ + } + 'skip$ + if$ + % + "\bibitem [\protect \citeauthoryear {%" write$ newline$ + % + % When key or firstkey is available, this takes precedence. + % + firstkey empty$ not + { % + % Full cite: firstkey. + % + firstkey write$ + "}{%" write$ newline$ + % + % Short cite: if key is not empty and cite.initials is 0, + % then key, else firstkey. + % + cite.initials #0 = + key empty$ not + and + { key } + { firstkey } + if$ + write$ + } + { key empty$ not + { % + % No firstkey, but key available: + % Both full and short labels are key. + % + key write$ + "}{%" write$ newline$ + key write$ + } + { % No key or firstkey, so find out which field + % to use as author. + % + % Check reference type: + % if result is 1 then possibly editor acts as author + % 2 then editor does not act as author + % 3 then key should have been used + % 0 then unknown reference type + ref.type #2 = + { make.author.cite.label } + { make.author.editor.cite.label } + if$ + } + if$ + } + if$ + "}{%" write$ newline$ + % + % Make year label that's used for citations + % + make.definitive.year.label write$ + "}]{%" write$ newline$ + cite$ write$ + "} " write$ newline$ + % author.year.sort.label write$ newline$ % for testing purposes + % year.label write$ newline$ % for testing purposes + % + % If the item is used in a meta-analysis, indicate this with + % a star. + % + "\APACinsertmetastar {%" write$ newline$ + cite$ write$ + "}%" write$ newline$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {editor.postfix} +{ editor num.names$ #1 > + { "(\BEDS)" } + { "(\BED)" } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {editor.trans.postfix} +{ editor num.names$ #1 > + { "(\BEDS{} \BAnd{} \BTRANSS)" } + { "(\BED{} \BAnd{} \BTRANS)" } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % "(Trans.)" postfix + % translator must not be empty + % +FUNCTION {trans.postfix} +{ translator num.names$ #1 > + { "(\BTRANSS)" } + { "(\BTRANS)" } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {authors.editors.reflist.apa5} +{ 'field := + 'dot := + % + field num.names$ 'numnames := % numnames is the total number of names + % contained in field + numnames 'format.num.names := % Format all authors + format.num.names name.max > % Unless this exceeds the maximum of 6. + { dot + { name.max 'format.num.names := } % Format 6 authors + { cite.num.names.full 'format.num.names := } % Format 1 editor + if$ + } + 'skip$ + if$ + % + % Enclose authors in APACrefauthors environment to allow crude style + % options in \LaTeX. + "\begin{APACrefauthors}%" + write$ newline$ + % + % It is kind of explicit in the APA manual that if "et al." would + % refer to exactly one author (the 7th), then this author should + % still be replaced by "et al.", unlike with citations. + % So format.num.names is not adapted. + % + % Format first author + % + #1 'nameptr := + field nameptr format.author.name + % + % Add period if required and if this is the only author. + % + numnames #1 = + dot + and + { add.period$ } + 'skip$ + if$ + add.name.index % Add index entry when desired. + % + numnames #1 = + 'skip$ + { format.num.names #1 = + { % + % First author et al. + % + comma.between.two + % + % Add period if required. + % + dot + { et.al.string.period * } + { et.al.string * } + if$ + write$ + } + { numnames #2 = + { % + % Given that format.num.names > 1, it is 2. + % + comma.between.two write$ + % + % Format second author. + % + #2 'nameptr := + field nameptr format.author.name 's := + % + % Check if 2nd author is explicit "others". + % If so, insert "et al." string. + % + s "others" = + { % + % First et al. + % Add period if required. + % + dot + { et.al.string.period } + { et.al.string } + if$ + write$ + } + { % + % First \& Second + % + and.before.last write$ + % + % Add period if required. + % + dot + { s add.period$ } + { s } + if$ + add.name.index % Add index entry when desired. + } + if$ + } + { % + % 3 or more names, 2 or more must be cited + % + % for nameptr := 2 to format.num.names - 1 do + % + #2 'nameptr := + { nameptr format.num.names < } + { % + % Put comma between consecutive authors + % + comma.between.names write$ + % + % Format and add next author + % + field nameptr format.author.name + add.name.index % Add index entry when desired. + % + % Move to next author + % + nameptr #1 + 'nameptr := + } + while$ + % + % nameptr = format.num.names + % Format this author. + % + field nameptr format.author.name 's := + % + format.num.names numnames = + { % + % This is also the last author. Add (optional) comma. + % + comma.before.last write$ + % + % Check if this author is explicit "others". + % If so, insert "et al." string. + % + s "others" = + { % + % Add period if required. + % + dot + { et.al.string.period } + { et.al.string } + if$ + write$ + } + { and.before.last write$ + % + % Add period if required. + % + dot + { s add.period$ } + { s } + if$ + add.name.index % Add index entry when desired. + } + if$ + } + { % + % This is not the last author. + % Add comma, author name, and "et al." + % + comma.between.names write$ + s + add.name.index % Add index entry when desired. + % + comma.before.last + % + % Add period if required. + % + dot + { et.al.string.period * } + { et.al.string * } + if$ + write$ + } + if$ + } + if$ + } + if$ + } + if$ + % + % End APACrefauthors environment. + "\end{APACrefauthors}%" + write$ newline$ +} + +FUNCTION {authors.reflist.apa6} +{ 'field := + 'dot := + field num.names$ 'numnames := + numnames #7 > + { #7 'format.num.names := } + { numnames 'format.num.names := } + if$ + "\begin{APACrefauthors}%" + write$ newline$ + #1 'nameptr := + field nameptr format.author.name + numnames #1 = + { dot + { %add.period$ +} + 'skip$ + if$ + add.name.index + } + { add.name.index + numnames #2 = + { comma.between.two write$ + #2 'nameptr := + field nameptr format.author.name 's := + s "others" = + { "`others' not consistent with 6th ed. of the APA Manual" + warning$ + dot + { et.al.string.period } + { et.al.string } + if$ + write$ newline$ + } + { and.before.last write$ + dot + { s add.period$ } + { s } + if$ + add.name.index + } + if$ + } + { %% for nameptr := 2 to format.num.names - 1 do + #2 'nameptr := + { nameptr format.num.names < } + { comma.between.names write$ + field nameptr format.author.name + add.name.index + nameptr #1 + 'nameptr := + } + while$ + field numnames format.author.name 's := + format.num.names numnames = + { comma.before.last write$ + s "others" = + { "`others' not consistent with 6th ed. of the APA " + "Manual" * + warning$ + dot + { et.al.string.period } + { et.al.string } + if$ + write$ + } + { no.and.before.last write$ + dot + { s add.period$ } + { s } + if$ + add.name.index + } + if$ + } + { dots.before.last write$ + s + add.name.index + } + if$ + } + if$ + } + if$ + "\end{APACrefauthors}%" + write$ newline$ +} + +FUNCTION {format.author.names} +{ 'field := + 'dot := + dot + { dot field authors.reflist.apa6 } + { dot field authors.editors.reflist.apa5 } + if$ +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.authors} +{ #1 author format.author.names } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.editors.as.authors} +{ #0 editor format.author.names + "\ " editor.postfix * add.period$ write$ newline$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.ed.trans.as.authors} +{ #0 editor format.author.names + "\ " editor.trans.postfix * add.period$ write$ newline$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.editor.names} +{ 'field := + % + field num.names$ 'numnames := % numnames is the total number of names + % contained in field + numnames 'format.num.names := % Format all authors + format.num.names name.max > % Unless this exceeds the maximum of 6. + { #1 'format.num.names := } % Then it becomes 1 (First et al.) + 'skip$ + if$ + % + % Format first editor + % + field #1 format.editor.name + % + numnames #1 = + 'skip$ + { format.num.names #1 = + { et.al.string * } % First editor et al., no comma. + { numnames #2 = + { % + % Given that format.num.names > 1, it is 2. + % No comma. Format second editor. + % + field #2 format.editor.name 's := + % + % Check if 2nd editor is explicit "others". + % If so, insert "et al." string. + % + s "others" = + { et.al.string * } % First et al. + { and.before.last * s * } % First \& Second + if$ + } + { % + % 3 or more names, 2 or more must be cited + % + % for nameptr := 2 to format.num.names - 1 do + % + #2 'nameptr := + { nameptr format.num.names < } + { % + % Put comma between consecutive editors + % + comma.between.names * + % + % Format and add next editor + % + field nameptr format.editor.name * + % + % Move to next editor + % + nameptr #1 + 'nameptr := + } + while$ + % + % nameptr = format.num.names + % Format this editor. + % + field nameptr format.editor.name 's := + % + format.num.names numnames = + { % + % This is also the last editor. Add (optional) comma. + % + comma.before.last * + % + % Check if this editor is explicit "others". + % If so, insert "et al." string. + % + s "others" = + { et.al.string * } + { and.before.last * s * } + if$ + } + { % + % This is not the last editor. + % Add comma, editor name, and "et al." + % + comma.between.names * s * + comma.before.last * et.al.string * + } + if$ + } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format editors in case editors do not act as authors + % (such as reference to chapter in edited book) + % + % L. W. Poon (Ed.) (1 editor) + % or + % A. S. Gurman \& D. P. Kniskern (Eds.) (2 editors) + % or + % L. Poon, A. Jones, \& D. P. Smith (Eds.) (>2 editors) + % + % editor must not be empty + % +FUNCTION {format.editors.in.line} +{ editor format.editor.names + editor.postfix connect.with.space.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format editors in case editors are also translators + % and do not act as authors + % (such as reference to chapter in edited book + % of translated articles) + % + % L. W. Poon (Ed. and Trans.) (1 editor) + % or + % A. S. Gurman \& D. P. Kniskern (Eds. and Trans.) (2 editors) + % or + % L. Poon, A. Jones, \& D. P. Smith (Eds. and Trans.) (>2 editors) + % + % editor must not be empty + % +FUNCTION {format.editors.trans.in.line} +{ editor format.editor.names + editor.trans.postfix connect.with.space.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format translators in case translators act as editors + % (such as reference to chapter in translated book) + % + % L. W. Poon (Trans.) (1 translator) + % or + % A. S. Gurman \& D. P. Kniskern (Trans.) (2 translators) + % or + % L. Poon, A. Jones, \& D. P. Smith (Trans.) (>2 translators) + % + % translator must not be empty + % +FUNCTION {format.translators.in.line} +{ translator format.editor.names + trans.postfix connect.with.space.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format translators in case translator does not act as editor + % (such as reference to translated book) + % + % L. Solotaroff, Trans. + % +FUNCTION {format.translators.in.paren.check} +{ translator empty$ + { "" } + { translator format.editor.names + translator num.names$ #1 > + { ", \BTRANSS{}" * } + { ", \BTRANS{}" * } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format editors and translators in case neither act as editor + % (such as reference to edited or translated book with a + % a single author) + % + % L. Solotaroff, Ed. + % L. Solotaroff, Ed. \& Trans. + % L. Solotaroff, Trans. + % L. Solotaroff, Ed. \& S. Prokofieff, Trans. + % +FUNCTION {format.editors.translators.in.paren.check} +{ editor empty$ + { translator empty$ + { "" } + { translator format.editor.names + translator num.names$ #1 > + { ", \BTRANSS{}" * } + { ", \BTRANS{}" * } + if$ + } + if$ + } + { editor format.editor.names + editor num.names$ #1 > + { ", \BEDS{}" * } + { ", \BED{}" * } + if$ + translator empty$ + 'skip$ + { editor translator = + { editor num.names$ #1 > + { " \BAnd{} \BTRANSS" * } + { " \BAnd{} \BTRANS" * } + if$ + } + { " \BAnd{} " * + translator format.editor.names * + translator num.names$ #1 > + { ", \BTRANSS{}" * } + { ", \BTRANS{}" * } + if$ + } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % translator of article + % +FUNCTION {format.atrans.check} +{ format.translators.in.paren.check parenthesize.check } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format "In editor (Ed.), " + % +FUNCTION {format.in.editors} +{ "\BIn{} " + editor empty$ + 'skip$ + { format.editors.in.line * ", " * } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format "In translator (Trans.)," + % +FUNCTION {format.in.trans} +{ "\BIn{} " + translator empty$ + 'skip$ + { format.translators.in.line * ", " * } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format "In editor (Ed. and Trans.)" + % or "In editor (Ed.)" if editor not equal to translator + % +FUNCTION {format.in.editors.trans} +%{ "\BIn{} " Commented by SPI +{ " " + editor empty$ + { translator empty$ + 'skip$ + { format.translators.in.line * ", " * } + if$ + } + { translator empty$ + { format.editors.in.line * } + { editor translator = + { format.editors.trans.in.line * } + { format.editors.in.line * } + if$ + } + if$ + ", " * + } + if$ +} + +FUNCTION {in.format.in.editors.trans} +{ "\BIn{} " + editor empty$ + { translator empty$ + 'skip$ + { format.translators.in.line * ", " * } + if$ + } + { translator empty$ + { format.editors.in.line * } + { editor translator = + { format.editors.trans.in.line * } + { format.editors.in.line * } + if$ + } + if$ + ", " * + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.year.check} +{ "\APACrefYear{" + protect.year * + % + % Add "a", "b", etc. when necessary. + % + make.definitive.year.supplement * + "}" * +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.year.month.day.check} +{ "\APACrefYearMonthDay{" + protect.year * + % + % Add "a", "b", etc. when necessary. + % + make.definitive.year.supplement * + "}{" * + % + % Add month and day when present. + % + month empty$ + 'skip$ + { month * } + if$ + "}{" * + day empty$ + 'skip$ + { day * } + if$ + "}" * +} +FUNCTION {format.year.nomonth.day.check} +{ "\APACrefYearMonthDay{" + protect.year * + % + % Add "a", "b", etc. when necessary. + % + make.definitive.year.supplement * + "}{" * + % + % Add month and day when present. + % + month empty$ + 'skip$ + { } + if$ + "}{" * + day empty$ + 'skip$ + { day * } + if$ + "}" * +} + +FUNCTION {format.atitle.no.dot} +{ "{\BBOQ}" swap$ + "{\BBCQ}" swap$ + duplicate$ empty$ + 'skip$ + { duplicate$ + % Two arguments: Title twice: (1) don't change case; (2) change case + "\APACrefatitle {" swap$ * "} {" * swap$ + "t" change.case$ + * "}" * + } + if$ + enclose.check +} + +FUNCTION {format.atitle.dot} +{ "{\BBOQ}" swap$ + "{\BBCQ}" swap$ + duplicate$ empty$ + 'skip$ + { duplicate$ + % Two arguments: Title twice: (1) don't change case; (2) change case + "\APACrefatitle {" swap$ * "} {" * swap$ + "t" change.case$ + * "}" * add.period$ + } + if$ + enclose.check +} + +FUNCTION {format.atitle.connect} +{ swap$ + duplicate$ empty$ + { pop$ + format.atitle.dot + } + { swap$ + format.atitle.no.dot + swap$ connect.with.space.check + add.period$ + } + if$ +} + +FUNCTION {format.btitle.no.dot} +{ duplicate$ empty$ + { pop$ + "" + } + { duplicate$ + % Two arguments: Title twice: (1) don't change case; (2) change case + "\APACrefbtitle {" swap$ * "} {" * swap$ + "t" change.case$ + * "}" * + } + if$ +} + +FUNCTION {format.btitle.dot} +{ duplicate$ empty$ + { pop$ + "" + } + { add.period$ format.btitle.no.dot } + if$ +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title of book and similar + % field must be on top of stack + % second element on stack must be connected: + % if that is empty, then btitle.dot + % else btitle.no.dot, connect, and add period + % +FUNCTION {format.btitle.connect} +{ swap$ + duplicate$ empty$ + { pop$ + format.btitle.dot + } + { swap$ + format.btitle.no.dot + swap$ connect.with.space.check + add.period$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title of book and similar + % field must be on top of stack + % second element on stack must be connected + % +FUNCTION {format.btitle.connect.no.dot} +{ swap$ + duplicate$ empty$ + { pop$ + format.btitle.no.dot + } + { swap$ + format.btitle.no.dot + swap$ connect.with.space.check + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format englishtitle (of nonenglish article, etc.) + % +FUNCTION {format.aetitle.check} +{ englishtitle empty$ + { "" } + { % Two arguments: Title twice: (1) don't change case; (2) change case + "\APACrefaetitle {" englishtitle * "} {" * + englishtitle "t" change.case$ * "}" * + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format englishtitle (of nonenglish book, etc.) + % +FUNCTION {format.betitle.check} +{ englishtitle empty$ + { "" } + { % Two arguments: Title twice: (1) don't change case; (2) change case + "\APACrefbetitle {" englishtitle * "} {" * + englishtitle "t" change.case$ * "}" * + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format type (of article, etc.) + % +FUNCTION {format.atype.check} +{ type bracket.check } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format title and englishtitle (of article, etc.) + % +FUNCTION {format.atitle.check} +{ format.aetitle.check + title format.atitle.connect +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format title, englishtitle, and type + % (of article, etc.) + % +FUNCTION {format.atitle.type.check} +{ format.aetitle.check + format.atype.check connect.with.space.check + title format.atitle.connect +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format title, englishtitle, + % and translator (of article, etc.) + % +FUNCTION {format.atitle.trans.check} +{ format.aetitle.check + format.atrans.check connect.with.space.check + title format.atitle.connect +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format title, englishtitle, type, + % and translator (of article, etc.) + % +FUNCTION {format.atitle.type.trans.check} +{ format.aetitle.check + format.atype.check connect.with.space.check + format.atrans.check connect.with.space.check + title format.atitle.connect +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format journal, volume, number and pages + % call with + % formatted.pages format.journal.vol.num.pages.check + % +FUNCTION { format.journal.vol.num.pages.check } +{ "journal" journal warning.if.empty + duplicate$ empty$ + journal empty$ and + volume empty$ and + number empty$ and + { pop$ "" } + { "\APACjournalVolNumPages{" journal "" connect.check + "}{" * volume "" connect.check + "}{" * number "" connect.check + "}{" * swap$ "" connect.check + ",}" * + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % volume of book, checks whether + % "Volume" or "Volumes" + % + % call with + % field format.bvolume.check + % +FUNCTION {format.bvolume.check} +{ duplicate$ empty$ + 'skip$ + { duplicate$ multi.result.check + { "\BVOLS" swap$ tie.or.space.connect } + { "\BVOL" swap$ tie.or.space.connect } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % edition of book, must not be empty + % call with + % field format.edition.check + % +FUNCTION {format.edition.check} +{ duplicate$ empty$ + 'skip$ + { "\PrintOrdinal{" swap$ * "}" * + "\BEd" connect.with.space.check + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % volume and edition of book + % +FUNCTION {format.bvol.edition.check} +{ edition format.edition.check + volume format.bvolume.check + connect.with.comma.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % volume and edition of book + % +FUNCTION {format.bvol.edition} +{ format.bvol.edition.check + parenthesize.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % volume and edition and translator of translated book + % +FUNCTION {format.bvol.edition.trans} +{ format.bvol.edition.check + format.translators.in.paren.check connect.with.semicolon.check + parenthesize.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % volume, edition, editor, and translator of (translated) book + % +FUNCTION {format.bvol.edition.editor.trans} +{ format.bvol.edition.check + format.editors.translators.in.paren.check connect.with.semicolon.check + parenthesize.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % formats pages by first checking if 1 or more pages + % and prefixing pages with "p." or "pp." (these strings + % are given in the commands \BPG and \BPGS, respectively), + % whichever is applicable, and do a tie or space connect + % + % call with + % field format.bpages.check + % +FUNCTION {format.bpages.check} +{ duplicate$ empty$ + 'skip$ + { duplicate$ multi.result.check + { "\BPGS" swap$ tie.or.space.connect } + { "\BPG~" swap$ * } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % formats chapters by first checking if 1 or more chapters + % and prefixing pages with "chap." (this string + % is given in the commands \BCHAP and \BCHAPS, respectively), + % whichever is applicable, and do a tie or space connect + % + % call with + % field format.bchapter.check + % +FUNCTION {format.bchapter.check} +{ duplicate$ empty$ + 'skip$ + { duplicate$ multi.result.check + { "\BCHAPS" swap$ tie.or.space.connect } + { "\BCHAP" swap$ tie.or.space.connect } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % volume, edition, and pages or chapter of article in book etc. + % +FUNCTION {format.bvol.edition.pages} +{ format.bvol.edition.check + pages empty$ + { chapter format.bchapter.check connect.with.comma.check } + { pages format.bpages.check connect.with.comma.check } + if$ + parenthesize.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title, volume, edition of book + % +FUNCTION {format.btitle.vol.edition} +{ format.betitle.check + format.bvol.edition connect.with.space.check + title format.btitle.connect.no.dot +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title, volume, edition, and translator of book + % +FUNCTION {format.btitle.vol.edition.trans} +{ format.betitle.check + format.bvol.edition.trans connect.with.space.check + title format.btitle.connect.no.dot +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title, volume, edition, editor, and translator of book + % +FUNCTION {format.btitle.vol.edition.editor.trans} +{ format.betitle.check + format.bvol.edition.editor.trans connect.with.space.check + title format.btitle.connect.no.dot +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format address and publisher of book etc. + % + % New York: Wiley + % or + % Wiley (if address empty) + % or + % New York (if publisher empty) + % +FUNCTION {format.address.publisher} +{ % + % If publisher = author or publisher = "author" or publisher = "Author" + % then hand over the final choice how to format this to \LaTeX. + % (I could imagine similar code for editors, but the APA manual does + % not mention it and then we'd have to check whether the editor is in + % the author position, so let's keep it simple until someone complains.) + % + author empty$ + publisher empty$ or + { publisher "\APACaddressPublisher{" } + { author publisher = + "author" publisher = or + "Author" publisher = or + { author "\APACaddressPublisherEqAuth{" } + { publisher "\APACaddressPublisher{" } + if$ + } + if$ + address "" connect.check "}{" * + % Recover publisher that was pushed onto the stack previously. + swap$ "" connect.check "}" * +} + +FUNCTION {format.address.publisher.check} +{ publisher empty$ + address empty$ + and + 'skip$ + { + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.address.publisher + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format number as in reports: No. 2017 + % call with + % field format.rnumber.check + % +FUNCTION {format.rnumber.check} +{ duplicate$ empty$ + 'skip$ + { duplicate$ multi.result.check + { "\BNUMS" swap$ tie.or.space.connect } + { "\BNUM" swap$ tie.or.space.connect } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format type and number of a standalone item + % call with + % format.type.number + % +FUNCTION { format.type.number } +{ type empty$ + { type.2 } + { type } + if$ + number empty$ + { bracket.check } + { number format.rnumber.check connect.with.space.check + parenthesize.check + } + if$ +} + +FUNCTION {format.howpublished} +{ howpublished empty$ + 'skip$ + { % clear the stack + duplicate$ empty$ + 'pop$ + { output.dot.new.block } + if$ + "\APAChowpublished {" howpublished * "}" * + } + if$ +} +FUNCTION {output.howpublished} +{ howpublished empty$ + 'skip$ + { "\APAChowpublished {" howpublished * "}" * + output.dot.new.block + } + if$ +} +FUNCTION {howpublished.block} +{ howpublished empty$ + 'skip$ + { start.new.block + "\APAChowpublished {" howpublished * "}" * + output.dot.end.block + } + if$ +} +FUNCTION {begin.end.url.env} +{ "\begin{APACrefURL} " + lastchecked empty$ + { urldate empty$ + 'skip$ + { "[{" * urldate * "}]" * } + if$ + } + { "[{" * lastchecked * "}]" * } + if$ + " \end{APACrefURL} " +} + +FUNCTION {begin.end.doi.env} +{ "\begin{APACrefDOI} " + " \end{APACrefDOI} " +} + +FUNCTION {begin.end.msg.env} +{ "\begin{APACrefURLmsg} " + " \end{APACrefURLmsg} " +} +FUNCTION {format.url} +{ type.2 empty$ + { begin.end.url.env } + { type.2 "\bibmessage" = + { begin.end.msg.env } + { begin.end.url.env } + if$ + } + if$ +%%"\url{" url * "}" * + "{" url * "}" * + enclose.check +} +FUNCTION {url.block} +{ doi empty$ + { url empty$ + 'skip$ + { start.new.block + format.url + output.end.block + } + if$ + } + 'skip$ + if$ +} +FUNCTION {format.doi} +{ begin.end.doi.env + "\doi{" doi * "}" * + enclose.check +} +FUNCTION {doi.block} +{ doi empty$ + 'skip$ + { start.new.block + format.doi + output.end.block + } + if$ +} +FUNCTION {format.note} +{ "\APACrefnote{" "}" note enclose.check } +FUNCTION {note.block} +{ note empty$ + 'skip$ + { start.new.block + format.note + output.end.block + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format original year of publication and note + % (reprint or translation) + % +FUNCTION {format.orig.year.note} +{ originalyear empty$ + { format.note } + { "\APACorigyearnote{" + originalyear "" connect.check "}{" * + note "" connect.check "}" * + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format original journal of publication and note + % (reprint or translation) + % +FUNCTION {format.orig.journal.note} +{ "\APACorigjournalnote{" + originalyear "" connect.check "}{" * + originaljournal "" connect.check "}{" * + originalvolume "" connect.check "}{" * + originalnumber "" connect.check "}{" * + originalpages "" connect.check "}{" * + note "" connect.check "}" * +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format original book of publication and note + % (reprint or translation) + % +FUNCTION {format.orig.book.note} +{ "\APACorigbooknote{" originalyear "" connect.check "}{" * + % + originaleditor empty$ + 'skip$ + { originaleditor num.names$ #1 > + { "\APACorigEDS {" * originaleditor format.editor.names * "}" * } + { "\APACorigED {" * originaleditor format.editor.names * "}" * } + if$ + } + if$ + % + "}{" * + originalbooktitle format.btitle.no.dot "" connect.check "} {" * + originaledition format.edition.check "" connect.check "} {" * + originalvolume format.bvolume.check "" connect.check "} {" * + originalpages format.bpages.check "" connect.check "} {" * + originaladdress "" connect.check "} {" * + originalpublisher "" connect.check "} {" * + note "" connect.check "}" * +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format information about original publication of reprint + % and format optional note + % +FUNCTION {format.orig.note} +{ originaljournal empty$ + { originalbooktitle empty$ + { note empty$ + { originalyear empty$ + 'skip$ + { originalyear "\bibnodate" = + originalyear "l" change.case$ "no date" = or + originalyear "l" change.case$ "n.d." = or + 'skip$ + { output.new.block + format.orig.year.note + } + if$ + } + if$ + } + { output.new.block + format.orig.year.note + } + if$ + } + { output.new.block + format.orig.book.note + } + if$ + } + { output.new.block + format.orig.journal.note + } + if$ +} +FUNCTION {fin.entry} +{ %doi empty$ + % 'skip$ + % { output.new.block + % format.doi + % } + % if$ + output.end.block + "\PrintBackRefs{\CurrentBib}" write$ newline$ + test + { "\vspace{\baselineskip}" write$ newline$ } + 'skip$ + if$ +} +FUNCTION {fin.entry.2} +{ doi.block + "\PrintBackRefs{\CurrentBib}" write$ newline$ + test + { "\vspace{\baselineskip}" write$ newline$ } + 'skip$ + if$ +} + +FUNCTION {format.archive} +{ + archivePrefix empty$ + { "" } + { archivePrefix ":" *} + if$ +} + +FUNCTION {format.primaryClass} +{ + primaryClass empty$ + { "" } + { " {[" primaryClass * "]}" *} + if$ +} + +FUNCTION {format.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + { "{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {format.softmisc.archive} +{ + archivePrefix empty$ + { "" } + { "" } + if$ +} + +FUNCTION {format.softmisc.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {periodical} +{ + author empty$ + % + % no author: possibly special issue with editors as authors + % (APA manual, ex. 11, p. 121) + % + { editor empty$ + % + % no author or editor: title serves as author. + % title formatted as article title (APA manual not consistent in this, + % compare statement on p. 119: ``treat as book title'' and + % example 8, p. 121: no underlining => article title) + % + { format.atitle.type.trans.check output.new.block + % + % now formatted date on top of stack + % + output.dot.new.block + } + % + % format editor and year, and check if year is present + % format article title and check if title or type present + % + { format.editors.as.authors start.new.block + % + % now formatted date on top of stack + % + output.dot.new.block + format.atitle.type.trans.check output.new.block + } + if$ + } + % + % format author and year, and check if year is present + % format article title and check if title or type present + % + { format.authors start.new.block + % + % now formatted date on top of stack + % + output.dot.new.block + format.atitle.type.trans.check output.new.block + } + if$ + % + % format journal name, volume and issue number, and pages + % and check if journal not empty + % + format.journal.vol.num.pages.check +% output.new.block + doi empty$ + 'skip$ + { output.new.block + format.doi + } + if$ + % + % if not empty, insert howpublished. + % (used if article is retrieved from the internet) + % +% format.howpublished add.period$ + % + % format url + % + url empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + % + % possible reprint and optional note + % + format.orig.note + output.new.block + format.eprint + output.new.block + format.primaryClass + fin.entry + } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % journal article + % +FUNCTION {article} +{ pages format.year.month.day.check periodical } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % magazine article + % +FUNCTION {magazine} +{ pages format.year.month.day.check periodical } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % newspaper article + % +FUNCTION {newspaper} +{ pages format.bpages.check format.year.month.day.check periodical } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % (translation of) entire book + % +FUNCTION {book} +{ % + % author or editor, + % year, title, englishtitle, translator + % + author empty$ + % + % no author: possibly edited book with editors as authors + % + { editor empty$ + % + % no author or editor: title serves as author. + % title formatted as book title + % + { format.btitle.vol.edition.trans + format.type.number connect.with.space.check + output.dot.new.block + format.year.check add.period$ + } + % + % format editor and year, and check if year is present + % format booktitle, volume, and edition and check if title present + % + { translator empty$ + { format.editors.as.authors start.new.block + format.year.check output.dot.new.block + format.btitle.vol.edition + } + % + % format translator correctly + % + { translator editor = + not + { format.editors.as.authors start.new.block + format.year.check output.dot.new.block + format.btitle.vol.edition.trans + } + { format.ed.trans.as.authors start.new.block + format.year.check output.dot.new.block + format.btitle.vol.edition + } + if$ + } + if$ + format.type.number connect.with.space.check + add.period$ + } + if$ + } + % + % format author and year, and check if year is present + % format booktitle, volume, and edition and check if title present + % + { format.authors start.new.block + format.year.check output.dot.new.block + format.btitle.vol.edition.editor.trans + format.type.number connect.with.space.check + add.period$ + } + if$ + % + % format address and publisher + % + format.address.publisher.check + % + % if not empty, insert howpublished. + % (used if book is retrieved from the internet) + % + format.howpublished add.period$ + % + % format url + % + url empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + % + % format original publication (of reprint/translation) + % and optional note + % + format.orig.note + fin.entry +} +FUNCTION {incollection} +{ author empty$ + { editor.ne.trans + { format.atitle.type.trans.check } + { format.atitle.type.check } + if$ + output.new.block + format.year.month.day.check add.period$ + } + { format.authors start.new.block + format.year.month.day.check output.dot.new.block + editor.ne.trans + { format.atitle.type.trans.check } + { format.atitle.type.check } + if$ + } + if$ + editor empty$ + translator empty$ and + edition empty$ and + volume empty$ and + pages empty$ and + chapter empty$ and + booktitle empty$ and + 'skip$ + { + output.new.block + format.in.editors.trans + format.bvol.edition.pages + booktitle format.btitle.connect * add.period$ + } + if$ + format.address.publisher.check + format.howpublished add.period$ + url empty$ + 'skip$ + { + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + format.orig.note + fin.entry +} + +FUNCTION {inbookcollection} +{ author empty$ + { editor.ne.trans + { format.atitle.type.trans.check } + { format.atitle.type.check } + if$ + output.new.block + format.year.month.day.check add.period$ + } + { format.authors start.new.block + format.year.month.day.check output.dot.new.block + editor.ne.trans + { format.atitle.type.trans.check } + { format.atitle.type.check } + if$ + } + if$ + editor empty$ + translator empty$ and + edition empty$ and + volume empty$ and + pages empty$ and + chapter empty$ and + booktitle empty$ and + 'skip$ + { + output.new.block + in.format.in.editors.trans + format.bvol.edition.pages + booktitle format.btitle.connect * add.period$ + } + if$ + format.address.publisher.check + format.howpublished add.period$ + url empty$ + 'skip$ + { + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + format.orig.note + fin.entry +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % technical report number + % +FUNCTION {format.tr.number} +{ type empty$ + { "\BTR{}" } + { type "\bibnotype" = + { "" } + { type } + if$ + } + if$ + number format.rnumber.check connect.with.space.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title, volume, edition, report number + % +FUNCTION {format.tr.title.number} +{ format.betitle.check + % Single out the situation in which there is no number + % and type = {\bibnotype}, i.e., no type as well. + % (Why not use book then?) + type empty$ + { % Now, we're in the regular situation with at least a + % number, a type, a volume, or an edition. + "\APACbVolEdTR{" format.bvol.edition.check * "}{" * + format.tr.number * "}" * + } + { type "\bibnotype" = + number empty$ + volume empty$ + edition empty$ + and + and + and + { "" } + { % Now, we're in the regular situation with at least a + % number, a type, a volume, or an edition. + "\APACbVolEdTR {" format.bvol.edition.check * "}{" * + format.tr.number * "}" * + } + if$ + } + if$ + connect.with.space.check + title format.btitle.connect +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format address and institution of reports etc. + % + % Washington, DC: National Institute of Education + % or + % National Institute of Education (if address empty) + % + % warning if no institution + % +FUNCTION {format.address.institution.check} +{ url empty$ + doi empty$ and + { "institution" institution warning.if.empty + "address" address warning.if.empty + } + 'skip$ + if$ + institution empty$ + address empty$ + and + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + % + % If institution = author or institution = "author" + % or institution = "Author" then hand over the final choice how to + % format this to \LaTeX. See also format.address.publisher + % + author empty$ + institution empty$ or + { institution "\APACaddressInstitution{" } + { author institution = + "author" institution = or + "Author" institution = or + { author "\APACaddressInstitutionEqAuth{" } + { institution "\APACaddressInstitution{" } + if$ + } + if$ + address "" connect.check "}{" * + % Recover institution that was pushed onto the stack previously. + swap$ "" connect.check "}" * + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % reports + % +FUNCTION {techreport} +{ author empty$ + % + % no author: possibly edited report with editors as authors + % + { editor empty$ + % + % no author or editor: title serves as author. + % title formatted as book title + % + { format.tr.title.number output.dot.new.block + format.year.month.day.check add.period$ + } + % + % format editor and year, and check if year is present + % format report title and check if title present + % format volume, edition, type, and number + % + { format.editors.as.authors start.new.block + format.year.month.day.check output.dot.new.block + format.tr.title.number add.period$ + } + if$ + } + % + % format author and year, and check if year is present + % format report title and check if title present + % format volume, edition, type, and number + % + { format.authors start.new.block + format.year.month.day.check output.dot.new.block + format.tr.title.number add.period$ + } + if$ + % + % format address and institution, check if institution present + % + format.address.institution.check + % + % if not empty, insert howpublished. + % (used if report is retrieved from the internet) + % + format.howpublished add.period$ + % + % format url + % + url empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + % + % format optional note + % + note empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.note + } + if$ + fin.entry +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % (translated) article or chapter in report + % +FUNCTION {intechreport} +{ author empty$ + % + % no author: title serves as author. + % title formatted as article title (APA manual not consistent in this, + % compare statement on p. 119: ``treat as book title'' and + % example 8, p. 121: no underlining => article title) + % + { editor.ne.trans + { format.atitle.trans.check } + { format.atitle.check } + if$ + output.new.block + format.year.month.day.check output.dot.new.block + } + % + % format author and year, and check if year is present + % format article title and check if title or type present + % + { format.authors start.new.block + format.year.month.day.check output.dot.new.block + editor.ne.trans + { format.atitle.trans.check } + { format.atitle.check } + if$ + output.new.block + } + if$ + % + % format "In " editor " (Ed. \& Trans.), " + % booktitle, volume, edition, pages + % + format.in.editors.trans + % + % volume, edition, report type and number, pages + % + "\APACbVolEdTRpgs {" format.bvol.edition.check * "} {" * + format.tr.number * + "} {" * pages format.bpages.check * + "}" * + % + booktitle format.btitle.connect * + add.period$ + % + % format address and publisher + % + format.address.institution.check + % + % if not empty, insert howpublished. + % (used if report is retrieved from the internet) + % + format.howpublished add.period$ + % + % format url + % + url empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + % + % format original publication (of reprint/translation) + % and optional note + % + format.orig.note + fin.entry +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % papers presented at conferences etc. + % +FUNCTION {lecture} +{ author empty$ + { "author" author warning.if.empty } + { format.authors start.new.block } + if$ + % + % format year, month, and day, and check if year present + % format title and check if title present + % format howpublished and check if howpublished present + % + format.year.month.day.check output.dot.new.block + symposium empty$ + { format.betitle.check + title format.btitle.connect output.new.block + howpublished empty$ + { "symposium and howpublished missing in " cite$ * warning$ + "" + } + { "\APAChowpublished {" howpublished * "}" * } + if$ + address connect.with.comma.check + } + { format.atitle.type.check output.new.block + "\BIn{} " + chair empty$ + 'skip$ + { chair format.editor.names + chair num.names$ #1 > + { "(\BCHAIRS)" } + { "(\BCHAIR)" } + if$ + connect.with.space.check * ", " * + } + if$ + symposium format.btitle.no.dot * + format.howpublished + address connect.with.comma.check + } + if$ + add.period$ + % + % format url + % + url empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + % + % format optional note + % + note empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.note + } + if$ + fin.entry +} + +FUNCTION {format.ttitle.type.school} +{ doi empty$ not + url empty$ not or + howpublished empty$ not or + { pop$ } + { swap$ pop$ } + if$ + type empty$ + 'skip$ + { type "\bibnotype" = + { pop$ + "" + } + { pop$ + type + } + if$ + } + if$ + duplicate$ empty$ + doi empty$ + url empty$ and + howpublished empty$ and + address empty$ + school empty$ and or and + { 'pop$ + title empty$ not + englishtitle empty$ not or + { start.new.block } + 'skip$ + if$ + "" + } + { start.new.block + "\APACtypeAddressSchool {" swap$ * "}{" * + doi empty$ + url empty$ and + howpublished empty$ and + { "}{}" * } + { address "" connect.check "}{" * + school "" connect.check "}" * + } + if$ + } + if$ + format.betitle.check swap$ + connect.with.space.check + "title" title warning.if.empty + title format.btitle.connect +} +FUNCTION {unpub.address.school.block} +{ doi empty$ + url empty$ and + howpublished empty$ and + { "school" school warning.if.empty + school empty$ + address empty$ and + 'skip$ + { start.new.block + "\APACaddressSchool {" address "" connect.check "}{" * + school "" connect.check "}" * + output.dot.end.block + } + if$ + } + 'skip$ + if$ +} +FUNCTION {thesis} +{ journal empty$ not + { pop$ pop$ + article + } + { author empty$ + { "author" author warning.if.empty } + { format.authors start.new.block } + if$ + format.year.check output.dot.end.block + format.ttitle.type.school output.dot.end.block + unpub.address.school.block + howpublished.block + url.block + note.block + fin.entry.2 + } + if$ +} +FUNCTION {phdthesis} +{ "\BPhD" "\BUPhD" thesis } +FUNCTION {mastersthesis} +{ "\BMTh" "\BUMTh" thesis } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title of something (used in unpublished and misc) + % english translation of title + % type and number of something + % +FUNCTION {format.btitle.type.num} +{ format.betitle.check + format.bvol.edition connect.with.space.check + format.type.number + connect.with.space.check + title empty$ + { add.period$ } + { title format.btitle.connect } + if$ +} + +FUNCTION {format.version} +{ + version empty$ + { "" } + { " " * version *} + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title of message or software-related thing (used in misc) + % english translation of title + % type and number of something + % +FUNCTION {format.mtitle.type.num} +{ format.aetitle.check + format.bvol.edition connect.with.space.check + type.2 "\bibmessage" = + { number empty$ + 'skip$ + { type.2 number tie.or.space.connect + bracket.check + connect.with.space.check + } + if$ + } + { format.type.number + connect.with.space.check + } + if$ + title empty$ + { add.period$ } + { title format.atitle.connect } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title, english translation of title, + % type and number of something (used in misc) + % +FUNCTION {output.misctitle.type.num} +{ type.2 empty$ + { format.btitle.type.num } + { type.2 "\bibmessage" = + type.2 "\bibcomputerprogram" = or + type.2 "\bibcomputerprogrammanual" = or + type.2 "\bibcomputerprogramandmanual" = or + type.2 "\bibcomputersoftware" = or + type.2 "\bibcomputersoftwaremanual" = or + type.2 "\bibcomputersoftwareandmanual" = or + type.2 "\bibprogramminglanguage" = or + { format.mtitle.type.num } + { format.btitle.type.num } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % unpublished manuscripts, etc. + % +FUNCTION {unpublished} +{ check.relevant.fields + author empty$ + % + % no author: possibly edited book with editors as authors + % + { editor empty$ + % + % no author or editor: title serves as author. + % title formatted as book title + % + { format.btitle.type.num output.new.block + format.year.month.day.check add.period$ + } + % + % format editor and year, and check if year is present + % format book title, volume, and edition and check if title present + % + { format.editors.as.authors start.new.block + format.year.month.day.check output.dot.new.block + format.btitle.type.num + } + if$ + } + % + % format author and year, and check if year is present + % format book title, volume, and edition + % and check if title or type present + % + { format.authors start.new.block + format.year.month.day.check output.dot.new.block + format.btitle.type.num + } + if$ + howpublished empty$ + organization empty$ and + address empty$ and + 'skip$ + { output.new.block + "\APAChowpublished{" "}" howpublished enclose.check + organization connect.with.comma.check + address connect.with.comma.check + add.period$ + } + if$ + % + % format url + % + url empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + % + % format optional note + % + note empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.note + } + if$ + fin.entry +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % nonprint media and other things that don't fit + % +FUNCTION {misc} +{ % + % To handle @manual: use type.2 instead of type. + type.2 empty$ + type empty$ not and + { type 'type.2 := } + 'skip$ + if$ + % + author empty$ + % + % no author: possibly edited item with editors as authors + % + { editor empty$ + % + % no author or editor: title/type serves as author. + % title formatted as book title + % + % if no title and no type, howpublished is title + % + { title empty$ + type.2 empty$ and + { howpublished empty$ + { "No author, editor, title, type, and howpublished in " + cite$ * warning$ + "" + } + { "\APAChowpublished{" howpublished * "}" * add.period$ } + if$ + format.year.month.day.check add.period$ + } + { output.misctitle.type.num %output.new.block + format.year.month.day.check add.period$ + format.howpublished add.period$ + } + if$ + } + % + % format editor and year, and check if year is present + % format book title, volume, and edition and check if title present + % + { format.editors.as.authors start.new.block + format.year.month.day.check output.dot.new.block + output.misctitle.type.num output.dot.new.block + format.howpublished add.period$ + } + if$ + } + % + % format author and year, and check if year is present + % format book title, volume, and edition + % and check if title or type present + % + { format.authors start.new.block + format.year.month.day.check output.dot.new.block + output.misctitle.type.num + format.howpublished add.period$ + } + if$ + % + address empty$ + publisher empty$ and + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.address.publisher add.period$ + } + if$ + % + % format url + % + url empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + % + % format optional note + % + note empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.note + } + if$ + fin.entry +} + +FUNCTION {softmisc} +{ % + % To handle @manual: use type.2 instead of type. + type.2 empty$ + type empty$ not and + { type 'type.2 := } + 'skip$ + if$ + % + author empty$ + % + % no author: possibly edited item with editors as authors + % + { editor empty$ + % + % no author or editor: title/type serves as author. + % title formatted as book title + % + % if no title and no type, howpublished is title + % + { title empty$ + type.2 empty$ and + { howpublished empty$ + { "No author, editor, title, type, and howpublished in " + cite$ * warning$ + "" + } + { "\APAChowpublished{" howpublished * "}" * add.period$ } + if$ + format.year.month.day.check add.period$ + } + { output.misctitle.type.num %output.new.block + format.year.month.day.check add.period$ + format.howpublished add.period$ + } + if$ + } + % + % format editor and year, and check if year is present + % format book title, volume, and edition and check if title present + % + { format.editors.as.authors start.new.block + format.year.month.day.check output.dot.new.block + output.misctitle.type.num output.dot.new.block + format.howpublished add.period$ + } + if$ + } + % + % format author and year, and check if year is present + % format book title, volume, and edition + % and check if title or type present + % + { format.authors start.new.block + format.year.nomonth.day.check output.dot.new.block + output.misctitle.type.num + format.version + format.howpublished add.period$ + } + if$ + % + address empty$ + publisher empty$ and + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.address.publisher add.period$ + } + if$ + % + % format url + % + url empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + % + % format optional note + % + note empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.note + } + if$ + output.dot.new.block + format.softmisc.eprint + fin.entry +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % for legal cases and other cases that need to be + % done by hand + % +FUNCTION {literal} +{ "key" key warning.if.empty + "text" text warning.if.empty + text empty$ + { "" } + { text } + if$ + fin.entry +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % technical documentation + % +FUNCTION {manual} +{ % + % If type is empty, assume that it is a computer software manual. + % + type empty$ + { "\bibcomputersoftwaremanual" 'type.2 := } + 'skip$ + if$ + misc +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % booklet + % +FUNCTION {booklet} +{ misc } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % part of a book + % +FUNCTION {inbook} +{ inbookcollection } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % article in proceedings + % +FUNCTION {inproceedings} +{ incollection } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % article in proceedings (Kopka & Daly, 2004, p. 230) + % +FUNCTION {conference} +{ inproceedings } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % proceedings + % +FUNCTION {proceedings} +{ misc } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % unknown types + % +FUNCTION {default.type} +{ misc } + +FUNCTION {initialize} +{ + #6 'name.max := +%% #250 'entry.max$ := +%% #5000 'global.max$ := +} +FUNCTION {init.old.number} +{ #0 'old.number := } +FUNCTION {init.old.label} +{ "zzzzzz" 'old.label := } +FUNCTION {init.cite.initials.add.to.year} +{ #0 'cite.initials := + #0 'add.to.year := +} +FUNCTION {move.forward} +{ #1 'forward := } +FUNCTION {move.backward} +{ #0 'forward := } +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{}" write$ newline$ + "\renewcommand{\doi}[1]{\url{https://doi.org/#1}}" + write$ newline$ + "\bibcommenthead" write$ newline$ +} +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} +FUNCTION {write.bbl.entry} +{ + make.cite.labels + call.type$ +} +READ +EXECUTE { identify.apacite.version } +EXECUTE { initialize } +EXECUTE { init.old.number } +ITERATE { make.citeorder.number } +ITERATE { make.sort.title } +SORT +EXECUTE { init.old.number } +EXECUTE { init.old.label } +ITERATE { make.title.number } +ITERATE { make.tentative.sort.label } +SORT +ITERATE { init.cite.initials.add.to.year } +EXECUTE { init.initials } +ITERATE { check.add.initials } +EXECUTE { init.initials } +REVERSE { check.add.initials } +ITERATE { tentative.cite.num.names } +EXECUTE { init.cite.num.names } +EXECUTE { move.forward } +ITERATE { definitive.cite.num.names } +EXECUTE { init.cite.num.names } +EXECUTE { move.backward } +REVERSE { definitive.cite.num.names } +ITERATE { make.final.sort.key } +SORT +EXECUTE { begin.bib } +ITERATE { write.bbl.entry } +EXECUTE { end.bib } + +%% +%% End of file `apacite.bst'. diff --git a/papers/preprint/bst/sn-aps.bst b/papers/preprint/bst/sn-aps.bst new file mode 100644 index 000000000..4cc13dda7 --- /dev/null +++ b/papers/preprint/bst/sn-aps.bst @@ -0,0 +1,1530 @@ +%% +%% This is file `spphys.bst', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% merlin.mbs (with options: `seq-no,vonx,nm-init,ed-au,yr-par,xmth,jtit-x,jttl-rm,thtit-a,vol-bf,volp-com,jpg-1,pgsep-c,num-xser,ser-vol,ser-ed,jnm-x,pub-date,pre-pub,doi,edpar,edby,fin-bare,pp,ed,abr,ord,jabr,xand,url,url-blk,nfss,') +%% ---------------------------------------- +%%********************************************************************************%% +%% %% +%% For Springer physics publications. Based on the APS reference style. %% +%% Report bugs and improvements to: Joylene Vette-Guillaume or Frank Holzwarth %% +%% Springer-Verlag 2004/10/15 %% +%% %% +%%********************************************************************************%% +%% +%% Copyright 1994-2004 Patrick W Daly + % =============================================================== + % IMPORTANT NOTICE: + % This bibliographic style (bst) file has been generated from one or + % more master bibliographic style (mbs) files, listed above. + % + % This generated file can be redistributed and/or modified under the terms + % of the LaTeX Project Public License Distributed from CTAN + % archives in directory macros/latex/base/lppl.txt; either + % version 1 of the License, or any later version. + % =============================================================== + % Name and version information of the main mbs file: + % \ProvidesFile{merlin.mbs}[2004/02/09 4.13 (PWD, AO, DPC)] + % For use with BibTeX version 0.99a or later + %------------------------------------------------------------------- + % This bibliography style file is intended for texts in ENGLISH + % This is a numerical citation style, and as such is standard LaTeX. + % It requires no extra package to interface to the main text. + % The form of the \bibitem entries is + % \bibitem{key}... + % Usage of \cite is as follows: + % \cite{key} ==>> [#] + % \cite[chap. 2]{key} ==>> [#, chap. 2] + % where # is a number determined by the ordering in the reference list. + % The order in the reference list is that by which the works were originally + % cited in the text, or that in the database. + %--------------------------------------------------------------------- + +ENTRY + { address + author + booktitle + chapter + doi + edition + editor + eid + howpublished + institution + journal + key + keywords + month + note + number + organization + pages + publisher + school + series + title + type + url + volume + year + eprint + archive + archivePrefix + primaryClass + adsurl + adsnote + version + } + {} + { label } +INTEGERS { output.state before.all mid.sentence after.sentence after.block } +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} +STRINGS { s t} +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} +FUNCTION {fin.entry} +{ duplicate$ empty$ + 'pop$ + 'write$ + if$ + newline$ +} + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} +FUNCTION {add.blank} +{ " " * before.all 'output.state := +} + +FUNCTION {add.comma} +{ duplicate$ empty$ + 'skip$ + { "," * add.blank } + if$ +} + +FUNCTION {date.block} +{ + new.block +} + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} +FUNCTION {new.block.checka} +{ empty$ + 'skip$ + 'new.block + if$ +} +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} +FUNCTION {new.sentence.checka} +{ empty$ + 'skip$ + 'new.sentence + if$ +} +FUNCTION {new.sentence.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.sentence + if$ +} +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "\emph{" swap$ * "}" * } + if$ +} +FUNCTION {bolden} +{ duplicate$ empty$ + { pop$ "" } + { "\textbf{" swap$ * "}" * } + if$ +} +FUNCTION {tie.or.space.prefix} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ +} + +FUNCTION {capitalize} +{ "u" change.case$ "t" change.case$ } + +FUNCTION {space.word} +{ " " swap$ * " " * } + % Here are the language-specific definitions for explicit words. + % Each function has a name bbl.xxx where xxx is the English word. + % The language selected here is ENGLISH +FUNCTION {bbl.and} +{ "and"} + +FUNCTION {bbl.etal} +{ "et~al." } + +FUNCTION {bbl.editors} +{ "eds." } + +FUNCTION {bbl.editor} +{ "ed." } + +FUNCTION {bbl.edby} +{ "ed. by" } + +FUNCTION {bbl.edition} +{ "edn." } + +FUNCTION {bbl.volume} +{ "vol." } + +FUNCTION {bbl.of} +{ "of" } + +FUNCTION {bbl.number} +{ "no." } + +FUNCTION {bbl.nr} +{ "no." } + +FUNCTION {bbl.in} +{ "in" } + +FUNCTION {bbl.pages} +{ "pp." } + +FUNCTION {bbl.page} +{ "p." } + +FUNCTION {bbl.chapter} +{ "chap." } + +FUNCTION {bbl.techrep} +{ "Tech. Rep." } + +FUNCTION {bbl.mthesis} +{ "Master's thesis" } + +FUNCTION {bbl.phdthesis} +{ "Ph.D. thesis" } + +FUNCTION {bbl.first} +{ "1st" } + +FUNCTION {bbl.second} +{ "2nd" } + +FUNCTION {bbl.third} +{ "3rd" } + +FUNCTION {bbl.fourth} +{ "4th" } + +FUNCTION {bbl.fifth} +{ "5th" } + +FUNCTION {bbl.st} +{ "st" } + +FUNCTION {bbl.nd} +{ "nd" } + +FUNCTION {bbl.rd} +{ "rd" } + +FUNCTION {bbl.th} +{ "th" } + +MACRO {jan} {"Jan."} + +MACRO {feb} {"Feb."} + +MACRO {mar} {"Mar."} + +MACRO {apr} {"Apr."} + +MACRO {may} {"May"} + +MACRO {jun} {"Jun."} + +MACRO {jul} {"Jul."} + +MACRO {aug} {"Aug."} + +MACRO {sep} {"Sep."} + +MACRO {oct} {"Oct."} + +MACRO {nov} {"Nov."} + +MACRO {dec} {"Dec."} + +FUNCTION {eng.ord} +{ duplicate$ "1" swap$ * + #-2 #1 substring$ "1" = + { bbl.th * } + { duplicate$ #-1 #1 substring$ + duplicate$ "1" = + { pop$ bbl.st * } + { duplicate$ "2" = + { pop$ bbl.nd * } + { "3" = + { bbl.rd * } + { bbl.th * } + if$ + } + if$ + } + if$ + } + if$ +} + +MACRO {acmcs} {"ACM Comput. Surv."} + +MACRO {acta} {"Acta Inf."} + +MACRO {cacm} {"Commun. ACM"} + +MACRO {ibmjrd} {"IBM J. Res. Dev."} + +MACRO {ibmsj} {"IBM Syst.~J."} + +MACRO {ieeese} {"IEEE Trans. Software Eng."} + +MACRO {ieeetc} {"IEEE Trans. Comput."} + +MACRO {ieeetcad} + {"IEEE Trans. Comput. Aid. Des."} + +MACRO {ipl} {"Inf. Process. Lett."} + +MACRO {jacm} {"J.~ACM"} + +MACRO {jcss} {"J.~Comput. Syst. Sci."} + +MACRO {scp} {"Sci. Comput. Program."} + +MACRO {sicomp} {"SIAM J. Comput."} + +MACRO {tocs} {"ACM Trans. Comput. Syst."} + +MACRO {tods} {"ACM Trans. Database Syst."} + +MACRO {tog} {"ACM Trans. Graphic."} + +MACRO {toms} {"ACM Trans. Math. Software"} + +MACRO {toois} {"ACM Trans. Office Inf. Syst."} + +MACRO {toplas} {"ACM Trans. Progr. Lang. Syst."} + +MACRO {tcs} {"Theor. Comput. Sci."} + +FUNCTION {bibinfo.check} +{ swap$ + duplicate$ missing$ + { + pop$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ pop$ + } + { swap$ + pop$ + } + if$ + } + if$ +} +FUNCTION {bibinfo.warn} +{ swap$ + duplicate$ missing$ + { + swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ "empty " swap$ * " in " * cite$ * warning$ + } + { swap$ + pop$ + } + if$ + } + if$ +} +FUNCTION {format.url} +{ url empty$ + { "" } + { "\urlprefix\url{" url * "}" * } + if$ +} + +STRINGS { bibinfo} +INTEGERS { nameptr namesleft numnames } + +FUNCTION {format.names} +{ 'bibinfo := + duplicate$ empty$ 'skip$ { + 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{f{.}.~}{vv~}{ll}{, jj}" + format.name$ + bibinfo bibinfo.check + 't := + nameptr #1 > + { + namesleft #1 > + { ", " * t * } + { + "," * + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal * + } + { " " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } if$ +} +FUNCTION {format.names.ed} +{ + format.names +} +FUNCTION {format.authors} +{ author "author" format.names +} +FUNCTION {get.bbl.editor} +{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } + +FUNCTION {format.editors} +{ editor "editor" format.names duplicate$ empty$ 'skip$ + { + " " * + get.bbl.editor + "(" swap$ * ")" * + * + } + if$ +} +FUNCTION {format.doi} +{ doi "doi" bibinfo.check + duplicate$ empty$ 'skip$ + { + new.block + "\doi{" swap$ * "}" * + } + if$ +} +FUNCTION {format.note} +{ + note empty$ + { "" } + { note #1 #1 substring$ + duplicate$ "{" = + 'skip$ + { output.state mid.sentence = + { "l" } + { "u" } + if$ + change.case$ + } + if$ + note #2 global.max$ substring$ * "note" bibinfo.check + } + if$ +} + +FUNCTION {format.title} +{ title + duplicate$ empty$ 'skip$ + { "t" change.case$ } + if$ + "title" bibinfo.check +} +FUNCTION {output.bibitem} +{ newline$ + "\bibitem{" write$ + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {if.digit} +{ duplicate$ "0" = + swap$ duplicate$ "1" = + swap$ duplicate$ "2" = + swap$ duplicate$ "3" = + swap$ duplicate$ "4" = + swap$ duplicate$ "5" = + swap$ duplicate$ "6" = + swap$ duplicate$ "7" = + swap$ duplicate$ "8" = + swap$ "9" = or or or or or or or or or +} +FUNCTION {n.separate} +{ 't := + "" + #0 'numnames := + { t empty$ not } + { t #-1 #1 substring$ if.digit + { numnames #1 + 'numnames := } + { #0 'numnames := } + if$ + t #-1 #1 substring$ swap$ * + t #-2 global.max$ substring$ 't := + numnames #5 = + { duplicate$ #1 #2 substring$ swap$ + #3 global.max$ substring$ + "," swap$ * * + } + 'skip$ + if$ + } + while$ +} +FUNCTION {n.dashify} +{ +%% n.separate + 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {word.in} +{ bbl.in + " " * } + +FUNCTION {format.date} +{ + "" + duplicate$ empty$ + year "year" bibinfo.check duplicate$ empty$ + { swap$ 'skip$ + { "there's a month but no year in " cite$ * warning$ } + if$ + * + } + { swap$ 'skip$ + { + swap$ + " " * swap$ + } + if$ + * + } + if$ + duplicate$ empty$ + 'skip$ + { + before.all 'output.state := + " (" swap$ * ")" * + } + if$ +} +FUNCTION {format.btitle} +{ title "title" bibinfo.check + duplicate$ empty$ 'skip$ + { + emphasize + } + if$ +} +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { bbl.volume volume tie.or.space.prefix + "volume" bibinfo.check * * + series "series" bibinfo.check + duplicate$ empty$ 'pop$ + { emphasize ", " * swap$ * } + if$ + "volume and number" number either.or.check + } + if$ +} +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { series empty$ + { number "number" bibinfo.check } + { output.state mid.sentence = + { bbl.number } + { bbl.number capitalize } + if$ + number tie.or.space.prefix "number" bibinfo.check * * + bbl.in space.word * + series "series" bibinfo.check * + } + if$ + } + if$ + } + { "" } + if$ +} +FUNCTION {is.num} +{ chr.to.int$ + duplicate$ "0" chr.to.int$ < not + swap$ "9" chr.to.int$ > not and +} + +FUNCTION {extract.num} +{ duplicate$ 't := + "" 's := + { t empty$ not } + { t #1 #1 substring$ + t #2 global.max$ substring$ 't := + duplicate$ is.num + { s swap$ * 's := } + { pop$ "" 't := } + if$ + } + while$ + s empty$ + 'skip$ + { pop$ s } + if$ +} + +FUNCTION {convert.edition} +{ extract.num "l" change.case$ 's := + s "first" = s "1" = or + { bbl.first 't := } + { s "second" = s "2" = or + { bbl.second 't := } + { s "third" = s "3" = or + { bbl.third 't := } + { s "fourth" = s "4" = or + { bbl.fourth 't := } + { s "fifth" = s "5" = or + { bbl.fifth 't := } + { s #1 #1 substring$ is.num + { s eng.ord 't := } + { edition 't := } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + t +} + +FUNCTION {format.edition} +{ edition duplicate$ empty$ 'skip$ + { + convert.edition + output.state mid.sentence = + { "l" } + { "t" } + if$ change.case$ + "edition" bibinfo.check + " " * bbl.edition * + } + if$ +} +INTEGERS { multiresult } +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} +FUNCTION {format.pages} +{ pages duplicate$ empty$ 'skip$ + { duplicate$ multi.page.check + { + bbl.pages swap$ + n.dashify + } + { + bbl.page swap$ + } + if$ + tie.or.space.prefix + "pages" bibinfo.check + * * + } + if$ +} +FUNCTION {first.page} +{ 't := + "" + { t empty$ not t #1 #1 substring$ "-" = not and } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + while$ +} + +FUNCTION {format.journal.pages} +{ pages duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ + { pop$ pop$ format.pages } + { + ", " * + swap$ + n.dashify + "pages" bibinfo.check + * + } + if$ + } + if$ +} +FUNCTION {format.journal.eid} +{ eid "eid" bibinfo.check + duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ 'skip$ + { + ", " * + } + if$ + swap$ * + } + if$ +} +FUNCTION {format.vol.num.pages} +{ volume field.or.null + duplicate$ empty$ 'skip$ + { + "volume" bibinfo.check + } + if$ + bolden + number "number" bibinfo.check duplicate$ empty$ 'skip$ + { + swap$ duplicate$ empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + swap$ + "(" swap$ * ")" * + } + if$ * + eid empty$ + { format.journal.pages } + { format.journal.eid } + if$ +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { bbl.chapter } + { type "l" change.case$ + "type" bibinfo.check + } + if$ + chapter tie.or.space.prefix + "chapter" bibinfo.check + * * + pages empty$ + 'skip$ + { ", " * format.pages * } + if$ + } + if$ +} + +FUNCTION {format.booktitle} +{ + booktitle "booktitle" bibinfo.check + emphasize +} +FUNCTION {format.in.ed.booktitle} +{ format.booktitle duplicate$ empty$ 'skip$ + { + format.bvolume duplicate$ empty$ 'pop$ + { ", " swap$ * * } + if$ + editor "editor" format.names.ed duplicate$ empty$ 'pop$ + { + bbl.edby + " " * swap$ * + swap$ + "," * + " " * swap$ + * } + if$ + word.in swap$ * + } + 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 duplicate$ empty$ + 'pop$ + { swap$ pop$ + "t" change.case$ "type" bibinfo.check + } + if$ +} +FUNCTION {format.tr.number} +{ number "number" bibinfo.check + type duplicate$ empty$ + { pop$ bbl.techrep } + 'skip$ + if$ + "type" bibinfo.check + swap$ duplicate$ empty$ + { pop$ "t" change.case$ } + { tie.or.space.prefix * * } + if$ +} +FUNCTION {format.article.crossref} +{ + key duplicate$ empty$ + { pop$ + journal duplicate$ empty$ + { "need key or journal for " cite$ * " to crossref " * crossref * warning$ } + { "journal" bibinfo.check emphasize word.in swap$ * } + if$ + } + { word.in swap$ * " " *} + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {format.crossref.editor} +{ editor #1 "{vv~}{ll}" format.name$ + "editor" bibinfo.check + editor num.names$ duplicate$ + #2 > + { pop$ + "editor" bibinfo.check + " " * bbl.etal + * + } + { #2 < + 'skip$ + { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { + "editor" bibinfo.check + " " * bbl.etal + * + } + { + bbl.and space.word + * editor #2 "{vv~}{ll}" format.name$ + "editor" bibinfo.check + * + } + if$ + } + if$ + } + if$ +} +FUNCTION {format.book.crossref} +{ volume duplicate$ empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + pop$ word.in + } + { bbl.volume + capitalize + swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word * + } + if$ + editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { series empty$ + { "need editor, key, or series for " cite$ * " to crossref " * + crossref * warning$ + "" * + } + { series emphasize * } + if$ + } + { key * } + if$ + } + { format.crossref.editor * } + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {format.incoll.inproc.crossref} +{ + editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { format.booktitle duplicate$ empty$ + { "need editor, key, or booktitle for " cite$ * " to crossref " * + crossref * warning$ + } + { word.in swap$ * } + if$ + } + { word.in key * " " *} + if$ + } + { word.in format.crossref.editor * " " *} + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {format.org.or.pub} +{ 't := + "" + year empty$ + { "empty year in " cite$ * warning$ } + 'skip$ + if$ + address empty$ t empty$ and + year empty$ and + 'skip$ + { + add.blank "(" * + t empty$ + { address "address" bibinfo.check * + } + { t * + address empty$ + 'skip$ + { ", " * address "address" bibinfo.check * } + if$ + } + if$ + year empty$ + 'skip$ + { t empty$ address empty$ and + 'skip$ + { ", " * } + if$ + year "year" bibinfo.check + * + } + if$ + ")" * + } + if$ +} +FUNCTION {format.publisher.address} +{ publisher "publisher" bibinfo.warn format.org.or.pub +} + +FUNCTION {format.organization.address} +{ organization "organization" bibinfo.check format.org.or.pub +} + +FUNCTION {format.softmisc.archive} +{ + archivePrefix empty$ + { "" } + { "" } + if$ +} + +FUNCTION {format.archive} +{ + archivePrefix empty$ + { "" } + { archivePrefix ":" *} + if$ +} + +FUNCTION {format.primaryClass} +{ + primaryClass empty$ + { "" } + { "{[" primaryClass * "]}" *} + if$ +} + +FUNCTION {format.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {format.softmisc.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + add.comma + format.title "title" output.check + new.block + crossref missing$ + { + journal + "journal" bibinfo.check + "journal" output.check + add.blank + format.vol.num.pages output + format.date "year" output.check + } + { format.article.crossref output.nonnull + format.pages output + } + if$ + format.doi output + new.block + format.url output + new.block + format.note output + new.block + format.eprint output + add.blank + format.primaryClass output + fin.entry +} + +FUNCTION {book} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + add.comma + format.btitle "title" output.check + crossref missing$ + { format.bvolume output + format.edition output + new.block + format.number.series output + new.sentence + format.publisher.address output + format.pages output + } + { + new.block + format.book.crossref output.nonnull + format.date "year" output.check + } + if$ + format.doi output + new.block + format.url output + new.block + format.note output + fin.entry +} +FUNCTION {booklet} +{ output.bibitem + format.authors output + add.comma + format.title "title" output.check + new.block + howpublished "howpublished" bibinfo.check output + address "address" bibinfo.check output + format.date output + format.doi output + new.block + format.url output + new.block + format.note output + fin.entry +} + +FUNCTION {inbook} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + add.comma + format.btitle "title" output.check + crossref missing$ + { + format.publisher.address output + format.bvolume output + format.edition output + format.chapter.pages "chapter and pages" output.check + new.block + format.number.series output + new.sentence + } + { + format.chapter.pages "chapter and pages" output.check + new.block + format.book.crossref output.nonnull + format.date "year" output.check + } + if$ + format.doi output + new.block + format.url output + new.block + format.note output + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + add.comma + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.edition output + format.number.series output + format.publisher.address output + format.chapter.pages output + new.sentence + } + { format.incoll.inproc.crossref output.nonnull + format.chapter.pages output + } + if$ + format.doi output + new.block + format.url output + new.block + format.note output + fin.entry +} +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check + add.comma + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + new.sentence + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + format.number.series output + format.pages output + } + { format.incoll.inproc.crossref output.nonnull + format.pages output + } + if$ + format.doi output + new.block + format.url output + new.block + format.note output + fin.entry +} +FUNCTION {conference} { inproceedings } +FUNCTION {manual} +{ output.bibitem + author empty$ + { organization "organization" bibinfo.check + duplicate$ empty$ 'pop$ + { output + address "address" bibinfo.check output + } + if$ + } + { format.authors output.nonnull } + if$ + add.comma + format.btitle "title" output.check + author empty$ + { organization empty$ + { + address new.block.checka + address "address" bibinfo.check output + } + 'skip$ + if$ + } + { + organization address new.block.checkb + organization "organization" bibinfo.check output + address "address" bibinfo.check output + } + if$ + format.edition output + format.date output + format.doi output + new.block + format.url output + new.block + format.note output + fin.entry +} + +FUNCTION {mastersthesis} +{ output.bibitem + format.authors "author" output.check + add.comma + format.title + "title" output.check + new.block + bbl.mthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.date "year" output.check + format.doi output + new.block + format.url output + new.block + format.note output + fin.entry +} + +FUNCTION {misc} +{ output.bibitem + format.authors output + title howpublished new.block.checkb + format.title output + howpublished new.block.checka + howpublished "howpublished" bibinfo.check output + format.date output + format.doi output + new.block + format.url output + new.block + format.note output + fin.entry + empty.misc.check +} + +FUNCTION {softmisc} +{ output.bibitem + format.authors output + title howpublished new.block.checkb + format.title output + version output + howpublished new.block.checka + howpublished "howpublished" bibinfo.check output + format.date output + format.doi output + new.block + format.url output + new.block + format.note output + new.block + format.softmisc.eprint output + fin.entry + empty.misc.check +} + +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" output.check + add.comma + format.title + "title" output.check + new.block + bbl.phdthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.date "year" output.check + format.doi output + new.block + format.url output + new.block + format.note output + fin.entry +} + +FUNCTION {proceedings} +{ output.bibitem + editor empty$ + { organization "organization" bibinfo.check output + } + { format.editors output.nonnull } + if$ + new.block + format.btitle "title" output.check + format.bvolume output + format.number.series output + editor empty$ + { publisher empty$ + 'skip$ + { + new.sentence + format.publisher.address output + } + if$ + } + { publisher empty$ + { + new.sentence + format.organization.address output } + { + new.sentence + organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + } + if$ + format.doi output + new.block + format.url output + new.block + format.note output + fin.entry +} + +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check + add.comma + format.title + "title" output.check + new.block + format.tr.number output.nonnull + institution "institution" bibinfo.warn output + address "address" bibinfo.check output + format.date "year" output.check + format.doi output + new.block + format.url output + new.block + format.note output + fin.entry +} + +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check + add.comma + format.title "title" output.check + format.date output + format.doi output + new.block + format.url output + new.block + format.note "note" output.check + fin.entry +} + +FUNCTION {default.type} { misc } +READ +STRINGS { longest.label } +INTEGERS { number.label longest.label.width } +FUNCTION {initialize.longest.label} +{ "" 'longest.label := + #1 'number.label := + #0 'longest.label.width := +} +FUNCTION {longest.label.pass} +{ number.label int.to.str$ 'label := + number.label #1 + 'number.label := + label width$ longest.label.width > + { label 'longest.label := + label width$ 'longest.label.width := + } + 'skip$ + if$ +} +EXECUTE {initialize.longest.label} +ITERATE {longest.label.pass} +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" longest.label * "}" * + write$ newline$ + "\providecommand{\url}[1]{{#1}}" + write$ newline$ + "\providecommand{\urlprefix}{URL }" + write$ newline$ + %%"\expandafter\ifx\csname urlstyle\endcsname\relax" + %% write$ newline$ + %%" \providecommand{\doi}[1]{\discretionary{}{}{}#1}\else" + %%write$ newline$ + %%" \providecommand{\doi}{\discretionary{}{}{}\begingroup \urlstyle{rm}\Url}\fi" + "\providecommand{\doi}[1]{\url{https://doi.org/#1}}" + write$ newline$ + "\bibcommenthead" write$ newline$ +} +EXECUTE {begin.bib} +EXECUTE {init.state.consts} +ITERATE {call.type$} +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} +EXECUTE {end.bib} +%% End of customized bst file +%% +%% End of file `spphys.bst'. + diff --git a/papers/preprint/bst/sn-basic.bst b/papers/preprint/bst/sn-basic.bst new file mode 100644 index 000000000..5072a4d9d --- /dev/null +++ b/papers/preprint/bst/sn-basic.bst @@ -0,0 +1,1798 @@ +%% +%% This is file `spbasic.bst', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% merlin.mbs (with options: `ay,nat,seq-lab,vonx,nm-rvx,ed-rev,jnrlst,dt-beg,yr-par,yrp-x,yrpp-xsp,note-yr,jxper,jttl-rm,thtit-a,pgsep-c,num-xser,ser-vol,jnm-x,btit-rm,bt-rm,pre-pub,doi,edparxc,blk-tit,in-col,fin-bare,pp,ed,abr,mth-bare,ord,jabr,xand,eprint,url,url-blk,em-x,nfss,') +%% ---------------------------------------- +%% +%%********************************************************************************%% +%% %% +%% For Springer medical, life sciences, chemistry, geology, engineering and %% +%% computer science publications. %% +%% For use with the natbib package (see below). Default is author-year citations. %% +%% When citations are numbered, please use \usepackage[numbers]{natbib}. %% +%% %% +%%********************************************************************************%% +%% +%% Copyright 1994-2004 Patrick W Daly + % =============================================================== + % IMPORTANT NOTICE: + % This bibliographic style (bst) file has been generated from one or + % more master bibliographic style (mbs) files, listed above. + % + % This generated file can be redistributed and/or modified under the terms + % of the LaTeX Project Public License Distributed from CTAN + % archives in directory macros/latex/base/lppl.txt; either + % version 1 of the License, or any later version. + % =============================================================== + % Name and version information of the main mbs file: + % \ProvidesFile{merlin.mbs}[2004/02/09 4.13 (PWD, AO, DPC)] + % For use with BibTeX version 0.99a or later + %------------------------------------------------------------------- + % This bibliography style file is intended for texts in ENGLISH + % This is an author-year citation style bibliography. As such, it is + % non-standard LaTeX, and requires a special package file to function properly. + % Such a package is natbib.sty by Patrick W. Daly + % The form of the \bibitem entries is + % \bibitem[Jones et al.(1990)]{key}... + % \bibitem[Jones et al.(1990)Jones, Baker, and Smith]{key}... + % The essential feature is that the label (the part in brackets) consists + % of the author names, as they should appear in the citation, with the year + % in parentheses following. There must be no space before the opening + % parenthesis! + % With natbib v5.3, a full list of authors may also follow the year. + % In natbib.sty, it is possible to define the type of enclosures that is + % really wanted (brackets or parentheses), but in either case, there must + % be parentheses in the label. + % The \cite command functions as follows: + % \citet{key} ==>> Jones et al. (1990) + % \citet*{key} ==>> Jones, Baker, and Smith (1990) + % \citep{key} ==>> (Jones et al., 1990) + % \citep*{key} ==>> (Jones, Baker, and Smith, 1990) + % \citep[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2) + % \citep[e.g.][]{key} ==>> (e.g. Jones et al., 1990) + % \citep[e.g.][p. 32]{key} ==>> (e.g. Jones et al., p. 32) + % \citeauthor{key} ==>> Jones et al. + % \citeauthor*{key} ==>> Jones, Baker, and Smith + % \citeyear{key} ==>> 1990 + %--------------------------------------------------------------------- + +ENTRY + { address + archive + author + booktitle + chapter + doi + edition + editor + eid + eprint + howpublished + institution + journal + key + keywords + month + note + number + organization + pages + publisher + school + series + title + type + url + volume + year + archivePrefix + primaryClass + adsurl + adsnote + version + } + {} + { label extra.label sort.label short.list } +INTEGERS { output.state before.all mid.sentence after.sentence after.block } +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} +STRINGS { s t} +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} +FUNCTION {fin.entry} +{ duplicate$ empty$ + 'pop$ + 'write$ + if$ + newline$ +} + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} +FUNCTION {add.blank} +{ " " * before.all 'output.state := +} + +FUNCTION {no.blank.or.punct} +{ "\hspace{0pt}" * before.all 'output.state := +} + +FUNCTION {date.block} +{ + add.blank +} + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} +STRINGS {z} +FUNCTION {remove.dots} +{ 'z := + "" + { z empty$ not } + { z #1 #1 substring$ + z #2 global.max$ substring$ 'z := + duplicate$ "." = 'pop$ + { * } + if$ + } + while$ +} +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} +FUNCTION {emphasize} +{ skip$ } +FUNCTION {tie.or.space.prefix} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ +} + +FUNCTION {capitalize} +{ "u" change.case$ "t" change.case$ } + +FUNCTION {space.word} +{ " " swap$ * " " * } + % Here are the language-specific definitions for explicit words. + % Each function has a name bbl.xxx where xxx is the English word. + % The language selected here is ENGLISH +FUNCTION {bbl.and} +{ "and"} + +FUNCTION {bbl.etal} +{ "et~al" } + +FUNCTION {bbl.editors} +{ "eds" } + +FUNCTION {bbl.editor} +{ "ed" } + +FUNCTION {bbl.edby} +{ "edited by" } + +FUNCTION {bbl.edition} +{ "edn." } + +FUNCTION {bbl.volume} +{ "vol" } + +FUNCTION {bbl.of} +{ "of" } + +FUNCTION {bbl.number} +{ "no." } + +FUNCTION {bbl.nr} +{ "no." } + +FUNCTION {bbl.in} +{ "in" } + +FUNCTION {bbl.pages} +{ "pp" } + +FUNCTION {bbl.incoll.pages} +{ "p" } + +FUNCTION {bbl.page} +{ "p" } + +FUNCTION {bbl.chapter} +{ "chap" } + +FUNCTION {bbl.techrep} +{ "Tech. Rep." } + +FUNCTION {bbl.mthesis} +{ "Master's thesis" } + +FUNCTION {bbl.phdthesis} +{ "PhD thesis" } + +FUNCTION {bbl.first} +{ "1st" } + +FUNCTION {bbl.second} +{ "2nd" } + +FUNCTION {bbl.third} +{ "3rd" } + +FUNCTION {bbl.fourth} +{ "4th" } + +FUNCTION {bbl.fifth} +{ "5th" } + +FUNCTION {bbl.st} +{ "st" } + +FUNCTION {bbl.nd} +{ "nd" } + +FUNCTION {bbl.rd} +{ "rd" } + +FUNCTION {bbl.th} +{ "th" } + +MACRO {jan} {"Jan."} + +MACRO {feb} {"Feb."} + +MACRO {mar} {"Mar."} + +MACRO {apr} {"Apr."} + +MACRO {may} {"May"} + +MACRO {jun} {"Jun."} + +MACRO {jul} {"Jul."} + +MACRO {aug} {"Aug."} + +MACRO {sep} {"Sep."} + +MACRO {oct} {"Oct."} + +MACRO {nov} {"Nov."} + +MACRO {dec} {"Dec."} + +FUNCTION {eng.ord} +{ duplicate$ "1" swap$ * + #-2 #1 substring$ "1" = + { bbl.th * } + { duplicate$ #-1 #1 substring$ + duplicate$ "1" = + { pop$ bbl.st * } + { duplicate$ "2" = + { pop$ bbl.nd * } + { "3" = + { bbl.rd * } + { bbl.th * } + if$ + } + if$ + } + if$ + } + if$ +} + +MACRO {acmcs} {"ACM Comput Surv"} + +MACRO {acta} {"Acta Inf"} + +MACRO {cacm} {"Commun ACM"} + +MACRO {ibmjrd} {"IBM~J~Res Dev"} + +MACRO {ibmsj} {"IBM Syst~J"} + +MACRO {ieeese} {"IEEE Trans Softw Eng"} + +MACRO {ieeetc} {"IEEE Trans Comput"} + +MACRO {ieeetcad} + {"IEEE Trans Comput Aid Des"} + +MACRO {ipl} {"Inf Process Lett"} + +MACRO {jacm} {"J~ACM"} + +MACRO {jcss} {"J~Comput Syst Sci"} + +MACRO {scp} {"Sci Comput Program"} + +MACRO {sicomp} {"SIAM J~Comput"} + +MACRO {tocs} {"ACM Trans Comput Syst"} + +MACRO {tods} {"ACM Trans Database Syst"} + +MACRO {tog} {"ACM Trans Graphic"} + +MACRO {toms} {"ACM Trans Math Softw"} + +MACRO {toois} {"ACM Trans Office Inf Syst"} + +MACRO {toplas} {"ACM Trans Program Lang Syst"} + +MACRO {tcs} {"Theor Comput Sci"} + +FUNCTION {bibinfo.check} +{ swap$ + duplicate$ missing$ + { + pop$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ pop$ + } + { swap$ + pop$ + } + if$ + } + if$ +} +FUNCTION {bibinfo.warn} +{ swap$ + duplicate$ missing$ + { + swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ "empty " swap$ * " in " * cite$ * warning$ + } + { swap$ + pop$ + } + if$ + } + if$ +} + +FUNCTION {format.eprint} +{ eprint duplicate$ empty$ + 'skip$ + { "\eprint" + archive empty$ + 'skip$ + { "[" * archive * "]" * } + if$ + "{" * swap$ * "}" * + } + if$ +} + +FUNCTION {format.archive} +{ + archivePrefix empty$ + { "" } + { archivePrefix ":" *} + if$ +} + +FUNCTION {format.primaryClass} +{ + primaryClass empty$ + { "" } + { "{[" primaryClass * "]}" *} + if$ +} + +FUNCTION {format.soft.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {format.softmisc.archive} +{ + archivePrefix empty$ + { "" } + { "" } + if$ +} + +FUNCTION {format.softmisc.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {format.url} +{ url empty$ + { "" } + { "\urlprefix\url{" url * "}" * } + if$ +} + +STRINGS { bibinfo} +INTEGERS { nameptr namesleft numnames } + +FUNCTION {format.names} +{ 'bibinfo := + duplicate$ empty$ 'skip$ { + 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv~}{ll}{ f{}}{jj}" + format.name$ 't := + nameptr #1 > + { + nameptr #3 + #1 + = + numnames #3 + > and + { "others" 't := + #1 'namesleft := } + 'skip$ + if$ + namesleft #1 > + { ", " * t * } + { + "," * + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal * + } + { " " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } if$ +} + +FUNCTION {format.names.ed} +{ + format.names +} +FUNCTION {format.key} +{ empty$ + { key field.or.null } + { "" } + if$ +} + +FUNCTION {format.authors} +{ author "author" format.names +} +FUNCTION {get.bbl.editor} +{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } + +FUNCTION {format.editors} +{ editor "editor" format.names duplicate$ empty$ 'skip$ + { + " " * + get.bbl.editor + "(" swap$ * ")" * + * + } + if$ +} +FUNCTION {format.doi} +{ doi "doi" bibinfo.check + duplicate$ empty$ 'skip$ + { + "\doi{" swap$ * "}" * + } + if$ +} +FUNCTION {format.note} +{ + note empty$ + { "" } + { note #1 #1 substring$ + duplicate$ "{" = + 'skip$ + { output.state mid.sentence = + { "l" } + { "u" } + if$ + change.case$ + } + if$ + note #2 global.max$ substring$ * "note" bibinfo.check + } + if$ +} + +FUNCTION {format.title} +{ title + duplicate$ empty$ 'skip$ + { "t" change.case$ } + if$ + "title" bibinfo.check +} +FUNCTION {format.full.names} +{'s := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv~}{ll}" format.name$ + 't := + nameptr #1 > + { + namesleft #1 > + { ", " * t * } + { + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal * + } + { + numnames #2 > + { "," * } + 'skip$ + if$ + bbl.and + space.word * t * + } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {author.editor.key.full} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.full.names } + if$ + } + { author format.full.names } + if$ +} + +FUNCTION {author.key.full} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.full.names } + if$ +} + +FUNCTION {editor.key.full} +{ editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.full.names } + if$ +} + +FUNCTION {make.full.names} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.full + { type$ "proceedings" = + 'editor.key.full + 'author.key.full + if$ + } + if$ +} + +FUNCTION {output.bibitem} +{ newline$ + "\bibitem[{" write$ + label write$ + ")" make.full.names duplicate$ short.list = + { pop$ } + { * } + if$ + "}]{" * write$ + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {add.period} +{ duplicate$ empty$ + 'skip$ + { "." * add.blank } + if$ +} + +FUNCTION {if.digit} +{ duplicate$ "0" = + swap$ duplicate$ "1" = + swap$ duplicate$ "2" = + swap$ duplicate$ "3" = + swap$ duplicate$ "4" = + swap$ duplicate$ "5" = + swap$ duplicate$ "6" = + swap$ duplicate$ "7" = + swap$ duplicate$ "8" = + swap$ "9" = or or or or or or or or or +} +FUNCTION {n.separate} +{ 't := + "" + #0 'numnames := + { t empty$ not } + { t #-1 #1 substring$ if.digit + { numnames #1 + 'numnames := } + { #0 'numnames := } + if$ + t #-1 #1 substring$ swap$ * + t #-2 global.max$ substring$ 't := + numnames #5 = + { duplicate$ #1 #2 substring$ swap$ + #3 global.max$ substring$ + "," swap$ * * + } + 'skip$ + if$ + } + while$ +} +FUNCTION {n.dashify} +{ +%% n.separate + 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {word.in} +{ bbl.in capitalize + ":" * + " " * } + +FUNCTION {format.date} +{ year "year" bibinfo.check duplicate$ empty$ + { + "empty year in " cite$ * "; set to ????" * warning$ + pop$ "????" + } + 'skip$ + if$ + extra.label * + before.all 'output.state := + " (" swap$ * ")" * +} +FUNCTION {format.btitle} +{ title "title" bibinfo.check + duplicate$ empty$ 'skip$ + { + } + if$ +} +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { bbl.volume volume tie.or.space.prefix + "volume" bibinfo.check * * + series "series" bibinfo.check + duplicate$ empty$ 'pop$ + { emphasize ", " * swap$ * } + if$ + "volume and number" number either.or.check + } + if$ +} +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { series empty$ + { number "number" bibinfo.check } + { output.state mid.sentence = + { bbl.number } + { bbl.number capitalize } + if$ + number tie.or.space.prefix "number" bibinfo.check * * + bbl.in space.word * + series "series" bibinfo.check * + } + if$ + } + if$ + } + { "" } + if$ +} +FUNCTION {is.num} +{ chr.to.int$ + duplicate$ "0" chr.to.int$ < not + swap$ "9" chr.to.int$ > not and +} + +FUNCTION {extract.num} +{ duplicate$ 't := + "" 's := + { t empty$ not } + { t #1 #1 substring$ + t #2 global.max$ substring$ 't := + duplicate$ is.num + { s swap$ * 's := } + { pop$ "" 't := } + if$ + } + while$ + s empty$ + 'skip$ + { pop$ s } + if$ +} + +FUNCTION {convert.edition} +{ extract.num "l" change.case$ 's := + s "first" = s "1" = or + { bbl.first 't := } + { s "second" = s "2" = or + { bbl.second 't := } + { s "third" = s "3" = or + { bbl.third 't := } + { s "fourth" = s "4" = or + { bbl.fourth 't := } + { s "fifth" = s "5" = or + { bbl.fifth 't := } + { s #1 #1 substring$ is.num + { s eng.ord 't := } + { edition 't := } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + t +} + +FUNCTION {format.edition} +{ edition duplicate$ empty$ 'skip$ + { + convert.edition + output.state mid.sentence = + { "l" } + { "t" } + if$ change.case$ + "edition" bibinfo.check + " " * bbl.edition * + } + if$ +} +INTEGERS { multiresult } +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} +FUNCTION {format.pages} +{ pages duplicate$ empty$ 'skip$ + { duplicate$ multi.page.check + { + bbl.pages swap$ + n.dashify + } + { + bbl.page swap$ + } + if$ + tie.or.space.prefix + "pages" bibinfo.check + * * + } + if$ +} +FUNCTION {format.journal.pages} +{ pages duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ + { pop$ pop$ format.pages } + { + ":" * + swap$ + n.dashify + "pages" bibinfo.check + * + } + if$ + } + if$ +} +FUNCTION {format.journal.eid} +{ eid "eid" bibinfo.check + duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ 'skip$ + { + ":" * + } + if$ + swap$ * + } + if$ +} + +FUNCTION {format.incoll.pages} +{ pages duplicate$ empty$ 'skip$ + { duplicate$ multi.page.check + { + bbl.incoll.pages swap$ + n.dashify + } + { + bbl.page swap$ + } + if$ + tie.or.space.prefix + "pages" bibinfo.check + * * + } + if$ +} + +FUNCTION {format.incoll.chapter.pages} +{ chapter empty$ + 'format.incoll.pages + { type empty$ + { bbl.chapter } + { type "l" change.case$ + "type" bibinfo.check + } + if$ + chapter tie.or.space.prefix + "chapter" bibinfo.check + * * + pages empty$ + 'skip$ + { ", " * format.incoll.pages * } + if$ + } + if$ +} + +FUNCTION {format.vol.num.pages} +{ volume field.or.null + duplicate$ empty$ 'skip$ + { + "volume" bibinfo.check + } + if$ + number "number" bibinfo.check duplicate$ empty$ 'skip$ + { + swap$ duplicate$ empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + swap$ + "(" swap$ * ")" * + } + if$ * + eid empty$ + { format.journal.pages } + { format.journal.eid } + if$ +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { bbl.chapter } + { type "l" change.case$ + "type" bibinfo.check + } + if$ + chapter tie.or.space.prefix + "chapter" bibinfo.check + * * + pages empty$ + 'skip$ + { ", " * format.pages * } + if$ + } + if$ +} + +FUNCTION {format.booktitle} +{ + booktitle "booktitle" bibinfo.check +} +FUNCTION {format.in.ed.booktitle} +{ format.booktitle duplicate$ empty$ 'skip$ + { + editor "editor" format.names.ed duplicate$ empty$ 'pop$ + { + " " * + get.bbl.editor + "(" swap$ * ") " * + * swap$ + * } + if$ + word.in swap$ * + } + if$ +} +FUNCTION {format.thesis.type} +{ type duplicate$ empty$ + 'pop$ + { swap$ pop$ + "t" change.case$ "type" bibinfo.check + } + if$ +} +FUNCTION {format.tr.number} +{ number "number" bibinfo.check + type duplicate$ empty$ + { pop$ bbl.techrep } + 'skip$ + if$ + "type" bibinfo.check + swap$ duplicate$ empty$ + { pop$ "t" change.case$ } + { tie.or.space.prefix * * } + if$ +} +FUNCTION {format.article.crossref} +{ + word.in + " \cite{" * crossref * "}" * +} +FUNCTION {format.book.crossref} +{ volume duplicate$ empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + pop$ word.in + } + { bbl.volume + capitalize + swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word * + } + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {format.incoll.inproc.crossref} +{ + word.in + " \cite{" * crossref * "}" * +} +FUNCTION {format.org.or.pub} +{ 't := + "" + address empty$ t empty$ and + 'skip$ + { + t empty$ + { address "address" bibinfo.check * + } + { t * + address empty$ + 'skip$ + { ", " * address "address" bibinfo.check * } + if$ + } + if$ + } + if$ +} +FUNCTION {format.publisher.address} +{ publisher "publisher" bibinfo.warn format.org.or.pub +} + +FUNCTION {format.organization.address} +{ organization "organization" bibinfo.check format.org.or.pub +} + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + new.sentence + crossref missing$ + { + journal + remove.dots + "journal" bibinfo.check + "journal" output.check + add.blank + format.vol.num.pages output + } + { format.article.crossref output.nonnull + format.pages output + } + if$ + new.sentence + format.doi output + format.url output + format.note output + format.soft.eprint output + add.blank + format.primaryClass output + fin.entry +} + +FUNCTION {book} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + editor format.key output + add.blank + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + format.date "year" output.check + date.block + format.btitle "title" output.check + crossref missing$ + { format.bvolume output + format.edition output + new.sentence + format.number.series output + format.publisher.address output + } + { + new.sentence + format.book.crossref output.nonnull + } + if$ + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} +FUNCTION {booklet} +{ output.bibitem + format.authors output + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + new.sentence + howpublished "howpublished" bibinfo.check output + address "address" bibinfo.check output + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} + +FUNCTION {inbook} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + editor format.key output + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + format.date "year" output.check + date.block + format.btitle "title" output.check + crossref missing$ + { + format.bvolume output + format.edition output + format.publisher.address output + format.chapter.pages "chapter and pages" output.check + new.sentence + format.number.series output + } + { + format.chapter.pages "chapter and pages" output.check + new.sentence + format.book.crossref output.nonnull + } + if$ + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + new.sentence + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.edition output + new.sentence + format.number.series output + format.publisher.address output + format.incoll.chapter.pages output + } + { format.incoll.inproc.crossref output.nonnull + format.incoll.chapter.pages output + } + if$ + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + new.sentence + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.bvolume output + new.sentence + format.publisher.address output + } + if$ + format.number.series output + format.pages output + } + { format.incoll.inproc.crossref output.nonnull + format.pages output + } + if$ + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} +FUNCTION {conference} { inproceedings } +FUNCTION {manual} +{ output.bibitem + format.authors output + author format.key output + format.date "year" output.check + date.block + format.btitle "title" output.check + new.sentence + organization "organization" bibinfo.check output + address "address" bibinfo.check output + format.edition output + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} + +FUNCTION {mastersthesis} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title + "title" output.check + new.sentence + bbl.mthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} + +FUNCTION {misc} +{ output.bibitem + format.authors output + author format.key output + format.date "year" output.check + date.block + format.title output + new.sentence + howpublished "howpublished" bibinfo.check output + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} + +FUNCTION {insert.comma} +{ duplicate$ empty$ + 'skip$ + { ", " * add.blank } + if$ +} + +FUNCTION {softmisc} +{ output.bibitem + format.authors output + author format.key output + format.date "year" output.check + date.block + format.title output + insert.comma + version output + new.sentence + howpublished "howpublished" bibinfo.check output + format.doi output + format.url output + format.note output + format.softmisc.eprint output + fin.entry +} + +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title + "title" output.check + new.sentence + bbl.phdthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} + +FUNCTION {proceedings} +{ output.bibitem + format.editors output + editor format.key output + format.date "year" output.check + date.block + format.btitle "title" output.check + format.bvolume output + format.number.series output + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} + +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title + "title" output.check + new.sentence + format.tr.number output.nonnull + institution "institution" bibinfo.warn output + address "address" bibinfo.check output + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} + +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + format.doi output + format.url output + format.note "note" output.check + format.eprint output + fin.entry +} + +FUNCTION {default.type} { misc } +READ +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} +INTEGERS { len } +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} +FUNCTION {format.lab.names} +{ 's := + "" 't := + s #1 "{vv~}{ll}" format.name$ + s num.names$ duplicate$ + #2 > + { pop$ + " " * bbl.etal * + } + { #2 < + 'skip$ + { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { + " " * bbl.etal * + } + { bbl.and space.word * s #2 "{vv~}{ll}" format.name$ + * } + if$ + } + if$ + } + if$ +} + +FUNCTION {author.key.label} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.editor.key.label} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {editor.key.label} +{ editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ +} + +FUNCTION {calc.short.authors} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.label + { type$ "proceedings" = + 'editor.key.label + 'author.key.label + if$ + } + if$ + 'short.list := +} + +FUNCTION {calc.label} +{ calc.short.authors + short.list + "(" + * + year duplicate$ empty$ + { pop$ "????" } + 'skip$ + if$ + * + 'label := +} + +FUNCTION {sort.format.names} +{ 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{ll{ }}{ f{ }}{ jj{ }}" + format.name$ 't := + nameptr #1 > + { + " " * + namesleft #1 = t "others" = and + { "zzzzz" * } + { numnames #2 > nameptr #2 = and + { "zz" * year field.or.null * " " * } + 'skip$ + if$ + t sortify * + } + if$ + } + { t sortify * } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {sort.format.title} +{ 't := + "A " #2 + "An " #3 + "The " #4 t chop.word + chop.word + chop.word + sortify + #1 global.max$ substring$ +} +FUNCTION {author.sort} +{ author empty$ + { key empty$ + { "to sort, need author or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { author sort.format.names } + if$ +} +FUNCTION {author.editor.sort} +{ author empty$ + { editor empty$ + { key empty$ + { "to sort, need author, editor, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ + } + { author sort.format.names } + if$ +} +FUNCTION {editor.sort} +{ editor empty$ + { key empty$ + { "to sort, need editor or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ +} +FUNCTION {presort} +{ calc.label + label sortify + " " + * + type$ "book" = + type$ "inbook" = + or + 'author.editor.sort + { type$ "proceedings" = + 'editor.sort + 'author.sort + if$ + } + if$ + #1 entry.max$ substring$ + 'sort.label := + sort.label + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} + +ITERATE {presort} +SORT +STRINGS { last.label next.extra } +INTEGERS { last.extra.num number.label } +FUNCTION {initialize.extra.label.stuff} +{ #0 int.to.chr$ 'last.label := + "" 'next.extra := + #0 'last.extra.num := + #0 'number.label := +} +FUNCTION {forward.pass} +{ last.label label = + { last.extra.num #1 + 'last.extra.num := + last.extra.num int.to.chr$ 'extra.label := + } + { "a" chr.to.int$ 'last.extra.num := + "" 'extra.label := + label 'last.label := + } + if$ + number.label #1 + 'number.label := +} +FUNCTION {reverse.pass} +{ next.extra "b" = + { "a" 'extra.label := } + 'skip$ + if$ + extra.label 'next.extra := + extra.label + duplicate$ empty$ + 'skip$ + { "{\natexlab{" swap$ * "}}" * } + if$ + 'extra.label := + label extra.label * 'label := +} +EXECUTE {initialize.extra.label.stuff} +ITERATE {forward.pass} +REVERSE {reverse.pass} +FUNCTION {bib.sort.order} +{ sort.label + " " + * + year field.or.null sortify + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} +ITERATE {bib.sort.order} +SORT +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" number.label int.to.str$ * "}" * + write$ newline$ + "\providecommand{\natexlab}[1]{#1}" + write$ newline$ + "\providecommand{\url}[1]{{#1}}" + write$ newline$ + "\providecommand{\urlprefix}{URL }" + write$ newline$ + %%"\expandafter\ifx\csname urlstyle\endcsname\relax" + %%write$ newline$ + %%" \providecommand{\doi}[1]{\discretionary{}{}{}https://doi.org/#1}\else" + %%write$ newline$ + %%" \providecommand{\doi}{\discretionary{}{}{}\begingroup \urlstyle{rm}\Url}\fi" + "\providecommand{\doi}[1]{\url{https://doi.org/#1}}" + write$ newline$ + "\providecommand{\eprint}[2][]{\url{#2}}" + write$ newline$ + " \bibcommenthead " + write$ newline$ +} +EXECUTE {begin.bib} +EXECUTE {init.state.consts} +ITERATE {call.type$} +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} +EXECUTE {end.bib} +%% End of customized bst file +%% +%% End of file `spbasic.bst'. + diff --git a/papers/preprint/bst/sn-chicago.bst b/papers/preprint/bst/sn-chicago.bst new file mode 100644 index 000000000..bb6d2c6fd --- /dev/null +++ b/papers/preprint/bst/sn-chicago.bst @@ -0,0 +1,1808 @@ +%%% ==================================================================== +%%% @BibTeX-style-file{ +%%% author = "Glenn Paulley", +%%% version = "4", +%%% date = "28 August 1992", +%%% time = "10:23:39 199", +%%% filename = "chicago.bst", +%%% address = "Data Structuring Group +%%% Department of Computer Science +%%% University of Waterloo +%%% Waterloo, Ontario, Canada +%%% N2L 3G1", +%%% telephone = "(519) 885-1211", +%%% FAX = "(519) 885-1208", +%%% checksum = "26323 1654 5143 37417", +%%% email = "gnpaulle@bluebox.uwaterloo.ca", +%%% codetable = "ISO/ASCII", +%%% keywords = "", +%%% supported = "yes", +%%% abstract = "A BibTeX bibliography style that follows the +%%% `B' reference style of the 13th Edition of +%%% the Chicago Manual of Style. A detailed +%%% feature list is given below.", +%%% docstring = "The checksum field above contains a CRC-16 +%%% checksum as the first value, followed by the +%%% equivalent of the standard UNIX wc (word +%%% count) utility output of lines, words, and +%%% characters. This is produced by Robert +%%% Solovay's checksum utility.", +%%% } +%%% ==================================================================== +% +% "Chicago" BibTeX style, chicago.bst +% =================================== +% +% BibTeX `chicago' style file for BibTeX version 0.99c, LaTeX version 2.09 +% Place it in a file called chicago.bst in the BibTeX search path. +% You need to include chicago.sty as a \documentstyle option. +% (Placing it in the same directory as the LaTeX document should also work.) +% This "chicago" style is based on newapa.bst (American Psych. Assoc.) +% found at ymir.claremont.edu. +% +% Citation format: (author-last-name year) +% (author-last-name and author-last-name year) +% (author-last-name, author-last-name, and author-last-name year) +% (author-last-name et al. year) +% (author-last-name) +% author-last-name (year) +% (author-last-name and author-last-name) +% (author-last-name et al.) +% (year) or (year,year) +% year or year,year +% +% Reference list ordering: alphabetical by author or whatever passes +% for author in the absence of one. +% +% This BibTeX style has support for abbreviated author lists and for +% year-only citations. This is done by having the citations +% actually look like +% +% \citeauthoryear{full-author-info}{abbrev-author-info}{year} +% +% The LaTeX style has to have the following (or similar) +% +% \let\@internalcite\cite +% \def\fullcite{\def\citeauthoryear##1##2##3{##1, ##3}\@internalcite} +% \def\fullciteA{\def\citeauthoryear##1##2##3{##1}\@internalcite} +% \def\shortcite{\def\citeauthoryear##1##2##3{##2, ##3}\@internalcite} +% \def\shortciteA{\def\citeauthoryear##1##2##3{##2}\@internalcite} +% \def\citeyear{\def\citeauthoryear##1##2##3{##3}\@internalcite} +% +% These TeX macro definitions are found in chicago.sty. Additional +% commands to manipulate different components of a citation can be defined +% so that, for example, you can list author's names without parentheses +% if using a citation as a noun or object in a sentence. +% +% This file was originally copied from newapa.bst at ymir.claremont.edu. +% +% Features of chicago.bst: +% ======================= +% +% - full names used in citations, but abbreviated citations are available +% (see above) +% - if an entry has a "month", then the month and year are also printed +% as part of that bibitem. +% - all conjunctions use "and" instead of "\&" +% - major modification from Chicago Manual of Style (13th ed.) is that +% only the first author in a reference appears last name first- +% additional authors appear as J. Q. Public. +% - pages are listed as "pp. xx-xx" in all entry types except +% article entries. +% - book, inbook, and manual use "location: publisher" (or organization) +% for address and publisher. All other types list publishers separately. +% - "pp." are used to identify page numbers for all entry types except +% articles. +% - organization is used as a citation label if neither author nor editor +% is present (for manuals). +% - "et al." is used for long author and editor lists, or when "others" +% is used. +% +% Modifications and bug fixes from newapa.bst: +% =========================================== +% +% - added month, year to bib entries if month is present +% - fixed bug with In proceedings, added necessary comma after title +% - all conjunctions changed to "and" from "\&" +% - fixed bug with author labels in my.full.label: "et al." now is +% generated when "others" is an author name +% - major modification from Chicago Manual of Style (13th ed.) is that +% only the first author in a reference appears last name first- +% additional authors appear as J. Q. Public. +% - pages are listed as "pp. xx-xx" in all entry types except +% article entries. Unnecessary (IMHO) "()" around page numbers +% were removed, and page numbers now don't end with a period. +% - created chicago.sty for use with this bibstyle (required). +% - fixed bugs in FUNCTION {format.vol.num.pages} for missing volume, +% number, and /or pages. Renamed to format.jour.vol. +% - fixed bug in formatting booktitles: additional period an error if +% book has a volume. +% - fixed bug: editors usually given redundant period before next clause +% (format.editors.dot) removed. +% - added label support for organizations, if both author and editor +% are missing (from alpha.bst). If organization is too long, then +% the key field is used for abbreviated citations. +% - In proceedings or books of several volumes, no comma was written +% between the "Volume x" and the page numbers (this was intentional +% in newapa.bst). Fixed. +% - Some journals may not have volumes/numbers, only month/year (eg. +% IEEE Computer). Fixed bug in article style that assumed volume/number +% was always present. +% +% Original documentation for newapa.sty: +% ===================================== +% +% This version was made by modifying the master file made by +% Oren Patashnik (PATASHNIK@SCORE.STANFORD.EDU), and the 'named' BibTeX +% style of Peter F. Patel-Schneider. +% +% Copyright (C) 1985, all rights reserved. +% Copying of this file is authorized only if either +% (1) you make absolutely no changes to your copy, including name, or +% (2) if you do make changes, you name it something other than 'newapa.bst'. +% There are undoubtably bugs in this style. If you make bug fixes, +% improvements, etc. please let me know. My e-mail address is: +% spencer@cgrg.ohio.state.edu or 71160.3141@compuserve.com +% +% This style was made from 'plain.bst', 'named.bst', and 'apalike.bst', +% with lots of tweaking to make it look like APA style, along with tips +% from Young Ryu and Brian Reiser's modifications of 'apalike.bst'. + +ENTRY + { address + author + booktitle + chapter + edition + editor + howpublished + institution + journal + key + keywords + month + note + doi + number + organization + pages + publisher + school + series + title + type + volume + year + eprint + archive + archivePrefix + primaryClass + eid + adsurl + adsnote + version + } + {} + { label.year extra.label sort.year sort.label } + +INTEGERS { output.state before.all mid.sentence after.sentence after.block } + +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} + +STRINGS { s t u } + +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} + +FUNCTION {add.blank} +{ " " * before.all 'output.state := +} + +% Use a colon to separate output. Used only for address/publisher +% combination in book/inbook types, address/institution for manuals, +% and organization:publisher for proceedings (inproceedings). +% +FUNCTION {output.nonnull.colon} +{ 's := + output.state mid.sentence = + { ": " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} + +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} + +FUNCTION {output.colon} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull.colon + if$ +} + +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} + +FUNCTION {output.check.colon} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull.colon + if$ +} + +FUNCTION {output.year.check} +{ year empty$ + { "empty year in " cite$ * warning$ } + { write$ + " " year * extra.label * + month empty$ + { "" * } + { ", " * month * "" * } + if$ + mid.sentence 'output.state := + } + if$ +} + + +FUNCTION {fin.entry} +{ add.period$ + write$ + newline$ +} + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} + +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} + +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} + +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} + +FUNCTION {new.block.checka} +{ empty$ + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.sentence.checka} +{ empty$ + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {new.sentence.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} + +% +% Emphasize the top string on the stack. +% +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "{\em " swap$ * "}" * } + if$ +} + +% +% Emphasize the top string on the stack, but add a trailing space. +% +FUNCTION {emphasize.space} +{ duplicate$ empty$ + { pop$ "" } + { "{\em " swap$ * "\/}" * } + if$ +} + +INTEGERS { nameptr namesleft numnames } +% +% Format bibliographical entries with the first author last name first, +% and subsequent authors with initials followed by last name. +% All names are formatted in this routine. +% +FUNCTION {format.names} +{ 's := + #1 'nameptr := % nameptr = 1; + s num.names$ 'numnames := % numnames = num.name$(s); + numnames 'namesleft := + { namesleft #0 > } + + { nameptr #1 = + {s nameptr "{vv~}{ll}{, jj}{, f{.}.}" format.name$ 't := } + {s nameptr "{f{.}.~}{vv~}{ll}{, jj}" format.name$ 't := } + if$ + nameptr #1 > + { namesleft #1 > + { ", " * t * } + { numnames #2 > + { "," * } + 'skip$ + if$ + t "others" = + { " et~al." * } + { " and " * t * } % from Chicago Manual of Style + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := % nameptr += 1; + namesleft #1 - 'namesleft := % namesleft =- 1; + } + while$ +} + +FUNCTION {my.full.label} +{ 's := + #1 'nameptr := % nameptr = 1; + s num.names$ 'numnames := % numnames = num.name$(s); + numnames 'namesleft := + { namesleft #0 > } + + { s nameptr "{vv~}{ll}" format.name$ 't := % get the next name + nameptr #1 > + { namesleft #1 > + { ", " * t * } + { numnames #2 > + { "," * } + 'skip$ + if$ + t "others" = + { " et~al." * } + { " and " * t * } % from Chicago Manual of Style + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := % nameptr += 1; + namesleft #1 - 'namesleft := % namesleft =- 1; + } + while$ + +} + +FUNCTION {format.names.fml} +% +% Format names in "familiar" format, with first initial followed by +% last name. Like format.names, ALL names are formatted. +% +{ 's := + #1 'nameptr := % nameptr = 1; + s num.names$ 'numnames := % numnames = num.name$(s); + numnames 'namesleft := + { namesleft #0 > } + + { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't := + + nameptr #1 > + { namesleft #1 > + { ", " * t * } + { numnames #2 > + { "," * } + 'skip$ + if$ + t "others" = + { " et~al." * } + { " and " * t * } +% { " \& " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := % nameptr += 1; + namesleft #1 - 'namesleft := % namesleft =- 1; + } + while$ +} + +FUNCTION {format.authors} +{ author empty$ + { "" } + { author format.names } + if$ +} + +FUNCTION {format.key} +{ empty$ + { key field.or.null } + { "" } + if$ +} + +% +% Format editor names for use in the "in" types: inbook, incollection, +% inproceedings: first initial, then last names. When editors are the +% LABEL for an entry, then format.editor is used which lists editors +% by last name first. +% +FUNCTION {format.editors.fml} +{ editor empty$ + { "" } + { editor format.names.fml + editor num.names$ #1 > + { " (Eds.)" * } + { " (Ed.)" * } + if$ + } + if$ +} + +% +% Format editor names for use in labels, last names first. +% +FUNCTION {format.editors} +{ editor empty$ + { "" } + { editor format.names + editor num.names$ #1 > + { " eds." * } + { " ed." * } + if$ + } + if$ +} + +FUNCTION {in.format.editors} +{ editor empty$ + { "" } + { editor format.names + editor num.names$ #1 > + { " eds. " swap$ * } + { " ed. " swap$ * } + if$ + } + if$ +} + +FUNCTION {format.title} +{ title empty$ + { "" } + { title "t" change.case$ } + if$ +} + +% Note that the APA style requres case changes +% in article titles. The following does not +% change cases. If you perfer it, uncomment the +% following and comment out the above. + +%FUNCTION {format.title} +%{ title empty$ +% { "" } +% { title } +% if$ +%} + +FUNCTION {n.dashify} +{ 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {format.btitle} +{ edition empty$ + { title emphasize } + { title empty$ + { title emphasize } + { volume empty$ % gnp - check for volume, then don't need period + { "{\em " title * "\/} (" * edition * " ed.)" * "." * } + { "{\em " title * "\/} (" * edition * " ed.)" * } + if$ + } + if$ + } + if$ +} + +FUNCTION {format.emphasize.booktitle} +{ edition empty$ + { booktitle emphasize } + { booktitle empty$ + { booktitle emphasize } + { volume empty$ % gnp - extra period an error if book has a volume + { "{\em " booktitle * "\/} (" * edition * " ed.)" * "." *} + { "{\em " booktitle * "\/} (" * edition * " ed.)" * } + if$ + } + if$ + } + if$ + } + + +FUNCTION {tie.or.space.connect} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ * * +} + +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} + +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { "Volume" volume tie.or.space.connect % gnp - changed to mixed case + series empty$ + 'skip$ + { " of " * series emphasize * } + if$ + "volume and number" number either.or.check + } + if$ +} + +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { output.state mid.sentence = + { "Number" } % gnp - changed to mixed case always + { "Number" } + if$ + number tie.or.space.connect + series empty$ + { "there's a number but no series in " cite$ * warning$ } + { " in " * series * } + if$ + } + if$ + } + { "" } + if$ +} + +INTEGERS { multiresult } + +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} + +FUNCTION {format.pages} +{ pages empty$ + { "" } + { pages multi.page.check + { "pp.\ " pages n.dashify tie.or.space.connect } % gnp - removed () + { "pp.\ " pages tie.or.space.connect } + if$ + } + if$ +} + + +FUNCTION {format.in.pages} +{ pages empty$ + { "" } + { pages multi.page.check + { "" pages n.dashify tie.or.space.connect } % gnp - removed () + { "" pages tie.or.space.connect } + if$ + } + if$ +} + +% By Young (and Spencer) +% GNP - fixed bugs with missing volume, number, and/or pages +% +% Format journal, volume, number, pages for article types. +% +FUNCTION {format.jour.vol} +{ journal empty$ + { "no journal in " cite$ * warning$ + "" } + { journal emphasize.space } + if$ + number empty$ + { volume empty$ + { "no number and no volume in " cite$ * warning$ + "" * } + { "~" * Volume * "" * } + if$ + } + { volume empty$ + {"no volume for " cite$ * warning$ + "~(" * number * ")" * } + { "~" * + volume emphasize.space + "(" * number * ")" * * } + if$ + } + if$ + pages empty$ + {"page numbers missing in " cite$ * warning$ + "" * } % gnp - place a null string on the stack for output + { duplicate$ empty$ + { pop$ format.pages } + { ": " * pages n.dashify * } % gnp - removed pp. for articles + if$ + } + if$ +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { "Chapter" } % gnp - changed to mixed case + { type "t" change.case$ } + if$ + chapter tie.or.space.connect + pages empty$ + {"page numbers missing in " cite$ * warning$} % gnp - added check + { ", " * format.pages * } + if$ + } + if$ +} + + +FUNCTION {format.in.chapter.pages} +{ chapter empty$ + 'format.in.pages + { type empty$ + { "Chapter" } % gnp - changed to mixed case + { type "t" change.case$ } + if$ + chapter tie.or.space.connect + pages empty$ + {"page numbers missing in " cite$ * warning$} % gnp - added check + { ", " * format.in.pages * } + if$ + } + if$ +} + +FUNCTION {format.in.ed.booktitle} +{ booktitle empty$ + { "" } + { editor empty$ + { "In " format.emphasize.booktitle * } + { "In " format.editors.fml * ", " * format.emphasize.booktitle * } + if$ + } + if$ +} + +FUNCTION {format.in.coll.ed.booktitle} +{ booktitle empty$ + { "" } + { editor empty$ + { "" format.emphasize.booktitle * } + { "In " format.emphasize.booktitle * ", " * in.format.editors * } + if$ + } + if$ +} + +FUNCTION {format.thesis.type} +{ type empty$ + 'skip$ + { pop$ + type "t" change.case$ + } + if$ +} + +FUNCTION {format.tr.number} +{ type empty$ + { "Technical Report" } + 'type + if$ + number empty$ + { "t" change.case$ } + { number tie.or.space.connect } + if$ +} + +FUNCTION {format.article.crossref} +{ "See" + "\citeN{" * crossref * "}" * +} + +FUNCTION {format.crossref.editor} +{ editor #1 "{vv~}{ll}" format.name$ + editor num.names$ duplicate$ + #2 > + { pop$ " et~al." * } + { #2 < + 'skip$ + { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { " et~al." * } + { " and " * editor #2 "{vv~}{ll}" format.name$ * } + if$ + } + if$ + } + if$ +} + +FUNCTION {format.book.crossref} +{ volume empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + "In " + } + { "Volume" volume tie.or.space.connect % gnp - changed to mixed case + " of " * + } + if$ + editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { series empty$ + { "need editor, key, or series for " cite$ * " to crossref " * + crossref * warning$ + "" * + } + { "{\em " * series * "\/}" * } + if$ + } + { key * } + if$ + } + { format.crossref.editor * } + if$ + " \citeN{" * crossref * "}" * +} + +FUNCTION {format.incoll.inproc.crossref} +{ "See" + " \citeN{" * crossref * "}" * +} + +% format.lab.names: +% +% determines "short" names for the abbreviated author information. +% "Long" labels are created in calc.label, using the routine my.full.label +% to format author and editor fields. +% +% There are 4 cases for labels. (n=3 in the example) +% a) one author Foo +% b) one to n Foo, Bar and Baz +% c) use of "and others" Foo, Bar et al. +% d) more than n Foo et al. +% +FUNCTION {format.lab.names} +{ 's := + s num.names$ 'numnames := + numnames #2 > % change number to number of others allowed before + % forcing "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 {author.key.label} +{ author empty$ + { key empty$ + { "no key, author in " cite$ * warning$ + cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {editor.key.label} +{ editor empty$ + { key empty$ + { "no key, editor in " cite$ * warning$ + cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ +} + +FUNCTION {author.key.organization.label} +% +% added - gnp. Provide label formatting by organization if author is null. +% +{ author empty$ + { organization empty$ + { key empty$ + { "no key, author or organization in " cite$ * warning$ + cite$ #1 #3 substring$ } + 'key + if$ + } + { organization } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {editor.key.organization.label} +% +% added - gnp. Provide label formatting by organization if editor is null. +% +{ editor empty$ + { organization empty$ + { key empty$ + { "no key, editor or organization in " cite$ * warning$ + cite$ #1 #3 substring$ } + 'key + if$ + } + { organization } + if$ + } + { editor format.lab.names } + if$ +} + +FUNCTION {author.editor.key.label} +{ author empty$ + { editor empty$ + { key empty$ + { "no key, author, or editor in " cite$ * warning$ + cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {calc.label} +% +% Changed - GNP. See also author.organization.sort, editor.organization.sort +% Form label for BibTeX entry. The classification of which fields are used +% for which type of entry (book, inbook, etc.) are taken from alpha.bst. +% The change here from newapa is to also include organization as a +% citation label if author or editor is missing. +% +{ 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$ + + author empty$ % generate the full label citation information. + { editor empty$ + { organization empty$ + { "no author, editor, or organization in " cite$ * warning$ + "??" } + { organization } + if$ + } + { editor my.full.label } + if$ + } + { author my.full.label } + if$ + +% leave label on the stack, to be popped when required. + + "}{" * swap$ * "}{" * +% year field.or.null purify$ #-1 #4 substring$ * +% +% save the year for sort processing afterwards (adding a, b, c, etc.) +% + year field.or.null purify$ #-1 #4 substring$ + 'label.year := +} + +FUNCTION {output.bibitem} +{ newline$ + + "\bibitem[\protect\citeauthoryear{" write$ + calc.label write$ + sort.year write$ + "}]{" write$ + + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {output.doi} +{ + doi empty$ + { skip$ } + { "\doi{" doi * "}" * output } + if$ +} + +FUNCTION {format.archive} +{ + archivePrefix empty$ + { "" } + { archivePrefix ":" *} + if$ +} + +FUNCTION {format.primaryClass} +{ + primaryClass empty$ + { "" } + { "{[" primaryClass * "]}" *} + if$ +} + +FUNCTION {format.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {format.softmisc.archive} +{ + archivePrefix empty$ + { "" } + { "" } + if$ +} + +FUNCTION {format.softmisc.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {article} +{ output.bibitem + format.authors + "author" output.check +add.period$ "" * + author format.key output % added + output.year.check % added + new.block + format.title + "title" output.check + new.block + crossref missing$ + { format.jour.vol output + } + { format.article.crossref output.nonnull + format.pages output + } + if$ + new.block + output.doi + new.block + format.eprint output + add.blank + format.primaryClass output + fin.entry +} + +FUNCTION {book} +{ output.bibitem + author empty$ + { format.editors + "author and editor" output.check } + { format.authors + output.nonnull +add.period$ "" * + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + output.year.check % added + new.block + format.btitle + "title" output.check + crossref missing$ + { format.bvolume output + new.block + format.number.series output + new.sentence + address output + publisher "publisher" output.check.colon + } + { new.block + format.book.crossref output.nonnull + } + if$ + new.block + note output + fin.entry +} + +FUNCTION {booklet} +{ output.bibitem + format.authors output + author format.key output % added + output.year.check % added + new.block + format.title + "title" output.check + new.block + howpublished output + address output + new.block + note output + fin.entry +} + +FUNCTION {inbook} +{ output.bibitem + author empty$ + { format.editors + "author and editor" output.check + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + output.year.check % added + new.block + format.btitle + "title" output.check + crossref missing$ + { format.bvolume output + format.chapter.pages + "chapter and pages" output.check + new.block + format.number.series output + new.sentence + address output + publisher + "publisher" output.check.colon + } + { format.chapter.pages "chapter and pages" output.check + new.block + format.book.crossref output.nonnull + } + if$ + new.block + note output + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + format.authors + "author" output.check +add.period$ "" * + author format.key output % added + output.year.check % added + new.block + format.title + "title" output.check + crossref missing$ + { format.in.coll.ed.booktitle +"booktitle" output.check + format.bvolume output + format.number.series output + format.in.chapter.pages output % gnp - was special.output.nonnull +% left out comma before page numbers + new.sentence + address output + publisher "publisher" output.check.colon + } + { format.incoll.inproc.crossref + output.nonnull + format.in.chapter.pages output + } + if$ + new.block + note output + new.block + output.doi + fin.entry +} + +FUNCTION {inproceedings} +{ output.bibitem + format.authors + "author" output.check + author format.key output % added + output.year.check % added + new.block + format.title + "title" output.check + new.block + crossref missing$ + { format.in.ed.booktitle + "booktitle" output.check + format.bvolume output + format.number.series output + address output + format.pages output + new.sentence + organization output + publisher output.colon + } + { format.incoll.inproc.crossref output.nonnull + format.pages output + } + if$ + new.block + note output + fin.entry +} + +FUNCTION {conference} { inproceedings } + +FUNCTION {manual} +{ output.bibitem + author empty$ + { editor empty$ + { organization "organization" output.check + organization format.key output } % if all else fails, use key + { format.editors "author and editor" output.check } + if$ + } + { format.authors output.nonnull } + if$ + output.year.check % added + new.block + format.btitle + "title" output.check + organization address new.block.checkb +% Reversed the order of "address" and "organization", added the ":". + address output + organization "organization" output.check.colon +% address output +% ":" output +% organization output + new.block + note output + fin.entry +} + +FUNCTION {mastersthesis} +{ output.bibitem + format.authors + "author" output.check + author format.key output % added + output.year.check % added + new.block + format.title + "title" output.check + new.block + "Master's thesis" format.thesis.type output.nonnull + school "school" output.check + address output + new.block + note output + fin.entry +} + +FUNCTION {misc} +{ output.bibitem + format.authors output +add.period$ "" * + author format.key output % added + output.year.check % added + title howpublished new.block.checkb + format.title output + new.block + howpublished output + new.block + note output + fin.entry +} + +FUNCTION {softmisc} +{ output.bibitem + format.authors output +add.period$ "" * + author format.key output % added + %%output.year.check % added + year output + title howpublished new.block.checkb + format.title output + version output + new.block + howpublished output + new.block + note output + new.block + format.softmisc.eprint output + fin.entry +} + +FUNCTION {phdthesis} +{ output.bibitem + format.authors + "author" output.check + author format.key output % added + output.year.check % added + new.block + format.btitle + "title" output.check + new.block + "Ph.\ D. thesis" format.thesis.type output.nonnull + school "school" output.check + address output + new.block + note output + fin.entry +} + +FUNCTION {proceedings} +{ output.bibitem + editor empty$ + { organization output + organization format.key output } % gnp - changed from author format.key + { format.editors output.nonnull } + if$ +% author format.key output % gnp - removed (should be either +% editor or organization + output.year.check % added (newapa) + new.block + format.btitle + "title" output.check + format.bvolume output + format.number.series output + address output + new.sentence + organization output + publisher output.colon + new.block + note output + fin.entry +} + +FUNCTION {techreport} +{ output.bibitem + format.authors + "author" output.check + author format.key output % added + output.year.check % added + new.block + format.title + "title" output.check + new.block + format.tr.number output.nonnull + institution + "institution" output.check + address output + new.block + note output + fin.entry +} + +FUNCTION {unpublished} +{ output.bibitem + format.authors + "author" output.check + author format.key output % added + output.year.check % added + new.block + format.title + "title" output.check + new.block + note "note" output.check + fin.entry +} + +FUNCTION {default.type} { misc } + +MACRO {jan} {"January"} + +MACRO {feb} {"February"} + +MACRO {mar} {"March"} + +MACRO {apr} {"April"} + +MACRO {may} {"May"} + +MACRO {jun} {"June"} + +MACRO {jul} {"July"} + +MACRO {aug} {"August"} + +MACRO {sep} {"September"} + +MACRO {oct} {"October"} + +MACRO {nov} {"November"} + +MACRO {dec} {"December"} + +MACRO {acmcs} {"ACM Computing Surveys"} + +MACRO {acta} {"Acta Informatica"} + +MACRO {ai} {"Artificial Intelligence"} + +MACRO {cacm} {"Communications of the ACM"} + +MACRO {ibmjrd} {"IBM Journal of Research and Development"} + +MACRO {ibmsj} {"IBM Systems Journal"} + +MACRO {ieeese} {"IEEE Transactions on Software Engineering"} + +MACRO {ieeetc} {"IEEE Transactions on Computers"} + +MACRO {ieeetcad} + {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} + +MACRO {ipl} {"Information Processing Letters"} + +MACRO {jacm} {"Journal of the ACM"} + +MACRO {jcss} {"Journal of Computer and System Sciences"} + +MACRO {scp} {"Science of Computer Programming"} + +MACRO {sicomp} {"SIAM Journal on Computing"} + +MACRO {tocs} {"ACM Transactions on Computer Systems"} + +MACRO {tods} {"ACM Transactions on Database Systems"} + +MACRO {tog} {"ACM Transactions on Graphics"} + +MACRO {toms} {"ACM Transactions on Mathematical Software"} + +MACRO {toois} {"ACM Transactions on Office Information Systems"} + +MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} + +MACRO {tcs} {"Theoretical Computer Science"} + +READ + +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} + +INTEGERS { len } + +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} + + + +FUNCTION {sort.format.names} +{ 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { nameptr #1 > + { " " * } + 'skip$ + if$ + 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.title} +{ 't := + "A " #2 + "An " #3 + "The " #4 t chop.word + chop.word + chop.word + sortify + #1 global.max$ substring$ +} + +FUNCTION {author.sort} +{ author empty$ + { key empty$ + { "to sort, need author or key in " cite$ * warning$ + "" } + { key sortify } + if$ + } + { author sort.format.names } + if$ +} + +FUNCTION {editor.sort} +{ editor empty$ + { key empty$ + { "to sort, need editor or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ +} + +FUNCTION {author.editor.sort} +{ author empty$ + { "missing author in " cite$ * warning$ + editor empty$ + { key empty$ + { "to sort, need author, editor, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ + } + { author sort.format.names } + if$ +} + +FUNCTION {author.organization.sort} +% +% added - GNP. Stack author or organization for sorting (from alpha.bst). +% Unlike alpha.bst, we need entire names, not abbreviations +% +{ author empty$ + { organization empty$ + { key empty$ + { "to sort, need author, organization, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { organization sortify } + if$ + } + { author sort.format.names } + if$ +} + +FUNCTION {editor.organization.sort} +% +% added - GNP. Stack editor or organization for sorting (from alpha.bst). +% Unlike alpha.bst, we need entire names, not abbreviations +% +{ editor empty$ + { organization empty$ + { key empty$ + { "to sort, need editor, organization, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { organization sortify } + if$ + } + { editor sort.format.names } + if$ +} + +FUNCTION {presort} +% +% Presort creates the bibentry's label via a call to calc.label, and then +% sorts the entries based on entry type. Chicago.bst adds support for +% including organizations as the sort key; the following is stolen from +% alpha.bst. +% +{ calc.label sortify % recalculate bibitem label + year field.or.null purify$ #-1 #4 substring$ * % add year + " " + * + type$ "book" = + type$ "inbook" = + or + 'author.editor.sort + { type$ "proceedings" = + 'editor.organization.sort + { type$ "manual" = + 'author.organization.sort + 'author.sort + if$ + } + if$ + } + if$ + #1 entry.max$ substring$ % added for newapa + 'sort.label := % added for newapa + sort.label % added for newapa + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} + +ITERATE {presort} + +SORT % by label, year, author/editor, title + +STRINGS { last.label next.extra } + +INTEGERS { last.extra.num } + +FUNCTION {initialize.extra.label.stuff} +{ #0 int.to.chr$ 'last.label := + "" 'next.extra := + #0 'last.extra.num := +} + +FUNCTION {forward.pass} +% +% Pass through all entries, comparing current entry to last one. +% Need to concatenate year to the stack (done by calc.label) to determine +% if two entries are the same (see presort) +% +{ last.label + calc.label year field.or.null purify$ #-1 #4 substring$ * % add year + #1 entry.max$ substring$ = % are they equal? + { last.extra.num #1 + 'last.extra.num := + last.extra.num int.to.chr$ 'extra.label := + } + { "a" chr.to.int$ 'last.extra.num := + "" 'extra.label := + calc.label year field.or.null purify$ #-1 #4 substring$ * % add year + #1 entry.max$ substring$ 'last.label := % assign to last.label + } + if$ +} + +FUNCTION {reverse.pass} +{ next.extra "b" = + { "a" 'extra.label := } + 'skip$ + if$ + label.year extra.label * 'sort.year := + extra.label 'next.extra := +} + +EXECUTE {initialize.extra.label.stuff} + +ITERATE {forward.pass} + +REVERSE {reverse.pass} + +FUNCTION {bib.sort.order} +{ sort.label + " " + * + year field.or.null sortify + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} + +ITERATE {bib.sort.order} + +SORT % by sort.label, year, title --- giving final bib. order. + +FUNCTION {begin.bib} + +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{}" write$ newline$ + "\providecommand{\doi}[1]{\url{https://doi.org/#1}}" + write$ newline$ + "\bibcommenthead" write$ newline$ +} + + +EXECUTE {begin.bib} + +EXECUTE {init.state.consts} + +ITERATE {call.type$} + +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} + +EXECUTE {end.bib} + diff --git a/papers/preprint/bst/sn-mathphys.bst b/papers/preprint/bst/sn-mathphys.bst new file mode 100644 index 000000000..236a058ff --- /dev/null +++ b/papers/preprint/bst/sn-mathphys.bst @@ -0,0 +1,3208 @@ +%% This is file `bmc-mathphys.bst' (created: 2011-12-27) +%% Compatible with bibtex version 0.99d. +%% +%% Please submit bugs or your comments to vtex@vtex.lt +%% Start subject with a "[BMC] bibtex: " + subject +%% +%% Sorting entries is done by name and year fields! +%% +%% 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. +%% +%% LIMITATIONS: +%% If you are getting error like +%% "Sorry---you've exceeded BibTeX's number of string global-variables" +%% that means you are using to old bibtex version. You should download latest version 0.99d. +%% (One of the binaries location is minimals.contextgarden.net/current/bin/common/) +%% +%% BibTeX programming: Linas Stonys, VTeX, Lithuania, lstonys@vtex.lt +% +% Changes: +% 2013-07-15 -- added XML output (taken from bmc_article.bst) v2.0 +% + +ENTRY + { address + author + booktitle + bnumber + chapter + doi + edition + editor + howpublished + institution + isbn + journal + key + keywords + month + note + number + organization + pages + publisher + school + series + title + type + volume + year + url + info + options + urldate + eprint + archive + archivePrefix + primaryClass + eid + adsurl + adsnote + version + } + {} + { label extra.label sort.label short.list} + +INTEGERS { output.state before.all mid.sentence after.sentence + after.block after.authors between.elements bother + Nisbn Nmonth slen set.settings tmp month.printed} + +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := + #4 'after.authors := + #5 'between.elements := +} + +STRINGS { s t element} +STRINGS { longest.label last.label list.string default.list} +STRINGS { v l f j b temp.str} + +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { " " * write$ newline$} + { output.state after.block = + { add.period$ write$ + newline$ + } + { + output.state after.authors = + { ": " * write$ + newline$ + } + { output.state between.elements = + { ", " * write$ newline$} + { output.state before.all = + 'write$ + { add.period$ " " * write$ newline$} + if$ + } + 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 {fin.entry} +{ write$ newline$ } + +FUNCTION {stupid.colon} +{ after.authors 'output.state := } + + +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 {not} +{ { #0 } + { #1 } + if$ +} + +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} + +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} + + +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} + +FUNCTION {sort.format.month} +{ 't := + t #1 #2 substring$ "01" = + t #1 #1 substring$ "1" = + t #2 #2 substring$ "" = + and or + { "January" } + { t #1 #2 substring$ "02" = + t #1 #1 substring$ "2" = + t #2 #2 substring$ "" = + and or + { "February" } + { t #1 #2 substring$ "03" = + t #1 #1 substring$ "3" = + t #2 #2 substring$ "" = + and or + { "March" } + { t #1 #2 substring$ "04" = + t #1 #1 substring$ "4" = + or + { "April" } + { t #1 #2 substring$ "05" = + t #1 #1 substring$ "5" = + or + { "May" } + { t #1 #2 substring$ "06" = + t #1 #1 substring$ "6" = + or + { "June" } + { t #1 #2 substring$ "07" = + t #1 #1 substring$ "7" = + or + { "July" } + { t #1 #2 substring$ "08" = + t #1 #1 substring$ "8" = + or + { "August" } + { t #1 #2 substring$ "09" = + t #1 #1 substring$ "9" = + or + { "September" } + { t #1 #2 substring$ "10" = + { "October" } + { t #1 #2 substring$ "11" = + { "November" } + { t #1 #2 substring$ "12" = + { "December" } + { t } % No match + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + +} + +INTEGERS {sk} +FUNCTION {is.num} +{ chr.to.int$ + duplicate$ "0" chr.to.int$ < not + swap$ "9" chr.to.int$ > not and +} + +FUNCTION {make.tag} +{ 't := + duplicate$ empty$ + { pop$ "" } + { bother #0 = + { + t "volume" = + {"\textbf{" swap$ * "}" * } + 'skip$ + if$ + } + { "\b" t * "{" * swap$ * "}" * } + if$ + } + if$ +} + + + +FUNCTION {springer.publisher} +{publisher #1 #8 substring$ "Springer" = + { "Springer" } + { publisher } + if$ +} + +FUNCTION {format.adsurl} +{ + adsurl empty$ + { "" } + {" \href{" adsurl "}" *} + if$ +} + +FUNCTION {format.adsnote} +{ + adsnote empty$ + { "" } + { ". " * adsnote *} + if$ +} + + +FUNCTION {format.soft.title} +{ + title empty$ + { "" } + { title "," *} + if$ +} + +FUNCTION {format.softmisctitle} +{ title empty$ + { ""} + { version empty$ + { title ", " *} + { title ", " * version " " *} + if$ + } + if$ +} + +FUNCTION {format.softmisc.archive} +{ + archivePrefix empty$ + { "" } + { "" } + if$ +} + +FUNCTION {format.archive} +{ + archivePrefix empty$ + { "" } + { archivePrefix ":" *} + if$ +} + +FUNCTION {format.primaryClass} +{ + primaryClass empty$ + { "" } + { "{[" primaryClass * "]}" *} + if$ +} + +FUNCTION {format.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {format.softmisc.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {format.pub.address} +{ publisher empty$ + howpublished empty$ + and + { + address empty$ + 'skip$ + { volume empty$ + 'insert.comma + 'new.sentence + if$ + address + type$ "inproceedings" = + {"conflocation"} + {"location"} + if$ + make.tag output + } + if$ + } + { + address empty$ + { publisher empty$ + {howpublished} + {springer.publisher} + if$ + "publisher" make.tag + #1 bother = + {", \blocation{???}" * } + 'skip$ + if$ + output + } + { + publisher empty$ + {howpublished } + {springer.publisher } + if$ + "publisher" make.tag output + insert.comma + address "location" make.tag output + } + if$ + } + if$ +} + +INTEGERS { nameptr namesleft numnames } + +FUNCTION {mk.tag} +{ 'temp.str := + duplicate$ empty$ + { pop$ "" } + { + b "nothing" = + 'skip$ + { "\b" temp.str * "{" * swap$ * "}" * } + if$ + } + if$ +} + +FUNCTION {space.after.dot} +{'j := + t 'f := + j 't := + s 'j := + "" 'l := + "" 's := + { t empty$ not } + { + t #1 #3 substring$ "{-}" = + { l " {q}. " * 'l := + t #4 global.max$ substring$ 't := + } + 'skip$ + if$ + + 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$ + f 't := + j 's := + l +} + +FUNCTION {fix.inits}{ + 't := + "" 'element := + { t empty$ not } + { + t #1 #3 substring$ ".q." = + { element ".-" * 'element := + t #3 global.max$ substring$ 't := + } + {element t #1 #1 substring$ * 'element :=} + if$ + + t #2 global.max$ substring$ 't := + } + while$ + element +} + +FUNCTION {fix.snm}{ + 't := + "" 'element := + { t empty$ not } + { + t #1 #3 substring$ "{-}" = + {element "-" * 'element := + t #3 global.max$ substring$ 't := + } + {element t #1 #1 substring$ * 'element :=} + if$ + + t #2 global.max$ substring$ 't := + } + while$ + element +} + +FUNCTION {enbrace.dash}{ + 't := + "" 'element := + { t empty$ not } + { + t #1 #1 substring$ "-" = + {element "{-}" * 'element :=} + {element t #1 #1 substring$ * 'element :=} + if$ + t #2 global.max$ substring$ 't := + } + while$ + element +} + +FUNCTION {fix.name}{ + + enbrace.dash 's := + "" 'l := + "" 't := + + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { + s nameptr "{vv~}{ll}{, jj}" format.name$ + s nameptr "{, ff}" format.name$ space.after.dot * 'l := + #1 nameptr = + {l 't :=} + {t " and " * l * 't := } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + t +} + +FUNCTION {name.separator}{ + namesleft #1 > + {", " * } + 'skip$ + if$ +} + +FUNCTION {format.author.editor} +{ 'b := + + bother #1 = + b "nothing" = + or + 'skip$ + {"b" b * 'b :=} + if$ + + b "editor" = + b "beditor" = + b "nothing" = + or or + {editor 's :=} + {author 's :=} + if$ + + %% modifying name + s fix.name 's := + + "" 't := + + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + + s numnames "{ll}" format.name$ 'l := + l "others" = + l "{others}" = + l "et al." = + l "{et al.}" = + or or or + {#1 'tmp :=} + {#0 'tmp :=} + if$ + + { namesleft #0 > } + { s nameptr "{vv}" format.name$ "particle" mk.tag 'v := + s nameptr "{ll}" format.name$ fix.snm "snm" mk.tag 'l := + s nameptr "{f{.}.}" format.name$ fix.inits "inits" mk.tag 'f := + s nameptr "{jj}" format.name$ "suffix" mk.tag 'j := + + + namesleft #1 = + tmp #1 = + and + { b "bauthor" = + b "beditor" = + or + {"et al."} + {"\betal"} + if$ + #1 'tmp := + } + { + b "bauthor" = + b "beditor" = + or + {"\oauthor{"} + { + b "nothing" = + {""} + {"\b" b * "{" *} + if$ + } +%% if$ +%% +%% v empty$ +%% 'skip$ +%% {v * " " *} + if$ + + l empty$ + 'skip$ + { l *} + if$ + + f empty$ + 'skip$ + {", " * f *} + if$ + + j empty$ + 'skip$ + {" " * j *} + if$ + + b "nothing" = + {""} + {"}"} + if$ + + * "" 't := + } + if$ + + name.separator + write$ + + namesleft #1 > + b "nothing" = not + and + { namesleft #2 = + tmp #1 = + and + 'skip$ + 'newline$ + if$ + } + 'skip$ + if$ + + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {format.editors} +{ editor empty$ + 'skip$ + { + bother #0 = + { author empty$ + {"editor"} + {"nothing"} + if$ + } + {"editor"} + if$ + format.author.editor + editor num.names$ #1 > + { " (eds.)" } + { " (ed.)" } + if$ + write$ + } + if$ +} + +FUNCTION {format.authors} +{ author empty$ + 'skip$ + {"author" format.author.editor} + if$ +} + +FUNCTION {cite.author.editor} +{ 's := + s #1 "{vv~}{ll}" format.name$ + s num.names$ duplicate$ + #2 > + { pop$ " et~al." * } + { #2 = + { s #2 "{vv~}{ll}{ jj}{ f}" format.name$ "others" = + { " et~al." * } + { " and " * s #2 "{vv~}{ll}" format.name$ * } + if$ + } + 'skip$ + 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$ +} + +INTEGERS { multiresult char.num k int} +INTEGERS {str.length count return save.num1 save.num2} +FUNCTION {is.in.list}{ + 'f := + %%%% saveing "s" and "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 := + } + while$ + + save.num1 'int := + save.num2 'count := + + #0 return = + { s t = + {#1 'return :=} + 'skip$ + if$ + } + 'skip$ + if$ + %%%% returning original "s" and "t" + j 's := + f 't := + + return +} + +INTEGERS {bibitem.count} + +FUNCTION {print.count} +{ bibitem.count #1 + 'bibitem.count := + newline$ + "%%% " + bibitem.count int.to.str$ * write$ +} + + +FUNCTION {output.bibitem} +{ print.count + newline$ + "\bibitem[\protect\citeauthoryear{" write$ + check.auth.edit.org write$ + "}{" write$ + check.year write$ + "}]{" write$ + cite$ write$ + "}" write$ + newline$ + "" before.all 'output.state := +} + + + + +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 {find.integer} +{ 't := + #0 'int := + { int not + t empty$ not + and + } + { t #1 #1 substring$ 's := + s is.num + {#1 'int :=} + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + int +} + +function{title.lowerwords}{ +"a,an,and,of,the,for,in,to,over,from,on,or,so,than,that,this,as,but,with,by,at,down,up,upon,al,ale,aus,aux,d'Analyse,d'Analystes,d'Architecture,d'Etudes,d'Histoire,da,dans,de,degli,dei,del," +"dell',dell'Accademia,dell'Istituto,dell'Universita,della,delle,dem,der,des,detta,di,die,din,dlia,do,du,e,eXpress,ed,ego,el,em,en,et,fur,i,iz,l'Academie,l'Age,l'Antiquite," * +"l'Approximation,l'Ecole,l'Histoire,l'I.S.U.P.,l'INSA,l'IREM,l'Indirizzo,l'Institut,l'Institute,l'UFR,l'Union,l'Universite,la,las,les,na,nella,per,po,si,sue,sur,ta,tes,und,van,voor,zu,zum,zur" * +} + +FUNCTION {upercase.first.letters}{ + 't := + "" 's := + #1 'int := + #1 'count := + list.string 'v := + "" 'b := + title.lowerwords 'list.string := + + t text.length$ 'slen := + + {count slen = not } + {t int #1 substring$ " " = + { + int #1 - 'int := + t #1 int substring$ 'b := + + % if word not in title.lowerwords - uppercase first letter + b is.in.list not + { b "l" change.case$ b = + { b "u" change.case$ "t" change.case$ 'b := } + 'skip$ + if$ + } + 'skip$ + if$ + + int #1 + 'int := + + s b " " * * 's := + int #1 + 'int := + t int global.max$ substring$ 't := + #0 'int := + } + 'skip$ + if$ + int #1 + 'int := + count #1 + 'count := +% "count=" count int.to.str$ * " slen=" * slen int.to.str$ * top$ + } + while$ + v 'list.string := + % last word is "t" and need to check it too + s t + t "l" change.case$ t = + { "u" change.case$ "t" change.case$ } + 'skip$ + if$ + * +} + + +FUNCTION {format.title} +{ title empty$ + { "" } + { title + "article" type$ = + type$ "techreport" = + type$ "inbook" = + type$ "inproceedings" = + type$ "incollection" = + type$ "phdthesis" = + type$ "mastersthesis" = + or or or or or or + {"t" change.case$} + { type$ "unpublished" = + type$ "misc" = + or + 'skip$ + 'upercase.first.letters + if$ + } + if$ + } + if$ +} + + +FUNCTION {note.presented} +{ note #1 #9 substring$ "presented" = + note #1 #9 substring$ "Presented" = + or +} + +FUNCTION {n.filter} +{ 't := + "" + { t empty$ not } + { t #1 #1 substring$ "," = + t #1 #1 substring$ "\" = + t #1 #1 substring$ "~" = + or or + { "" * + t #2 global.max$ substring$ 't := + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +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 + {s "year" make.tag + "nameyear" is.in.list + {longest.label * } + 'skip$ + if$ + } + {t "year" make.tag } + if$ + } + { t "year" make.tag + "nameyear" is.in.list + {extra.label *} + 'skip$ + if$ + } + if$ + } + if$ +} + +FUNCTION {format.date} +{ year empty$ + { "" } + { year byear } + if$ +} + +FUNCTION {parens} +{ "(" swap$ * ")" * } + +FUNCTION {format.date.parens} +{ year empty$ + { "" } + { year byear parens } + if$ +} + +FUNCTION {noparens} +{ " " swap$ * "" * } + +FUNCTION {format.softmiscdate} +{ year empty$ + { "" } + { year byear parens } + if$ +} + +FUNCTION {format.month}{ + month empty$ + {""} + {month sort.format.month "confdate" make.tag} + if$ +} + +FUNCTION {formatpatent.date} +{ year empty$ + 'skip$ + { month empty$ + { year } + {format.month " " * year *} + if$ + } + if$ +} + +FUNCTION {month.year.date} +{ year empty$ + {""} + { month empty$ + {year byear} + { format.month " " * year byear * } + if$ + type$ "inproceedings" = + 'skip$ + {"(" swap$ * ")" * } + if$ + } + if$ +} + +FUNCTION {tie.or.space.connect} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ * * +} +FUNCTION {format.volume} +{ volume empty$ + { "book" type$ = + {number empty$ + {""} + {"vol. " number "seriesno" make.tag *} + if$ + } + {""} + if$ + } + {"vol. " volume "seriesno" make.tag *} + if$ +} +FUNCTION {format.volume2} +{ volume empty$ + {""} + {"vol. " volume "seriesno" make.tag *} + if$ +} + +FUNCTION {format.art.vol} +{ + volume empty$ + {""} + {volume n.filter "volume" make.tag} + if$ + number empty$ + 'skip$ + { "(" number "issue" make.tag * ")" * * } + if$ +} + +FUNCTION {format.series} +{ series empty$ + 'skip$ + {series "sertitle" make.tag} + if$ +} + +FUNCTION {format.edition} +{ edition empty$ + { "" } + { "" 'v := + "" 'l := + "" 'f := + edition "l" change.case$ 's := + "1" s = + "first" s = + or + { + "1" 'v := + "st" 'l := + } + { + "2" s = + "second" s = + or + { + "2" 'v := + "nd" 'l := + } + { + "3" s = + "third" s = + or + { + "3" 'v := + "rd" 'l := + } + { + "4" s = + "fourth" s = + or + { + "4" 'v := + "th" 'l := + } + { + "5" s = + "fifth" s = + or + { + "5" 'v := + "th" 'l := + } + { + "6" s = + "sixth" s = + or + { + "6" 'v := + "th" 'l := + } + { + "7" s = + "seventh" s = + or + { + "7" 'v := + "th" 'l := + } + { + "8" s = + "eighth" s = + or + { + "8" 'v := + "th" 'l := + } + { + "9" s = + "nineth" s = + or + { + "9" 'v := + "th" 'l := + } + { + edition "t" change.case$ 'f := + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + #0 bother = + { f "" = + { v l * 'f :=} + 'skip$ + if$ + } + { f "" = + { "\bedition{" v * "}" * l * 'f :=} + { "\bedition{" f * "}" * 'f :=} + if$ + } + if$ + f " edn." * + } + if$ +} +FUNCTION {format.isbn} +{ isbn empty$ + { "" } + { isbn "isbn" make.tag} + if$ +} + +INTEGERS {default.info} + + +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + "" 'l := + + {t empty$ not} + { t #1 #1 substring$ 's := + + s is.num not + { "" l = not + {t find.integer + {#1 'multiresult := } + {#0 'multiresult := } + if$ + "" 't := + } + { + t #2 global.max$ substring$ 't := + } + if$ + } + { l s * 'l := + t #2 global.max$ substring$ 't := + } + if$ + } + while$ + multiresult +} +FUNCTION {clearpage} +{ 't := + "" 's := + "" 'l := + + { t empty$ not } + { + t #1 #1 substring$ 's := + s is.num not + 'skip$ + { l s * 'l := } + if$ + t #2 global.max$ substring$ 't := + } + while$ + l + +} +FUNCTION {do.pages} +{'t := + "" 'j := + "" 'v := + {t empty$ not} + { t #1 #1 substring$ 's := + s is.num not + s "," = not + and + { "" j = + { + t #2 global.max$ substring$ 't := + } + {t find.integer + { t clearpage 'v := } + 'skip$ + if$ + "" 't := + } + if$ + } + { j s * 'j := + t #2 global.max$ substring$ 't := + } + if$ + } + while$ + j clearpage 'j := + j "fpage" make.tag + "cnd" is.in.list + 'skip$ + {"--" * v "lpage" make.tag *} + if$ +} + + +FUNCTION {format.pages} +{ pages empty$ + { "" } + { pages multi.page.check + {type$ "article" = + {""} + {"cnd" is.in.list + {"p. "} + {"pp. "} + if$ + } + if$ + pages do.pages * + } + {type$ "article" = + {""} + {"p. "} + if$ + pages clearpage "fpage" make.tag * + } + + if$ + } + if$ +} + +FUNCTION {replace.tilde} +{ 't := + "" + { t empty$ not } + { t #1 #1 substring$ "~" = + { { t #1 #1 substring$ "~" = } + { "\texttildelow " * + t #2 global.max$ substring$ 't := + } + while$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + + +FUNCTION {format.url} +{ url empty$ + 'skip$ + { type$ "article" = + 'skip$ + { #0 bother = + { "\url{" } + { "\burl{" } + if$ + url replace.tilde * "}" * + output + } + if$ + + urldate empty$ + 'skip$ + { "Accessed " urldate * output } + if$ + } + if$ +} + + +FUNCTION {publisher.month.pages}{ + publisher empty$ series empty$ and + { address empty$ + 'skip$ + 'new.sentence + if$ + format.pub.address + + pages empty$ + 'skip$ + {insert.comma} + if$ + format.pages output + + } + { + pages empty$ + 'skip$ + {insert.comma} + if$ + format.pages output + publisher empty$ + 'skip$ + {new.sentence} + if$ + format.pub.address + } + if$ +} + +function{process.doi}{ + doi 't := + "" 'b := + #1 'int := +% "doi =" t * top$ + + t text.length$ 'slen := + + {int slen = not } + {t int #3 substring$ "10." = + { + t int #1 - #1 substring$ 'b := + b "" = + {"a" 'b :=} % if b is empty need to set a letter + 'skip$ + if$ + + b is.num not + { + t int slen int - #1 + substring$ 't := + slen #1 - 'int := + } + 'skip$ + if$ + + } + 'skip$ + if$ + int #1 + 'int := + } + while$ + t +} + +FUNCTION {format.doi} +{ doi empty$ + {""} + { + "nodoi" is.in.list + {""} + %%{"doi:\doiurl{" process.doi * "}" * } + {"\doiurl{" process.doi * "} " * } + if$ + } + if$ +} + +FUNCTION {format.in.ed.booktitle} +{ booktitle empty$ + {#1 bother = + "cnd" is.in.list not + and + { editor empty$ + 'skip$ + { "In: " output write$ format.editors } + if$ + } + 'skip$ + if$ + } + { editor empty$ + { "In: " booktitle upercase.first.letters "btitle" make.tag * output} + { "In: " output write$ format.editors "" %%% pushing empty string to the empty stack + booktitle upercase.first.letters "btitle" make.tag output + } + if$ + } + + if$ +} + +FUNCTION {format.in.ed} +{ title empty$ + 'skip$ + { editor empty$ + { title "btitle" make.tag output} + { author empty$ + { format.editors + stupid.colon + %format.date output + title "btitle" make.tag output + } + { "In: " output write$ format.editors "" %%% pushing empty string to the empty stack + title "btitle" make.tag output + } + if$ + } + if$ + } + if$ +} + +FUNCTION {format.tr.number} +{ type empty$ + { "Technical Report" } + 'type + if$ + number empty$ + { "t" change.case$ } + { number tie.or.space.connect } + if$ +} + +FUNCTION {patent.number} +{ number empty$ + 'skip$ + { number } + if$ +} +INTEGERS { len } + +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} + +FUNCTION {format.inpres} +{ "l" change.case$ 't := + "in press: " #10 + "in press. " #10 + "in press " #9 t chop.word + chop.word + chop.word + #1 global.max$ substring$ +} + +FUNCTION {bcomment.note} +{ note empty$ + 'skip$ + {note format.inpres "comment" make.tag output} + 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$ + type "t" change.case$ + } + if$ +} + +FUNCTION {format.chapter.and.note} +{ note empty$ chapter empty$ organization empty$ and and + 'skip$ + { chapter empty$ + "notnumber" last.label = + or + {organization empty$ + { note "comment" make.tag output } + { note empty$ + { organization "comment" make.tag output } + { organization ". " * note * "comment" make.tag output } + if$ + } + if$ + } + { note empty$ + { "Chap. " chapter * "comment" make.tag output} + { type empty$ + { "Chap. " } + { type "t" change.case$ "Section" = + { "Sect. " } + { "Chap. " } + if$ + } + if$ + chapter * ". " * note * "comment" make.tag output + } + if$ + } + if$ + } + if$ +} + +FUNCTION {item.end} +{ chapter empty$ + type$ "unpublished" = not + type$ "misc" = not + and and + { new.sentence + format.doi output + } + 'skip$ + if$ + + type$ "unpublished" = + type$ "misc" = + or + { note empty$ + 'skip$ + {note.presented + 'skip$ + {new.sentence note output} + if$ + } + if$ + format.date.parens output + } + { new.sentence + type$ "proceedings" = + { author empty$ editor empty$ and + 'bcomment.note + 'format.chapter.and.note + if$ + } + 'format.chapter.and.note + if$ + } + if$ + list.string 'v := + default.list 'list.string := + + type$ ".isbn" * is.in.list + "cnd" is.in.list + or + { + new.sentence +% format.isbn output + } + 'skip$ + if$ + new.sentence + %% commented by SPi as we are using format.eprint %% + %% and also to avoide eprint being printed twice - Start %% + %%eprint empty$ + %% 'skip$ + %% {"\arxivurl{" eprint * "}" * output} + %%if$ + %% End %% + chapter empty$ + type$ "unpublished" = not + type$ "misc" = not + and and + 'skip$ + { new.sentence + format.doi output + } + if$ + new.sentence + format.url + v 'list.string := + fin.entry +} + +FUNCTION {article.item.end} +{ chapter empty$ + type$ "unpublished" = not + type$ "misc" = not + and and + { new.sentence +% format.doi output + } + 'skip$ + if$ + + type$ "unpublished" = + type$ "misc" = + or + { note empty$ + 'skip$ + {note.presented + 'skip$ + {new.sentence note output} + if$ + } + if$ + format.date.parens output + } + { new.sentence + type$ "proceedings" = + { author empty$ editor empty$ and + 'bcomment.note + 'format.chapter.and.note + if$ + } + 'format.chapter.and.note + if$ + } + if$ + list.string 'v := + default.list 'list.string := + + type$ ".isbn" * is.in.list + "cnd" is.in.list + or + { + new.sentence +% format.isbn output + } + 'skip$ + if$ + new.sentence + %% commented by SPi as we are using format.eprint %% + %% and also to avoide eprint being printed twice - Start %% + %%eprint empty$ + %% 'skip$ + %% {"\arxivurl{" eprint * "}" * output} + %%if$ + %% End %% + chapter empty$ + type$ "unpublished" = not + type$ "misc" = not + and and + 'skip$ + { new.sentence +%% format.doi output + } + if$ + new.sentence + format.url + v 'list.string := + fin.entry +} + + +FUNCTION {insert.element} +{ #0 bother = + { element "{botherref}" * write$ newline$} + { + type$ "article" = + {element "{barticle}" * write$ newline$} + 'skip$ + if$ + type$ "book" = + type$ "proceedings" = + type$ "manual" = + type$ "booklet" = + or or or + {element "{bbook}" * write$ newline$} + 'skip$ + if$ + + type$ "inbook" = + { "notnumber" last.label = + {element "{bchapter}" * write$ newline$} + {element "{bbook}" * write$ newline$} + if$ + } + 'skip$ + if$ + + type$ "incollection" = + type$ "inproceedings" = + type$ "conference" = + or or + {element "{bchapter}" * write$ newline$} + 'skip$ + if$ + } + if$ +} + +FUNCTION {end.element} +{ "\end" 'element := + item.end + insert.element + "\endbibitem" write$ newline$ +} + +FUNCTION {article.end.element} +{ "\end" 'element := + article.item.end + insert.element + "\endbibitem" write$ newline$ +} + + +FUNCTION {begin.element} +{ "\begin" 'element := + insert.element +} +function {set.options}{ + options empty$ + 'skip$ + {options 'list.string :=} + if$ +} + +FUNCTION {settings} +{} + +FUNCTION {article} +{ output.bibitem + author empty$ + institution empty$ + editor empty$ + and and + journal empty$ + or + year empty$ + or + % above tagging rule means: + % nead: (volume & (pages or number) ) or (doi [without volume, pages and number]) + volume empty$ not + pages empty$ not bnumber empty$ not or + and + + volume empty$ pages empty$ bnumber empty$ and and + doi empty$ not and + or + not + or + {#0 'bother :=} + {#1 'bother :=} + if$ + begin.element + author empty$ + { editor empty$ + 'skip$ + {format.editors stupid.colon} + if$ + } + { format.authors stupid.colon} + if$ + "cnd" is.in.list + { + journal empty$ + {format.title "atitle" make.tag "title" output.check} + {journal "jtitle" make.tag output} + if$ + } + { + format.title "atitle" make.tag "title" output.check + journal empty$ + 'skip$ + {new.sentence journal "jtitle" make.tag output} + if$ + } + if$ + format.art.vol output + pages empty$ + 'skip$ + {insert.comma} + if$ + format.pages output + format.date.parens output + format.doi output + format.eprint output + format.primaryClass output + article.end.element +} + + +FUNCTION {patent} +{ output.bibitem + #0 'bother := + begin.element + author empty$ + 'skip$ + {format.authors stupid.colon} + if$ + format.title "title" output.check + add.period$ + patent.number output + insert.comma + formatpatent.date output + end.element +} + +FUNCTION { other } { patent } + +FUNCTION {book} +{ output.bibitem + author empty$ + institution empty$ + organization empty$ + editor empty$ + and and and + title empty$ + year empty$ + or or + {#0 'bother :=} + { + publisher empty$ address empty$ not and + {#0 'bother :=} + {#1 'bother :=} + if$ + } + if$ + begin.element + author empty$ + { editor empty$ + 'skip$ + {format.editors stupid.colon} + if$ + } + { format.authors stupid.colon} + if$ + format.title "btitle" make.tag "title" output.check + series empty$ + { + format.volume output + insert.comma + format.edition output + } + { edition empty$ + 'skip$ + 'insert.comma + if$ + format.edition output + new.sentence + format.series output + insert.comma + format.volume output + } + if$ + publisher.month.pages + format.date.parens output + end.element +} + +FUNCTION {booklet} +{output.bibitem + author empty$ + title empty$ + year empty$ + howpublished empty$ + or or or + {#0 'bother :=} + {#1 'bother :=} + if$ + + begin.element + author empty$ + 'skip$ + {format.authors stupid.colon} + if$ + format.title "btitle" make.tag "title" output.check + address empty$ publisher empty$ howpublished empty$ and and + 'skip$ + 'new.sentence + if$ + format.pub.address + format.date.parens output + end.element +} + +FUNCTION {misc} +{output.bibitem + #0 'bother := + begin.element + author empty$ + 'skip$ + {format.authors stupid.colon} + if$ + format.title "btitle" make.tag "title" output.check + address empty$ publisher empty$ howpublished empty$ and and + 'skip$ + 'new.sentence + if$ + format.pub.address + end.element +} + +FUNCTION {softmisc} +{output.bibitem + #0 'bother := + begin.element + author empty$ + 'skip$ + {format.authors} + if$ + stupid.colon + format.title "btitle" make.tag "title" output.check + insert.comma + version output + insert.comma + %%address empty$ publisher empty$ howpublished empty$ and and + %%'skip$ + %% 'new.sentence + %%if$ + format.pub.address + format.softmiscdate output + insert.comma + format.softmisc.eprint output + end.element +} + +FUNCTION {inbook} +{ output.bibitem + author empty$ + institution empty$ + organization empty$ + editor empty$ + and and and + title empty$ + year empty$ + or or + {#0 'bother :=} + { + publisher empty$ address empty$ not and + {#0 'bother :=} + {#1 'bother :=} + if$ + } + if$ + + chapter empty$ + { "" 'last.label :=} + { chapter string.to.integer empty$ author empty$ not and + { "notnumber" 'last.label :=} + { "" 'last.label :=} + if$ + } + if$ + + begin.element + author empty$ + 'skip$ + {format.authors stupid.colon} + if$ + "notnumber" last.label = + { chapter "ctitle" make.tag output + add.period$ + } + 'skip$ + if$ + format.in.ed + series empty$ + { + insert.comma + format.volume output + insert.comma + format.edition output + new.sentence + } + { + insert.comma + format.edition output + new.sentence + format.series output + volume empty$ + 'skip$ + 'insert.comma + if$ + format.volume output + } + if$ + publisher.month.pages + publisher empty$ address empty$ edition empty$ series empty$ pages empty$ volume empty$ and and and and and + 'insert.comma + 'skip$ + if$ + format.date.parens output + end.element +} +FUNCTION {incollection} +{ output.bibitem + author empty$ + institution empty$ + and + booktitle empty$ + title empty$ + year empty$ + or or or + {#0 'bother :=} + { + publisher empty$ address empty$ not and + {#0 'bother :=} + {#1 'bother :=} + if$ + } + if$ + begin.element + author empty$ + 'skip$ + {format.authors stupid.colon} + if$ + + "cnd" is.in.list + { + booktitle empty$ title empty$ not and + { + format.title "ctitle" make.tag "title" output.check + new.sentence + } + 'skip$ + if$ + } + { + format.title "ctitle" make.tag "title" output.check + title empty$ + 'skip$ + {new.sentence} + if$ + } + if$ + format.in.ed.booktitle + series empty$ + { + format.volume output + insert.comma + format.edition output + } + { + edition empty$ + 'skip$ + { insert.comma + format.edition output + } + if$ + new.sentence + format.series output + insert.comma + format.volume output + } + if$ + publisher.month.pages + format.date.parens output + end.element +} + +FUNCTION {inproceedings} +{ output.bibitem + author empty$ + institution empty$ + and + title empty$ + year empty$ + or or + {#0 'bother :=} + {#1 'bother :=} + if$ + begin.element + author empty$ + 'skip$ + {format.authors stupid.colon} + if$ + + "cnd" is.in.list + { + booktitle empty$ title empty$ not and + { + format.title "ctitle" make.tag "title" output.check + new.sentence + } + 'skip$ + if$ + } + { + format.title "ctitle" make.tag "title" output.check + title empty$ booktitle empty$ not and + 'skip$ + {new.sentence} + if$ + } + if$ + + format.in.ed.booktitle + series empty$ + 'skip$ + {new.sentence format.series output} + if$ + volume empty$ address empty$ publisher empty$ and and + 'skip$ + 'insert.comma + if$ + format.volume output + publisher.month.pages + format.date.parens output + end.element +} + +FUNCTION {conference} { inproceedings } + +FUNCTION {manual} +{ output.bibitem + author empty$ + organization empty$ + title empty$ + year empty$ + address empty$ + or or or or + {#0 'bother :=} + {#1 'bother :=} + if$ + begin.element + + author empty$ + { organization empty$ + 'skip$ + { organization "publisher" make.tag output.nonnull + stupid.colon% add.period$ + } + if$ + } + { format.authors stupid.colon} + if$ + title empty$ + 'skip$ + {format.title "btitle" make.tag output} + if$ + edition empty$ + {new.sentence} + {insert.comma} + if$ + format.edition output + edition empty$ + 'skip$ + {new.sentence} + if$ + author empty$ organization empty$ + or + 'skip$ + { organization "publisher" make.tag output.nonnull + insert.comma + } + if$ + address empty$ + 'skip$ + {address "location" make.tag output} + if$ + format.date.parens output + end.element +} + + +FUNCTION {phdthesis} +{output.bibitem + #0 'bother := + begin.element + author empty$ + 'skip$ + {format.authors stupid.colon} + if$ + format.title "title" output.check + new.sentence + type$ "mastersthesis" = + {"Master's thesis" format.thesis.type output.nonnull} + {"PhD thesis" format.thesis.type output.nonnull} + if$ + school empty$ + 'skip$ + 'insert.comma + if$ + school "school" output.check + address empty$ + 'skip$ + 'insert.comma + if$ + address output + month.year.date output + end.element +} +FUNCTION {mastersthesis}{phdthesis} + + +FUNCTION {proceedings} +{ output.bibitem + author empty$ + institution empty$ + organization empty$ + editor empty$ + and and and + title empty$ + year empty$ + or or + {#0 'bother :=} + { + publisher empty$ address empty$ not and + {#0 'bother :=} + {#1 'bother :=} + if$ + } + if$ + + begin.element + author empty$ + { editor empty$ + {organization "institutionaled" make.tag "organization" output.check } + { format.editors } + if$ + } + { format.authors } + if$ + stupid.colon + format.title "btitle" make.tag output + series empty$ + 'skip$ + {new.sentence format.series output} + if$ + volume empty$ + 'skip$ + 'insert.comma + if$ + format.volume output + publisher.month.pages + format.date.parens output + end.element +} + +FUNCTION {techreport} +{ output.bibitem + #0 'bother := + begin.element + author empty$ + 'skip$ + {format.authors stupid.colon} + if$ + format.title "title" output.check + new.sentence + format.tr.number output.nonnull + institution empty$ + 'skip$ + 'insert.comma + if$ + institution "institution" output.check + address empty$ + 'skip$ + 'insert.comma + if$ + address output + month.year.date output + end.element +} + +FUNCTION {unpublished} +{ output.bibitem + #0 'bother := + + begin.element + author empty$ + 'skip$ + {format.authors stupid.colon} + if$ + format.title "title" output.check + note empty$ + 'skip$ + { note.presented + {note output} + 'skip$ + if$ + } + if$ + end.element +} + +FUNCTION {default.type} { unpublished } + +MACRO {jan} {"January"} +MACRO {feb} {"February"} +MACRO {mar} {"March"} +MACRO {apr} {"April"} +MACRO {may} {"May"} +MACRO {jun} {"June"} +MACRO {jul} {"July"} +MACRO {aug} {"August"} +MACRO {sep} {"September"} +MACRO {oct} {"October"} +MACRO {nov} {"November"} +MACRO {dec} {"December"} + +READ + +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} + +INTEGERS { et.al.char.used } + +FUNCTION {initialize.et.al.char.used} +{ #0 'et.al.char.used := +} + +%%%%% setting default options +FUNCTION {set.default.opt} +{"unsort" 'list.string :=} + +EXECUTE {set.default.opt} + +FUNCTION {assign.opt}{ + % First need to set options + "settings" type$ = + { options empty$ + 'skip$ + {options 'list.string :=} + if$ + } + 'skip$ + if$ +} + +ITERATE {assign.opt} +EXECUTE {initialize.et.al.char.used} + +FUNCTION {alpha.format.lab.names} +{ '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 {standard.format.lab.names} +{ 's := + s #1 "{vv~}{ll}" format.name$ + s num.names$ duplicate$ + #2 > + { pop$ " et~al." * } + { #2 < + 'skip$ + { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { " et~al." * } + { " and " * s #2 "{vv~}{ll}" format.name$ * } + if$ + } + if$ + } + if$ +} +FUNCTION {format.lab.names}{ + "alpha" is.in.list + 'alpha.format.lab.names + 'standard.format.lab.names + if$ +} + +FUNCTION {author.key.label} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + { key #3 text.prefix$ } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.editor.key.label} +{ author empty$ + { editor empty$ + { key empty$ + { "zzz" } + { key #3 text.prefix$ } + if$ + } + { editor format.lab.names } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.key.organization.label} +{ author empty$ + { key empty$ + { organization empty$ + { "zzz" } + { "The " #4 organization chop.word #3 text.prefix$ } + if$ + } + { key #3 text.prefix$ } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {editor.key.organization.label} +{ editor empty$ + { key empty$ + { organization empty$ + { "zzz" } + { "The " #4 organization chop.word #3 text.prefix$ } + if$ + } + { key #3 text.prefix$ } + 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 + + "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} +{ 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { nameptr #1 > + { " " * + "alpha" is.in.list + 'skip$ + {numnames int.to.str$ * " " *} + if$ + } + 'skip$ + if$ + s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't := + nameptr numnames = + t "others" = + and + { "et al" * } + { t sortify * } + if$ + #3 numnames < + "alpha" is.in.list not + and + {#0 'namesleft := + " zzz " * + } + { + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + if$ + } + while$ +} + +FUNCTION {sort.format.title} +{ 't := + "A " #2 + "An " #3 + "The " #4 t chop.word + chop.word + chop.word + sortify + #1 global.max$ substring$ +} + +FUNCTION {author.sort} +{ author empty$ + { key empty$ + { "to sort, need author or key in " cite$ * warning$ + "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" = + 'author.organization.sort + 'author.sort + if$ + } + if$ + } + if$ + " " + * + year field.or.null sortify + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ 'sort.label := + sort.label * + #1 entry.max$ substring$ 'sort.key$ := + + "settings" type$ = + {"aaa"} + {"unsort" is.in.list + {"bb"} + {"alpha" is.in.list + {sort.key$} + {sort.label} + if$ + } + if$ + } + if$ + 'sort.key$ := +} + + +ITERATE {presort} + +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 label = + { last.extra.num #1 + 'last.extra.num := + last.extra.num int.to.chr$ 'extra.label := + } + { "a" chr.to.int$ 'last.extra.num := + "" 'extra.label := + label 'last.label := + } + if$ + number.label #1 + 'number.label := +} + +FUNCTION {reverse.pass} +{ j "b" = + { "a" 'extra.label := } + 'skip$ + if$ + extra.label 'j := + label extra.label * 'label := +} + +EXECUTE {initialize.longest.label} + +ITERATE {forward.pass} + +REVERSE {reverse.pass} + +FUNCTION {write.preambule} +{ "%% BioMed_Central_Bib_Style_v1.01" write$ newline$ newline$ + "\begin{thebibliography}{" number.label int.to.str$ * "}" * write$ newline$ + "% BibTex style file: bmc-mathphys.bst (version 2.1), 2014-07-24" write$ newline$ + "\ifx \bisbn \undefined \def \bisbn #1{ISBN #1}\fi" write$ newline$ + "\ifx \binits \undefined \def \binits#1{#1}\fi" write$ newline$ + "\ifx \bauthor \undefined \def \bauthor#1{#1}\fi" write$ newline$ + "\ifx \batitle \undefined \def \batitle#1{#1}\fi" write$ newline$ + "\ifx \bjtitle \undefined \def \bjtitle#1{#1}\fi" write$ newline$ + "\ifx \bvolume \undefined \def \bvolume#1{\textbf{#1}}\fi" write$ newline$ + "\ifx \byear \undefined \def \byear#1{#1}\fi" write$ newline$ + "\ifx \bissue \undefined \def \bissue#1{#1}\fi" write$ newline$ + "\ifx \bfpage \undefined \def \bfpage#1{#1}\fi" write$ newline$ + "\ifx \blpage \undefined \def \blpage #1{#1}\fi" write$ newline$ + "\ifx \burl \undefined \def \burl#1{\textsf{#1}}\fi" write$ newline$ + %%"\ifx \doiurl \undefined \def \doiurl#1{\textsf{#1}}\fi" write$ newline$ + "\ifx \doiurl \undefined \def \doiurl#1{\url{https://doi.org/#1}}\fi" write$ newline$ + "\ifx \betal \undefined \def \betal{\textit{et al.}}\fi" write$ newline$ + "\ifx \binstitute \undefined \def \binstitute#1{#1}\fi" write$ newline$ + "\ifx \binstitutionaled \undefined \def \binstitutionaled#1{#1}\fi" write$ newline$ + "\ifx \bctitle \undefined \def \bctitle#1{#1}\fi" write$ newline$ + "\ifx \beditor \undefined \def \beditor#1{#1}\fi" write$ newline$ + "\ifx \bpublisher \undefined \def \bpublisher#1{#1}\fi" write$ newline$ + "\ifx \bbtitle \undefined \def \bbtitle#1{#1}\fi" write$ newline$ + "\ifx \bedition \undefined \def \bedition#1{#1}\fi" write$ newline$ + "\ifx \bseriesno \undefined \def \bseriesno#1{#1}\fi" write$ newline$ + "\ifx \blocation \undefined \def \blocation#1{#1}\fi" write$ newline$ + "\ifx \bsertitle \undefined \def \bsertitle#1{#1}\fi" write$ newline$ + "\ifx \bsnm \undefined \def \bsnm#1{#1}\fi" write$ newline$ + "\ifx \bsuffix \undefined \def \bsuffix#1{#1}\fi" write$ newline$ + "\ifx \bparticle \undefined \def \bparticle#1{#1}\fi" write$ newline$ + "\ifx \barticle \undefined \def \barticle#1{#1}\fi" write$ newline$ + "\bibcommenthead" write$ newline$ +} + + +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + write.preambule + "\ifx \bconfdate \undefined \def \bconfdate #1{#1}\fi" write$ newline$ + "\ifx \botherref \undefined \def \botherref #1{#1}\fi" write$ newline$ + "\ifx \url \undefined \def \url#1{\textsf{#1}}\fi" write$ newline$ + "\ifx \bchapter \undefined \def \bchapter#1{#1}\fi" write$ newline$ + "\ifx \bbook \undefined \def \bbook#1{#1}\fi" write$ newline$ + "\ifx \bcomment \undefined \def \bcomment#1{#1}\fi" write$ newline$ + "\ifx \oauthor \undefined \def \oauthor#1{#1}\fi" write$ newline$ + "\ifx \citeauthoryear \undefined \def \citeauthoryear#1{#1}\fi" write$ newline$ + "\ifx \endbibitem \undefined \def \endbibitem {}\fi" write$ newline$ + "\ifx \bconflocation \undefined \def \bconflocation#1{#1}\fi" write$ newline$ + "\ifx \arxivurl \undefined \def \arxivurl#1{\textsf{#1}}\fi" write$ newline$ + "\csname PreBibitemsHook\endcsname" write$ newline$ +} + +EXECUTE {begin.bib} + +EXECUTE {init.state.consts} + +ITERATE {call.type$} + +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} + +EXECUTE {end.bib} + + +%% XML output - done for each entry referenced in the BibTeX database +INTEGERS {i ll li j.int global.counter} +STRINGS {lr lp lt ls } + +FUNCTION {replace} +{ + 'lr := % replace string + 'lp := % pattern + 'lt := % text to search + "" 'ls := % result string + lp text.length$ 'll := % length of the search pattern + { lt empty$ not } + { lt #1 ll substring$ lp = + { ls lr * 'ls := + lt ll #1 + global.max$ substring$ 'lt := } + { ls lt #1 #1 substring$ * 'ls := + lt #2 global.max$ substring$ 'lt := } + if$ + } + while$ + ls +} + +FUNCTION {strip.letters} +{ + "" 's := + duplicate$ missing$ + 'pop$ + { + 't := + { t "" = not } + { % ascii '0' = 48, '9' = 57 + t #1 #1 substring$ chr.to.int$ 'i := + i #47 > i #58 < and + { s t #1 #1 substring$ * 's := } + 'skip$ + if$ + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + s +} +FUNCTION {output.xml} +{ duplicate$ "" = + 'pop$ + { " " swap$ * write$ newline$ } + if$ +} + +%% + % markup.xml + % + % Takes 2 args text & tag {"the text " "tag"} + % Returns 1 string {"the text <\tag>"} +%% +FUNCTION {markup.xml} +{ + "" 'v := % result + 't := % tag + duplicate$ missing$ + 'pop$ + { 'v := } + if$ + v "" = + 'skip$ + { "<" t * ">" * v * "" * 'v := } + if$ + v +} + +%% Takes 2 args - tag, string +FUNCTION{markup.xml.title} +{ pop$ % tag + duplicate$ missing$ + 'pop$ + { + 's := % string + s "\&" "&" replace 's := + s "p" markup.xml 's := + s "title" markup.xml output.xml + } + if$ +} + + +%% + % markup.xml.pages + % + % Takes 1 arg (pages string) + % seperates into and if + % there is a - seperator. else no lpage. + % + % need to remove others +%% +FUNCTION{markup.xml.pages} +{ + "" 'v := % fpage + "" 's := % lpage + duplicate$ missing$ + 'pop$ + { + 't := + t " " "" replace 't := % remove all spaces. pgs must be - seperated + { t empty$ not } + { + t #1 #1 substring$ "-" = + { + t #2 global.max$ substring$ 's := + "" 't := % break while loop + }{ + v t #1 #1 substring$ * 'v := + t #2 global.max$ substring$ 't := + } + if$ + } + while$ + } + if$ + v "fpage" markup.xml output.xml + s "lpage" markup.xml output.xml +} + + +%% + % markup.xml.names + % + % Takes 2 args + % tag, namefield (eg. author "au") + % splits fields into and + % writes info + % returns nothing +%% +FUNCTION {markup.xml.names} +{ + 't := % tag + "" 'v := + "" 's := + duplicate$ empty$ + { pop$ + organization missing$ + { institution "cnm" markup.xml + "au" markup.xml "aug" markup.xml output.xml } + { organization "cnm" markup.xml + "au" markup.xml "aug" markup.xml output.xml } + if$ } + { + " " write$ newline$ + 'temp.str := % names string + temp.str num.names$ 'j.int := % num of names + #1 'i := % init counter + { i #1 j.int + < } % while (i <= j.int) + { + " " write$ + + % Initial first names + % if first name all in capitals + % - assume is initial list of first names. + temp.str i "{ff{ }}" format.name$ + duplicate$ "u" change.case$ = + { temp.str i "{ff{ }}" format.name$ } + { temp.str i "{f{}}" format.name$ } + if$ + + % if last name but no first name use cnm; else snm + duplicate$ "" = + { temp.str i "{ll{ }}" format.name$ % last names space seperated. + "cnm" markup.xml write$ } + { temp.str i "{ll{ }}" format.name$ % last names space seperated. + "snm" markup.xml write$ } + if$ + + "fnm" markup.xml write$ + + "" write$ newline$ + i #1 + 'i := + } + while$ + " " write$ newline$ + } + if$ +} + + +%% + % markup.xml.pub + % + % Takes 4 args (school address publisher tag) + % prints concatenation + % returns nothing +%% +FUNCTION {markup.xml.pub} +{ + 't := % Tag + "" 'v := % Publisher + "" 'l := % Address + "" 'f := % School + "" 's := % Answer + duplicate$ missing$ 'pop$ { 'v := } if$ + duplicate$ missing$ 'pop$ { 'l := } if$ + duplicate$ missing$ 'pop$ { 'f := } if$ + "" f = not % school not empty + { f 's := } % return school as publisher + { % else + "" v = "" l = and % address and pub empty + 'skip$ + { + "" l = + { v 's := } % return pub + { "" v = + { l 's := } % return add + { l ": " * v * 's := } % return add : pub + if$ + } + if$ + } + if$ + } + if$ + s t markup.xml output.xml +} + +%% + % xml.phd + % + % Takes nothing + % Returns type (phd/msc) of empty string +%% +FUNCTION {xml.phd} +{ + "phdthesis" type$ = + "mastersthesis" type$ = or + { "phdthesis" type$ = + { "PhD thesis" } + { "Master's thesis" } + if$ + } + { type } % usually empty + if$ +} + +% markup.xml.edition +% +% edition is a numeric value. ie "2" +% if format 2nd 1st etc.. strip letters. +% +FUNCTION {markup.xml.edition} +{ pop$ pop$ %clear stack + edition strip.letters duplicate$ "" = + { pop$ edition } + 'skip$ + if$ + "edition" markup.xml output.xml +} + + +FUNCTION{begin.bmcxmlcomment}{ + newline$ + "\newcommand{\BMCxmlcomment}[1]{}" write$ newline$ + newline$ + "\BMCxmlcomment{" write$ newline$ + newline$ "" write$ newline$ +} + +FUNCTION{end.bmcxmlcomment}{ + newline$ + "" write$ newline$ + "} % end of \BMCxmlcomment" write$ newline$ +} + +FUNCTION {export.xml}{ + newline$ + global.counter #1 + 'global.counter := + "" * + write$ newline$ +% title "\&" "&" replace "title" markup.xml.title + title "title" markup.xml.title + author "aug" markup.xml.names % org. and inst. here + howpublished missing$ + { booktitle missing$ + { journal missing$ + { xml.phd } % Phd/Msc + {journal} + if$ + } {booktitle} + if$ + } { howpublished } + if$ "source" markup.xml output.xml + school + address + publisher "publisher" markup.xml.pub + editor "editor" markup.xml output.xml + edition "edition" markup.xml.edition + series "p" markup.xml + "title" markup.xml + "series" markup.xml output.xml + chapter "p" markup.xml + "title" markup.xml + "section" markup.xml output.xml + % month % ignore + year "pubdate" markup.xml output.xml + + note missing$ + { volume "volume" markup.xml output.xml + number "issue" markup.xml output.xml + pages markup.xml.pages + url "url" markup.xml output.xml } + { note "l" change.case$ "in press" = + { " " write$ newline$ } + { volume "volume" markup.xml output.xml + number "issue" markup.xml output.xml + pages markup.xml.pages + url "url" markup.xml output.xml + note "note" markup.xml output.xml + } + if$ + } + if$ + "" write$ newline$ +} + +%%EXECUTE {begin.bmcxmlcomment} +%%ITERATE {export.xml} +%%EXECUTE {end.bmcxmlcomment} + + + + diff --git a/papers/preprint/bst/sn-nature.bst b/papers/preprint/bst/sn-nature.bst new file mode 100644 index 000000000..cae8f64c2 --- /dev/null +++ b/papers/preprint/bst/sn-nature.bst @@ -0,0 +1,1710 @@ +%% +%% This is file `naturemag.bst', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% merlin.mbs (with options: `head,seq-no,nm-rev,ed-rev,jnrlst,nmlm,x5,m1,yr-par,xmth,vol-bf,vnum-x,volp-com,num-xser,jnm-x,bkpg-x,pub-date,edparxc,ppx,ed,abr,xedn,jabr,amper,and-xcom,etal-it,eprint,url,url-blk,bibinfo,nfss,{}') +%% physjour.mbs (with options: `seq-no,nm-rev,ed-rev,jnrlst,nmlm,x5,m1,yr-par,xmth,vol-bf,vnum-x,volp-com,num-xser,jnm-x,bkpg-x,pub-date,edparxc,ppx,ed,abr,xedn,jabr,amper,and-xcom,etal-it,eprint,url,url-blk,bibinfo,nfss,{}') +%% geojour.mbs (with options: `seq-no,nm-rev,ed-rev,jnrlst,nmlm,x5,m1,yr-par,xmth,vol-bf,vnum-x,volp-com,num-xser,jnm-x,bkpg-x,pub-date,edparxc,ppx,ed,abr,xedn,jabr,amper,and-xcom,etal-it,eprint,url,url-blk,bibinfo,nfss,{}') +%% photjour.mbs (with options: `seq-no,nm-rev,ed-rev,jnrlst,nmlm,x5,m1,yr-par,xmth,vol-bf,vnum-x,volp-com,num-xser,jnm-x,bkpg-x,pub-date,edparxc,ppx,ed,abr,xedn,jabr,amper,and-xcom,etal-it,eprint,url,url-blk,bibinfo,nfss,{}') +%% merlin.mbs (with options: `tail,seq-no,nm-rev,ed-rev,jnrlst,nmlm,x5,m1,yr-par,xmth,vol-bf,vnum-x,volp-com,num-xser,jnm-x,bkpg-x,pub-date,edparxc,ppx,ed,abr,xedn,jabr,amper,and-xcom,etal-it,eprint,url,url-blk,bibinfo,nfss,{}') +%% ---------------------------------------- +%% *** Style for the journal Nature (created by Peter Czoschke) *** +%% +%% Copyright 1994-2002 Patrick W Daly + % =============================================================== + % IMPORTANT NOTICE: + % This bibliographic style (bst) file has been generated from one or + % more master bibliographic style (mbs) files, listed above. + % + % This generated file can be redistributed and/or modified under the terms + % of the LaTeX Project Public License Distributed from CTAN + % archives in directory macros/latex/base/lppl.txt; either + % version 1 of the License, or any later version. + % =============================================================== + % Name and version information of the main mbs file: + % \ProvidesFile{merlin.mbs}[2002/10/21 4.05 (PWD, AO, DPC)] + % For use with BibTeX version 0.99a or later + %------------------------------------------------------------------- + % This bibliography style file is intended for texts in ENGLISH + % This is a numerical citation style, and as such is standard LaTeX. + % It requires no extra package to interface to the main text. + % The form of the \bibitem entries is + % \bibitem{key}... + % Usage of \cite is as follows: + % \cite{key} ==>> [#] + % \cite[chap. 2]{key} ==>> [#, chap. 2] + % where # is a number determined by the ordering in the reference list. + % The order in the reference list is that by which the works were originally + % cited in the text, or that in the database. + %--------------------------------------------------------------------- + +ENTRY + { address + archive + author + booktitle + chapter + edition + editor + eprint + howpublished + institution + journal + key + keywords + month + note + number + organization + pages + publisher + school + series + title + type + url + doi + volume + year + archivePrefix + primaryClass + eid + adsurl + adsnote + version + } + {} + { label } +INTEGERS { output.state before.all mid.sentence after.sentence after.block } +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} +STRINGS { s t} +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} + +FUNCTION {output.in.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} + +FUNCTION {in.output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.in.nonnull + if$ +} +FUNCTION {fin.entry} +{ add.period$ + write$ + newline$ +} + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} +FUNCTION {add.blank} +{ " " * before.all 'output.state := +} + +FUNCTION {date.block} +{ + new.block +} + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} +FUNCTION {new.block.checka} +{ empty$ + 'skip$ + 'new.block + if$ +} +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} +FUNCTION {new.sentence.checka} +{ empty$ + 'skip$ + 'new.sentence + if$ +} +FUNCTION {new.sentence.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.sentence + if$ +} +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "\emph{" swap$ * "}" * } + if$ +} +FUNCTION {bolden} +{ duplicate$ empty$ + { pop$ "" } + { "\textbf{" swap$ * "}" * } + if$ +} +FUNCTION {tie.or.space.prefix} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ +} + +FUNCTION {capitalize} +{ "u" change.case$ "t" change.case$ } + +FUNCTION {space.word} +{ " " swap$ * " " * } + % Here are the language-specific definitions for explicit words. + % Each function has a name bbl.xxx where xxx is the English word. + % The language selected here is ENGLISH +FUNCTION {bbl.and} +{ "and"} + +FUNCTION {bbl.etal} +{ "et~al." } + +FUNCTION {bbl.in.editors} +{ "eds " } + +FUNCTION {bbl.editors} +{ "eds" } + +FUNCTION {bbl.editor} +{ "ed." } + +FUNCTION {bbl.edby} +{ "edited by" } + +FUNCTION {bbl.edition} +{ "edn" } + +FUNCTION {bbl.volume} +{ "Vol." } + +FUNCTION {bbl.of} +{ "of" } + +FUNCTION {bbl.number} +{ "no." } + +FUNCTION {bbl.nr} +{ "no." } + +FUNCTION {bbl.in} +{ "in" } + +FUNCTION {bbl.pages} +{ "" } + +FUNCTION {bbl.page} +{ "" } + +FUNCTION {bbl.chapter} +{ "Ch." } + +FUNCTION {bbl.techrep} +{ "Tech. Rep." } + +FUNCTION {bbl.mthesis} +{ "Master's thesis" } + +FUNCTION {bbl.phdthesis} +{ "Ph.D. thesis" } + +MACRO {jan} {"Jan."} + +MACRO {feb} {"Feb."} + +MACRO {mar} {"Mar."} + +MACRO {apr} {"Apr."} + +MACRO {may} {"May"} + +MACRO {jun} {"Jun."} + +MACRO {jul} {"Jul."} + +MACRO {aug} {"Aug."} + +MACRO {sep} {"Sep."} + +MACRO {oct} {"Oct."} + +MACRO {nov} {"Nov."} + +MACRO {dec} {"Dec."} + + %------------------------------------------------------------------- + % Begin module: + % \ProvidesFile{physjour.mbs}[2002/01/14 2.2 (PWD)] +MACRO {aa}{"Astron. \& Astrophys."} +MACRO {aasup}{"Astron. \& Astrophys. Suppl. Ser."} +MACRO {aj} {"Astron. J."} +MACRO {aph} {"Acta Phys."} +MACRO {advp} {"Adv. Phys."} +MACRO {ajp} {"Amer. J. Phys."} +MACRO {ajm} {"Amer. J. Math."} +MACRO {amsci} {"Amer. Sci."} +MACRO {anofd} {"Ann. Fluid Dyn."} +MACRO {am} {"Ann. Math."} +MACRO {ap} {"Ann. Phys. (NY)"} +MACRO {adp} {"Ann. Phys. (Leipzig)"} +MACRO {ao} {"Appl. Opt."} +MACRO {apl} {"Appl. Phys. Lett."} +MACRO {app} {"Astroparticle Phys."} +MACRO {apj} {"Astrophys. J."} +MACRO {apjsup} {"Astrophys. J. Suppl."} +MACRO {apss} {"Astrophys. Space Sci."} +MACRO {araa} {"Ann. Rev. Astron. Astrophys."} +MACRO {baas} {"Bull. Amer. Astron. Soc."} +MACRO {baps} {"Bull. Amer. Phys. Soc."} +MACRO {cmp} {"Comm. Math. Phys."} +MACRO {cpam} {"Commun. Pure Appl. Math."} +MACRO {cppcf} {"Comm. Plasma Phys. \& Controlled Fusion"} +MACRO {cpc} {"Comp. Phys. Comm."} +MACRO {cqg} {"Class. Quant. Grav."} +MACRO {cra} {"C. R. Acad. Sci. A"} +MACRO {fed} {"Fusion Eng. \& Design"} +MACRO {ft} {"Fusion Tech."} +MACRO {grg} {"Gen. Relativ. Gravit."} +MACRO {ieeens} {"IEEE Trans. Nucl. Sci."} +MACRO {ieeeps} {"IEEE Trans. Plasma Sci."} +MACRO {ijimw} {"Interntl. J. Infrared \& Millimeter Waves"} +MACRO {ip} {"Infrared Phys."} +MACRO {irp} {"Infrared Phys."} +MACRO {jap} {"J. Appl. Phys."} +MACRO {jasa} {"J. Acoust. Soc. America"} +MACRO {jcp} {"J. Comp. Phys."} +MACRO {jetp} {"Sov. Phys.--JETP"} +MACRO {jfe} {"J. Fusion Energy"} +MACRO {jfm} {"J. Fluid Mech."} +MACRO {jmp} {"J. Math. Phys."} +MACRO {jne} {"J. Nucl. Energy"} +MACRO {jnec} {"J. Nucl. Energy, C: Plasma Phys., Accelerators, Thermonucl. Res."} +MACRO {jnm} {"J. Nucl. Mat."} +MACRO {jpc} {"J. Phys. Chem."} +MACRO {jpp} {"J. Plasma Phys."} +MACRO {jpsj} {"J. Phys. Soc. Japan"} +MACRO {jsi} {"J. Sci. Instrum."} +MACRO {jvst} {"J. Vac. Sci. \& Tech."} +MACRO {nat} {"Nature"} +MACRO {nature} {"Nature"} +MACRO {nedf} {"Nucl. Eng. \& Design/Fusion"} +MACRO {nf} {"Nucl. Fusion"} +MACRO {nim} {"Nucl. Inst. \& Meth."} +MACRO {nimpr} {"Nucl. Inst. \& Meth. in Phys. Res."} +MACRO {np} {"Nucl. Phys."} +MACRO {npb} {"Nucl. Phys. B"} +MACRO {nt/f} {"Nucl. Tech./Fusion"} +MACRO {npbpc} {"Nucl. Phys. B (Proc. Suppl.)"} +MACRO {inc} {"Nuovo Cimento"} +MACRO {nc} {"Nuovo Cimento"} +MACRO {pf} {"Phys. Fluids"} +MACRO {pfa} {"Phys. Fluids A: Fluid Dyn."} +MACRO {pfb} {"Phys. Fluids B: Plasma Phys."} +MACRO {pl} {"Phys. Lett."} +MACRO {pla} {"Phys. Lett. A"} +MACRO {plb} {"Phys. Lett. B"} +MACRO {prep} {"Phys. Rep."} +MACRO {pnas} {"Proc. Nat. Acad. Sci. USA"} +MACRO {pp} {"Phys. Plasmas"} +MACRO {ppcf} {"Plasma Phys. \& Controlled Fusion"} +MACRO {phitrsl} {"Philos. Trans. Roy. Soc. London"} +MACRO {prl} {"Phys. Rev. Lett."} +MACRO {pr} {"Phys. Rev."} +MACRO {physrev} {"Phys. Rev."} +MACRO {pra} {"Phys. Rev. A"} +MACRO {prb} {"Phys. Rev. B"} +MACRO {prc} {"Phys. Rev. C"} +MACRO {prd} {"Phys. Rev. D"} +MACRO {pre} {"Phys. Rev. E"} +MACRO {ps} {"Phys. Scripta"} +MACRO {procrsl} {"Proc. Roy. Soc. London"} +MACRO {rmp} {"Rev. Mod. Phys."} +MACRO {rsi} {"Rev. Sci. Inst."} +MACRO {science} {"Science"} +MACRO {sciam} {"Sci. Am."} +MACRO {sam} {"Stud. Appl. Math."} +MACRO {sjpp} {"Sov. J. Plasma Phys."} +MACRO {spd} {"Sov. Phys.--Doklady"} +MACRO {sptp} {"Sov. Phys.--Tech. Phys."} +MACRO {spu} {"Sov. Phys.--Uspeki"} +MACRO {st} {"Sky and Telesc."} + % End module: physjour.mbs + %------------------------------------------------------------------- + % Begin module: + % \ProvidesFile{geojour.mbs}[2002/07/10 2.0h (PWD)] +MACRO {aisr} {"Adv. Space Res."} +MACRO {ag} {"Ann. Geophys."} +MACRO {anigeo} {"Ann. Geofis."} +MACRO {angl} {"Ann. Glaciol."} +MACRO {andmet} {"Ann. d. Meteor."} +MACRO {andgeo} {"Ann. d. Geophys."} +MACRO {andphy} {"Ann. Phys.-Paris"} +MACRO {afmgb} {"Arch. Meteor. Geophys. Bioklimatol."} +MACRO {atph} {"Atm\'osphera"} +MACRO {aao} {"Atmos. Ocean"} +MACRO {ass}{"Astrophys. Space Sci."} +MACRO {atenv} {"Atmos. Environ."} +MACRO {aujag} {"Aust. J. Agr. Res."} +MACRO {aumet} {"Aust. Meteorol. Mag."} +MACRO {blmet} {"Bound.-Lay. Meteorol."} +MACRO {bams} {"Bull. Amer. Meteorol. Soc."} +MACRO {cch} {"Clim. Change"} +MACRO {cdyn} {"Clim. Dynam."} +MACRO {cbul} {"Climatol. Bull."} +MACRO {cap} {"Contrib. Atmos. Phys."} +MACRO {dsr} {"Deep-Sea Res."} +MACRO {dhz} {"Dtsch. Hydrogr. Z."} +MACRO {dao} {"Dynam. Atmos. Oceans"} +MACRO {eco} {"Ecology"} +MACRO {empl}{"Earth, Moon and Planets"} +MACRO {envres} {"Environ. Res."} +MACRO {envst} {"Environ. Sci. Technol."} +MACRO {ecms} {"Estuarine Coastal Mar. Sci."} +MACRO {expa}{"Exper. Astron."} +MACRO {geoint} {"Geofis. Int."} +MACRO {geopub} {"Geofys. Publ."} +MACRO {geogeo} {"Geol. Geofiz."} +MACRO {gafd} {"Geophys. Astrophys. Fluid Dyn."} +MACRO {gfd} {"Geophys. Fluid Dyn."} +MACRO {geomag} {"Geophys. Mag."} +MACRO {georl} {"Geophys. Res. Lett."} +MACRO {grl} {"Geophys. Res. Lett."} +MACRO {ga} {"Geophysica"} +MACRO {gs} {"Geophysics"} +MACRO {ieeetap} {"IEEE Trans. Antenn. Propag."} +MACRO {ijawp} {"Int. J. Air Water Pollut."} +MACRO {ijc} {"Int. J. Climatol."} +MACRO {ijrs} {"Int. J. Remote Sens."} +MACRO {jam} {"J. Appl. Meteorol."} +MACRO {jaot} {"J. Atmos. Ocean. Technol."} +MACRO {jatp} {"J. Atmos. Terr. Phys."} +MACRO {jastp} {"J. Atmos. Solar-Terr. Phys."} +MACRO {jce} {"J. Climate"} +MACRO {jcam} {"J. Climate Appl. Meteor."} +MACRO {jcm} {"J. Climate Meteor."} +MACRO {jcy} {"J. Climatol."} +MACRO {jgr} {"J. Geophys. Res."} +MACRO {jga} {"J. Glaciol."} +MACRO {jh} {"J. Hydrol."} +MACRO {jmr} {"J. Mar. Res."} +MACRO {jmrj} {"J. Meteor. Res. Japan"} +MACRO {jm} {"J. Meteor."} +MACRO {jpo} {"J. Phys. Oceanogr."} +MACRO {jra} {"J. Rech. Atmos."} +MACRO {jaes} {"J. Aeronaut. Sci."} +MACRO {japca} {"J. Air Pollut. Control Assoc."} +MACRO {jas} {"J. Atmos. Sci."} +MACRO {jmts} {"J. Mar. Technol. Soc."} +MACRO {jmsj} {"J. Meteorol. Soc. Japan"} +MACRO {josj} {"J. Oceanogr. Soc. Japan"} +MACRO {jwm} {"J. Wea. Mod."} +MACRO {lao} {"Limnol. Oceanogr."} +MACRO {mwl} {"Mar. Wea. Log"} +MACRO {mau} {"Mausam"} +MACRO {meteor} {"``Meteor'' Forschungsergeb."} +MACRO {map} {"Meteorol. Atmos. Phys."} +MACRO {metmag} {"Meteor. Mag."} +MACRO {metmon} {"Meteor. Monogr."} +MACRO {metrun} {"Meteor. Rundsch."} +MACRO {metzeit} {"Meteor. Z."} +MACRO {metgid} {"Meteor. Gidrol."} +MACRO {mwr} {"Mon. Weather Rev."} +MACRO {nwd} {"Natl. Weather Dig."} +MACRO {nzjmfr} {"New Zeal. J. Mar. Freshwater Res."} +MACRO {npg} {"Nonlin. Proc. Geophys."} +MACRO {om} {"Oceanogr. Meteorol."} +MACRO {ocac} {"Oceanol. Acta"} +MACRO {oceanus} {"Oceanus"} +MACRO {paleoc} {"Paleoceanography"} +MACRO {pce} {"Phys. Chem. Earth"} +MACRO {pmg} {"Pap. Meteor. Geophys."} +MACRO {ppom} {"Pap. Phys. Oceanogr. Meteor."} +MACRO {physzeit} {"Phys. Z."} +MACRO {pps} {"Planet. Space Sci."} +MACRO {pss} {"Planet. Space Sci."} +MACRO {pag} {"Pure Appl. Geophys."} +MACRO {qjrms} {"Quart. J. Roy. Meteorol. Soc."} +MACRO {quatres} {"Quat. Res."} +MACRO {rsci} {"Radio Sci."} +MACRO {rse} {"Remote Sens. Environ."} +MACRO {rgeo} {"Rev. Geophys."} +MACRO {rgsp} {"Rev. Geophys. Space Phys."} +MACRO {rdgeo} {"Rev. Geofis."} +MACRO {revmeta} {"Rev. Meteorol."} +MACRO {sgp}{"Surveys in Geophys."} +MACRO {sp} {"Solar Phys."} +MACRO {ssr} {"Space Sci. Rev."} +MACRO {tellus} {"Tellus"} +MACRO {tac} {"Theor. Appl. Climatol."} +MACRO {tagu} {"Trans. Am. Geophys. Union (EOS)"} +MACRO {wrr} {"Water Resour. Res."} +MACRO {weather} {"Weather"} +MACRO {wafc} {"Weather Forecast."} +MACRO {ww} {"Weatherwise"} +MACRO {wmob} {"WMO Bull."} +MACRO {zeitmet} {"Z. Meteorol."} + % End module: geojour.mbs + %------------------------------------------------------------------- + % Begin module: + % \ProvidesFile{photjour.mbs}[1999/02/24 2.0b (PWD)] + +MACRO {appopt} {"Appl. Opt."} +MACRO {bell} {"Bell Syst. Tech. J."} +MACRO {ell} {"Electron. Lett."} +MACRO {jasp} {"J. Appl. Spectr."} +MACRO {jqe} {"IEEE J. Quantum Electron."} +MACRO {jlwt} {"J. Lightwave Technol."} +MACRO {jmo} {"J. Mod. Opt."} +MACRO {josa} {"J. Opt. Soc. America"} +MACRO {josaa} {"J. Opt. Soc. Amer.~A"} +MACRO {josab} {"J. Opt. Soc. Amer.~B"} +MACRO {jdp} {"J. Phys. (Paris)"} +MACRO {oc} {"Opt. Commun."} +MACRO {ol} {"Opt. Lett."} +MACRO {phtl} {"IEEE Photon. Technol. Lett."} +MACRO {pspie} {"Proc. Soc. Photo-Opt. Instrum. Eng."} +MACRO {sse} {"Solid-State Electron."} +MACRO {sjot} {"Sov. J. Opt. Technol."} +MACRO {sjqe} {"Sov. J. Quantum Electron."} +MACRO {sleb} {"Sov. Phys.--Leb. Inst. Rep."} +MACRO {stph} {"Sov. Phys.--Techn. Phys."} +MACRO {stphl} {"Sov. Techn. Phys. Lett."} +MACRO {vr} {"Vision Res."} +MACRO {zph} {"Z. f. Physik"} +MACRO {zphb} {"Z. f. Physik~B"} +MACRO {zphd} {"Z. f. Physik~D"} + +MACRO {CLEO} {"CLEO"} +MACRO {ASSL} {"Adv. Sol.-State Lasers"} +MACRO {OSA} {"OSA"} + % End module: photjour.mbs +%% Copyright 1994-2002 Patrick W Daly +MACRO {acmcs} {"ACM Comput. Surv."} + +MACRO {acta} {"Acta Inf."} + +MACRO {cacm} {"Commun. ACM"} + +MACRO {ibmjrd} {"IBM J. Res. Dev."} + +MACRO {ibmsj} {"IBM Syst.~J."} + +MACRO {ieeese} {"IEEE Trans. Software Eng."} + +MACRO {ieeetc} {"IEEE Trans. Comput."} + +MACRO {ieeetcad} + {"IEEE Trans. Comput. Aid. Des."} + +MACRO {ipl} {"Inf. Process. Lett."} + +MACRO {jacm} {"J.~ACM"} + +MACRO {jcss} {"J.~Comput. Syst. Sci."} + +MACRO {scp} {"Sci. Comput. Program."} + +MACRO {sicomp} {"SIAM J. Comput."} + +MACRO {tocs} {"ACM Trans. Comput. Syst."} + +MACRO {tods} {"ACM Trans. Database Syst."} + +MACRO {tog} {"ACM Trans. Graphic."} + +MACRO {toms} {"ACM Trans. Math. Software"} + +MACRO {toois} {"ACM Trans. Office Inf. Syst."} + +MACRO {toplas} {"ACM Trans. Progr. Lang. Syst."} + +MACRO {tcs} {"Theor. Comput. Sci."} + +FUNCTION {bibinfo.check} +{ swap$ + duplicate$ missing$ + { + pop$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ pop$ + } + { swap$ + "\bibinfo{" swap$ * "}{" * swap$ * "}" * + } + if$ + } + if$ +} +FUNCTION {bibinfo.warn} +{ swap$ + duplicate$ missing$ + { + swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ "empty " swap$ * " in " * cite$ * warning$ + } + { swap$ + "\bibinfo{" swap$ * "}{" * swap$ * "}" * + } + if$ + } + if$ +} +FUNCTION {format.eprint} +{ eprint duplicate$ empty$ + 'skip$ + { "\eprint" + archive empty$ + 'skip$ + { "[" * archive * "]" * } + if$ + "{" * swap$ * "}" * + } + if$ +} +FUNCTION {format.url} +{ url empty$ + { "" } + { "\urlprefix\url{" url * "}" * } + if$ +} + +FUNCTION {format.doi} +{ doi empty$ + { "" } + { "\doi{" doi * "}" * } + if$ +} + +STRINGS { bibinfo} +INTEGERS { nameptr namesleft numnames } + +FUNCTION {format.names} +{ 'bibinfo := + duplicate$ empty$ 'skip$ { + 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv~}{ll}{, f.}{, jj}" + format.name$ + bibinfo bibinfo.check + 't := + nameptr #1 > + { + nameptr #1 + #1 + = + numnames #5 + > and + { "others" 't := + #1 'namesleft := } + 'skip$ + if$ + namesleft #1 > + { ", " * t * } + { + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal emphasize * + } + { + "\&" + space.word * t * + } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } if$ +} +FUNCTION {format.names.ed} +{ + format.names +} +FUNCTION {format.authors} +{ author "author" format.names +} +FUNCTION {get.bbl.editor} +{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } + +FUNCTION {get.in.bbl.editor} +{ } + +FUNCTION {format.editors} +{ editor "editor" format.names duplicate$ empty$ 'skip$ + { + " " * + get.bbl.editor + "(" swap$ * ")" * + * + } + if$ +} + +FUNCTION {format.in.editors} +{ "" editor "editor" format.names duplicate$ empty$ 'skip$ + { swap$ "(eds" * + " " * swap$ * + swap$ " " * + swap$ * ")" * + } + if$ +} + +FUNCTION {format.note} +{ + note empty$ + { "" } + { note #1 #1 substring$ + duplicate$ "{" = + 'skip$ + { output.state mid.sentence = + { "l" } + { "u" } + if$ + change.case$ + } + if$ + note #2 global.max$ substring$ * "note" bibinfo.check + } + if$ +} + + + +FUNCTION {format.in.title} +{ title + duplicate$ empty$ 'skip$ + { "t" change.case$ } + if$ + " in \textit{" swap$ * "}" * "title" bibinfo.check +} + +FUNCTION {format.title} +{ title + duplicate$ empty$ 'skip$ + { "t" change.case$ } + if$ + "title" bibinfo.check +} + +FUNCTION {format.inpro.title} +{ title + duplicate$ empty$ 'skip$ + { "t" change.case$ } + if$ + "title" bibinfo.check + emphasize} + +FUNCTION {format.version} +{ version + duplicate$ empty$ 'skip$ + { "t" change.case$ } + if$ + "version" bibinfo.check +} + +%FUNCTION {format.inpro.title} +%{ title +% duplicate$ empty$ 'skip$ +% { "t" change.case$ } +% if$ +% "title" bibinfo.check +% emphasize} + +FUNCTION {output.bibitem} +{ newline$ + "\bibitem{" write$ + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {n.dashify} +{ + 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {word.in} +{ bbl.in capitalize + " " * } + +FUNCTION {format.date} +{ + "" + duplicate$ empty$ + year "year" bibinfo.check duplicate$ empty$ + { swap$ 'skip$ + { "there's a month but no year in " cite$ * warning$ } + if$ + * + } + { swap$ 'skip$ + { + swap$ + " " * swap$ + } + if$ + * + } + if$ + duplicate$ empty$ + 'skip$ + { + before.all 'output.state := + " (" swap$ * ")" * + } + if$ +} +FUNCTION {format.btitle} +{ title "title" bibinfo.check + duplicate$ empty$ 'skip$ + { + emphasize + } + if$ +} +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { bbl.volume volume tie.or.space.prefix + "volume" bibinfo.check * * + series "series" bibinfo.check + duplicate$ empty$ 'pop$ + { swap$ bbl.of space.word * swap$ + emphasize * } + if$ + "volume and number" number either.or.check + } + if$ +} +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { series empty$ + { number "number" bibinfo.check } + { output.state mid.sentence = + { bbl.number } + { bbl.number capitalize } + if$ + number tie.or.space.prefix "number" bibinfo.check * * + bbl.in space.word * + series "series" bibinfo.check * + } + if$ + } + if$ + } + { "" } + if$ +} + +FUNCTION {format.edition} +{ edition duplicate$ empty$ 'skip$ + { + output.state mid.sentence = + { "l" } + { "t" } + if$ change.case$ + "edition" bibinfo.check + " " * bbl.edition * + } + if$ +} +INTEGERS { multiresult } +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} +FUNCTION {format.pages} +{ pages duplicate$ empty$ 'skip$ + { duplicate$ multi.page.check + { + n.dashify + } + { + } + if$ + "pages" bibinfo.check + } + if$ +} +FUNCTION {format.journal.pages} +{ pages duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ + { pop$ pop$ format.pages } + { + ", " * + swap$ + n.dashify + "pages" bibinfo.check + * + } + if$ + } + if$ +} +FUNCTION {format.number} + {number empty$ + 'skip$ + { "~(" number * ")" * * } + if$ + } +FUNCTION {format.vol.num.pages} +{ volume field.or.null + duplicate$ empty$ 'skip$ + { + "volume" bibinfo.check + } + if$ + bolden +% format.number + format.journal.pages +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { bbl.chapter } + { type "l" change.case$ + "type" bibinfo.check + } + if$ + chapter tie.or.space.prefix + "chapter" bibinfo.check + * * + pages empty$ + 'skip$ + { ", " * format.pages * } + if$ + } + if$ +} + +FUNCTION {format.booktitle} +{ + booktitle "booktitle" bibinfo.check + emphasize +} +FUNCTION {format.in.ed.booktitle} +{ duplicate$ empty$ 'skip$ + { +editor "editor" format.names.ed duplicate$ empty$ 'pop$ + { +format.booktitle swap$ +"(" editor num.names$ #1 > 'bbl.in.editors 'bbl.editor if$ * swap$ ") " * + * swap$ + * } + if$ + } + 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 duplicate$ empty$ + 'pop$ + { swap$ pop$ + "t" change.case$ "type" bibinfo.check + } + if$ +} +FUNCTION {format.tr.number} +{ number "number" bibinfo.check + type duplicate$ empty$ + { pop$ bbl.techrep } + 'skip$ + if$ + "type" bibinfo.check + swap$ duplicate$ empty$ + { pop$ "t" change.case$ } + { tie.or.space.prefix * * } + if$ +} +FUNCTION {format.article.crossref} +{ + key duplicate$ empty$ + { pop$ + journal duplicate$ empty$ + { "need key or journal for " cite$ * " to crossref " * crossref * warning$ } + { "journal" bibinfo.check emphasize word.in swap$ * } + if$ + } + { word.in swap$ * " " *} + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {format.crossref.editor} +{ editor #1 "{vv~}{ll}" format.name$ + "editor" bibinfo.check + editor num.names$ duplicate$ + #2 > + { pop$ + "editor" bibinfo.check + " " * bbl.etal + emphasize + * + } + { #2 < + 'skip$ + { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { + "editor" bibinfo.check + " " * bbl.etal + emphasize + * + } + { + " \& " + * editor #2 "{vv~}{ll}" format.name$ + "editor" bibinfo.check + * + } + if$ + } + if$ + } + if$ +} +FUNCTION {format.book.crossref} +{ volume duplicate$ empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + pop$ word.in + } + { bbl.volume + capitalize + swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word * + } + if$ + editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { series empty$ + { "need editor, key, or series for " cite$ * " to crossref " * + crossref * warning$ + "" * + } + { series emphasize * } + if$ + } + { key * } + if$ + } + { format.crossref.editor * } + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {format.incoll.inproc.crossref} +{ + editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { format.booktitle duplicate$ empty$ + { "need editor, key, or booktitle for " cite$ * " to crossref " * + crossref * warning$ + } + { word.in swap$ * } + if$ + } + { word.in key * " " *} + if$ + } + { word.in format.crossref.editor * " " *} + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {format.org.or.pub} +{ 't := + "" + year empty$ + { "empty year in " cite$ * warning$ } + 'skip$ + if$ + address empty$ t empty$ and + year empty$ and + 'skip$ + { + add.blank "(" * + t empty$ + { address "address" bibinfo.check * + } + { t * + address empty$ + 'skip$ + { ", " * address "address" bibinfo.check * } + if$ + } + if$ + year empty$ + 'skip$ + { t empty$ address empty$ and + 'skip$ + { ", " * } + if$ + year "year" bibinfo.check + * + } + if$ + ")" * + } + if$ +} +FUNCTION {format.publisher.address} +{ publisher "publisher" bibinfo.warn format.org.or.pub +} + +FUNCTION {format.organization.address} +{ organization "organization" bibinfo.check format.org.or.pub +} + +FUNCTION {format.archive} +{ + archivePrefix empty$ + { "" } + { archivePrefix ":" *} + if$ +} + +FUNCTION {format.primaryClass} +{ + primaryClass empty$ + { "" } + { " {[" primaryClass * "]}" *} + if$ +} + +FUNCTION {format.soft.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ + "eprint" bibinfo.check +} + +FUNCTION {format.softmisc.archive} +{ + archivePrefix empty$ + { "" } + { "" } + if$ +} + +FUNCTION {format.softmisc.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + crossref missing$ + { + journal + "journal" bibinfo.check + emphasize + "journal" output.check + add.blank + format.vol.num.pages output + format.date "year" output.check + } + { format.article.crossref output.nonnull + format.pages output + } + if$ + new.block + format.url output + new.block + %% format.doi output + format.note output + %%format.eprint output + %% format.soft.eprint output + %% add.blank + %% format.primaryClass output + fin.entry +} + +FUNCTION {book} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + add.blank + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + new.block + format.btitle "title" output.check + add.blank + format.edition output + crossref missing$ + { format.bvolume output + new.block + format.number.series output + new.sentence + format.publisher.address output + } + { + new.block + format.book.crossref output.nonnull + format.date "year" output.check + } + if$ + new.block + format.url output + new.block + format.note output + format.eprint output + fin.entry +} +FUNCTION {booklet} +{ output.bibitem + format.authors output + new.block + format.title "title" output.check + new.block + howpublished "howpublished" bibinfo.check output + address "address" bibinfo.check output + format.date output + new.block + format.url output + new.block + format.note output + format.eprint output + fin.entry +} + +FUNCTION {inbook} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + new.block + format.btitle "title" output.check + crossref missing$ + { + format.bvolume output + format.chapter.pages "chapter and pages" output.check + new.block + format.number.series output + new.sentence + format.publisher.address output + } + { + format.chapter.pages "chapter and pages" output.check + new.block + format.book.crossref output.nonnull + format.date "year" output.check + } + if$ + format.edition output + new.block + format.url output + new.block + format.note output + format.eprint output + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + new.block + format.in.title "title" output.check + add.blank + format.edition output +% new.block + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + add.blank + format.number.series output + format.chapter.pages output + new.sentence + format.publisher.address output + } + { format.incoll.inproc.crossref output.nonnull + format.chapter.pages output + } + if$ + new.block + format.url output + new.block + format.note output + format.eprint output + fin.entry +} +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check + new.block + format.editors output +add.blank + format.inpro.title "title" output.check + new.block + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.number.series output + format.pages output + new.sentence + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + } + { format.incoll.inproc.crossref output.nonnull + format.pages output + } + if$ + new.block + format.url output + new.block + format.note output + format.eprint output + fin.entry +} +FUNCTION {conference} { inproceedings } +FUNCTION {manual} +{ output.bibitem + author empty$ + { organization "organization" bibinfo.check + duplicate$ empty$ 'pop$ + { output + address "address" bibinfo.check output + } + if$ + } + { format.authors output.nonnull } + if$ + new.block + format.btitle "title" output.check + author empty$ + { organization empty$ + { + address new.block.checka + address "address" bibinfo.check output + } + 'skip$ + if$ + } + { + organization address new.block.checkb + organization "organization" bibinfo.check output + address "address" bibinfo.check output + } + if$ + format.edition output + format.date output + new.block + format.url output + new.block + format.note output + format.eprint output + fin.entry +} + +FUNCTION {mastersthesis} +{ output.bibitem + format.authors "author" output.check + new.block + format.btitle + "title" output.check + new.block + bbl.mthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.date "year" output.check + new.block + format.url output + new.block + format.note output + format.eprint output + fin.entry +} + +FUNCTION {misc} +{ output.bibitem + format.authors output + title howpublished new.block.checkb + format.title output + howpublished new.block.checka + howpublished "howpublished" bibinfo.check output + format.date output + new.block + format.url output + new.block + format.note output + format.eprint output + fin.entry + empty.misc.check +} + +FUNCTION {softmisc} +{ output.bibitem + format.authors output + title howpublished new.block.checkb + format.title output + format.version output + howpublished new.block.checka + howpublished "howpublished" bibinfo.check output + format.date output + new.block + format.url output + new.block + format.note output + %%format.eprint output + format.softmisc.eprint output + fin.entry + empty.misc.check +} + +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" output.check + new.block + format.btitle + "title" output.check + new.block + bbl.phdthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.date "year" output.check + new.block + format.url output + new.block + format.note output + format.eprint output + fin.entry +} + +FUNCTION {proceedings} +{ output.bibitem + editor empty$ + { organization "organization" bibinfo.check output + } + { format.editors output.nonnull } + if$ + new.block + format.btitle "title" output.check + format.bvolume output + format.number.series output + editor empty$ + { publisher empty$ + 'skip$ + { + new.sentence + format.publisher.address output + } + if$ + } + { publisher empty$ + { + new.sentence + format.organization.address output } + { + new.sentence + organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + } + if$ + new.block + format.url output + new.block + format.note output + format.eprint output + fin.entry +} + +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check + new.block + format.title + "title" output.check + new.block + format.tr.number output.nonnull + institution "institution" bibinfo.warn output + address "address" bibinfo.check output + format.date "year" output.check + new.block + format.url output + new.block + format.note output + format.eprint output + fin.entry +} + +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + format.date output + new.block + format.url output + new.block + format.note "note" output.check + format.eprint output + fin.entry +} + +FUNCTION {default.type} { misc } +READ +STRINGS { longest.label } +INTEGERS { number.label longest.label.width } +FUNCTION {initialize.longest.label} +{ "" 'longest.label := + #1 'number.label := + #0 'longest.label.width := +} +FUNCTION {longest.label.pass} +{ number.label int.to.str$ 'label := + number.label #1 + 'number.label := + label width$ longest.label.width > + { label 'longest.label := + label width$ 'longest.label.width := + } + 'skip$ + if$ +} +EXECUTE {initialize.longest.label} +ITERATE {longest.label.pass} +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" longest.label * "}" * + write$ newline$ + "\expandafter\ifx\csname url\endcsname\relax" + write$ newline$ + %%" \def\url#1{\texttt{#1}}\fi" + " \def\url#1{\burl{#1}}\fi" + write$ newline$ + "\expandafter\ifx\csname urlprefix\endcsname\relax\def\urlprefix{URL }\fi" + write$ newline$ + "\providecommand{\bibinfo}[2]{#2}" + write$ newline$ + "\providecommand{\eprint}[2][]{\url{#2}}" + write$ newline$ + "\providecommand{\doi}[1]{\url{https://doi.org/#1}}" + write$ newline$ + "\bibcommenthead" write$ newline$ +} +EXECUTE {begin.bib} +EXECUTE {init.state.consts} +ITERATE {call.type$} +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} +EXECUTE {end.bib} +%% End of customized bst file +%% +%% End of file `nature.bst'. \ No newline at end of file diff --git a/papers/preprint/bst/sn-vancouver.bst b/papers/preprint/bst/sn-vancouver.bst new file mode 100644 index 000000000..5af90528b --- /dev/null +++ b/papers/preprint/bst/sn-vancouver.bst @@ -0,0 +1,2033 @@ +%% +%% This `vancouver.bst' bibliographic style file (for LaTeX/BibTeX) is +%% generated with the docstrip utility and modified manually to meet the +%% ``Uniform Requirements for Manuscripts Submitted to Biomedical Journals'' +%% as published in N Engl J Med 1997;336:309-315. +%% (also known as the Vancouver style) +%% This specification may be found on the web page of the +%% International Committe of Medical Journal Editors: +%% +%% http://www.icmje.org +%% +%%------------------------------------------------------------------- +%% +%% Copyright 2004 Folkert van der Beek +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Folkert van der Beek. +%% +%% Complaints, suggestions and comments may be sent to +%% +%% Folkert van der Beek +%% +%%------------------------------------------------------------------- +%% +%% This bibliography style file is intended for texts in ENGLISH +%% This is a numerical citation style, and as such is standard LaTeX. +%% It requires no extra package to interface to the main text. +%% The form of the \bibitem entries is +%% \bibitem{key}... +%% Usage of \cite is as follows: +%% \cite{key} ==>> [#] +%% \cite[chap. 2]{key} ==>> [#, chap. 2] +%% where # is a number determined by the ordering in the reference list. +%% The order in the reference list is that by which the works were originally +%% cited in the text, or that in the database. + % +%% To change the reference numbering system from [1] to 1, +%% put the following code in the preamble: +%% \makeatletter % Reference list option change +%% \renewcommand\@biblabel[1]{#1} % from [1] to 1 +%% \makeatother % +%% +%%--------------------------------------------------------------------- + +%% List of all possible fields +ENTRY + { address + assignee % for patents + author + booktitle % for articles in books + chapter % for incollection, esp. internet documents + cartographer % for maps + day + edition + editor + howpublished + institution % for technical reports + inventor % for patents + journal + key + keywords + month + note + number + organization + pages + part + publisher + school + series + title + type + volume + word + year + eprint % urlbst + doi % urlbst + url % urlbst + lastchecked % urlbst + updated % urlbst + archive + archivePrefix + primaryClass + eid + adsurl + adsnote + version + } + {} + { label } +%% Declaration of integer variables +INTEGERS { output.state before.all mid.sentence after.sentence after.block } +STRINGS { urlintro eprinturl eprintprefix doiprefix doiurl } % urlbst... +INTEGERS { hrefform addeprints adddoiresolver } +% Following constants may be adjusted by hand, if desired +FUNCTION {init.config.constants} +{ + "Available from: " 'urlintro := % prefix before URL + "http://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref + "arXiv:" 'eprintprefix := % text prefix printed before eprint ref + "http://dx.doi.org/" 'doiurl := % prefix to make URL from DOI + "" 'doiprefix := % text prefix printed before DOI ref + #0 'addeprints := % 0=no eprints; 1=include eprints + #0 'adddoiresolver := % 0=no DOI resolver; 1=include it + #0 'hrefform := % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs +} +INTEGERS { + bracket.state + outside.brackets + open.brackets + within.brackets + close.brackets +} +% ...urlbst to here +FUNCTION {init.state.consts} +{ #0 'outside.brackets := % urlbst + #1 'open.brackets := + #2 'within.brackets := + #3 'close.brackets := + + #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} +%% Declaration of string variables +STRINGS { s t} + +% urlbst +FUNCTION {output.nonnull.original} +{ 's := + output.state mid.sentence = + { ". " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} + +% urlbst... +FUNCTION {output.nonnull} +{ % Save the thing we've been asked to output + 's := + % If the bracket-state is close.brackets, then add a close-bracket to + % what is currently at the top of the stack, and set bracket.state + % to outside.brackets + bracket.state close.brackets = + { "]" * + outside.brackets 'bracket.state := + } + 'skip$ + if$ + bracket.state outside.brackets = + { % We're outside all brackets -- this is the normal situation. + % Write out what's currently at the top of the stack, using the + % original output.nonnull function. + s + output.nonnull.original + } + { % Still in brackets. Add open-bracket or (continuation) comma, add the + % new text (in s) to the top of the stack, and move to the close-brackets + % state, ready for next time (unless inbrackets resets it). If we come + % into this branch, then output.state is carefully undisturbed. + bracket.state open.brackets = + { " [" * } + { ", " * } % bracket.state will be within.brackets + if$ + s * + close.brackets 'bracket.state := + } + if$ +} + +% Call this function just before adding something which should be presented in +% brackets. bracket.state is handled specially within output.nonnull. +FUNCTION {inbrackets} +{ bracket.state close.brackets = + { within.brackets 'bracket.state := } % reset the state: not open nor closed + { open.brackets 'bracket.state := } + if$ +} + +FUNCTION {format.lastchecked} +{ lastchecked empty$ + { "" } + { updated empty$ + { inbrackets "cited " lastchecked * } + { inbrackets "updated " updated * "; cited " * lastchecked * } + if$ + } + if$ +} +% ...urlbst to here + +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} + +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} + +FUNCTION {fin.entry} +{ + bracket.state close.brackets = % urlbst + { "]" * } + 'skip$ + if$ + add.period$ + write$ + newline$ +} + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} + +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} + +FUNCTION {add.blank} +{ " " * before.all 'output.state := +} + +FUNCTION {no.blank.or.punct} +{ "" * before.all 'output.state := +} + +FUNCTION {add.semicolon} +{ + ";" * + no.blank.or.punct +} + + +FUNCTION {misc.add.colon} +{ + ": " * + } + +FUNCTION {misc.add.comma} +{ + ", " * + } + +FUNCTION {date.block} +{ + "." * + no.blank.or.punct +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% LOGICAL `NOT', `AND', AND `OR' % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Logical 'not': +% If the first element on the stack is A then this function +% does the following: +% push { #0 } +% push { #1 } +% So now the first 3 elements of the stack are +% { #1 } { #0 } A +% The first 3 are popped and subjected to 'if': +% If A > 0 then { #0 } is executed, else { #1 } is executed: +% if A > 0 +% then 0 +% else 1 +% So consider integers as logicals, where 1 = true and 0 = false, +% then this does +% (if A then false else true) +% which is a logical 'not'. + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Logical 'and': +% If the first 2 elements on the stack are A B +% then this function does the following: +% push 'skip$ +% push { pop$ #0 } +% So now first 4 elements are +% { pop$ #0 } 'skip$ A B +% The first 3 are popped and subjected to 'if' (B is on top of +% the stack): +% If A > 0 then 'skip$ is executed, else { pop$ #0 } is executed: +% if A > 0 +% then (B stays on top of stack) +% else (B is popped and #0 is pushed) +% So consider integers as logicals, where 1 = true and 0 = false, +% then this does +% (if A then B else false) +% which is a logical 'and'. + +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Logical 'or': +% If the first 2 elements on the stack are A B +% then this function does the following: +% push { pop$ #1 } +% push 'skip$ +% So now first 4 elements are +% 'skip$ { pop$ #1 } A B +% The first 3 are popped and subjected to 'if' (B is on top of +% the stack): +% If A > 0 then { pop$ #1 } is executed, else 'skip$ is executed: +% if A > 0 +% then (B is popped and #1 is pushed) +% else (B stays on top of stack) +% So consider integers as logicals, where 1 = true and 0 = false, +% then this does +% (if A then true else B) +% which is a logical 'or'. + +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% GENERAL PURPOSE FUNCTIONS FOR FORMATTING % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% issues warning if field is empty +% call with +% "field" field warning.if.empty +% Note that the first field must be between quotes +% because it is the fieldname for use in the warning message. +% + +FUNCTION {warning.if.empty} +{ empty$ + { "No " swap$ * " in " * cite$ * warning$ } + { pop$ } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % encloses string in pre- and postfix string + % call with + % prefix postfix S enclose.check + % delivers empty string if S empty + % +FUNCTION {enclose.check} +{ duplicate$ empty$ + { pop$ pop$ pop$ + "" + } + { swap$ * * } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% emphasizes top of stack +% call with +% string" emphasize.check +% + +FUNCTION {emphasize.check} +{ "\Bem{" swap$ + "}" swap$ + enclose.check +} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % brackets top of stack + % call with + % "string" bracket.check + % +FUNCTION {bracket.check} +{ "[" swap$ + "]" swap$ + enclose.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % parenthesizes top of stack + % call with + % "string" parenthesize + % +FUNCTION {parenthesize.check} +{ "(" swap$ + ")" swap$ + enclose.check +} + +STRINGS {z} + +FUNCTION {remove.dots} +{ 'z := % expects string on top of the stack, pops the string and assigns it to variable z + "" % push empty string + { z empty$ not } % returns 0 if variable z is empty + { z #1 #1 substring$ % push the first character of variable z + z #2 global.max$ substring$ 'z := % assigns the 2nd to last character of variable z to variable z + duplicate$ "\" = % pushes 1 if the last character is "\", otherwise 0 + { * % concatenates the last 2 literals + z #1 #1 substring$ % push the first character of variable z + z #2 global.max$ substring$ 'z := % assigns the 2nd to last character of variable z to variable z + * % concatenates the last 2 literals, i.e. every character, even a dot, following a "\" will be printed + } + { duplicate$ "." = % pushes 1 if the last character is ".", otherwise 0 + 'pop$ % pushes the pop$ function + { * } % concatenates the last 2 literals + if$ % pops the last character if it is a dot, otherwise concatenates it with the string on top of the stack + } + if$ + } + while$ +} + +INTEGERS {l} +FUNCTION{string.length} +{ + #1 'l := + { duplicate$ duplicate$ #1 l substring$ = not } + { l #1 + 'l := } + while$ + pop$ l +} + +STRINGS {replace find text} +INTEGERS {find_length} +FUNCTION {find.replace} +{ + 'replace := + 'find := + 'text := + find string.length 'find_length := + "" + { text empty$ not } + { text #1 find_length substring$ find = + { + replace * + text #1 find_length + global.max$ substring$ 'text := + } + { text #1 #1 substring$ * + text #2 global.max$ substring$ 'text := + } + if$ + } + while$ +} + +FUNCTION {new.block.checka} +{ empty$ + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.sentence.checka} +{ empty$ + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {new.sentence.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} + +FUNCTION {emphasize} +{ skip$ } + +FUNCTION {tie.or.space.prefix} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ +} + +FUNCTION {capitalize} +{ "u" change.case$ "t" change.case$ } + +FUNCTION {space.word} +{ " " swap$ * " " * } + + % Here are the language-specific definitions for explicit words. + % Each function has a name bbl.xxx where xxx is the English word. + % The language selected here is ENGLISH + +FUNCTION {bbl.and} +{ "and"} + +FUNCTION {bbl.etal} +{ "et~al." } + +FUNCTION {bbl.editors} +{ "editors" } + +FUNCTION {bbl.editor} +{ "editor" } + +FUNCTION {bbl.cartographers} +{ "cartographers" } + +FUNCTION {bbl.cartographer} +{ "cartographer" } + +FUNCTION {bbl.inventors} +{ "inventors" } + +FUNCTION {bbl.inventor} +{ "inventor" } + +FUNCTION {bbl.assignees} +{ "assignees" } + +FUNCTION {bbl.assignee} +{ "assignee" } + +FUNCTION {bbl.edby} +{ "edited by" } + +FUNCTION {bbl.edition} +{ "ed." } + +FUNCTION {bbl.volume} +{ "vol." } + +FUNCTION {bbl.of} +{ "of" } + +FUNCTION {bbl.number} +{ "no." } + +FUNCTION {bbl.nr} +{ "no." } + +FUNCTION {bbl.in} +{ "in" } + +FUNCTION {bbl.pages} +{ "p." } + +FUNCTION {bbl.page} +{ "p." } + +FUNCTION {bbl.chapter} +{ "chap." } + +FUNCTION {bbl.techrep} +{ "Tech. Rep." } + +FUNCTION {bbl.mthesis} +{ "Master's thesis" } + +FUNCTION {bbl.phdthesis} +{ "Ph.D. thesis" } + +FUNCTION {bbl.first} +{ "1st" } + +FUNCTION {bbl.second} +{ "2nd" } + +FUNCTION {bbl.third} +{ "3rd" } + +FUNCTION {bbl.fourth} +{ "4th" } + +FUNCTION {bbl.fifth} +{ "5th" } + +FUNCTION {bbl.st} +{ "st" } + +FUNCTION {bbl.nd} +{ "nd" } + +FUNCTION {bbl.rd} +{ "rd" } + +FUNCTION {bbl.th} +{ "th" } + +MACRO {jan} {"Jan."} + +MACRO {feb} {"Feb."} + +MACRO {mar} {"Mar."} + +MACRO {apr} {"Apr."} + +MACRO {may} {"May"} + +MACRO {jun} {"Jun."} + +MACRO {jul} {"Jul."} + +MACRO {aug} {"Aug."} + +MACRO {sep} {"Sep."} + +MACRO {oct} {"Oct."} + +MACRO {nov} {"Nov."} + +MACRO {dec} {"Dec."} + +FUNCTION {eng.ord} +{ duplicate$ "1" swap$ * + #-2 #1 substring$ "1" = + { bbl.th * } + { duplicate$ #-1 #1 substring$ + duplicate$ "1" = + { pop$ bbl.st * } + { duplicate$ "2" = + { pop$ bbl.nd * } + { "3" = + { bbl.rd * } + { bbl.th * } + if$ + } + if$ + } + if$ + } + if$ +} + +FUNCTION {bibinfo.check} +{ swap$ + duplicate$ missing$ + { + pop$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ pop$ + } + { swap$ + pop$ + } + if$ + } + if$ +} + +FUNCTION {bibinfo.warn} +{ swap$ + duplicate$ missing$ + { + swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ "empty " swap$ * " in " * cite$ * warning$ + } + { swap$ + pop$ + } + if$ + } + if$ +} + +STRINGS { bibinfo} +INTEGERS { nameptr namesleft numnames } + +FUNCTION {format.names} +{ 'bibinfo := + duplicate$ empty$ 'skip$ { + "." ". " find.replace 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv~}{ll}{ f{}}{ jj}" + format.name$ + remove.dots + bibinfo bibinfo.check + 't := + nameptr #1 > + { + nameptr #6 + #1 + = + numnames #6 + > and + { "others" 't := + #1 'namesleft := } + 'skip$ + if$ + namesleft #1 > + { ", " * t * } + { + "," * + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal * + } + { " " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } if$ +} + +FUNCTION {format.names.org} +{ 'bibinfo := + duplicate$ empty$ 'skip$ { + 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{ff~}{vv~}{ll}" + format.name$ + bibinfo bibinfo.check + 't := + nameptr #1 > + { + namesleft #1 > + { "; " * t * } + { + ";" * + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal * + } + { " " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } if$ +} + +FUNCTION {format.names.ed} +{ + format.names +} + +FUNCTION {format.authors} +{ + author "author" format.names + %%"." " " "author" find.replace format.names +} + +FUNCTION {format.organizations} +{ organization "organization" format.names.org +} + +FUNCTION {get.bbl.editor} +{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } + +FUNCTION {get.bbl.cartographer} +{ cartographer num.names$ #1 > 'bbl.cartographers 'bbl.cartographer if$ } + +FUNCTION {get.bbl.inventor} +{ inventor num.names$ #1 > 'bbl.inventors 'bbl.inventor if$ } + +FUNCTION {get.bbl.assignee} +{ assignee num.names$ #1 > 'bbl.assignees 'bbl.assignee if$ } + +FUNCTION {format.editors} +{ editor "editor" format.names duplicate$ empty$ 'skip$ + { + "," * + " " * + get.bbl.editor + * + } + if$ +} + +FUNCTION {format.assignees} +{ assignee "assignee" format.names.org duplicate$ empty$ 'skip$ + { + "," * + " " * + get.bbl.assignee + * + } + if$ +} + +FUNCTION {format.cartographers} +{ cartographer "cartographer" format.names duplicate$ empty$ 'skip$ + { + "," * + " " * + get.bbl.cartographer + * + } + if$ +} + +FUNCTION {format.inventors} +{ inventor "inventor" format.names duplicate$ empty$ 'skip$ + { + "," * + " " * + get.bbl.inventor + * + } + if$ +} + +FUNCTION {format.note} +{ + note empty$ + { "" } + { note #1 #1 substring$ + duplicate$ "{" = + 'skip$ + { output.state mid.sentence = + { "l" } + { "u" } + if$ + change.case$ + } + if$ + note #2 global.max$ substring$ * "note" bibinfo.check + } + if$ +} + +FUNCTION {format.title} +{ title +%%duplicate$ empty$ 'skip$ +%% { "t" change.case$ } +%%if$ + "title" bibinfo.check +} + +FUNCTION {format.type} +{ type empty$ + 'skip$ + { inbrackets type } + %%{ add.blank "[" type * "]" * } + if$ +} + +FUNCTION {cite.author.editor} +{ 's := + s #1 "{vv~}{ll}" format.name$ + s num.names$ duplicate$ + #2 > + { pop$ " et~al." * } + { #2 = + { s #2 "{vv~}{ll}{ jj}{ f}" format.name$ "others" = + { " et~al." * } + { " and " * s #2 "{vv~}{ll}" format.name$ * } + if$ + } + 'skip$ + 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} + if$ +} + +FUNCTION {output.bibitem} +{ outside.brackets 'bracket.state := % urlbst + newline$ + "\bibitem[\protect\citeauthoryear{" write$ +check.auth.edit.org write$ +"}{" write$ check.year write$ "}]{" write$ cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {n.dashify} +{ + 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {word.in} +{ bbl.in capitalize + ":" * + " " * } + +FUNCTION {format.journal.date} +{ + month "month" bibinfo.check + duplicate$ empty$ + year "year" bibinfo.check duplicate$ empty$ + { + swap$ 'skip$ + { "there's a month but no year in " cite$ * warning$ } + if$ + * + } + { swap$ 'skip$ + { + " " * swap$ + } + if$ + * + remove.dots + } + if$ + duplicate$ empty$ + 'skip$ + { + before.all 'output.state := + after.sentence 'output.state := + } + if$ +} + +FUNCTION {format.date} +{ + no.blank.or.punct + ";" + duplicate$ empty$ + year "year" bibinfo.check duplicate$ empty$ + { swap$ 'skip$ + { "there's a month but no year in " cite$ * warning$ } + if$ + * + } + { swap$ 'skip$ + { + swap$ + " " * swap$ + } + if$ + * + } + if$ +} + +FUNCTION {format.btitle} +{ title "title" bibinfo.check + duplicate$ empty$ 'skip$ + { + } + if$ +} + +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} + +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { bbl.volume volume tie.or.space.prefix + "volume" bibinfo.check * * + series "series" bibinfo.check + duplicate$ empty$ 'pop$ + { swap$ bbl.of space.word * swap$ + emphasize * } + if$ + "volume and number" number either.or.check + } + if$ +} + +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { series empty$ + { number "number" bibinfo.check } + { output.state mid.sentence = + { bbl.number } + { bbl.number capitalize } + if$ + number tie.or.space.prefix "number" bibinfo.check * * + bbl.in space.word * + series "series" bibinfo.check * + } + if$ + } + if$ + } + { "" } + if$ +} + +FUNCTION {is.num} +{ chr.to.int$ + duplicate$ "0" chr.to.int$ < not + swap$ "9" chr.to.int$ > not and +} + +FUNCTION {extract.num} +{ duplicate$ 't := + "" 's := + { t empty$ not } + { t #1 #1 substring$ + t #2 global.max$ substring$ 't := + duplicate$ is.num + { s swap$ * 's := } + { pop$ "" 't := } + if$ + } + while$ + s empty$ + 'skip$ + { pop$ s } + if$ +} + +FUNCTION {convert.edition} +{ extract.num "l" change.case$ 's := + s "first" = s "1" = or + { bbl.first 't := } + { s "second" = s "2" = or + { bbl.second 't := } + { s "third" = s "3" = or + { bbl.third 't := } + { s "fourth" = s "4" = or + { bbl.fourth 't := } + { s "fifth" = s "5" = or + { bbl.fifth 't := } + { s #1 #1 substring$ is.num + { s eng.ord 't := } + { edition 't := } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + t +} + +FUNCTION {format.edition} +{ edition duplicate$ empty$ 'skip$ + { + convert.edition + output.state mid.sentence = + { "l" } + { "t" } + if$ change.case$ + "edition" bibinfo.check + " " * bbl.edition * + } + if$ +} +INTEGERS { multiresult } +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} + +FUNCTION {format.pages} +{ pages duplicate$ empty$ 'skip$ + { duplicate$ multi.page.check + { + bbl.pages swap$ + n.dashify + } + { + bbl.page swap$ + } + if$ + tie.or.space.prefix + "pages" bibinfo.check + * * + } + if$ +} + +FUNCTION {format.journal.pages} +{ pages duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ + { pop$ pop$ format.pages } + { + ":" * + swap$ + n.dashify + "pages" bibinfo.check + * + } + if$ + } + if$ +} + +FUNCTION {format.vol.num} +{ volume field.or.null + duplicate$ empty$ 'skip$ + { + "volume" bibinfo.check + } + if$ + number "number" bibinfo.check duplicate$ empty$ 'skip$ + { + swap$ duplicate$ empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + swap$ + "(" swap$ * ")" * + } + if$ * +} + +FUNCTION {format.vol.num.pages} +{ volume field.or.null + duplicate$ empty$ 'skip$ + { + "volume" bibinfo.check + } + if$ + number "number" bibinfo.check duplicate$ empty$ 'skip$ + { + swap$ duplicate$ empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + swap$ + "(" swap$ * ")" * + } + if$ * + format.journal.pages +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { bbl.chapter } + { type "l" change.case$ + "type" bibinfo.check + } + if$ + chapter tie.or.space.prefix + "chapter" bibinfo.check + * * + pages empty$ + 'skip$ + { ", " * format.pages * } + if$ + } + if$ + } + + FUNCTION {format.booktitle} + { + booktitle "booktitle" bibinfo.check + } + + FUNCTION {format.in.ed.booktitle} + { format.booktitle duplicate$ empty$ 'skip$ + { + editor "editor" format.names.ed duplicate$ empty$ 'pop$ + { + "," * + " " * + get.bbl.editor + ". " * + * swap$ + * } + if$ + word.in swap$ * + } + if$ + } + + FUNCTION {format.in.ed.title} + { format.title duplicate$ empty$ 'skip$ + { + editor "editor" format.names.ed duplicate$ empty$ 'pop$ + { + "," * + " " * + get.bbl.editor + ". " * + * swap$ + * } + if$ + word.in swap$ * + } + 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 duplicate$ empty$ + 'pop$ + { swap$ pop$ + "t" change.case$ "type" bibinfo.check + } + if$ +} +FUNCTION {format.tr.number} +{ + number "number" bibinfo.check + %%type duplicate$ empty$ + %%{ pop$ bbl.techrep } + %%'skip$ + %%if$ + %%"type" bibinfo.check + %%swap$ duplicate$ empty$ + %%{ pop$ "t" change.case$ } + %%{ tie.or.space.prefix * * } + %%if$ +} + +FUNCTION {format.org.or.pub} +{ 't := + "" + address empty$ t empty$ and + 'skip$ + { + address "address" bibinfo.check * + t empty$ + 'skip$ + { address empty$ + 'skip$ + { ": " * } + if$ + t * + } + if$ + } + if$ +} + +FUNCTION {format.publisher.address} +{ publisher "publisher" bibinfo.warn format.org.or.pub +} + +FUNCTION {format.organization.address} +{ organization "organization" bibinfo.check format.org.or.pub +} + +FUNCTION {format.institution.address} +{ institution "institution" bibinfo.check format.org.or.pub +} + + +% urlbst... +% Functions for making hypertext links. +% In all cases, the stack has (link-text href-url) +% +% make 'null' specials +FUNCTION {make.href.null} +{ + pop$ +} +% make hypertex specials +FUNCTION {make.href.hypertex} +{ + "\special {html: }" * swap$ * + "\special {html:}" * +} +% make hyperref specials +FUNCTION {make.href.hyperref} +{ + "\href {" swap$ * "} {" * swap$ * "}" * +} +FUNCTION {make.href} +{ hrefform #2 = + 'make.href.hyperref % hrefform = 2 + { hrefform #1 = + 'make.href.hypertex % hrefform = 1 + 'make.href.null % hrefform = 0 (or anything else) + if$ + } + if$ +} + +FUNCTION {format.url} +{ url empty$ + { "" } + { hrefform #1 = + { % special case -- add HyperTeX specials + urlintro "\url{" url * "}" * url make.href.hypertex * } + { urlintro "\url{" * url * "}" * } + if$ + } + if$ +} + +FUNCTION {format.eprint} +{ eprint empty$ + { "" } + { eprintprefix eprint * eprinturl eprint * make.href } + if$ +} + +FUNCTION {format.doi} +{ doi empty$ + { "" } + { doiprefix doi * doiurl doi * make.href } + if$ +} + +FUNCTION {format.ddoi} +{ doi "doi" bibinfo.check + duplicate$ empty$ 'skip$ + { + "\doi{" swap$ * "}" * + } + if$ +} + +% Output a URL. We can't use the more normal idiom (something like +% `format.url output'), because the `inbrackets' within +% format.lastchecked applies to everything between calls to `output', +% so that `format.url format.lastchecked * output' ends up with both +% the URL and the lastchecked in brackets. +FUNCTION {output.url} +{ url empty$ + 'skip$ + { new.block + format.url output + format.lastchecked output + } + if$ +} + +FUNCTION {output.web.refs} +{ + new.block + output.url + addeprints eprint empty$ not and + { format.eprint output.nonnull } + 'skip$ + if$ + adddoiresolver doi empty$ not and + { format.doi output.nonnull } + 'skip$ + if$ +% addeprints +% { eprint empty$ +% 'skip$ +% { format.eprint output.nonnull } +% if$ +% } +% 'skip$ +% if$ +} + +% Webpage entry type. +% Title and url fields required; +% author, note, year, month, and lastchecked fields optional +STRINGS {database} +FUNCTION {webpage} +{ output.bibitem + author empty$ + { editor empty$ + 'skip$ % author and editor both optional + { format.editors output.nonnull } + if$ + } + { editor empty$ + { format.authors output.nonnull } + { "can't use both author and editor fields in " cite$ * warning$ } + if$ + } + if$ +% author empty$ +% 'skip$ +% { format.authors output.nonnull } +% if$ + new.block + format.title "title" output.check + journal empty$ + { + format.type "type" output.check + publisher empty$ + 'skip$ + { format.publisher.address output } + if$ + "database on the Internet" 'database := + type database = + { format.journal.date "year" output.check } + { format.date "year" output.check } + if$ + lastchecked empty$ + 'skip$ + { format.lastchecked output } + if$ + new.block + part empty$ + 'skip$ + { part output } + if$ + pages empty$ + 'skip$ + { pages bracket.check output } + if$ + } + { journal + remove.dots + "journal" bibinfo.check + "journal" output.check + format.type "type" output.check + format.journal.date "year" output.check + lastchecked empty$ + 'skip$ + { format.lastchecked output + ";" no.blank.or.punct output + } + if$ + no.blank.or.punct format.vol.num output + pages empty$ + 'skip$ + { ":" no.blank.or.punct output + no.blank.or.punct pages bracket.check output + } + if$ + new.block + } + if$ + format.url "url" output.check + new.block + note output + fin.entry +} +% ...urlbst to here + +FUNCTION {misc} +{ output.bibitem + format.authors "author" output.check + format.editors "author and editor" output.check + no.blank.or.punct + add.period$ misc.add.colon +format.title "title" output.check + type missing$ + { skip$ } + { format.type "type" output.check } + %%{ inbrackets type output } + if$ + new.block + format.publisher.address output +% format.date "year" output.check + new.block + format.note output + new.block + howpublished new.block.checka + howpublished "howpublished" bibinfo.check output + output.web.refs % urlbst + fin.entry + empty.misc.check +} + +FUNCTION {format.archive} +{ + archivePrefix empty$ + { "" } + { archivePrefix ":" *} + if$ +} + +FUNCTION {format.primaryClass} +{ + primaryClass empty$ + { "" } + { "{[" primaryClass * "]}" *} + if$ +} + +FUNCTION {format.soft.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {format.softmisc.archive} +{ + archivePrefix empty$ + { "" } + { "" } + if$ +} + +FUNCTION {format.softmisc.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + organization empty$ + 'skip$ + { author empty$ + { + format.organizations "organization" output.check + } + { + "; " * + no.blank.or.punct + format.organizations "organization" output.check + } + if$ + } + if$ + new.block + format.title "title" output.check + type missing$ + { skip$ } + { format.type "type" output.check } + if$ + new.block + journal + remove.dots + "journal" bibinfo.check + "journal" output.check + format.journal.date "year" output.check + add.semicolon + format.vol.num.pages output + new.block + format.note output + format.ddoi output + new.block + format.soft.eprint output + format.primaryClass output + fin.entry +} + +FUNCTION {softmisc} +{ output.bibitem + format.authors "author" output.check + format.editors "author and editor" output.check + no.blank.or.punct + add.period$ misc.add.colon + format.title "title" output.check misc.add.comma + no.blank.or.punct + version output + type missing$ + { skip$ } + { format.type "type" output.check } + %%{ inbrackets type output } + if$ + new.block + format.publisher.address output +% format.date "year" output.check + new.block + format.note output + new.block + howpublished new.block.checka + howpublished "howpublished" bibinfo.check output + format.date "year" output.check + output.web.refs % urlbst + new.block + format.softmisc.eprint output + fin.entry + empty.misc.check +} + +FUNCTION {book} +{ output.bibitem + author empty$ + { editor empty$ + { format.organizations "organization" output.check } + { format.editors "author and editor" output.check } + if$ + } + { format.authors output.nonnull + "author and editor" editor either.or.check + } + if$ + new.block + format.btitle "title" output.check + format.bvolume output + new.block + format.edition output + new.sentence + author empty$ not + editor empty$ not + and + { format.editors "author and editor" output.check } + 'skip$ + if$ + format.number.series output + format.publisher.address output + format.date "year" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {booklet} +{ misc } + +FUNCTION {dictionary} +{ output.bibitem + format.booktitle "booktitle" output.check + format.bvolume output + new.block + format.edition output + new.sentence + format.publisher.address output + format.date "year" output.check + format.btitle "title" output.check + add.semicolon + add.blank + format.pages "pages" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {inbook} +{ output.bibitem + format.authors "author" output.check + new.block + chapter "chapter" output.check + new.block + format.in.ed.title "title" output.check + format.bvolume output + format.edition output + new.sentence + format.number.series output + format.publisher.address output + format.date "year" output.check + date.block + add.blank + format.pages "pages" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.edition output + new.sentence + format.number.series output + format.publisher.address output + format.date "year" output.check + date.block + add.blank + format.pages "pages" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + format.in.ed.booktitle "booktitle" output.check + format.bvolume output + new.sentence + format.number.series output + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + format.date "year" output.check + date.block + add.blank + format.pages "pages" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {conference} +{inproceedings} + +FUNCTION {manual} +{misc} + +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" output.check + new.block + format.btitle + "title" output.check + format.type "type" output.check + new.block + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.date "year" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {mastersthesis} +{phdthesis} + +FUNCTION {proceedings} +{ output.bibitem + editor empty$ + { organization "organization" bibinfo.check output + } + { format.editors output.nonnull } + if$ + new.block + format.btitle "title" output.check + format.bvolume output + editor empty$ + { publisher empty$ + 'skip$ + { + new.sentence + format.number.series output + format.publisher.address output + } + if$ + } + { publisher empty$ + { + new.sentence + format.organization.address output } + { + new.sentence + organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + } + if$ + format.date "year" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check + new.block + format.title + "title" output.check + new.block + format.institution.address output + format.date "year" output.check + format.tr.number output.nonnull + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {map} +{ output.bibitem + format.cartographers "cartographer" output.check + new.block + format.title + "title" output.check + format.type "type" output.check + new.block + format.publisher.address output + format.date "year" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {patent} +{ output.bibitem + format.inventors "inventor" output.check + "; " * + no.blank.or.punct + format.assignees "assignee" output.check + new.block + format.title + "title" output.check + new.block + format.tr.number output.nonnull + format.date "year" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + format.date output + new.block + format.note "note" output.check + output.web.refs % urlbst + fin.entry +} + +FUNCTION {default.type} { misc } +READ +STRINGS { longest.label } +INTEGERS { number.label longest.label.width } +FUNCTION {initialize.longest.label} +{ "" 'longest.label := + #1 'number.label := + #0 'longest.label.width := +} +FUNCTION {longest.label.pass} +{ number.label int.to.str$ 'label := + number.label #1 + 'number.label := + label width$ longest.label.width > + { label 'longest.label := + label width$ 'longest.label.width := + } + 'skip$ + if$ +} +EXECUTE {initialize.longest.label} +ITERATE {longest.label.pass} +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" longest.label * "}" * + write$ newline$ + "\providecommand{\doi}[1]{\url{https://doi.org/#1}}" + write$ newline$ + "\bibcommenthead" write$ newline$ +} +EXECUTE {begin.bib} +EXECUTE {init.config.constants} +EXECUTE {init.state.consts} +ITERATE {call.type$} +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} +EXECUTE {end.bib} +%% End of customized bst file +%% +%% End of file `vancouver.bst'. + diff --git a/papers/preprint/cover_letter.Rmd b/papers/preprint/cover_letter.Rmd new file mode 100644 index 000000000..d18782049 --- /dev/null +++ b/papers/preprint/cover_letter.Rmd @@ -0,0 +1,31 @@ +--- +output: pdf_document +title: "Cover letter" +date: "`r Sys.Date()`" +--- + +Dear Dr. Brysbaert, + +We are pleased to submit this paper to *Behavior Research Methods*. + +The paper, titled "Check your outliers! An introduction to identifying statistical outliers in R with *easystats*", provides an overview of current recommendations and best practices regarding the diagnosis and treatment of outliers, a common issue faced by researchers---and a potential source of scientific malpractice. + +The methods / tutorial paper covers best practice recommendations on methods for outlier detection and treatment in statistical analyses, as well as their implementation (with code) in the easystats performance package in R. It explains the key approaches, highlights recommendations, and shows how users can adopt them in their R analysis with a single function. The manuscript covers univariate, multivariate, and model-based statistical outlier detection methods, their recommended threshold, standard output, and plotting method, among other things. + +Beyond acting like a concise review of outlier treatment procedures and practical tutorial, we also introduce a new outlier-detection method that relies on a consensus-based approach. In this sense, the paper fits well with *Behavior Research Methods*, as the tutorial essentially communicates to psychologists how to easily follow some of the best practices in the detection of statistical outlier using currently available open source and free software. This makes the manuscript relevant to analyzing, understanding, and interpreting quantitative psychological data, psychological and behavioural science, and good research and statistical practices more generally. + +Finally, as per our personal communication, we are happy to share that we have added a section covering the management of outliers for reaction times, since much research in psychology relies on this type of task. We specifically discuss the Miller (2023) paper, and others, in the second and third paragraphs of Section 3 ("Handling Outliers"). We hope this is satisfying and are looking forward to further feedback. + +All authors have contributed substantially to the software and manuscript. All authors gave final approval to the manuscript and accept to be accountable. We have no conflicts of interest to disclose. + +Thank you for considering our submission. + +On the behalf of all authors, + +Rémi Thériault + +Department of Psychology, + +Université du Québec à Montréal, + +Montréal, Québec, Canada \ No newline at end of file diff --git a/papers/preprint/cover_letter.pdf b/papers/preprint/cover_letter.pdf new file mode 100644 index 000000000..be35e9d89 Binary files /dev/null and b/papers/preprint/cover_letter.pdf differ diff --git a/papers/preprint/empty.eps b/papers/preprint/empty.eps new file mode 100644 index 000000000..d216d5b70 --- /dev/null +++ b/papers/preprint/empty.eps @@ -0,0 +1,80 @@ +%!PS-Adobe-3.0 +%%Pages: (atend) +%%BoundingBox: 0 0 115 87 +%%HiResBoundingBox: 0.563794 0.527295 114.418213 86.036206 +%........................................... +%%Creator: GNU Ghostscript 653 (pswrite) +%%CreationDate: 2002/07/10 13:09:14 +%%DocumentData: Clean7Bit +%%LanguageLevel: 2 +%%EndComments +%%BeginProlog +% This copyright applies to everything between here and the %%EndProlog: +% Copyright (C) 2002 artofcode LLC, Benicia, CA. All rights reserved. +%%BeginResource: procset GS_pswrite_2_0_1001 +/GS_pswrite_2_0_1001 80 dict dup begin +/PageSize 2 array def/setpagesize{ PageSize aload pop 3 index eq exch +4 index eq and{ pop pop pop}{ PageSize dup 1 +5 -1 roll put 0 4 -1 roll put dup where{ exch get exec} +{ pop/setpagedevice where +{ pop 1 dict dup /PageSize PageSize put setpagedevice} +{ /setpage where{ pop PageSize aload pop pageparams 3 {exch pop} repeat +setpage}if}ifelse}ifelse}ifelse} bind def +/!{bind def}bind def/#{load def}!/N/counttomark # +/rG{3{3 -1 roll 255 div}repeat setrgbcolor}!/G{255 div setgray}!/K{0 G}! +/r6{dup 3 -1 roll rG}!/r5{dup 3 1 roll rG}!/r3{dup rG}! +/w/setlinewidth #/J/setlinecap # +/j/setlinejoin #/M/setmiterlimit #/d/setdash #/i/setflat # +/m/moveto #/l/lineto #/c/rcurveto # +/p{N 2 idiv{N -2 roll rlineto}repeat}! +/P{N 0 gt{N -2 roll moveto p}if}! +/h{p closepath}!/H{P closepath}! +/lx{0 rlineto}!/ly{0 exch rlineto}!/v{0 0 6 2 roll c}!/y{2 copy c}! +/re{4 -2 roll m exch dup lx exch ly neg lx h}! +/^{3 index neg 3 index neg}! +/f{P fill}!/f*{P eofill}!/s{H stroke}!/S{P stroke}! +/q/gsave #/Q/grestore #/rf{re fill}! +/Y{P clip newpath}!/Y*{P eoclip newpath}!/rY{re Y}! +/|={pop exch 4 1 roll 3 array astore cvx exch 1 index def exec}! +/|{exch string readstring |=}! +/+{dup type/nametype eq{2 index 7 add -3 bitshift 2 index mul}if}! +/@/currentfile #/${+ @ |}! +/B{{2 copy string{readstring pop}aload pop 4 array astore cvx +3 1 roll}repeat pop pop true}! +/Ix{[1 0 0 1 11 -2 roll exch neg exch neg]exch}! +/,{true exch Ix imagemask}!/If{false exch Ix imagemask}!/I{exch Ix image}! +/Ic{exch Ix false 3 colorimage}! +/F{/Columns counttomark 3 add -2 roll/Rows exch/K -1/BlackIs1 true>> +/CCITTFaxDecode filter}!/FX{< + format_value(digits = "signif3", + style_positive = "plus", + style_negative = "minus") |> + paste0(" SD") |> + replace(4, "Mean") +) + +p_uni <- ggplot(women, aes(height, weight)) + + geom_texthline(aes(yintercept = Y, label = Z_lab), data = uni_thresholds, + hjust = 0.8, halign = "center", + color = "grey60", size = 3) + + + geom_point(aes(shape = univ_outlier)) + + L + + labs(title = "(A) Univariate") + + + +# Multivariate methods -------------------------------------------- + +women[["multiv_outlier"]] <- check_outliers(women[,1:2], method = "mahalanobis") + +multi_thresholds <- qchisq(p = 0.001, df = 2, lower.tail = FALSE) +Ds <- c(1, 2, sqrt(multi_thresholds)) + +ellipses <- lapply(setNames(nm = Ds), function(.D) { + coords <- ellipse( + center = M, + shape = V, + radius = .D, + segments = 100, + draw = FALSE + ) + coords <- as.data.frame(coords) + coords[["D"]] <- .D + coords +}) +ellipses <- do.call("rbind", ellipses) +colnames(ellipses)[1:2] <- colnames(women)[1:2] +ellipses[["D_lab"]] <- format_value(ellipses[["D"]], digits = "signif3") + + +p_multi <- + ggplot(women, aes(height, weight)) + + geom_point(aes(x = M["height"], y = M["weight"]), + color = "grey60", size = 4) + + geom_textcontour(aes(group = D_lab, label = D_lab), data = ellipses, + stat = "identity", hjust = 0.17, + color = "grey60", size = 3) + + + geom_point(aes(shape = multiv_outlier)) + + L + + labs(title = "(B) Multivariate") + + +# Model-specific methods ------------------------------------------------ + +model <- lm(weight ~ height, data = women) + +women[["model_outlier"]] <- check_outliers(model, method = "cook") +women[["y_hat"]] <- fitted(model) + +a <- coef(model)[1] +b <- coef(model)[2] + +p_model <- + ggplot(women, aes(height, weight)) + + geom_abline(intercept = a, slope = b, color = "grey60") + + geom_segment(aes(xend = height, yend = y_hat), + color = "grey60") + + geom_point(aes(shape = model_outlier)) + + L + + labs(title = "(C) Model") + +# Combine plots --------------------------------------------------- + +no_y <- theme(axis.text.y = element_blank(), + axis.title.y = element_blank()) + +fig1 <- p_uni + (p_multi + no_y) + (p_model + no_y) + + plot_layout(nrow = 1, guides = "collect") + +``` diff --git a/papers/preprint/paper.Rmd b/papers/preprint/paper.Rmd new file mode 100644 index 000000000..222a0251c --- /dev/null +++ b/papers/preprint/paper.Rmd @@ -0,0 +1,424 @@ +--- +title: "Check your outliers! An introduction to identifying statistical outliers in R with *easystats*" +titlerunning: "Check your outliers" +tags: + - R + - univariate outliers + - multivariate outliers + - robust detection methods + - easystats +authors: + # - name: Rémi Thériault + - firstname: Rémi + lastname: Thériault + orcid: 0000-0003-4315-6788 + affiliation: 1 + corresponding: TRUE + email: theriault.remi@courrier.uqam.ca + + # - name: Mattan S. Ben-Shachar + - firstname: Mattan + particle: S. + lastname: Ben-Shachar + orcid: 0000-0002-4287-4801 + affiliation: 2 + + # - name: Indrajeet Patil + - firstname: Indrajeet + lastname: Patil + orcid: 0000-0003-1995-6531 + affiliation: 3 + + # - name: Daniel Lüdecke + - firstname: Daniel + lastname: Lüdecke + orcid: 0000-0002-8895-3206 + affiliation: 4 + + # - name: Brenton M. Wiernik + - firstname: Brenton + particle: M. + lastname: Wiernik + orcid: 0000-0001-9560-6336 + affiliation: 5 + + # - name: Dominique Makowski + - firstname: Dominique + lastname: Makowski + orcid: 0000-0001-5375-9967 + affiliation: 6 + +affiliations: + - number: 1 + # name: Department of Psychology, Université du Québec à Montréal, Montréal, Québec, Canada + info: + orgname: Department of Psychology, Université du Québec à Montréal, Montréal, Québec, Canada + - number: 2 + # name: Independent Researcher, Ramat Gan, Israel + info: + orgname: Independent Researcher, Ramat Gan, Israel + - number: 3 + # name: Center for Humans and Machines, Max Planck Institute for Human Development, Berlin, Germany + info: + orgname: Center for Humans and Machines, Max Planck Institute for Human Development, Berlin, Germany + - number: 4 + # name: Institute of Medical Sociology, University Medical Center Hamburg-Eppendorf, Germany + info: + orgname: Institute of Medical Sociology, University Medical Center Hamburg-Eppendorf, Germany + - number: 5 + # name: Independent Researcher, Tampa, FL, USA + info: + orgname: Independent Researcher, Tampa, FL, USA + - number: 6 + # name: School of Psychology, University of Sussex, Brighton, UK + info: + orgname: School of Psychology, University of Sussex, Brighton, UK +correspondence: theriault.remi@courrier.uqam.ca. +type: article +status: submit +date: 7 June 2023 +bibliography: paper.bib +abstract: | + Beyond the challenge of keeping up to date with current best practices regarding the diagnosis and treatment of outliers, an additional difficulty arises concerning the mathematical implementation of the recommended methods. Here, we provide an overview of current recommendations and best practices and demonstrate how they can easily and conveniently be implemented in the R statistical computing software, using the *{performance}* package of the *easystats* ecosystem. We cover univariate, multivariate, and model-based statistical outlier detection methods, their recommended threshold, standard output, and plotting methods. We conclude by reviewing the different theoretical types of outliers, whether to exclude or winsorize them, and the importance of transparency. A preprint of this paper is available at: https://doi.org/10.31234/osf.io/bu6nt. +keywords: | + univariate outliers; multivariate outliers; robust detection methods; R; easystats +acknowledgement: | + *{performance}* is part of the collaborative + [*easystats*](https://github.com/easystats/easystats) ecosystem + [@easystatspackage]. Thus, we thank all + [members of easystats](https://github.com/orgs/easystats/people), + contributors, and users alike. +authorcontributions: | + R.T. drafted the paper; all authors contributed to both the writing of the + paper and the conception of the software. +funding: | + This research received no external funding. +conflictsofinterest: | + The authors declare no conflict of interest. +abbreviations: + - short: SOD + long: Statistical outlier detection + - short: SEM + long: Structural equation modelling + - short: SD + long: Standard deviation + - short: MAD + long: Median absolute deviation + - short: IQR + long: Interquartile range + - short: HDI + long: Highest density interval + - short: BCI + long: Bias corrected and accelerated interval + - short: MCD + long: Minimum covariance determinant + - short: ICS + long: invariant coordinate selection + - short: OSF + long: Open Science Framework +# output: rticles::arxiv_article +output: rticles::springer_article +# output: word_document +# journal: "BRM" +classoptions: sn-basic, lineno +csl: apa.csl +--- + +```{r setup, include=FALSE} +knitr::opts_chunk$set( + echo = TRUE, + comment = "#>", + out.width = "100%", + dpi = 300, + warning = FALSE +) + +library(performance) +library(see) +library(datawizard) +library(insight) + +library(ggplot2) +library(geomtextpath) +library(patchwork) +library(car) +``` + +# Introduction + +Real-life data often contain observations that can be considered _abnormal_ when compared to the main population. The cause of this abnormality can be hard to assess and the boundaries of "normal" difficult to define---they may truly belong to a different distribution (originating from a different generative process) or simply be extreme cases, statistically rare but not impossible. + +Nonetheless, the improper handling of these outliers can substantially affect estimation quantities of interest, and in the context of statistical model can bias parameter estimates and weaken a models' predictive performance [@aguinis2013best]. It is thus essential to address this problem thoughtfully. Yet, despite the existence of established recommendations and guidelines, many researchers still do not treat outliers consistently, or do so using inappropriate strategies [@aguinis2013best; @simmons2011false; @leys2013outliers]. + +Understanding the various methods for outlier detection, their differences, as well as their benefits and disadvantages, can aid researchers in choosing between them and applying them correctly [see @smiti2020critical, for an overview of pros and cons of several recently developed advanced methods]. For example, Figure 1 shows a hypothetical dataset of women’s heights and weights [based on the “women” dataset in R, @mcneil1977interactive] and how applying three different types of outlier identification methods (univariate, multivariate, and model-based; all described in detail in this paper) can lead to different results. + +```{r fig1 parent, child=c('fig1.Rmd'), echo=FALSE} +``` + +```{r fig1, fig.cap = c("Visual representation for the most common methods in the families of outlier identification applied to a hypothetical dataset of women’s heights and weights. Note. In each subplot, triangles are observations marked as “outliers”. (A) Univariate method: Observations are marked as outliers if they lie at some fixed or relative distance from the center of each variable (in this case, 3.29 standard-deviations from y’s mean), suggesting they are not part of the same distribution as the rest of the data; (B) Multivariate method: Observations are marked as outliers if they lie at some fixed or relative distance from the multivariate center (in this case, a Mahalanobis distance of 3.72 from the centroid defined by the means of x and y), suggesting they are not part of the same multivariate distribution as the rest of the data; (C) Model-based method: Observations are marked as outliers if they affect the model’s estimated parameters by more than some threshold (in this case, they have a Cook’s distance of 0.71), suggesting that the inclusion of such observations biases the estimated parameters to a large degree (in the plot, this is represented as the observation with the large absolute residual [i.e., the distance from the regression line]—a concept closely related to Cook’s distance). As can be seen, although there is some overlap, the 3 methods do not agree on which observations are to be marked as outliers. Code to reproduce this figure and all analyses is available at https://osf.io/eqja6/."), echo=FALSE} +fig1 +``` + +One possible reason researchers do not employ validated strategies is that they may not be aware of existing recommendations, or do not know how to implement them using their analysis software. In this paper, we show how to follow current best practices for automatic and reproducible statistical outlier detection (SOD) using R and the *{performance}* package [@ludecke2021performance], which is part of the _easystats_ ecosystem of packages that build an R framework for easy statistical modeling, visualization, and reporting [@easystatspackage]. Installation instructions can be found on [GitHub](https://github.com/easystats/performance) or its [website](https://easystats.github.io/performance/), and its list of dependencies on [CRAN](https://cran.r-project.org/package=performance). + +The instructional materials that follow are aimed at an audience of researchers who want to follow good practices, and are appropriate for advanced undergraduate students, graduate students, professors, or professionals having to deal with the nuances of outlier treatment. + +# Identifying Outliers + +Although many researchers attempt to identify outliers with measures based on the mean (e.g., _z_ scores), those methods can be problematic. This is because the mean and standard deviation themselves are not robust to the influence of outliers and those methods also assume normally distributed data (i.e., a Gaussian distribution). Therefore, current guidelines recommend using robust methods to identify outliers, such as those relying on the median as opposed to the mean [@leys2019outliers; @leys2013outliers; @leys2018outliers]. Additionally, univariate methods can give false positives since they ignore the patterns in multidimensional data, which are often of interest (such as comparing conditional means or estimating correlation matrices). In such cases, multivariate outlier detection methods may be of relevance. + +Which exact outlier method to use depends on many factors. In some cases, eye-gauging odd observations can be an appropriate solution, though many researchers will favor algorithmic solutions to detect potential outliers, for example, based on a continuous value expressing the observations that stand out from the others. Indeed, relying on human intuition and “visual checks” can be rather subjective, and sometimes, even suboptimal. For example, visually communicating results containing outliers—say, on a scatter plot—has been shown to bias people’s estimations of a regression line, even when individuals correctly detect the outliers [@ciccione2023outlier]. + +One of the factors to consider when selecting an algorithmic outlier detection method is the statistical test of interest. Identifying observations where the regression model does not fit well can help find information relevant to our specific research context. This approach, known as model-based outliers detection (as outliers are extracted after the statistical model has been fit), can be contrasted with distribution-based outliers detection, which is based on the distance between an observation and the "center" of its population. Various quantification strategies of this distance exist for the latter, both univariate (involving only one variable at a time) and multivariate (involving multiple variables). + +However, we would like to emphasize that the methods listed in this paper are not an exhaustive list of methods developed and available to researchers. For instance, Bayesian approaches that do not fully reject outliers but simply lower their “weights” have been partly formalized by @chaloner1988bayesian and recently implemented by @ciccione2023outlier. Crucially, Ciccione and colleagues also provide empirical evidence that human observers might indeed perform such forms of Bayesian re-weighting of outliers when asked to detect and reject them, making interesting parallels between statistical research methods and naive psychological mechanisms. + +Importantly, whatever approach researchers choose remains a subjective decision, and usage (and rationale) must be transparently documented and reproducible [@leys2019outliers]. Researchers should commit (ideally in a preregistration) to an outlier treatment method before collecting the data. They should report in the paper their decisions and details of their methods, as well as any deviation from their original plan. These transparency practices can help reduce false positives due to excessive researchers' degrees of freedom (i.e., choice flexibility throughout the analysis). In the following section, we go through each of the mentioned methods and provide examples of how to implement them with R. + +## Univariate Outliers + +Researchers frequently attempt to identify outliers using measures of deviation from the center of a variable's distribution. One of the most popular of such procedures is the _z_-score transformation, which computes the distance in standard deviation (SD) from the mean. However, as mentioned earlier, this popular method is not robust. Therefore, for univariate outliers, it is recommended to use the median along with the median absolute deviation (MAD), which is more robust than the interquartile range or the mean and its standard deviation [@leys2019outliers; @leys2013outliers]. + +Researchers can identify outliers based on robust (i.e., MAD-based) _z_ scores using the `check_outliers()` function of the *{performance}* package, by specifying `method = "zscore_robust"`.^[Note that `check_outliers()` only checks numeric variables.] Although @leys2013outliers suggest a default threshold of 2.5 and @leys2019outliers a threshold of 3, *{performance}* uses by default a less conservative threshold of ~3.29.^[3.29 is an approximation of the two-tailed critical value for _p_ < .001, obtained through `qnorm(p = 1 - 0.001 / 2)`. We chose this threshold for consistency with the thresholds of all our other methods.] That is, data points will be flagged as outliers if they go beyond +/- ~3.29 MAD. Users can adjust this threshold using the `threshold` argument. + +Below, we provide example code using the `mtcars` dataset, which was extracted from the 1974 _Motor Trend_ US magazine. The dataset contains fuel consumption and 10 characteristics of automobile design and performance for 32 different car models (see `?mtcars` for details). We chose this dataset because it is accessible from base R and familiar to many R users. We might want to conduct specific statistical analyses on this data set, say, _t_ tests or structural equation modeling, but first, we want to check for outliers that may influence those test results. + +Because the automobile names are stored as column names in `mtcars`, we first have to convert them to an ID column to benefit from the `check_outliers()` ID argument. Furthermore, we only really need a few columns for this demonstration, so we pick the first four (`mpg` = Miles/(US) gallon; `cyl` = Number of cylinders; `disp` = Displacement; `hp` = Gross horsepower). Finally, because there are no outliers in this dataset, we add two artificial outliers before running our function. + +```{r z_score} +library(performance) + +# Create some artificial outliers and an ID column +data <- rbind(mtcars[1:4], 12, 55) +data <- cbind(car = row.names(data), data) + +outliers <- check_outliers(data, method = "zscore_robust", ID = "car") +outliers +``` + +What we see is that `check_outliers()` with the robust _z_ score method detected one outlier: case 33, which is one of the observations we added ourselves. It was flagged for two variables specifically: `mpg` (miles/(US) gallon) and `cyl` (number of cylinders), and the output provides its exact _z_ score for this variable. + +We describe how to deal with outliers in more details later in the paper, but should we want to exclude detected outliers from the main dataset, we can extract row numbers using `which()` on the output object, which can then be used for indexing: + +```{r} +which(outliers) + +data_clean <- data[-which(outliers), ] +``` + +All `check_outliers()` output objects possess a `plot()` method, meaning it is also possible to visualize all observations in a way that highlights the outliers using the generic `plot()` function on the resulting outlier object after loading the {see} package (Figure 2). + +```{r univariate, eval=FALSE} +library(see) + +plot(outliers) +``` + +```{r univariate_implicit, fig.cap = "Visual depiction of outliers using the robust z-score method. Note. The distance represents the highest deviation score per participant for variables mpg, cyl, disp, and hp. This score represents a given participant’s (1-34) highest robust z score among the tested variables. The resulting unique value (representing one of mpg, cyl, disp, or hp for that participant) is then rescaled to a range of 0 to 1 by dividing by the value of the participant with the highest score.", echo=FALSE} +library(see) + +plot(outliers) + + ggplot2::theme(axis.text.x = ggplot2::element_text( + angle = 45, size = 7 +)) +``` + +Other univariate methods are available, such as using the interquartile range (IQR), or based on different intervals, such as the highest density interval (HDI) or the bias corrected and accelerated interval (BCI). These methods are documented and described in the function's [help page](). + +## Multivariate Outliers + +Univariate outliers can be useful when the focus is on a particular variable, for instance the reaction time, as extreme values might be indicative of inattention or non-task-related behavior^[ Note that they might not be the optimal way of treating reaction time outliers [@ratcliff1993methods; @van1995statistical]]. + +However, in many scenarios, the variables of a data set are not independent, and an outlying observation or participant will be reflected to various degrees on multiple variables. For instance, in the case of survey studies containing a large number of items (e.g., many Likert scales), “careless” or low-effort responding participations (e.g., participants answering at random, displaying “straight-lining”, or “zigzagging” patterns of response) becomes more common—especially when relying on online samples such as through MTurk [@aruguete2019serious; @goldammer2020careless; @ward2023dealing]. Although specific methods exist to detect these unwanted behaviors in questionnaires [e.g., @cao2018z; @curran2016methods; @carelesspackage; @zijlstra2011outliers), this issue can be framed more generally as follows: multiple “odd” observations can sum up and reveal an abnormal participant. Importantly, the deviation from the norm could potentially be low for all variables when taken independently (not meeting the rejection criteria), but strong when taken together (in other words, the likelihood of being an outlier on one variable can be independent from the probability of being an outlier on multiple variables). + +One common approach for this is to compute multivariate distance metrics, such as the Mahalanobis distance. Although the Mahalanobis distance is very popular, just like the regular _z_ scores method, it is not robust and is heavily influenced by the outliers themselves. Therefore, for multivariate outliers, it is recommended to use the Minimum Covariance Determinant, a robust version of the Mahalanobis distance [MCD, @leys2018outliers; @leys2019outliers]. + +In *{performance}*'s `check_outliers()`, one can use this approach with `method = "mcd"`.^[Our default threshold for the MCD method is defined by `stats::qchisq(p = 1 - 0.001, df = ncol(x))`, which again is an approximation of the critical value for _p_ < .001 consistent with the thresholds of our other methods.] + +```{r multivariate} +outliers <- check_outliers(data, method = "mcd") +outliers +``` + +Here, we detected nine multivariate outliers (i.e., when looking at all variables of our dataset together). We can see the result in Figure 3. + +```{r multivariate_plot, eval=FALSE} +plot(outliers) +``` + +```{r multivariate_implicit, fig.cap = "Visual depiction of outliers using the minimum covariance determinant (MCD) method. Note. The MCD method is a robust version of the Mahalanobis distance. The distance represents the MCD scores for variables mpg, cyl, disp, and hp.", echo=FALSE} +plot(outliers) + + ggplot2::theme(axis.text.x = ggplot2::element_text( + angle = 45, size = 7 +)) +``` + +In small samples, however, the MCD method tends to be inaccurate, especially when dealing with high-dimensional data. Other multivariate methods are also available, such as the classic Mahalanobis distance and another type of robust Mahalanobis distance that relies on an orthogonalized Gnanadesikan–Kettenring pairwise estimator [@gnanadesikan1972robust]. These methods are documented and described in the function’s [help page](https://easystats.github.io/performance/reference/check_outliers.html). + +## Model-Based Outliers + +Working with regression models creates the possibility of using model-based SOD methods. These methods rely on the concept of _leverage_, that is, how much influence a given observation can have on the model estimates. If few observations have a relatively strong leverage/influence on the model, one can suspect that the model's estimates are biased by these observations, in which case flagging them as outliers could prove helpful (see next section, "Handling Outliers"). + +In {performance}, two such model-based SOD methods are currently available: Cook's distance, for regular regression models, and Pareto, for Bayesian models. As such, `check_outliers()` can be applied directly on regression model objects, by simply specifying `method = "cook"` (or `method = "pareto"` for Bayesian models).^[Our default threshold for the Cook method is defined by `stats::qf(0.5, ncol(x), nrow(x) - ncol(x))`, which again is an approximation of the critical value for _p_ < .001 consistent with the thresholds of our other methods. In this case, the value 0.5 represents the median of the implied F distribution for D, which allows us to flag D values that are “above average”.] + +Currently, most lm models are supported (except for `glmmTMB`, `lmrob`, and `glmrob` models), as long as they are supported by the underlying functions `stats::cooks.distance()` (or `loo::pareto_k_values()`) and `insight::get_data()` (for a full list of the 225 models currently supported by the `insight` package, see https://easystats.github.io/insight/#list-of-supported-models-by-class). We show a demo below. + +```{r model} +model <- lm(mpg ~ disp * hp, data = data) +outliers <- check_outliers(model, method = "cook") +outliers +``` + +Using the model-based outlier detection method, we identified a single outlier. We can see the result in Figure 4. + +```{r model_fig, fig.cap = "Visual depiction of outliers based on Cook’s distance (leverage and standardized residuals). Note. This plot is based on the fitted model."} +plot(outliers) +``` + +Table 1 below summarizes which methods to use in which cases, and with what threshold. The recommended thresholds are the default thresholds. + +```{r table1_prep, echo=FALSE} +df <- data.frame( + `Statistical Test` = c( + "Supported regression model", + NA, + "Structural Equation Modeling (or other unsupported model)^1^", + NA, + "Simple test with few variables (*t* test, correlation, etc.)"), + `Diagnosis Method` = c( + "**Model-based**: Cook (or Pareto for Bayesian models)", + NA, + "**Multivariate**: Minimum Covariance Determinant (MCD)", + NA, + "**Univariate**: robust *z* scores (MAD)"), + `Recommended Threshold` = c( + "_qf(0.5, ncol(x), nrow(x) - ncol(x))_ (or 0.7 for Pareto)", + NA, + "_qchisq(p = 1 - 0.001, df = ncol(x))_", + NA, + "_qnorm(p = 1 - 0.001 / 2)_, ~ 3.29"), + `Function Usage` = c( + '_check_outliers(model, method = "cook")_', + NA, + '_check_outliers(data, method = "mcd")_', + NA, + '_check_outliers(data, method = "zscore_robust")_'), + check.names = FALSE +) + +options(knitr.kable.NA = "") +knitr::kable( + df, align = "l", col.names = gsub("[.]", " ", names(df)), + caption = "Summary of Statistical Outlier Detection Methods Recommendations") +``` + +^1^ The Minimum Covariance Determinant (MCD) can be inaccurate for small sample sizes. In these cases, the classic Mahalanobis distance can be used instead. + +## Cook's Distance vs. MCD + +@leys2018outliers report a preference for the MCD method over Cook's distance. This is because Cook's distance removes one observation at a time and checks its corresponding influence on the model each time [@cook1977detection], and flags any observation that has a large influence. In the view of these authors, when there are several outliers, the process of removing a single outlier at a time is problematic as the model remains "contaminated" or influenced by other possible outliers in the model, rendering this method suboptimal in the presence of multiple outliers. + +However, distribution-based approaches are not a silver bullet either, and there are cases where the usage of methods agnostic to theoretical and statistical models of interest might be problematic. For example, a very tall person would be expected to also be much heavier than average, but that would still fit with the expected association between height and weight (i.e., it would be in line with a model such as `weight ~ height`). In contrast, using multivariate outlier detection methods in such a case may flag this person as being an outlier---being unusual on two variables, height and weight---even though the pattern fits perfectly with our predictions. + +Refer again to Figure 1: In Panel B both an extremely tall woman, and a shorter but heavier woman are flagged as outlier due to their (Mahalanobis) distance from the group’s centroid. However, when examined in the context of the relationship between height and weight (panel C), it is clear that the taller woman’s weight falls along the regression line. That is, it is _model-consistent_—we expect an extremely tall person to weigh more, and so this observation is not marked as an outlier using a model based method, though it is when using univariate (Panel A) or multivariate (Panel B) methods. On the other hand, the second observation not only has a high Cook’s distance, meaning it has influenced the model’s estimates by a large degree, but it also clearly diverges from the regression line—it is _model-inconsistent_, and is accordingly flagged as an outlier. + +This model-based approach to outlier detection is most coherent in regression-based settings; however, sometimes we are interested in multi-dimensional outlier detection in the classical sense of a point that is far away from the general cluster of our data. We might, for example, decide to exclude a person who is extremely tall and heavy because they differ too much from the main population of study, even if they do match the general trend. In these cases, other methods such as MCD can be appropriate. + +Finally, unusual observations happen naturally: extreme observations are expected even when taken from a normal distribution. While statistical models can integrate this "expectation", multivariate outlier methods might be too conservative, flagging too many observations despite belonging to the right generative process. For these reasons, we believe that model-based methods are still preferable to the MCD when using supported regression models. Additionally, if the presence of multiple outliers is a significant concern, regression methods that are more robust to outliers should be considered---like _t_ regression or quantile regression---as they render their precise identification less critical [@mcelreath2020statistical]. + +## Composite Outlier Score + +To reiterate, there is not any wrong method, per se. Different methods can be judged by their usefulness to do _something_, but do so differently. Univariate methods are often good at detecting non-representative values or data-coding errors. Multivariate methods are also good at detecting non-representative values in a joint-distribution sense. Similarly, model-based methods are good for detecting values that might unrealistically bias model inference. + +The *{performance}* package offers a consensus-based approach that combines several methods, based on the assumption that different methods provide different angles of looking at a given problem. By applying a variety of methods, one can hope to "triangulate" the true outliers (those consistently flagged by multiple methods) and thus attempt to minimize false positives. + +In practice, this approach computes a composite outlier score, formed of the average of the binary (0 or 1) classification results of each method. It represents the probability that each observation is classified as an outlier by at least one method. The default decision rule classifies rows with composite outlier scores superior or equal to 0.5 as outlier observations (i.e., that were classified as outliers by at least half of the methods). In *{performance}*'s `check_outliers()`, one can use this approach by including all desired methods in the corresponding argument. Returning to the example model above: + +```{r multimethod"} +outliers <- check_outliers(model, method = c("zscore_robust", "mcd", "cook")) +which(outliers) +``` + +Outliers (counts or per variables) for individual methods can then be obtained through attributes. For example: + +```{r} +attributes(outliers)$outlier_var$zscore_robust +``` + +An example sentence for reporting the usage of the composite method could be: + +> Based on a composite outlier score [see the 'check_outliers()' function in the 'performance' R package, @ludecke2021performance] obtained via the joint application of multiple outliers detection algorithms [(a) median absolute deviation (MAD)-based robust _z_ scores, @leys2013outliers; (b) Mahalanobis minimum covariance determinant (MCD), @leys2019outliers; and (c) Cook's distance, @cook1977detection], we excluded two participants that were classified as outliers by at least half of the methods used. + +# Handling Outliers + +The above section demonstrated how to identify outliers using the `check_outliers()` function in the *{performance}* package. But what should we do with these outliers once identified? It is common to automatically discard any observation that has been marked as "an outlier" as if it might infect the rest of the data with its statistical ailment. However, it is important to remember that researchers do not have access to the ground truth—it is not possible to know which observations truly do not “belong” with the rest of the sample. Instead, outlier detection methods behave much like unsupervised learning methods, trying to find patterns in the data, and to mark observations that seem to have a bad “fit” with these patterns. + +Therefore, we believe that these methods should merely be used as suggestive, and advocate for researchers and analysts to use their _domain knowledge_ when deciding how to deal with observations marked as outliers using SOD. Indeed, automatic tools can help detect outliers, but they are nowhere near perfect. Although they can be useful for flagging suspect data, they can have misses and false alarms, and they cannot completely replace human eyes and proper vigilance from the researcher. That is, the use of SOD methods is but one step in the get-to-know-your-data pipeline. + +For example, in the case of reaction time analysis, @miller2023outlier systematically compared 58 SOD procedures in simulations using large datasets of real reaction times. He concluded that regardless of the selected procedure, the exclusion of outliers (reaction times too slow or too fast) generally did more harm than good compared to retaining them, as they tend to incorrectly detect outliers, reduce statistical power, and increase bias and noise. He thus recommends only excluding invalid reaction times, such as those under a fixed threshold, e.g., 150 ms, which is close to the minimal physiological limit for reacting to a visual stimulus. Setting an upper limit on very long times (e.g., 3 to 5 seconds, depending on the experimental task) to remove potential sparse artifacts can also improve model convergence and fitting. + +@miller2023outlier also suggests that it is typically better to assess outliers within specific experimental conditions or groups (a condition-specific strategy), rather than across the entire dataset at once (a pooled strategy), particularly in the case of reaction times. Additionally, common procedures such as statistical transformations (e.g., log-transformation) reportedly offer at best no benefit (being instead potentially detrimental) to statistical power [@schramm2019reaction]. Given the specific shape of a typical reaction distribution, treating them with bespoke models that take into account its skewness (thus reframing the notion of outliers and integrating the longer right tail of the distribution) should be considered. Examples of such models—referred to as sequential sampling models or evidence accumulation models—include Wald models [@anders2016shifted], log-normal race models [@rouder2015lognormal], linear ballistic accumulators [@brown2008simplest], and Drift Diffusion Models [@ratcliff2016diffusion]. + +Thus, when manually inspecting data for outliers, it can be helpful to think of outliers as belonging to different types of outliers, or categories, which can help decide what to do with a given outlier. + +## Error, Interesting, and Random Outliers + +Several authors distinguish between error outliers, interesting outliers, and random outliers [@aguinis2013best; @leys2019outliers].^[Some authors provide much more detailed classifications of outliers; for example, see Table 1 in Aguinis et al. (2013), for 14 different outlier definitions based on a literature review.] _Error outliers_ are likely due to human error and should be corrected before data analysis or outright removed since they are invalid observations (e.g., physiologically implausible reaction times). _Interesting outliers_ are not due to technical error and may be of theoretical interest; it might thus be relevant to investigate them further, even though they should be removed from the current analysis of interest. _Random outliers_ are assumed to be due to chance alone and to belong to the correct distribution and, therefore, should be retained. + +It is recommended to _keep_ observations which are expected to be part of the distribution of interest, even if they are outliers [@leys2019outliers]. However, if it is suspected that the outliers belong to an alternative distribution, then those observations could have a large impact on the results. These observations could then call into question the robustness of these results, especially if significance is conditional on their inclusion, so they should be removed. Some authors also report detailed decision trees for handling outliers [e.g., see Figures 1 & 2 in @aguinis2013best]. + +We should also keep in mind that there might be error outliers that are not detected by statistical tools but should nonetheless be found and removed. For example, if we are studying the effects of X on Y among teenagers, and we have one observation from a 20-year-old, this observation might not be a _statistical outlier_, but it is an outlier in the _context_ of our research and should be discarded. We could call these observations *undetected* error outliers, in the sense that although they do not statistically stand out, they do not belong to the theoretical or empirical distribution of interest (e.g., teenagers). In this way, we should not blindly rely on statistical outlier detection methods; doing our due diligence to investigate undetected error outliers relative to our specific research question is also essential for valid inferences. + +## Winsorization + +_Removing_ outliers that do not belong to the distribution of interest can in this case be a valid strategy, and ideally one would report results with and without outliers to see the extent of their impact on results. This approach however can reduce statistical power. Therefore, some propose a _recoding_ approach, namely, winsorization: bringing outliers back within acceptable limits [e.g., three MADs, @tukey1963less]. However, if possible, it is recommended to collect enough data so that even after removing outliers, there is still sufficient statistical power without having to resort to winsorization [@leys2019outliers]. + +The _easystats_ ecosystem makes it easy to incorporate this step into your workflow through the `winsorize()` function of *{datawizard}*, a lightweight R package to facilitate data wrangling and statistical transformations [@patil2022datawizard]. This procedure will bring back univariate outliers within the limits of 'acceptable' values, based either on the percentile, the _z_ score, or its robust alternative based on the MAD. For example, let's say we want to winsorize the univariate outlier identified before: + +```{r winsorization} +data[33:34, 2:3] # See outliers rows + +# Winsorizing using the MAD +library(datawizard) +winsorized_data <- winsorize(data, method = "zscore", + robust = TRUE, threshold = 3) + +# Outlier values > +/- MAD have been winsorized +winsorized_data[33:34, 2:3] +``` + +## The Importance of Transparency + +Finally, it is a critical part of a sound outlier treatment that regardless of which SOD method used, it should be reported in a reproducible manner. Ideally, the handling of outliers should be specified *a priori* with as much detail as possible, and preregistered, to limit researchers' degrees of freedom and therefore risks of false positives [@leys2019outliers]. This is especially true given that interesting outliers and random outliers are oftentimes hard to distinguish in practice. Thus, researchers should always prioritize transparency and report all the following information: (a) how many outliers were identified (including percentage); (b) according to which method and criteria, (c) using which function of which R package (if applicable), and (d) how they were handled (excluded or winsorized, if the latter, using what threshold). If at all possible, (e) the corresponding code along with the data should be shared in a public repository like the Open Science Framework (OSF), so that the exclusion criteria can be reproduced precisely. + +# Conclusion + +In this paper, we have shown how to investigate outliers using the `check_outliers()` function of the *{performance}* package while following current good practices. However, best practice for outlier treatment does not stop at using appropriate statistical algorithms, but entails respecting existing recommendations, such as preregistration, reproducibility, consistency, transparency, and justification. Ideally, one would additionally also report the package, function, and threshold used (linking to the full code when possible). We hope that this paper and the accompanying `check_outliers()` function of *easystats* will help researchers engage in good research practices while providing a smooth outlier detection experience. + +# Declarations + +## Funding information + +This research received no external funding. + +## Competing Interests + +The authors declare no conflict of interest + +## Availability of data and materials (data transparency) + +This paper first appeared as a preprint (https://doi.org/10.31234/osf.io/bu6nt) and is also available as an online vignette at: https://easystats.github.io/performance/articles/check_outliers. All data used in this paper uses data included with base R. + +## Code availability + +The performance package is available at the package official website (https://easystats.github.io/performance), on CRAN (https://cran.r-project.org/package=performance), and on the R-Universe (https://easystats.r-universe.dev/performance). The source code is available on GitHub (https://github.com/easystats/performance/), and the package can be installed from CRAN with `install.packages("performance")`. The code to reproduce figures and all analyses in this paper is available at https://osf.io/eqja6/. + +## Contributions + +Writing- Original draft preparation: RT. Writing- Reviewing and Editing, Software: RT, MSB-S, IP, DL, BMW, and DM. + +## Acknowledgements + +*{performance}* is part of the collaborative [*easystats*](https://github.com/easystats/easystats) ecosystem [@easystatspackage]. Thus, we thank all [members of easystats](https://github.com/orgs/easystats/people), contributors, and users alike. + +# References \ No newline at end of file diff --git a/papers/preprint/paper.bib b/papers/preprint/paper.bib new file mode 100644 index 000000000..c1ef2a746 --- /dev/null +++ b/papers/preprint/paper.bib @@ -0,0 +1,369 @@ +@article{zijlstra2011outliers, + title={Outliers in questionnaire data: Can they be detected and should they be removed?}, + author={Zijlstra, Wobbe P and van der Ark, L Andries and Sijtsma, Klaas}, + journal={Journal of Educational and Behavioral Statistics}, + volume={36}, + number={2}, + pages={186--212}, + year={2011}, + publisher={Sage Publications Sage CA: Los Angeles, CA}, + doi = {10.3102/1076998610366263} +} + +@software{carelesspackage, + title = {{careless}: Procedures for computing indices of careless responding}, + author = {Yentes, R.D. and Wilhelm, F.}, + year = {2023}, + url = {https://cran.r-project.org/package=careless} +} + +@article{curran2016methods, + title={Methods for the detection of carelessly invalid responses in survey data}, + author={Curran, Paul G}, + journal={Journal of Experimental Social Psychology}, + volume={66}, + pages={4--19}, + year={2016}, + publisher={Elsevier}, + doi = {10.1016/j.jesp.2015.07.006} +} + +@article{cao2018z, + title={Z-Glyph: Visualizing outliers in multivariate data}, + author={Cao, Nan and Lin, Yu-Ru and Gotz, David and Du, Fan}, + journal={Information Visualization}, + volume={17}, + number={1}, + pages={22--40}, + year={2018}, + publisher={SAGE Publications Sage UK: London, England}, + doi = {10.1177/1473871616686635} +} + +@article{ward2023dealing, + title={Dealing with careless responding in survey data: Prevention, identification, and recommended best practices}, + author={Ward, Mary K and Meade, Adam W}, + journal={Annual Review of Psychology}, + volume={74}, + number={1}, + pages={577--596}, + year={2023}, + publisher={Annual Reviews}, + doi = {10.1146/annurev-psych-040422-045007} +} + +@article{goldammer2020careless, + title={Careless responding in questionnaire measures: Detection, impact, and remedies}, + author={Goldammer, Philippe and Annen, Hubert and St{\"o}ckli, Peter Lucas and Jonas, Klaus}, + journal={The Leadership Quarterly}, + volume={31}, + number={4}, + pages={101384}, + year={2020}, + publisher={Elsevier}, + doi = {10.1016/j.leaqua.2020.101384} +} + +@article{aruguete2019serious, + title={How serious is the ‘carelessness’ problem on Mechanical Turk?}, + author={Aruguete, Mara S and Huynh, Ho and Browne, Blaine L and Jurs, Bethany and Flint, Emilia and McCutcheon, Lynn E}, + journal={International Journal of Social Research Methodology}, + volume={22}, + number={5}, + pages={441--449}, + year={2019}, + publisher={Taylor \& Francis}, + doi = {10.1080/13645579.2018.1563966} +} + +@article{chaloner1988bayesian, + title={A Bayesian approach to outlier detection and residual analysis}, + author={Chaloner, Kathryn and Brant, Rollin}, + journal={Biometrika}, + volume={75}, + number={4}, + pages={651--659}, + year={1988}, + publisher={Oxford University Press}, + doi = {10.1093/biomet/75.4.651} +} + +@article{ciccione2023outlier, + title={Outlier detection and rejection in scatterplots: Do outliers influence intuitive statistical judgments?}, + author={Ciccione, Lorenzo and Dehaene, Guillaume and Dehaene, Stanislas}, + journal={Journal of Experimental Psychology: Human Perception and Performance}, + volume={49}, + number={1}, + pages={129}, + year={2023}, + publisher={American Psychological Association}, + doi = {10.1037/xhp0001065} +} + +@article{mcneil1977interactive, + title={Interactive data analysis: A practical primer}, + author={McNeil, Donald R}, + journal={(No Title)}, + year={1977}, + publisher={Wiley} +} + +@article{smiti2020critical, + title={A critical overview of outlier detection methods}, + author={Smiti, Abir}, + journal={Computer Science Review}, + volume={38}, + pages={100306}, + year={2020}, + publisher={Elsevier}, + doi = {10.1016/j.cosrev.2020.100306} +} + +@article{aguinis2013best, + title={Best-practice recommendations for defining, identifying, and handling outliers}, + author={Aguinis, Herman and Gottfredson, Ryan K and Joo, Harry}, + journal={Organizational research methods}, + volume={16}, + number={2}, + pages={270--301}, + year={2013}, + publisher={Sage Publications Sage CA: Los Angeles, CA}, + doi = {10.1177/1094428112470848} +} + +@article{ratcliff2016diffusion, + title={Diffusion decision model: Current issues and history}, + author={Ratcliff, Roger and Smith, Philip L and Brown, Scott D and McKoon, Gail}, + journal={Trends in Cognitive Sciences}, + volume={20}, + number={4}, + pages={260--281}, + year={2016}, + publisher={Elsevier}, + doi = {10.1016/j.tics.2016.01.007} +} + +@article{brown2008simplest, + title={The simplest complete model of choice response time: Linear ballistic accumulation}, + author={Brown, Scott D and Heathcote, Andrew}, + journal={Cognitive Psychology}, + volume={57}, + number={3}, + pages={153--178}, + year={2008}, + publisher={Elsevier}, + doi = {10.1016/j.cogpsych.2007.12.002} +} + +@article{rouder2015lognormal, + title={The lognormal race: A cognitive-process model of choice and latency with desirable psychometric properties}, + author={Rouder, Jeffrey N and Province, Jordan M and Morey, Richard D and Gomez, Pablo and Heathcote, Andrew}, + journal={Psychometrika}, + volume={80}, + pages={491--513}, + year={2015}, + publisher={Springer}, + doi = {10.1007/s11336-013-9396-3} +} + +@article{anders2016shifted, + title={The shifted {Wald} distribution for response time data analysis.}, + author={Anders, Royce and Alario, F and Van Maanen, Leendert and others}, + journal={Psychological Methods}, + volume={21}, + number={3}, + pages={309}, + year={2016}, + publisher={American Psychological Association}, + doi = {10.1037/met0000066} +} + +@article{schramm2019reaction, + title={Are reaction time transformations really beneficial?}, + author={Schramm, Pele and Rouder, Jeffrey N}, + year={2019}, + journal={PsyArXiv}, + doi = {10.31234/osf.io/9ksa6} +} + +@article{miller2023outlier, + title={Outlier exclusion procedures for reaction time analysis: The cures are generally worse than the disease.}, + author={Miller, Jeff}, + journal={Journal of Experimental Psychology: General}, + year={2023}, + publisher={American Psychological Association}, + doi = {10.1037/xge0001450} +} + +@article{leys2019outliers, + title = {How to Classify, Detect, and Manage Univariate and Multivariate Outliers, With Emphasis on Pre-Registration},author = {Leys, Christophe and Delacre, Marie and Mora, Youri L. and Lakens, Daniël and Ley, Christophe}, + journal = {International Review of Social Psychology}, + year = {2019}, + doi = {10.5334/irsp.289} +} + +@article{leys2013outliers, + title = {Detecting outliers: Do not use standard deviation around the mean, use absolute deviation around the median}, + author = {Christophe Leys and Christophe Ley and Olivier Klein and Philippe Bernard and Laurent Licata}, + journal = {Journal of Experimental Social Psychology}, + volume = {49}, + number = {4}, + pages = {764-766}, + year = {2013}, + doi = {10.1016/j.jesp.2013.03.013} +} + +@article{leys2018outliers, + title = {Detecting multivariate outliers: Use a robust variant of the {Mahalanobis} distance}, + journal = {Journal of Experimental Social Psychology}, + volume = {74}, + pages = {150-156}, + year = {2018}, + issn = {0022-1031}, + doi = {10.1016/j.jesp.2017.09.011}, + author = {Christophe Leys and Olivier Klein and Yves Dominicy and Christophe Ley}, +} + +@article{simmons2011false, + author = {Joseph P. Simmons and Leif D. Nelson and Uri Simonsohn}, + title ={False-Positive Psychology: Undisclosed Flexibility in Data Collection and Analysis Allows Presenting Anything as Significant}, + journal = {Psychological Science}, + volume = {22}, + number = {11}, + pages = {1359-1366}, + year = {2011}, + doi = {10.1177/0956797611417632} +} + +@software{easystatspackage, + title = {{easystats}: Streamline Model Interpretation, Visualization, and Reporting}, + author = {Daniel Lüdecke and Dominique Makowski and Mattan S. Ben-Shachar and Indrajeet Patil and Brenton M. Wiernik and Etienne Bacher and Rémi Thériault}, + year = {2023}, + date = {2023-02-04}, + origdate = {2019-01-28}, + url = {https://easystats.github.io/easystats/} +} + +@Article{ludecke2021performance, + author = {Daniel Lüdecke and Mattan S. Ben-Shachar and Indrajeet Patil and Philip Waggoner and Dominique Makowski}, + title = {{performance}: An {R} package for assessment, comparison and testing of statistical models}, + volume = {6}, + number = {60}, + journal = {Journal of Open Source Software}, + year = {2021}, + pages = {3139}, + doi = {10.21105/joss.03139} + } + +@Article{patil2022datawizard, + title = {{datawizard}: An {R} package for easy data preparation and statistical transformations}, + author = {Indrajeet Patil and Dominique Makowski and Mattan S. Ben-Shachar and Brenton M. Wiernik and Etienne Bacher and Daniel Lüdecke}, + journal = {Journal of Open Source Software}, + year = {2022}, + volume = {7}, + number = {78}, + pages = {4684}, + doi = {10.21105/joss.04684}, + } + +@article{cook1977detection, + author = {R. Dennis Cook}, + title = {Detection of Influential Observation in Linear Regression}, + journal = {Technometrics}, + volume = {19}, + number = {1}, + pages = {15-18}, + year = {1977}, + publisher = {Taylor & Francis}, + doi = {10.1080/00401706.1977.10489493} +} + +@book{iglewicz1993outliers, + title = {How to detect and handle outliers (Vol. 16)}, + publisher = {Asq Press}, + author = {Iglewicz, B. and Hoaglin, D. C}, + year = {1993} +} + +@article{gnanadesikan1972robust, + title = {Robust estimates, residuals, and outlier detection with multiresponse data}, + author = {Gnanadesikan, R. and Kettenring, J. R}, + doi = {10.2307/2528963}, + journal = {Biometrics}, + pages = {81-124}, + year = {1972}, + volume = {28}, + number = {1} +} + +@article{hubert2018mcd, + author = {Hubert, Mia and Debruyne, Michiel and Rousseeuw, Peter J.}, + title = {Minimum covariance determinant and extensions}, + journal = {Wiley Interdisciplinary Reviews: Computational Statistics}, + volume = {10}, + number = {3}, + pages = {e1421}, + doi = {10.1002/wics.1421}, + url = {https://doi.org/10.1002/wics.1421}, + year = {2018} +} + +@article{tukey1963less, + title={Less vulnerable confidence and significance procedures for location based on a single sample: Trimming/Winsorization 1}, + author={Tukey, John W and McLaughlin, Donald H}, + journal={Sankhy{\=a}: The Indian Journal of Statistics, Series A}, + pages={331--352}, + year={1963}, + publisher={JSTOR} +} + +@article{van1995statistical, + title={Statistical mimicking of reaction time data: Single-process models, parameter variability, and mixtures}, + author={Van Zandt, Trisha and Ratcliff, Roger}, + journal={Psychonomic Bulletin \& Review}, + volume={2}, + number={1}, + pages={20--54}, + year={1995}, + publisher={Springer}, + doi = {10.3758/BF03214411} +} + +@article{ratcliff1993methods, + title={Methods for dealing with reaction time outliers.}, + author={Ratcliff, Roger}, + journal={Psychological Bulletin}, + volume={114}, + number={3}, + pages={510}, + year={1993}, + publisher={American Psychological Association}, + doi = {10.1037/0033-2909.114.3.510} +} + +@book{mcelreath2020statistical, + title={Statistical rethinking: A Bayesian course with examples in {R} and Stan}, + author={McElreath, Richard}, + year={2020}, + publisher={CRC press} +} + +@article{theriault2023rempsyc, + title={{rempsyc}: Convenience functions for psychology}, + author={Thériault, Rémi}, + journal={Journal of Open Source Software}, + volume={8}, + number={87}, + pages={5466}, + year={2023}, + doi = {10.1037/0033-2909.114.3.510} +} + +@Manual{rcore, + title = {{R}: A Language and Environment for Statistical Computing}, + author = {{R Core Team}}, + organization = {R Foundation for Statistical Computing}, + address = {Vienna, Austria}, + year = {2021}, + url = {https://www.R-project.org/} +} \ No newline at end of file diff --git a/papers/JOSE/paper.md b/papers/preprint/paper.md similarity index 100% rename from papers/JOSE/paper.md rename to papers/preprint/paper.md diff --git a/papers/preprint/paper.pdf b/papers/preprint/paper.pdf new file mode 100644 index 000000000..b3781635e Binary files /dev/null and b/papers/preprint/paper.pdf differ diff --git a/papers/preprint/paper.tex b/papers/preprint/paper.tex new file mode 100644 index 000000000..220fa9daa --- /dev/null +++ b/papers/preprint/paper.tex @@ -0,0 +1,989 @@ +%Version 2.1 April 2023 +% See section 11 of the User Manual for version history +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% %% +%% Please do not use \input{...} to include other tex files. %% +%% Submit your LaTeX manuscript as one .tex document. %% +%% %% +%% All additional figures and files should be attached %% +%% separately and not embedded in the \TeX\ document itself. %% +%% %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\documentclass[sn-basic, lineno,pdflatex]{sn-jnl} + +%%%% Standard Packages +%% + +\usepackage{graphicx}% +\usepackage{multirow}% +\usepackage{amsmath,amssymb,amsfonts}% +\usepackage{amsthm}% +\usepackage{mathrsfs}% +\usepackage[title]{appendix}% +\usepackage{xcolor}% +\usepackage{textcomp}% +\usepackage{manyfoot}% +\usepackage{booktabs}% +\usepackage{algorithm}% +\usepackage{algorithmicx}% +\usepackage{algpseudocode}% +\usepackage{listings}% +%%%% + +%%%%%=============================================================================%%%% +%%%% Remarks: This template is provided to aid authors with the preparation +%%%% of original research articles intended for submission to journals published +%%%% by Springer Nature. The guidance has been prepared in partnership with +%%%% production teams to conform to Springer Nature technical requirements. +%%%% Editorial and presentation requirements differ among journal portfolios and +%%%% research disciplines. You may find sections in this template are irrelevant +%%%% to your work and are empowered to omit any such section if allowed by the +%%%% journal you intend to submit to. The submission guidelines and policies +%%%% of the journal take precedence. A detailed User Manual is available in the +%%%% template package for technical guidance. +%%%%%=============================================================================%%%% + + + +\raggedbottom + + + +% Pandoc syntax highlighting +\usepackage{color} +\usepackage{fancyvrb} +\newcommand{\VerbBar}{|} +\newcommand{\VERB}{\Verb[commandchars=\\\{\}]} +\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}} +% Add ',fontsize=\small' for more characters per line +\usepackage{framed} +\definecolor{shadecolor}{RGB}{248,248,248} +\newenvironment{Shaded}{\begin{snugshade}}{\end{snugshade}} +\newcommand{\AlertTok}[1]{\textcolor[rgb]{0.94,0.16,0.16}{#1}} +\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}} +\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{#1}} +\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}} +\newcommand{\BuiltInTok}[1]{#1} +\newcommand{\CharTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}} +\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}} +\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}} +\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{#1}} +\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}} +\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{#1}} +\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}} +\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}} +\newcommand{\ErrorTok}[1]{\textcolor[rgb]{0.64,0.00,0.00}{\textbf{#1}}} +\newcommand{\ExtensionTok}[1]{#1} +\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}} +\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}} +\newcommand{\ImportTok}[1]{#1} +\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}} +\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}} +\newcommand{\NormalTok}[1]{#1} +\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.81,0.36,0.00}{\textbf{#1}}} +\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{#1}} +\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}} +\newcommand{\RegionMarkerTok}[1]{#1} +\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.81,0.36,0.00}{\textbf{#1}}} +\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}} +\newcommand{\StringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}} +\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}} +\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}} +\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}} + +% tightlist command for lists without linebreak +\providecommand{\tightlist}{% + \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} + +% From pandoc table feature +\usepackage{longtable,booktabs,array} +\usepackage{calc} % for calculating minipage widths +% Correct order of tables after \paragraph or \subparagraph +\usepackage{etoolbox} +\makeatletter +\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{} +\makeatother +% Allow footnotes in longtable head/foot +\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}} +\makesavenoteenv{longtable} + + + + +\begin{document} + + +\title[Check your outliers]{Check your outliers! An introduction to +identifying statistical outliers in R with \emph{easystats}} + +%%=============================================================%% +%% Prefix -> \pfx{Dr} +%% GivenName -> \fnm{Joergen W.} +%% Particle -> \spfx{van der} -> surname prefix +%% FamilyName -> \sur{Ploeg} +%% Suffix -> \sfx{IV} +%% NatureName -> \tanm{Poet Laureate} -> Title after name +%% Degrees -> \dgr{MSc, PhD} +%% \author*[1,2]{\pfx{Dr} \fnm{Joergen W.} \spfx{van der} \sur{Ploeg} \sfx{IV} \tanm{Poet Laureate} +%% \dgr{MSc, PhD}}\email{iauthor@gmail.com} +%%=============================================================%% + +\author*[1]{\fnm{Rémi} \sur{Thériault} }\email{\href{mailto:theriault.remi@courrier.uqam.ca}{\nolinkurl{theriault.remi@courrier.uqam.ca}}} + +\author[2]{\fnm{Mattan} \spfx{S.} \sur{Ben-Shachar} } + +\author[3]{\fnm{Indrajeet} \sur{Patil} } + +\author[4]{\fnm{Daniel} \sur{Lüdecke} } + +\author[5]{\fnm{Brenton} \spfx{M.} \sur{Wiernik} } + +\author[6]{\fnm{Dominique} \sur{Makowski} } + + + + \affil[1]{\orgname{Department of Psychology, Université du Québec à +Montréal, Montréal, Québec, Canada}} + \affil[2]{\orgname{Independent Researcher, Ramat Gan, Israel}} + \affil[3]{\orgname{Center for Humans and Machines, Max Planck +Institute for Human Development, Berlin, Germany}} + \affil[4]{\orgname{Institute of Medical Sociology, University Medical +Center Hamburg-Eppendorf, Germany}} + \affil[5]{\orgname{Independent Researcher, Tampa, FL, USA}} + \affil[6]{\orgname{School of Psychology, University of Sussex, +Brighton, UK}} + +\abstract{Beyond the challenge of keeping up to date with current best +practices regarding the diagnosis and treatment of outliers, an +additional difficulty arises concerning the mathematical implementation +of the recommended methods. Here, we provide an overview of current +recommendations and best practices and demonstrate how they can easily +and conveniently be implemented in the R statistical computing software, +using the \emph{\{performance\}} package of the \emph{easystats} +ecosystem. We cover univariate, multivariate, and model-based +statistical outlier detection methods, their recommended threshold, +standard output, and plotting methods. We conclude by reviewing the +different theoretical types of outliers, whether to exclude or winsorize +them, and the importance of transparency. A preprint of this paper is +available at: \url{https://doi.org/10.31234/osf.io/bu6nt}.} + +\keywords{univariate outliers; multivariate outliers; robust detection +methods; R; easystats} + + + +\maketitle + +\section{Introduction}\label{introduction} + +Real-life data often contain observations that can be considered +\emph{abnormal} when compared to the main population. The cause of this +abnormality can be hard to assess and the boundaries of ``normal'' +difficult to define---they may truly belong to a different distribution +(originating from a different generative process) or simply be extreme +cases, statistically rare but not impossible. + +Nonetheless, the improper handling of these outliers can substantially +affect estimation quantities of interest, and in the context of +statistical model can bias parameter estimates and weaken a models' +predictive performance \citep{aguinis2013best}. It is thus essential to +address this problem thoughtfully. Yet, despite the existence of +established recommendations and guidelines, many researchers still do +not treat outliers consistently, or do so using inappropriate strategies +\citep{aguinis2013best, simmons2011false, leys2013outliers}. + +Understanding the various methods for outlier detection, their +differences, as well as their benefits and disadvantages, can aid +researchers in choosing between them and applying them correctly +\citep[see][for an overview of pros and cons of several recently +developed advanced methods]{smiti2020critical}. For example, Figure 1 +shows a hypothetical dataset of women's heights and weights \citep[based +on the ``women'' dataset in R,][]{mcneil1977interactive} and how +applying three different types of outlier identification methods +(univariate, multivariate, and model-based; all described in detail in +this paper) can lead to different results. + +\begin{figure} +\includegraphics[width=1\linewidth]{paper_files/figure-latex/fig1-1} \caption{Visual representation for the most common methods in the families of outlier identification applied to a hypothetical dataset of women’s heights and weights. Note. In each subplot, triangles are observations marked as “outliers”. (A) Univariate method: Observations are marked as outliers if they lie at some fixed or relative distance from the center of each variable (in this case, 3.29 standard-deviations from y’s mean), suggesting they are not part of the same distribution as the rest of the data; (B) Multivariate method: Observations are marked as outliers if they lie at some fixed or relative distance from the multivariate center (in this case, a Mahalanobis distance of 3.72 from the centroid defined by the means of x and y), suggesting they are not part of the same multivariate distribution as the rest of the data; (C) Model-based method: Observations are marked as outliers if they affect the model’s estimated parameters by more than some threshold (in this case, they have a Cook’s distance of 0.71), suggesting that the inclusion of such observations biases the estimated parameters to a large degree (in the plot, this is represented as the observation with the large absolute residual [i.e., the distance from the regression line]—a concept closely related to Cook’s distance). As can be seen, although there is some overlap, the 3 methods do not agree on which observations are to be marked as outliers. Code to reproduce this figure and all analyses is available at https://osf.io/eqja6/.}\label{fig:fig1} +\end{figure} + +One possible reason researchers do not employ validated strategies is +that they may not be aware of existing recommendations, or do not know +how to implement them using their analysis software. In this paper, we +show how to follow current best practices for automatic and reproducible +statistical outlier detection (SOD) using R and the +\emph{\{performance\}} package \citep{ludecke2021performance}, which is +part of the \emph{easystats} ecosystem of packages that build an R +framework for easy statistical modeling, visualization, and reporting +\citep{easystatspackage}. Installation instructions can be found on +\href{https://github.com/easystats/performance}{GitHub} or its +\href{https://easystats.github.io/performance/}{website}, and its list +of dependencies on +\href{https://cran.r-project.org/package=performance}{CRAN}. + +The instructional materials that follow are aimed at an audience of +researchers who want to follow good practices, and are appropriate for +advanced undergraduate students, graduate students, professors, or +professionals having to deal with the nuances of outlier treatment. + +\section{Identifying Outliers}\label{identifying-outliers} + +Although many researchers attempt to identify outliers with measures +based on the mean (e.g., \emph{z} scores), those methods can be +problematic. This is because the mean and standard deviation themselves +are not robust to the influence of outliers and those methods also +assume normally distributed data (i.e., a Gaussian distribution). +Therefore, current guidelines recommend using robust methods to identify +outliers, such as those relying on the median as opposed to the mean +\citep{leys2019outliers, leys2013outliers, leys2018outliers}. +Additionally, univariate methods can give false positives since they +ignore the patterns in multidimensional data, which are often of +interest (such as comparing conditional means or estimating correlation +matrices). In such cases, multivariate outlier detection methods may be +of relevance. + +Which exact outlier method to use depends on many factors. In some +cases, eye-gauging odd observations can be an appropriate solution, +though many researchers will favor algorithmic solutions to detect +potential outliers, for example, based on a continuous value expressing +the observations that stand out from the others. Indeed, relying on +human intuition and ``visual checks'' can be rather subjective, and +sometimes, even suboptimal. For example, visually communicating results +containing outliers---say, on a scatter plot---has been shown to bias +people's estimations of a regression line, even when individuals +correctly detect the outliers \citep{ciccione2023outlier}. + +One of the factors to consider when selecting an algorithmic outlier +detection method is the statistical test of interest. Identifying +observations where the regression model does not fit well can help find +information relevant to our specific research context. This approach, +known as model-based outliers detection (as outliers are extracted after +the statistical model has been fit), can be contrasted with +distribution-based outliers detection, which is based on the distance +between an observation and the ``center'' of its population. Various +quantification strategies of this distance exist for the latter, both +univariate (involving only one variable at a time) and multivariate +(involving multiple variables). + +However, we would like to emphasize that the methods listed in this +paper are not an exhaustive list of methods developed and available to +researchers. For instance, Bayesian approaches that do not fully reject +outliers but simply lower their ``weights'' have been partly formalized +by \citet{chaloner1988bayesian} and recently implemented by +\citet{ciccione2023outlier}. Crucially, Ciccione and colleagues also +provide empirical evidence that human observers might indeed perform +such forms of Bayesian re-weighting of outliers when asked to detect and +reject them, making interesting parallels between statistical research +methods and naive psychological mechanisms. + +Importantly, whatever approach researchers choose remains a subjective +decision, and usage (and rationale) must be transparently documented and +reproducible \citep{leys2019outliers}. Researchers should commit +(ideally in a preregistration) to an outlier treatment method before +collecting the data. They should report in the paper their decisions and +details of their methods, as well as any deviation from their original +plan. These transparency practices can help reduce false positives due +to excessive researchers' degrees of freedom (i.e., choice flexibility +throughout the analysis). In the following section, we go through each +of the mentioned methods and provide examples of how to implement them +with R. + +\subsection{Univariate Outliers}\label{univariate-outliers} + +Researchers frequently attempt to identify outliers using measures of +deviation from the center of a variable's distribution. One of the most +popular of such procedures is the \emph{z}-score transformation, which +computes the distance in standard deviation (SD) from the mean. However, +as mentioned earlier, this popular method is not robust. Therefore, for +univariate outliers, it is recommended to use the median along with the +median absolute deviation (MAD), which is more robust than the +interquartile range or the mean and its standard deviation +\citep{leys2019outliers, leys2013outliers}. + +Researchers can identify outliers based on robust (i.e., MAD-based) +\emph{z} scores using the \texttt{check\_outliers()} function of the +\emph{\{performance\}} package, by specifying +\texttt{method\ =\ "zscore\_robust"}.\footnote{Note that + \texttt{check\_outliers()} only checks numeric variables.} Although +\citet{leys2013outliers} suggest a default threshold of 2.5 and +\citet{leys2019outliers} a threshold of 3, \emph{\{performance\}} uses +by default a less conservative threshold of +\textasciitilde3.29.\footnote{3.29 is an approximation of the two-tailed + critical value for \emph{p} \textless{} .001, obtained through + \texttt{qnorm(p\ =\ 1\ -\ 0.001\ /\ 2)}. We chose this threshold for + consistency with the thresholds of all our other methods.} That is, +data points will be flagged as outliers if they go beyond +/- +\textasciitilde3.29 MAD. Users can adjust this threshold using the +\texttt{threshold} argument. + +Below, we provide example code using the \texttt{mtcars} dataset, which +was extracted from the 1974 \emph{Motor Trend} US magazine. The dataset +contains fuel consumption and 10 characteristics of automobile design +and performance for 32 different car models (see \texttt{?mtcars} for +details). We chose this dataset because it is accessible from base R and +familiar to many R users. We might want to conduct specific statistical +analyses on this data set, say, \emph{t} tests or structural equation +modeling, but first, we want to check for outliers that may influence +those test results. + +Because the automobile names are stored as column names in +\texttt{mtcars}, we first have to convert them to an ID column to +benefit from the \texttt{check\_outliers()} ID argument. Furthermore, we +only really need a few columns for this demonstration, so we pick the +first four (\texttt{mpg} = Miles/(US) gallon; \texttt{cyl} = Number of +cylinders; \texttt{disp} = Displacement; \texttt{hp} = Gross +horsepower). Finally, because there are no outliers in this dataset, we +add two artificial outliers before running our function. + +\begin{Shaded} +\begin{Highlighting}[] +\FunctionTok{library}\NormalTok{(performance)} + +\CommentTok{\# Create some artificial outliers and an ID column} +\NormalTok{data }\OtherTok{\textless{}{-}} \FunctionTok{rbind}\NormalTok{(mtcars[}\DecValTok{1}\SpecialCharTok{:}\DecValTok{4}\NormalTok{], }\DecValTok{12}\NormalTok{, }\DecValTok{55}\NormalTok{)} +\NormalTok{data }\OtherTok{\textless{}{-}} \FunctionTok{cbind}\NormalTok{(}\AttributeTok{car =} \FunctionTok{row.names}\NormalTok{(data), data)} + +\NormalTok{outliers }\OtherTok{\textless{}{-}} \FunctionTok{check\_outliers}\NormalTok{(data, }\AttributeTok{method =} \StringTok{"zscore\_robust"}\NormalTok{, }\AttributeTok{ID =} \StringTok{"car"}\NormalTok{)} +\NormalTok{outliers} +\end{Highlighting} +\end{Shaded} + +\begin{verbatim} +#> 1 outlier detected: case 34. +#> - Based on the following method and threshold: zscore_robust (3.291). +#> - For variables: mpg, cyl, disp, hp. +#> +#> ----------------------------------------------------------------------------- +#> +#> The following observations were considered outliers for two or more +#> variables by at least one of the selected methods: +#> +#> Row car n_Zscore_robust +#> 1 34 34 2 +#> +#> ----------------------------------------------------------------------------- +#> Outliers per variable (zscore_robust): +#> +#> $mpg +#> Row car Distance_Zscore_robust +#> 34 34 34 6.271888 +#> +#> $cyl +#> Row car Distance_Zscore_robust +#> 34 34 34 16.52502 +\end{verbatim} + +What we see is that \texttt{check\_outliers()} with the robust \emph{z} +score method detected one outlier: case 33, which is one of the +observations we added ourselves. It was flagged for two variables +specifically: \texttt{mpg} (miles/(US) gallon) and \texttt{cyl} (number +of cylinders), and the output provides its exact \emph{z} score for this +variable. + +We describe how to deal with outliers in more details later in the +paper, but should we want to exclude detected outliers from the main +dataset, we can extract row numbers using \texttt{which()} on the output +object, which can then be used for indexing: + +\begin{Shaded} +\begin{Highlighting}[] +\FunctionTok{which}\NormalTok{(outliers)} +\end{Highlighting} +\end{Shaded} + +\begin{verbatim} +#> [1] 34 +\end{verbatim} + +\begin{Shaded} +\begin{Highlighting}[] +\NormalTok{data\_clean }\OtherTok{\textless{}{-}}\NormalTok{ data[}\SpecialCharTok{{-}}\FunctionTok{which}\NormalTok{(outliers), ]} +\end{Highlighting} +\end{Shaded} + +All \texttt{check\_outliers()} output objects possess a \texttt{plot()} +method, meaning it is also possible to visualize all observations in a +way that highlights the outliers using the generic \texttt{plot()} +function on the resulting outlier object after loading the \{see\} +package (Figure 2). + +\begin{Shaded} +\begin{Highlighting}[] +\FunctionTok{library}\NormalTok{(see)} + +\FunctionTok{plot}\NormalTok{(outliers)} +\end{Highlighting} +\end{Shaded} + +\begin{figure} +\includegraphics[width=1\linewidth]{paper_files/figure-latex/univariate_implicit-1} \caption{Visual depiction of outliers using the robust z-score method. Note. The distance represents the highest deviation score per participant for variables mpg, cyl, disp, and hp. This score represents a given participant’s (1-34) highest robust z score among the tested variables. The resulting unique value (representing one of mpg, cyl, disp, or hp for that participant) is then rescaled to a range of 0 to 1 by dividing by the value of the participant with the highest score.}\label{fig:univariate_implicit} +\end{figure} + +Other univariate methods are available, such as using the interquartile +range (IQR), or based on different intervals, such as the highest +density interval (HDI) or the bias corrected and accelerated interval +(BCI). These methods are documented and described in the function's +\href{https://easystats.github.io/performance/reference/check_outliers.html}{help +page}. + +\subsection{Multivariate Outliers}\label{multivariate-outliers} + +Univariate outliers can be useful when the focus is on a particular +variable, for instance the reaction time, as extreme values might be +indicative of inattention or non-task-related behavior\footnote{ Note + that they might not be the optimal way of treating reaction time + outliers \citep{ratcliff1993methods, van1995statistical}}. + +However, in many scenarios, the variables of a data set are not +independent, and an outlying observation or participant will be +reflected to various degrees on multiple variables. For instance, in the +case of survey studies containing a large number of items (e.g., many +Likert scales), ``careless'' or low-effort responding participations +(e.g., participants answering at random, displaying ``straight-lining'', +or ``zigzagging'' patterns of response) becomes more common---especially +when relying on online samples such as through MTurk +\citep{aruguete2019serious, goldammer2020careless, ward2023dealing}. +Although specific methods exist to detect these unwanted behaviors in +questionnaires {[}e.g., \citet{cao2018z}; \citet{curran2016methods}; +\citet{carelesspackage}; \citet{zijlstra2011outliers}), this issue can +be framed more generally as follows: multiple ``odd'' observations can +sum up and reveal an abnormal participant. Importantly, the deviation +from the norm could potentially be low for all variables when taken +independently (not meeting the rejection criteria), but strong when +taken together (in other words, the likelihood of being an outlier on +one variable can be independent from the probability of being an outlier +on multiple variables). + +One common approach for this is to compute multivariate distance +metrics, such as the Mahalanobis distance. Although the Mahalanobis +distance is very popular, just like the regular \emph{z} scores method, +it is not robust and is heavily influenced by the outliers themselves. +Therefore, for multivariate outliers, it is recommended to use the +Minimum Covariance Determinant, a robust version of the Mahalanobis +distance \citep[MCD,][]{leys2018outliers, leys2019outliers}. + +In \emph{\{performance\}}'s \texttt{check\_outliers()}, one can use this +approach with \texttt{method\ =\ "mcd"}.\footnote{Our default threshold + for the MCD method is defined by + \texttt{stats::qchisq(p\ =\ 1\ -\ 0.001,\ df\ =\ ncol(x))}, which + again is an approximation of the critical value for \emph{p} + \textless{} .001 consistent with the thresholds of our other methods.} + +\begin{Shaded} +\begin{Highlighting}[] +\NormalTok{outliers }\OtherTok{\textless{}{-}} \FunctionTok{check\_outliers}\NormalTok{(data, }\AttributeTok{method =} \StringTok{"mcd"}\NormalTok{)} +\NormalTok{outliers} +\end{Highlighting} +\end{Shaded} + +\begin{verbatim} +#> 2 outliers detected: cases 33, 34. +#> - Based on the following method and threshold: mcd (20). +#> - For variables: mpg, cyl, disp, hp. +\end{verbatim} + +Here, we detected nine multivariate outliers (i.e., when looking at all +variables of our dataset together). We can see the result in Figure 3. + +\begin{Shaded} +\begin{Highlighting}[] +\FunctionTok{plot}\NormalTok{(outliers)} +\end{Highlighting} +\end{Shaded} + +\begin{figure} +\includegraphics[width=1\linewidth]{paper_files/figure-latex/multivariate_implicit-1} \caption{Visual depiction of outliers using the minimum covariance determinant (MCD) method. Note. The MCD method is a robust version of the Mahalanobis distance. The distance represents the MCD scores for variables mpg, cyl, disp, and hp.}\label{fig:multivariate_implicit} +\end{figure} + +In small samples, however, the MCD method tends to be inaccurate, +especially when dealing with high-dimensional data. Other multivariate +methods are also available, such as the classic Mahalanobis distance and +another type of robust Mahalanobis distance that relies on an +orthogonalized Gnanadesikan--Kettenring pairwise estimator +\citep{gnanadesikan1972robust}. These methods are documented and +described in the function's +\href{https://easystats.github.io/performance/reference/check_outliers.html}{help +page}. + +\subsection{Model-Based Outliers}\label{model-based-outliers} + +Working with regression models creates the possibility of using +model-based SOD methods. These methods rely on the concept of +\emph{leverage}, that is, how much influence a given observation can +have on the model estimates. If few observations have a relatively +strong leverage/influence on the model, one can suspect that the model's +estimates are biased by these observations, in which case flagging them +as outliers could prove helpful (see next section, ``Handling +Outliers''). + +In \{performance\}, two such model-based SOD methods are currently +available: Cook's distance, for regular regression models, and Pareto, +for Bayesian models. As such, \texttt{check\_outliers()} can be applied +directly on regression model objects, by simply specifying +\texttt{method\ =\ "cook"} (or \texttt{method\ =\ "pareto"} for Bayesian +models).\footnote{Our default threshold for the Cook method is defined + by \texttt{stats::qf(0.5,\ ncol(x),\ nrow(x)\ -\ ncol(x))}, which + again is an approximation of the critical value for \emph{p} + \textless{} .001 consistent with the thresholds of our other methods. + In this case, the value 0.5 represents the median of the implied F + distribution for D, which allows us to flag D values that are ``above + average''.} + +Currently, most lm models are supported (except for \texttt{glmmTMB}, +\texttt{lmrob}, and \texttt{glmrob} models), as long as they are +supported by the underlying functions \texttt{stats::cooks.distance()} +(or \texttt{loo::pareto\_k\_values()}) and \texttt{insight::get\_data()} +(for a full list of the 225 models currently supported by the +\texttt{insight} package, see +\url{https://easystats.github.io/insight/\#list-of-supported-models-by-class}). +We show a demo below. + +\begin{Shaded} +\begin{Highlighting}[] +\NormalTok{model }\OtherTok{\textless{}{-}} \FunctionTok{lm}\NormalTok{(mpg }\SpecialCharTok{\textasciitilde{}}\NormalTok{ disp }\SpecialCharTok{*}\NormalTok{ hp, }\AttributeTok{data =}\NormalTok{ data)} +\NormalTok{outliers }\OtherTok{\textless{}{-}} \FunctionTok{check\_outliers}\NormalTok{(model, }\AttributeTok{method =} \StringTok{"cook"}\NormalTok{)} +\NormalTok{outliers} +\end{Highlighting} +\end{Shaded} + +\begin{verbatim} +#> 1 outlier detected: case 33. +#> - Based on the following method and threshold: cook (0.806). +#> - For variable: (Whole model). +\end{verbatim} + +Using the model-based outlier detection method, we identified a single +outlier. We can see the result in Figure 4. + +\begin{Shaded} +\begin{Highlighting}[] +\FunctionTok{plot}\NormalTok{(outliers)} +\end{Highlighting} +\end{Shaded} + +\begin{figure} +\includegraphics[width=1\linewidth]{paper_files/figure-latex/model_fig-1} \caption{Visual depiction of outliers based on Cook’s distance (leverage and standardized residuals). Note. This plot is based on the fitted model.}\label{fig:model_fig} +\end{figure} + +Table 1 below summarizes which methods to use in which cases, and with +what threshold. The recommended thresholds are the default thresholds. + +\begin{longtable}[]{@{} + >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.2735}} + >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.2466}} + >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.2601}} + >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.2197}}@{}} +\caption{Summary of Statistical Outlier Detection Methods +Recommendations}\tabularnewline +\toprule\noalign{} +\begin{minipage}[b]{\linewidth}\raggedright +Statistical Test +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Diagnosis Method +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Recommended Threshold +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Function Usage +\end{minipage} \\ +\midrule\noalign{} +\endfirsthead +\toprule\noalign{} +\begin{minipage}[b]{\linewidth}\raggedright +Statistical Test +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Diagnosis Method +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Recommended Threshold +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Function Usage +\end{minipage} \\ +\midrule\noalign{} +\endhead +\bottomrule\noalign{} +\endlastfoot +Supported regression model & \textbf{Model-based}: Cook (or Pareto for +Bayesian models) & \emph{qf(0.5, ncol(x), nrow(x) - ncol(x))} (or 0.7 +for Pareto) & \emph{check\_outliers(model, method = ``cook'')} \\ +& & & \\ +Structural Equation Modeling (or other unsupported +model)\textsuperscript{1} & \textbf{Multivariate}: Minimum Covariance +Determinant (MCD) & \emph{qchisq(p = 1 - 0.001, df = ncol(x))} & +\emph{check\_outliers(data, method = ``mcd'')} \\ +& & & \\ +Simple test with few variables (\emph{t} test, correlation, etc.) & +\textbf{Univariate}: robust \emph{z} scores (MAD) & \emph{qnorm(p = 1 - +0.001 / 2)}, \textasciitilde{} 3.29 & \emph{check\_outliers(data, method += ``zscore\_robust'')} \\ +\end{longtable} + +\textsuperscript{1} The Minimum Covariance Determinant (MCD) can be +inaccurate for small sample sizes. In these cases, the classic +Mahalanobis distance can be used instead. + +\subsection{Cook's Distance vs.~MCD}\label{cooks-distance-vs.-mcd} + +\citet{leys2018outliers} report a preference for the MCD method over +Cook's distance. This is because Cook's distance removes one observation +at a time and checks its corresponding influence on the model each time +\citep{cook1977detection}, and flags any observation that has a large +influence. In the view of these authors, when there are several +outliers, the process of removing a single outlier at a time is +problematic as the model remains ``contaminated'' or influenced by other +possible outliers in the model, rendering this method suboptimal in the +presence of multiple outliers. + +However, distribution-based approaches are not a silver bullet either, +and there are cases where the usage of methods agnostic to theoretical +and statistical models of interest might be problematic. For example, a +very tall person would be expected to also be much heavier than average, +but that would still fit with the expected association between height +and weight (i.e., it would be in line with a model such as +\texttt{weight\ \textasciitilde{}\ height}). In contrast, using +multivariate outlier detection methods in such a case may flag this +person as being an outlier---being unusual on two variables, height and +weight---even though the pattern fits perfectly with our predictions. + +Refer again to Figure 1: In Panel B both an extremely tall woman, and a +shorter but heavier woman are flagged as outlier due to their +(Mahalanobis) distance from the group's centroid. However, when examined +in the context of the relationship between height and weight (panel C), +it is clear that the taller woman's weight falls along the regression +line. That is, it is \emph{model-consistent}---we expect an extremely +tall person to weigh more, and so this observation is not marked as an +outlier using a model based method, though it is when using univariate +(Panel A) or multivariate (Panel B) methods. On the other hand, the +second observation not only has a high Cook's distance, meaning it has +influenced the model's estimates by a large degree, but it also clearly +diverges from the regression line---it is \emph{model-inconsistent}, and +is accordingly flagged as an outlier. + +This model-based approach to outlier detection is most coherent in +regression-based settings; however, sometimes we are interested in +multi-dimensional outlier detection in the classical sense of a point +that is far away from the general cluster of our data. We might, for +example, decide to exclude a person who is extremely tall and heavy +because they differ too much from the main population of study, even if +they do match the general trend. In these cases, other methods such as +MCD can be appropriate. + +Finally, unusual observations happen naturally: extreme observations are +expected even when taken from a normal distribution. While statistical +models can integrate this ``expectation'', multivariate outlier methods +might be too conservative, flagging too many observations despite +belonging to the right generative process. For these reasons, we believe +that model-based methods are still preferable to the MCD when using +supported regression models. Additionally, if the presence of multiple +outliers is a significant concern, regression methods that are more +robust to outliers should be considered---like \emph{t} regression or +quantile regression---as they render their precise identification less +critical \citep{mcelreath2020statistical}. + +\subsection{Composite Outlier Score}\label{composite-outlier-score} + +To reiterate, there is not any wrong method, per se. Different methods +can be judged by their usefulness to do \emph{something}, but do so +differently. Univariate methods are often good at detecting +non-representative values or data-coding errors. Multivariate methods +are also good at detecting non-representative values in a +joint-distribution sense. Similarly, model-based methods are good for +detecting values that might unrealistically bias model inference. + +The \emph{\{performance\}} package offers a consensus-based approach +that combines several methods, based on the assumption that different +methods provide different angles of looking at a given problem. By +applying a variety of methods, one can hope to ``triangulate'' the true +outliers (those consistently flagged by multiple methods) and thus +attempt to minimize false positives. + +In practice, this approach computes a composite outlier score, formed of +the average of the binary (0 or 1) classification results of each +method. It represents the probability that each observation is +classified as an outlier by at least one method. The default decision +rule classifies rows with composite outlier scores superior or equal to +0.5 as outlier observations (i.e., that were classified as outliers by +at least half of the methods). In \emph{\{performance\}}'s +\texttt{check\_outliers()}, one can use this approach by including all +desired methods in the corresponding argument. Returning to the example +model above: + +\begin{Shaded} +\begin{Highlighting}[] +\NormalTok{outliers }\OtherTok{\textless{}{-}} \FunctionTok{check\_outliers}\NormalTok{(model, }\AttributeTok{method =} \FunctionTok{c}\NormalTok{(}\StringTok{"zscore\_robust"}\NormalTok{, }\StringTok{"mcd"}\NormalTok{, }\StringTok{"cook"}\NormalTok{))} +\FunctionTok{which}\NormalTok{(outliers)} +\end{Highlighting} +\end{Shaded} + +\begin{verbatim} +#> [1] 33 34 +\end{verbatim} + +Outliers (counts or per variables) for individual methods can then be +obtained through attributes. For example: + +\begin{Shaded} +\begin{Highlighting}[] +\FunctionTok{attributes}\NormalTok{(outliers)}\SpecialCharTok{$}\NormalTok{outlier\_var}\SpecialCharTok{$}\NormalTok{zscore\_robust} +\end{Highlighting} +\end{Shaded} + +\begin{verbatim} +#> $mpg +#> Row Distance_Zscore_robust +#> 34 34 6.271888 +\end{verbatim} + +An example sentence for reporting the usage of the composite method +could be: + +\begin{quote} +Based on a composite outlier score \citep[see the `check\_outliers()' +function in the `performance' R package,][]{ludecke2021performance} +obtained via the joint application of multiple outliers detection +algorithms \citetext{\citealp[(a) median absolute deviation (MAD)-based +robust \emph{z} scores,][]{leys2013outliers}; \citealp[(b) Mahalanobis +minimum covariance determinant (MCD),][]{leys2019outliers}; \citealp[and +(c) Cook's distance,][]{cook1977detection}}, we excluded two +participants that were classified as outliers by at least half of the +methods used. +\end{quote} + +\section{Handling Outliers}\label{handling-outliers} + +The above section demonstrated how to identify outliers using the +\texttt{check\_outliers()} function in the \emph{\{performance\}} +package. But what should we do with these outliers once identified? It +is common to automatically discard any observation that has been marked +as ``an outlier'' as if it might infect the rest of the data with its +statistical ailment. However, it is important to remember that +researchers do not have access to the ground truth---it is not possible +to know which observations truly do not ``belong'' with the rest of the +sample. Instead, outlier detection methods behave much like unsupervised +learning methods, trying to find patterns in the data, and to mark +observations that seem to have a bad ``fit'' with these patterns. + +Therefore, we believe that these methods should merely be used as +suggestive, and advocate for researchers and analysts to use their +\emph{domain knowledge} when deciding how to deal with observations +marked as outliers using SOD. Indeed, automatic tools can help detect +outliers, but they are nowhere near perfect. Although they can be useful +for flagging suspect data, they can have misses and false alarms, and +they cannot completely replace human eyes and proper vigilance from the +researcher. That is, the use of SOD methods is but one step in the +get-to-know-your-data pipeline. + +For example, in the case of reaction time analysis, +\citet{miller2023outlier} systematically compared 58 SOD procedures in +simulations using large datasets of real reaction times. He concluded +that regardless of the selected procedure, the exclusion of outliers +(reaction times too slow or too fast) generally did more harm than good +compared to retaining them, as they tend to incorrectly detect outliers, +reduce statistical power, and increase bias and noise. He thus +recommends only excluding invalid reaction times, such as those under a +fixed threshold, e.g., 150 ms, which is close to the minimal +physiological limit for reacting to a visual stimulus. Setting an upper +limit on very long times (e.g., 3 to 5 seconds, depending on the +experimental task) to remove potential sparse artifacts can also improve +model convergence and fitting. + +\citet{miller2023outlier} also suggests that it is typically better to +assess outliers within specific experimental conditions or groups (a +condition-specific strategy), rather than across the entire dataset at +once (a pooled strategy), particularly in the case of reaction times. +Additionally, common procedures such as statistical transformations +(e.g., log-transformation) reportedly offer at best no benefit (being +instead potentially detrimental) to statistical power +\citep{schramm2019reaction}. Given the specific shape of a typical +reaction distribution, treating them with bespoke models that take into +account its skewness (thus reframing the notion of outliers and +integrating the longer right tail of the distribution) should be +considered. Examples of such models---referred to as sequential sampling +models or evidence accumulation models---include Wald models +\citep{anders2016shifted}, log-normal race models +\citep{rouder2015lognormal}, linear ballistic accumulators +\citep{brown2008simplest}, and Drift Diffusion Models +\citep{ratcliff2016diffusion}. + +Thus, when manually inspecting data for outliers, it can be helpful to +think of outliers as belonging to different types of outliers, or +categories, which can help decide what to do with a given outlier. + +\subsection{Error, Interesting, and Random +Outliers}\label{error-interesting-and-random-outliers} + +Several authors distinguish between error outliers, interesting +outliers, and random outliers +\citep{aguinis2013best, leys2019outliers}.\footnote{Some authors provide + much more detailed classifications of outliers; for example, see Table + 1 in Aguinis et al.~(2013), for 14 different outlier definitions based + on a literature review.} \emph{Error outliers} are likely due to human +error and should be corrected before data analysis or outright removed +since they are invalid observations (e.g., physiologically implausible +reaction times). \emph{Interesting outliers} are not due to technical +error and may be of theoretical interest; it might thus be relevant to +investigate them further, even though they should be removed from the +current analysis of interest. \emph{Random outliers} are assumed to be +due to chance alone and to belong to the correct distribution and, +therefore, should be retained. + +It is recommended to \emph{keep} observations which are expected to be +part of the distribution of interest, even if they are outliers +\citep{leys2019outliers}. However, if it is suspected that the outliers +belong to an alternative distribution, then those observations could +have a large impact on the results. These observations could then call +into question the robustness of these results, especially if +significance is conditional on their inclusion, so they should be +removed. Some authors also report detailed decision trees for handling +outliers \citep[e.g., see Figures 1 \& 2 in][]{aguinis2013best}. + +We should also keep in mind that there might be error outliers that are +not detected by statistical tools but should nonetheless be found and +removed. For example, if we are studying the effects of X on Y among +teenagers, and we have one observation from a 20-year-old, this +observation might not be a \emph{statistical outlier}, but it is an +outlier in the \emph{context} of our research and should be discarded. +We could call these observations \emph{undetected} error outliers, in +the sense that although they do not statistically stand out, they do not +belong to the theoretical or empirical distribution of interest (e.g., +teenagers). In this way, we should not blindly rely on statistical +outlier detection methods; doing our due diligence to investigate +undetected error outliers relative to our specific research question is +also essential for valid inferences. + +\subsection{Winsorization}\label{winsorization} + +\emph{Removing} outliers that do not belong to the distribution of +interest can in this case be a valid strategy, and ideally one would +report results with and without outliers to see the extent of their +impact on results. This approach however can reduce statistical power. +Therefore, some propose a \emph{recoding} approach, namely, +winsorization: bringing outliers back within acceptable limits +\citep[e.g., three MADs,][]{tukey1963less}. However, if possible, it is +recommended to collect enough data so that even after removing outliers, +there is still sufficient statistical power without having to resort to +winsorization \citep{leys2019outliers}. + +The \emph{easystats} ecosystem makes it easy to incorporate this step +into your workflow through the \texttt{winsorize()} function of +\emph{\{datawizard\}}, a lightweight R package to facilitate data +wrangling and statistical transformations \citep{patil2022datawizard}. +This procedure will bring back univariate outliers within the limits of +`acceptable' values, based either on the percentile, the \emph{z} score, +or its robust alternative based on the MAD. For example, let's say we +want to winsorize the univariate outlier identified before: + +\begin{Shaded} +\begin{Highlighting}[] +\NormalTok{data[}\DecValTok{33}\SpecialCharTok{:}\DecValTok{34}\NormalTok{, }\DecValTok{2}\SpecialCharTok{:}\DecValTok{3}\NormalTok{] }\CommentTok{\# See outliers rows} +\end{Highlighting} +\end{Shaded} + +\begin{verbatim} +#> mpg cyl +#> 33 12 12 +#> 34 55 55 +\end{verbatim} + +\begin{Shaded} +\begin{Highlighting}[] +\CommentTok{\# Winsorizing using the MAD} +\FunctionTok{library}\NormalTok{(datawizard)} +\NormalTok{winsorized\_data }\OtherTok{\textless{}{-}} \FunctionTok{winsorize}\NormalTok{(data, }\AttributeTok{method =} \StringTok{"zscore"}\NormalTok{, } + \AttributeTok{robust =} \ConstantTok{TRUE}\NormalTok{, }\AttributeTok{threshold =} \DecValTok{3}\NormalTok{)} + +\CommentTok{\# Outlier values \textgreater{} +/{-} MAD have been winsorized} +\NormalTok{winsorized\_data[}\DecValTok{33}\SpecialCharTok{:}\DecValTok{34}\NormalTok{, }\DecValTok{2}\SpecialCharTok{:}\DecValTok{3}\NormalTok{]} +\end{Highlighting} +\end{Shaded} + +\begin{verbatim} +#> mpg cyl +#> 33 12.00000 12.0000 +#> 34 36.32403 14.8956 +\end{verbatim} + +\subsection{The Importance of +Transparency}\label{the-importance-of-transparency} + +Finally, it is a critical part of a sound outlier treatment that +regardless of which SOD method used, it should be reported in a +reproducible manner. Ideally, the handling of outliers should be +specified \emph{a priori} with as much detail as possible, and +preregistered, to limit researchers' degrees of freedom and therefore +risks of false positives \citep{leys2019outliers}. This is especially +true given that interesting outliers and random outliers are oftentimes +hard to distinguish in practice. Thus, researchers should always +prioritize transparency and report all the following information: (a) +how many outliers were identified (including percentage); (b) according +to which method and criteria, (c) using which function of which R +package (if applicable), and (d) how they were handled (excluded or +winsorized, if the latter, using what threshold). If at all possible, +(e) the corresponding code along with the data should be shared in a +public repository like the Open Science Framework (OSF), so that the +exclusion criteria can be reproduced precisely. + +\section{Conclusion}\label{conclusion} + +In this paper, we have shown how to investigate outliers using the +\texttt{check\_outliers()} function of the \emph{\{performance\}} +package while following current good practices. However, best practice +for outlier treatment does not stop at using appropriate statistical +algorithms, but entails respecting existing recommendations, such as +preregistration, reproducibility, consistency, transparency, and +justification. Ideally, one would additionally also report the package, +function, and threshold used (linking to the full code when possible). +We hope that this paper and the accompanying \texttt{check\_outliers()} +function of \emph{easystats} will help researchers engage in good +research practices while providing a smooth outlier detection +experience. + +\section{Declarations}\label{declarations} + +\subsection{Funding information}\label{funding-information} + +This research received no external funding. + +\subsection{Competing Interests}\label{competing-interests} + +The authors declare no conflict of interest + +\subsection{Availability of data and materials (data +transparency)}\label{availability-of-data-and-materials-data-transparency} + +This paper first appeared as a preprint +(\url{https://doi.org/10.31234/osf.io/bu6nt}) and is also available as +an online vignette at: +\url{https://easystats.github.io/performance/articles/check_outliers}. +All data used in this paper uses data included with base R. + +\subsection{Code availability}\label{code-availability} + +The performance package is available at the package official website +(\url{https://easystats.github.io/performance}), on CRAN +(\url{https://cran.r-project.org/package=performance}), and on the +R-Universe (\url{https://easystats.r-universe.dev/performance}). The +source code is available on GitHub +(\url{https://github.com/easystats/performance/}), and the package can +be installed from CRAN with \texttt{install.packages("performance")}. +The code to reproduce figures and all analyses in this paper is +available at \url{https://osf.io/eqja6/}. + +\subsection{Contributions}\label{contributions} + +Writing- Original draft preparation: RT. Writing- Reviewing and Editing, +Software: RT, MSB-S, IP, DL, BMW, and DM. + +\subsection{Acknowledgements}\label{acknowledgements} + +\emph{\{performance\}} is part of the collaborative +\href{https://github.com/easystats/easystats}{\emph{easystats}} +ecosystem \citep{easystatspackage}. Thus, we thank all +\href{https://github.com/orgs/easystats/people}{members of easystats}, +contributors, and users alike. + +\renewcommand\refname{References} +\bibliography{paper.bib} + + +\end{document} diff --git a/papers/preprint/paper.zip b/papers/preprint/paper.zip new file mode 100644 index 000000000..47906c01f Binary files /dev/null and b/papers/preprint/paper.zip differ diff --git a/papers/preprint/paper_files/figure-latex/fig1-1.pdf b/papers/preprint/paper_files/figure-latex/fig1-1.pdf new file mode 100644 index 000000000..80c597690 Binary files /dev/null and b/papers/preprint/paper_files/figure-latex/fig1-1.pdf differ diff --git a/papers/preprint/paper_files/figure-latex/model3-1.pdf b/papers/preprint/paper_files/figure-latex/model3-1.pdf new file mode 100644 index 000000000..cfc4f4492 Binary files /dev/null and b/papers/preprint/paper_files/figure-latex/model3-1.pdf differ diff --git a/papers/preprint/paper_files/figure-latex/model_fig-1.pdf b/papers/preprint/paper_files/figure-latex/model_fig-1.pdf new file mode 100644 index 000000000..d01dc1dc3 Binary files /dev/null and b/papers/preprint/paper_files/figure-latex/model_fig-1.pdf differ diff --git a/papers/preprint/paper_files/figure-latex/multivariate_implicit-1.pdf b/papers/preprint/paper_files/figure-latex/multivariate_implicit-1.pdf new file mode 100644 index 000000000..27c8900ad Binary files /dev/null and b/papers/preprint/paper_files/figure-latex/multivariate_implicit-1.pdf differ diff --git a/papers/preprint/paper_files/figure-latex/scatter-1.pdf b/papers/preprint/paper_files/figure-latex/scatter-1.pdf new file mode 100644 index 000000000..acdc18f9d Binary files /dev/null and b/papers/preprint/paper_files/figure-latex/scatter-1.pdf differ diff --git a/papers/preprint/paper_files/figure-latex/univariate_implicit-1.pdf b/papers/preprint/paper_files/figure-latex/univariate_implicit-1.pdf new file mode 100644 index 000000000..66dac5fdb Binary files /dev/null and b/papers/preprint/paper_files/figure-latex/univariate_implicit-1.pdf differ diff --git a/papers/JOSE/paper_longform.Rmd b/papers/preprint/paper_longform.Rmd similarity index 100% rename from papers/JOSE/paper_longform.Rmd rename to papers/preprint/paper_longform.Rmd diff --git a/papers/preprint/sn-apacite.bst b/papers/preprint/sn-apacite.bst new file mode 100644 index 000000000..be1dc5309 --- /dev/null +++ b/papers/preprint/sn-apacite.bst @@ -0,0 +1,5364 @@ +%% +%% This is file `apacite.bst', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% apacite.dtx (with options: `bibstyle') +%% +%% This is a generated file. +%% +%% Copyright (C) 1994-2013 Erik Meijer and any individual authors listed +%% elsewhere in this file. +%% +%% This file is part of the `apacite' package. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% The `apacite' package consists of the files apacite.dtx and +%% apacite.ins, and the following generated files: +%% apacite.sty, apacdoc.sty, apacite.drv, +%% apacite.bst, apacitex.bst, apacann.bst, apacannx.bst, +%% apa5ex.bib, apacxmpl.tex, +%% english.apc, dutch.apc, finnish.apc, french.apc, +%% german.apc, ngerman.apc, greek.apc, norsk.apc, +%% spanish.apc, swedish.apc. +%% +%% This work has the LPPL maintenance status `maintained' +%% +%% The Current Maintainer of this work is Erik Meijer +%% +%% This file may only be distributed together with a copy of the +%% source files of the apacite package, i.e., apacite.dtx and +%% apacite.ins. You may however distribute the apacite package without +%% the generated files. +%% +%% apacite.bst +%% [2013/07/21 v6.03 APA bibliography style] +%% apacite.bst : reference list according to APA manual +%% Written by Erik Meijer + +FUNCTION {identify.apacite.version} +{ % Put identifying string in the .blg file + "apacite.bst" + " [2013/07/21 v6.03 APA bibliography style]" + * top$ +} +ENTRY + { address + annote + annotate + author + booktitle + chair + chapter + day + doi + edition + editor + englishtitle + firstkey + howpublished + institution + journal + key + keywords + lastchecked + month + nihms + note + number + organization + originaladdress + originalbooktitle + originaledition + originaleditor + originaljournal + originalnumber + originalpages + originalpublisher + originalvolume + originalyear + pages + pmcid + publisher + school + series + symposium + text + title + translator + type + url + urldate + volume + year + eprint + archive + archivePrefix + primaryClass + eid + adsurl + adsnote + version + } + { cite.order %% order of first citation + title.number %% for sorting titles + cite.initials %% dummy (0-1) indicating whether or not + %% initials of the 1st author must + %% be used for citing + cite.num.names.full %% number of names to be cited for full and + cite.num.names.short %% short cite + add.to.year %% For a, b, c, etc. after year + %% in multiple citations with same author-year + } + { year.label %% For sorting entries by year + author.year.sort.label %% For sorting entries and checking whether + %% initials should be added, how many authors + %% should be cited and whether a, b, etc. + %% after year is necessary + title.sort.label %% for sorting titles + citeorder.sort.label %% for sorting by citation order + type.2 %% Replacement for type with misc entries and + %% entries that revert to misc. + } +INTEGERS { len pos name.max old.number numnames numnames.old + nameptr lastname format.num.names cite.initials.old + cite.num.names.old add.to.year.old forward + multiresult dot brace.level + } + +STRINGS { s t u old.label field + aut1f aut1s aut1f.old aut1s.old + aut2 aut2.old + aut3 aut3.old + aut4 aut4.old + aut5 aut5.old + aut6 aut6.old + year.label.old + } +FUNCTION {test} { #0 } +FUNCTION {dump.stack} +{ "---- STACK {" cite$ * "} ----" * top$ + stack$ + "---- END STACK {" cite$ * "} ----" * top$ +} +FUNCTION {make.index} { #0 } +FUNCTION {unsorted} { #0 } +MACRO {jan} {"{\APACmonth{01}}"} +MACRO {feb} {"{\APACmonth{02}}"} +MACRO {mar} {"{\APACmonth{03}}"} +MACRO {apr} {"{\APACmonth{04}}"} +MACRO {may} {"{\APACmonth{05}}"} +MACRO {jun} {"{\APACmonth{06}}"} +MACRO {jul} {"{\APACmonth{07}}"} +MACRO {aug} {"{\APACmonth{08}}"} +MACRO {sep} {"{\APACmonth{09}}"} +MACRO {oct} {"{\APACmonth{10}}"} +MACRO {nov} {"{\APACmonth{11}}"} +MACRO {dec} {"{\APACmonth{12}}"} +MACRO {winter} {"{\APACmonth{13}}"} +MACRO {spring} {"{\APACmonth{14}}"} +MACRO {summer} {"{\APACmonth{15}}"} +MACRO {fall} {"{\APACmonth{16}}"} +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % issues warning if field is empty + % call with + % "field" field warning.if.empty + % Note that the first field must be between quotes + % because it is the fieldname for use in the warning message. + % +FUNCTION {warning.if.empty} +{ empty$ + { "No " swap$ * " in " * cite$ * warning$ } + { pop$ } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % issues warning if title, type, and howpublished are empty + % +FUNCTION {check.relevant.fields} +{ title empty$ + type empty$ and + howpublished empty$ and + { "No title, type, and howpublished in " cite$ * warning$ } + 'skip$ + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % delivers 1 if (both editor and translator + % not empty and not equal to each other) + % 0 if (editor or translator empty) or + % (editor = translator) + % +FUNCTION {editor.ne.trans} +{ translator empty$ + { #0 } + { editor empty$ + { #0 } + { translator editor = + { #0 } + { #1 } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {conv.int.to.str} +{ duplicate$ #10 < + { "0000" swap$ int.to.str$ * } + { duplicate$ #100 < + { "000" swap$ int.to.str$ * } + { duplicate$ #1000 < + { "00" swap$ int.to.str$ * } + { duplicate$ #10000 < + { "0" swap$ int.to.str$ * } + { int.to.str$ } + if$ + } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {ref.type} +{ type$ "article" = + type$ "magazine" = + type$ "newspaper" = + type$ "book" = + type$ "techreport" = + type$ "unpublished" = + type$ "misc" = + type$ "booklet" = + type$ "manual" = + type$ "proceedings" = + or + or + or + or + or + or + or + or + or + { #1 } + { type$ "incollection" = + type$ "phdthesis" = + type$ "mastersthesis" = + type$ "lecture" = + type$ "inbook" = + type$ "inproceedings" = + type$ "conference" = + type$ "intechreport" = + or + or + or + or + or + or + or + { #2 } + { type$ "literal" = + { #3 } + { #0 } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {is.atype} +{ type$ "article" = + type$ "magazine" = + type$ "newspaper" = + type$ "incollection" = + type$ "inbook" = + type$ "inproceedings" = + type$ "conference" = + type$ "intechreport" = + type$ "manual" = + or + or + or + or + or + or + or + or + { #1 } + { journal empty$ not + % + type$ "phdthesis" = + type$ "mastersthesis" = + or + % + and + { #1 } + { type$ "misc" = + type empty$ not and + { type "\bibmessage" = + type "\bibcomputerprogram" = + type "\bibcomputerprogrammanual" = + type "\bibcomputerprogramandmanual" = + type "\bibcomputersoftware" = + type "\bibcomputersoftwaremanual" = + type "\bibcomputersoftwareandmanual" = + type "\bibprogramminglanguage" = + or + or + or + or + or + or + or + { #1 } + { #0 } + if$ + } + { #0 } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % connects two strings with connect string + % if one of them empty, then connect string + % is left out + % + % call with S1 S2 connectstring connect.check + % +FUNCTION {connect.check} +{ 'u := + % + % if S2 = "" + % + duplicate$ empty$ + % + % then remove S2 + % + { pop$ + % + % S1 is on top of stack. + % if it is empty, it is replaced by the empty string "" + % + duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ + } + % + % else swap S1 and S2 so that S1 can be checked + % + { swap$ + % + % if S1 is empty, remove S1 so that S2 is left on the + % stack and is the result is given + % + duplicate$ empty$ + { pop$ } + % + % now the real work starts: + % push the connect string "C" + % so that top of stack is "C" "S1" "S2" + % concatenate, so that top of stack is + % "S1+C" "S2" + % + { u * + % + % swap and concatenate + % + swap$ * + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % connects two strings with space ("\ ") + % if length of second is 4 or larger, + % connects them with non-breaking space ("tie", "~") + % if length of second smaller than 4 + % + % call with S1 S2 tie.or.space.connect + % result: "S1\ S2" or "S1~S2" + % +FUNCTION {tie.or.space.connect} +{ duplicate$ text.length$ #4 < + { "~" } + { "\ " } + if$ + swap$ * * +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % connects two strings with comma (", ") + % if one of them is empty, the comma is left out + % + % call with S1 S2 connect.with.comma.check + % result: "S1, S2" + % +FUNCTION {connect.with.comma.check} +{ ", " connect.check } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % connects two strings with semicolon ("; ") + % if one of them is empty, semicolon is left out + % + % call with S1 S2 connect.with.semicolon.check + % result: "S1; S2" + % +FUNCTION {connect.with.semicolon.check} +{ "; " connect.check } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % connects two strings with colon (": ") + % if one of them is empty, colon is left out + % + % call with S1 S2 connect.with.colon.check + % result: "S1: S2" + % +FUNCTION {connect.with.colon.check} +{ ": " connect.check } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % connects two strings with space ("\ ") + % + % call with S1 S2 connect.with.space.check + % result: "S1\ S2" + % +FUNCTION {connect.with.space.check} +{ "\ " connect.check } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % encloses string in pre- and postfix string + % call with + % prefix postfix S enclose.check + % delivers empty string if S empty + % +FUNCTION {enclose.check} +{ duplicate$ empty$ + { pop$ pop$ pop$ + "" + } + { swap$ * * } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % emphasizes top of stack + % call with + % "string" emphasize.check + % +FUNCTION {emphasize.check} +{ "\Bem{" swap$ + "}" swap$ + enclose.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % brackets top of stack + % call with + % "string" bracket + % +FUNCTION {bracket.check} +{ "[" swap$ + "]" swap$ + enclose.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % parenthesizes top of stack + % call with + % "string" parenthesize + % +FUNCTION {parenthesize.check} +{ "(" swap$ + ")" swap$ + enclose.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % checks whether argument is "multiresult": + % whether it contains '-', '+', or ',' characters + % used with pages to check whether pp. or p. must be used + % +FUNCTION {multi.result.check} +{ 't := + #0 'multiresult := + % + % while (not multiresult) and (length(t) > 1) do + % + { multiresult not + t text.length$ #1 > + and + } + % + % if t(1-2) = "--" or t(1) = "+" or "," + % then multiresult = 1 + % else t = t(2-last) + % + { t #1 #2 substring$ 's := + "--" s = + { #1 'multiresult := } + { t #1 #1 substring$ 's := + "+" s = + "," s = + or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + if$ + } + while$ + multiresult +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % Checks whether an author is a corporate author, i.e., + % whether the field starts with "{\bibcorporate". + % Call with + % field is.bibcorporate + % +FUNCTION {is.bibcorporate} +{ #1 #14 substring$ "{\bibcorporate" = } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {remove.spaces} +{ % Remove spaces from string. + % Works best if string only contains alphanumeric characters and spaces. + 's := % The original string + s text.length$ 'len := % Its length (no. of characters) + "" 't := % Initialize the transformed string + #0 'pos := + % + % while (pos < len) do + % + { pos len < } + { pos #1 + 'pos := + s pos #1 substring$ 'u := + % + % u is the pos-th character in s + % If it is a space, move to next character, + % else copy character to output. + % + u " " = + 'skip$ + { t u * 't := } + if$ + } + while$ + % + % Now push the result back on the stack + t +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % end block by writing what's left on the stack and + % starting a new line + % +FUNCTION {output.end.block} +{ write$ + newline$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % end block by adding a period and writing what's left + % on the stack and starting a new line + % +FUNCTION {output.dot.end.block} +{ add.period$ + output.end.block +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % starting new block by writing what's left on the stack, + % starting a new line and adding some extra space or + % whatever is more defined in \newblock + % +FUNCTION {output.new.block} +{ output.end.block + "\newblock" write$ newline$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % starting new block by writing what's left on the stack, + % starting a new line and adding some extra space or + % whatever is more defined in \newblock + % +FUNCTION {output.dot.new.block} +{ add.period$ + output.new.block +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {start.new.block} +{ "\unskip\ " write$ newline$ + "\newblock " write$ newline$ +} + +FUNCTION {sort.name.format.classic} { "{ll{}}{ f{}}{ vv{}}{ jj{}}" } + +FUNCTION {cite.name.format.classic} { "{ll}" } + +FUNCTION {author.name.format.classic} { "{ll}{, f{.}.}{ vv}{, jj}" } + +FUNCTION {index.name.format.classic} { "{ll}{, f{.}.}{ vv}{, jj}" } + +FUNCTION {sort.name.format} { "{vv{}}{ll{}}{ f{}}{ jj{}}" } + +FUNCTION {cite.name.format} { "{vv }{ll}" } + +FUNCTION {cite.initials.name.format} { "{f{.}.~~}{vv }{ll}{ jj}" } + +FUNCTION {author.name.format} { "{vv }{ll}{, f{.}.}{, jj}" } + +FUNCTION {editor.name.format} { "{f{.}.~~}{vv }{ll}{ jj}" } + +FUNCTION {index.name.format} { "{vv }{ll}{, f{.}.}{, jj}" } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {init.initials} +{ "yyyyy" 'aut1f.old := + "yyyyy" 'aut1s.old := + #0 'cite.initials.old := +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {update.no.initials} +{ 'field := + field 'aut1f.old := + field 'aut1s.old := + #0 'cite.initials.old := +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {check.add.initials.aut} +{ % + % If last name is equal to previous last name + % but initials are different, then initials should + % be cited. If initials are also the same, initials + % should be cited if that is the case for the previous + % author . + % + aut1s aut1s.old = + { aut1f aut1f.old = + { cite.initials.old 'cite.initials := } + { #1 'cite.initials := + aut1f 'aut1f.old := + aut1s 'aut1s.old := + cite.initials 'cite.initials.old := + } + if$ + } + { % + % Different last name. + aut1f 'aut1f.old := + aut1s 'aut1s.old := + cite.initials 'cite.initials.old := + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {check.add.initials.field} +{ 'field := + field #1 cite.initials.name.format format.name$ 'aut1f := + field #1 cite.name.format format.name$ 'aut1s := + % + % Now do the actual work + % + check.add.initials.aut +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {check.add.initials} +{ % + % Check whether author or editor or other field acts as author. + % Initials are only relevant with author or editor. + % + firstkey empty$ not + { key empty$ not + { % + % Both key and firstkey are nonempty. + % Then, key is treated as last name of first author, + % and firstkey is treated as last name + initials of + % first author . + % + firstkey sortify remove.spaces 'aut1f := + key sortify remove.spaces 'aut1s := + check.add.initials.aut + } + { firstkey sortify remove.spaces update.no.initials } + if$ + } + { key empty$ not + { key sortify remove.spaces update.no.initials } + { % + % No key or firstkey, so find out which field + % to use as author. + % + % Check reference type: + % if result is 1 then possibly editor acts as author + % 2 then editor does not act as author + % 3 then key should have been used + % 0 then unknown reference type + ref.type #2 = + { % + % Format first author with and without initials + author empty$ + { title.sort.label update.no.initials } + { author check.add.initials.field } + if$ + } + { % + % Format first author with and without initials + author empty$ + { editor empty$ + { title.sort.label update.no.initials } + { editor check.add.initials.field } + if$ + } + { author check.add.initials.field } + if$ + } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {tentative.cite.num.names.field} +{ 'field := + field num.names$ 'numnames := + numnames #3 < + { % + % 1 or 2 names: always cite all of them. + numnames 'cite.num.names.full := + numnames 'cite.num.names.short := + } + { numnames #6 < + { % + % 3-5 names: cite all of them the first time, + % only the first name later times + numnames 'cite.num.names.full := + #1 'cite.num.names.short := + } + { % + % 6 or more names: cite only the first name + #1 'cite.num.names.full := + #1 'cite.num.names.short := + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {tentative.cite.num.names} +{ % + % Check whether author or editor or other field acts as author. + % Number of names is only relevant with author or editor. + % + firstkey empty$ not + { + #1 'cite.num.names.full := + #1 'cite.num.names.short := + } + { key empty$ not + { + #1 'cite.num.names.full := + #1 'cite.num.names.short := + } + { % + % No key or firstkey, so find out which field + % to use as author. + % + % Check reference type: + % if result is 1 then possibly editor acts as author + % 2 then editor does not act as author + % 3 then key should have been used + % 0 then unknown reference type + ref.type #2 = + { % + % Format first author with and without initials + author empty$ + { + #1 'cite.num.names.full := + #1 'cite.num.names.short := + } + { author tentative.cite.num.names.field } + if$ + } + { % + % Format first author with and without initials + author empty$ + { editor empty$ + { + #1 'cite.num.names.full := + #1 'cite.num.names.short := + } + { editor tentative.cite.num.names.field } + if$ + } + { author tentative.cite.num.names.field } + if$ + } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {init.cite.num.names} +{ #0 'cite.num.names.old := + #0 'numnames.old := + "yyyy" 'year.label.old := + #0 'add.to.year.old := + "" 'aut1f.old := + "" 'aut2.old := + "" 'aut3.old := + "" 'aut4.old := + "" 'aut5.old := + "" 'aut6.old := +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {update.cite.num.names} +{ cite.num.names.short 'cite.num.names.old := + numnames 'numnames.old := + year.label 'year.label.old := + add.to.year 'add.to.year.old := + aut1f 'aut1f.old := + aut2 'aut2.old := + aut3 'aut3.old := + aut4 'aut4.old := + aut5 'aut5.old := + aut6 'aut6.old := +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.6.authors} +{ % + % First author: with initials. + % + field #1 cite.initials.name.format format.name$ 'aut1f := + % + % Second and later authors: without initials. + % + numnames #1 > + name.max #1 > + and + { % + % 2nd author + field #2 cite.name.format format.name$ 'aut2 := + % + numnames #2 > + name.max #2 > + and + { % + % 3nd author + field #3 cite.name.format format.name$ 'aut3 := + % + numnames #3 > + name.max #3 > + and + { % + % 4th author + field #4 cite.name.format format.name$ 'aut4 := + % + numnames #4 > + name.max #4 > + and + { % + % 5th author + field #5 cite.name.format format.name$ 'aut5 := + % + numnames #5 > + name.max #5 > + and + { % + % 6th author + field #6 cite.name.format format.name$ 'aut6 := + } + { % + % 5 authors: 6 is empty + % + "" 'aut6 := + } + if$ + } + { % + % 4 authors: 5-6 are empty + % + "" 'aut5 := + "" 'aut6 := + } + if$ + } + { % + % 3 authors: 4-6 are empty + % + "" 'aut4 := + "" 'aut5 := + "" 'aut6 := + } + if$ + } + { % + % 2 authors: 3-6 are empty + % + "" 'aut3 := + "" 'aut4 := + "" 'aut5 := + "" 'aut6 := + } + if$ + } + { % + % Only 1 author: 2-6 are empty + % + "" 'aut2 := + "" 'aut3 := + "" 'aut4 := + "" 'aut5 := + "" 'aut6 := + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {change.add.to.year} +{ + forward #1 = + { % + % Moving forward: this add.to.year number must be 1 higher than + % previous. + % + add.to.year.old #0 > + { add.to.year.old #1 + 'add.to.year := } + { #2 'add.to.year := } + if$ + } + { % + % Moving backward: this add.to.year number must be 1 lower than + % previous. + % + add.to.year.old #1 - 'add.to.year := + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {definitive.cite.num.names.1.or.2} +{ % + numnames numnames.old = + { % + % Same number of names: ambiguity could arise. Check whether current + % and previous have the same author(s). + % + aut1f aut1f.old = + { % + % Same first author: if the second author is also the same or if + % there is only one author, a's and b's should be added. + % + aut2 aut2.old = + numnames #2 = + and + % + numnames #1 = + or + { % + % Same author(s): add to year. + % + change.add.to.year + } + { % + % Different second author: no ambiguity possible. + % + skip$ + } + if$ + } + { % + % Different first author: no ambiguity possible. + % + skip$ + } + if$ + } + { % + % Different number of names: no ambiguity possible. + % + skip$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {definitive.cite.num.names.3.or.more} +{ % + % Check whether current and previous have the same first author. + % + aut1f aut1f.old = + { % + % Same first author: check second author + % + aut2 aut2.old = + { % + % Same 1st & 2nd author: check 3rd. + % + aut3 aut3.old = + { % + % Same 1st-3rd authors: check 4th. + % + numnames.old #3 = + { numnames #3 = + { % + % Both current and previous have 3 authors, which are + % the same, so both have identical author-year + % combinations, so ambiguity should be resolved by + % a's and b's. Check whether more authors were + % necessary for previous one. + % + change.add.to.year + cite.num.names.short cite.num.names.old < + { cite.num.names.old + 'cite.num.names.short := + } + 'skip$ + if$ + } + { % + % Previous has 3 authors, current has more, with same + % first 3, so at least 4 must be used for current to + % make a difference. + % + cite.num.names.short #4 < + { #4 'cite.num.names.short := } + 'skip$ + if$ + } + if$ + } + { numnames #3 = + { % + % Current has 3 authors, previous has more, with same + % first 3, so all 3 of current must be used. + % + numnames 'cite.num.names.short := + } + { % + % Same 1st-3rd author and both current and previous + % have at least 4 authors: check 4th. + % + aut4 aut4.old = + { % + % Same 1st-4th authors: check 5th. + % + numnames.old #4 = + { numnames #4 = + { % + % Both current and previous have 4 authors, + % which are the same, so both have + % identical author-year combinations, so + % ambiguity should be resolved by a's and + % b's. Check whether more authors were + % necessary for previous one. + % + change.add.to.year + cite.num.names.short cite.num.names.old < + { cite.num.names.old + 'cite.num.names.short := + } + 'skip$ + if$ + } + { % + % Previous has 4 authors, current has more, + % with same first 4, so at least 5 must be + % used for current to make a difference. + % + cite.num.names.short #5 < + { #5 'cite.num.names.short := } + 'skip$ + if$ + } + if$ + } + { numnames #4 = + { % + % Current has 4 authors, previous has more, + % with same first 4, so all 4 of current + % must be used. + % + numnames 'cite.num.names.short := + } + { % + % Same 1st-4th author and both current and + % previous have at least 5 authors: check + % 5th. + % + aut5 aut5.old = + { % + % Same 1st-5th authors: check 6th. + % + numnames.old #5 = + { numnames #5 = + { % + % Both current and previous + % have 5 authors, which are the + % same, so both have identical + % author-year combinations, so + % ambiguity should be resolved + % by a's and b's. Check whether + % more authors were necessary + % for previous one. + % + change.add.to.year + cite.num.names.short + cite.num.names.old < + { cite.num.names.old + 'cite.num.names.short := + } + 'skip$ + if$ + } + { % + % Previous has 5 authors, + % current has more, with same + % first 5, so at least 6 must + % be used for current to make + % a difference. + % + cite.num.names.short #6 < + { #6 'cite.num.names.short := } + 'skip$ + if$ + } + if$ + } + { numnames #5 = + { % + % Current has 5 authors, + % previous has more, with same + % first 5, so all 5 of current + % must be used. + % + numnames 'cite.num.names.short := + } + { % + % Same 1st-5th author and both + % current and previous have at + % least 6 authors. If one has + % 6 authors and the other has + % more or the 6th is different, + % 6 should be used (which is + % the maximum). + % + numnames #6 > + numnames.old #6 = + and + % + numnames #6 = + numnames.old #6 > + and + % + or + % + aut6 aut6.old = + not + % + or + { #6 cite.num.names.short < + { #6 + 'cite.num.names.short + := + } + 'skip$ + if$ + } + { % + % The first 6 authors are + % the same and either both + % have 6 or both have more. + % So for all practical + % purposes they have + % identical author-year + % combination, so ambiguity + % should be resolved by a's + % and b's. Check whether + % more authors were + % necessary for previous + % one. + % + change.add.to.year + cite.num.names.short + cite.num.names.old + < + { cite.num.names.old + 'cite.num.names.short + := + } + 'skip$ + if$ + } + if$ + } + if$ + } + if$ + } + { % + % Different 5th author: citing 5 authors is + % sufficient for this comparison. + % + cite.num.names.short #5 < + { #5 'cite.num.names.short := } + 'skip$ + if$ + } + if$ + } + if$ + } + if$ + } + { % + % Different 4th author: citing 4 authors is + % sufficient for this comparison. + % + cite.num.names.short #4 < + { #4 'cite.num.names.short := } + 'skip$ + if$ + } + if$ + } + if$ + } + if$ + } + { % + % Different 3rd author: citing 3 authors is sufficient for this + % comparison. + % + cite.num.names.short #3 < + { #3 'cite.num.names.short := } + 'skip$ + if$ + } + if$ + } + { % + % Different 2nd author: citing 2 authors is sufficient for this + % comparison. + % + cite.num.names.short #2 < + { #2 'cite.num.names.short := } + 'skip$ + if$ + } + if$ + } + { % + % Different first author: no ambiguity, move to next entry. + % + skip$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {definitive.cite.num.names.field} +{ 'field := + field num.names$ 'numnames := + % + % Format authors + % + format.6.authors + % + % Now compare authors with authors of previous entry. + % + cite.num.names.short numnames.old > + { % + % The previous entry has less authors than already defined + % necessary to be cited. No ambiguity is possible and we're ready. + % + skip$ + } + { % + % Both previous and current entry have at least one author . + % + year.label year.label.old = + { % + % Same year label: possibly ambiguous citation. + % + % First check: current and/or previous have 1 or + % 2 authors. + % + numnames #3 < + numnames.old #3 < + or + % + { definitive.cite.num.names.1.or.2 } + { definitive.cite.num.names.3.or.more } + if$ + } + { % + % Different year label: everything's fine, + % move to next entry. + % + skip$ + } + if$ + } + if$ + % + % If during the previous process the name maximum is exceeded + % (which was not checked), correct this. NOTE: If the name + % maximum is smaller than 6, this could lead to ambiguous + % citations if, e.g., the year and the first 5 authors are + % the same, but the 6th author is different. + % + cite.num.names.short name.max > + { name.max 'cite.num.names.short := } + 'skip$ + if$ + % + % For a "full" cite, the number of names should always be at least + % as large as for a "short" cite. + % + cite.num.names.full cite.num.names.short < + { cite.num.names.short 'cite.num.names.full := } + 'skip$ + if$ + % + % Update "old" variables for next entry. + % + update.cite.num.names +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {definitive.cite.no.names} +{ % + % The formatted field that acts as author is on top + % of the stack. + 'aut1f := + "" 'aut2 := + "" 'aut3 := + "" 'aut4 := + "" 'aut5 := + "" 'aut6 := + #1 'numnames := + % + year.label year.label.old = + { % + % Same year label: possibly ambiguous citation. + % + definitive.cite.num.names.1.or.2 + } + { % + % Different year label: everything's fine, + % move to next entry. + % + skip$ + } + if$ + % + % Update "old" variables for next entry. + % + update.cite.num.names +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {definitive.cite.num.names} +{ % + % Check whether author or editor or other field acts as author. + % Number of names is only relevant with author or editor. + % + firstkey empty$ not + { firstkey sortify remove.spaces definitive.cite.no.names } + { key empty$ not + { key sortify remove.spaces definitive.cite.no.names } + { % + % No key or firstkey, so find out which field + % to use as author. + % + % Check reference type: + % if result is 1 then possibly editor acts as author + % 2 then editor does not act as author + % 3 then key should have been used + % 0 then unknown reference type + ref.type #2 = + { % + % Format first author with and without initials + author empty$ + { title.sort.label definitive.cite.no.names } + { author definitive.cite.num.names.field } + if$ + } + { % + % Format first author with and without initials + author empty$ + { editor empty$ + { title.sort.label definitive.cite.no.names } + { editor definitive.cite.num.names.field } + if$ + } + { author definitive.cite.num.names.field } + if$ + } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.tentative.year.sort.label} +{ % + % Implicit or explicit ``no date'' is put at the front + % (the year zero; years B.C. will imply complications) + % because these are possibly old works. + % ``In press'' is put at the end. + % + year empty$ + { "0000" 'year.label := } + { year "\bibnodate" = + year "l" change.case$ "no date" = or + year "l" change.case$ "n.d." = or + { "0000" 'year.label := } + { year "\BIP" = + year "l" change.case$ "in press" = or + year "l" change.case$ "forthcoming" = or + { "9999" 'year.label := } + { % It is not checked whether the year field + % makes sense. + year sortify remove.spaces 'year.label := + } + if$ + } + if$ + } + if$ + % + % Push year sort label on the stack + year.label +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {month.number.day} +{ month empty$ + { "" } + { month sortify remove.spaces + % + % Add the day when available. + day empty$ + 'skip$ + { "/" * + day sortify remove.spaces * + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.name.sort.label} +{ % + % Author or editor-acting-as-author available. + % => Make tentative "short cite with initials" author + % label (L1) of one of the forms + % "Last1 F1" + % "Last1 F1 Last2" + % "Last1 F1 zzzz" ("zzzz" representing et al.) + % => If more than 2 'authors': make label (L2) for 2nd-6th authors + % of one of the forms + % "Last2 Last3" + % "Last2 Last3 Last4" + % "Last2 Last3 Last4 Last5" + % "Last2 Last3 Last4 Last5 Last6" + % "Last2 Last3 Last4 Last5 Last6 zzzz" + % + % Then format year label (L3) of one of the forms: + % "0000" (missing year or explicit 'no date') + % "9999" ('in press') + % year (otherwise; don't use originalyear here yet) + % + % From earlier sorting of titles, we have title number. Convert + % to string, which gives title label (L4) . + % + % Then tentative sorting label (author.year.sort.label) is a + % concatenation of + % L1 + % " " + % L3 + % " " + % L2 + % " " + % L4 + % + % The name field is on top of the stack. + 'field := + % + % numnames is the total number of names contained in field + field num.names$ 'numnames := + % + % Format first author + field #1 sort.name.format format.name$ + % + % Format the second author if there are two, or else "zzzz" = et al. + numnames #1 = + 'skip$ + { numnames #2 = + { % + % Two authors: format second author + field #2 "{ll{}}" format.name$ 's := + s "others" = + { " zzzz" * } % Add "et al."-substitute + { " " * s * } % Add second author + if$ + } + { " zzzz" * } % 3 or more authors: add "et al."-substitute + if$ + } + if$ + " " * % Add spaces + make.tentative.year.sort.label * % Add year (L3). + " " * % Add spaces + % + % Now build up L2 if applicable + numnames #3 < + 'skip$ + { % + % Treat last author slightly differently + numnames name.max > + { name.max 'lastname := + " zzzz" % Push "et al."-substitute on stack + } + { numnames 'lastname := + "" % Push empty string on stack + } + if$ + % + % Names 2 to "last" - 1 + "" % Push empty string on stack + #2 'nameptr := + { nameptr lastname < } + { % Add name no. nameptr + field nameptr "{ll{}}" format.name$ * + " " * + nameptr #1 + 'nameptr := + } + while$ + % + % "Last" author + field lastname "{ll{}}" format.name$ 's := + s "others" = + { "zzzz" * } % Add "et al."-substitute + { s * } % Add last author + if$ + % + swap$ * % Add the previously formatted empty string or + % "et al."-substitute if there are many authors. + * % Add L2 to the earlier labels. + } + if$ + % + " " * % Add spaces + title.number conv.int.to.str * % Add sorted title number (L4). + sortify % Clean up and convert to lowercase + " " * % Add spaces + month.number.day * % Add month and day when available + 'author.year.sort.label := % Assign result to sort label. +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.field.year.sort.label} +{ % + % 'field' acts as first author (L1), subsequent authors + % are empty (L2). + % + % Then format year label (L3) of one of the forms: + % "0000" (missing year or explicit 'no date') + % "9999" ('in press') + % year (otherwise; don't use originalyear here yet) + % + % From earlier sorting of titles, we have title number. Convert + % to string, which gives title label (L4) . + % + % Then tentative sorting label (author.year.sort.label) is a + % concatenation of + % L1 + % " " + % L3 + % " " + % L2 + % " " + % L4 + % + % 'field' is on top of the stack. It is already supposed to be cleaned + % (i.e., sortified and space-removed), so this is already L1. + " " * % Add spaces to L1 + make.tentative.year.sort.label * % Add year (L3). + " " * % Add spaces + " " * % L2 is empty, add spaces + title.number conv.int.to.str * % Add sorted title number (L4). + sortify % Clean up and convert to lowercase + " " * % Add spaces + month.number.day * % Add month and day when available + 'author.year.sort.label := % Assign result to sort label. +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.author.editor.sort.label} +{ author empty$ + { editor empty$ + { % + % Use what has previously been stored in title.sort.label + % as author substitute . + title.sort.label make.field.year.sort.label + } + { editor make.name.sort.label } + if$ + } + { author make.name.sort.label } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.author.sort.label} +{ author empty$ + { % + % Use what has previously been stored in title.sort.label + % as author substitute . + title.sort.label make.field.year.sort.label + } + { author make.name.sort.label } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.tentative.sort.label} +{ % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % General strategy: + % + % Ordinary situation: author or editor-acting-as-author + % available. + % => Make tentative "short cite with initials" author + % label (L1) of one of the forms + % "Last1 F1" + % "Last1 F1 Last2" + % "Last1 F1 zzzz" ("zzzz" representing et al.) + % => If more than 2 'authors': make label (L2) for 2nd-6th authors + % of one of the forms + % "Last2 Last3" + % "Last2 Last3 Last4" + % "Last2 Last3 Last4 Last5" + % "Last2 Last3 Last4 Last5 Last6" + % "Last2 Last3 Last4 Last5 Last6 zzzz" + % When key is available (overrules author and editor fields): + % => L1 = key, L2 = "" + % No author, editor, and key: define title or substitute as key + % and format as key. + % + % Then format year label (L3) of one of the forms: + % "0000" (missing year or explicit 'no date') + % "9999" ('in press') + % year (otherwise; don't use originalyear here yet) + % + % From earlier sorting of titles, we have title number. Convert + % to string, which gives title label (L4) . + % + % Then tentative sorting label (author.year.sort.label) is a + % concatenation of + % L1 + % " " + % L3 + % " " + % L2 + % " " + % L4 + % + % This can then be sorted, from which it can be derived + % whether initials are necessary, how many names must + % be used for short and full citations, and whether "a"'s and + % "b"'s etc. are necessary behind the year labels. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % key and firstkey overrule author information + % + firstkey empty$ not + { key empty$ not + { % + % Both key and firstkey available: + % for sorting and checking initials, treat key as last + % name and firstkey as initials. + % + key sortify remove.spaces + " " * + firstkey sortify remove.spaces * + make.field.year.sort.label + } + { firstkey sortify remove.spaces make.field.year.sort.label } + if$ + } + { key empty$ not + { key sortify remove.spaces make.field.year.sort.label } + { % + % No key or firstkey, so find out which field + % to use as author. + % + % Check reference type: + % if result is 1 then possibly editor acts as author + % 2 then editor does not act as author + % 3 then key should have been used + % 0 then unknown reference type + ref.type + duplicate$ #1 = + { pop$ + make.author.editor.sort.label + } + { duplicate$ #2 = + { pop$ + make.author.sort.label + } + { #3 = + { "no key in " cite$ * warning$ + make.author.editor.sort.label + } + { make.author.editor.sort.label } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + % + author.year.sort.label 'sort.key$ := +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.definitive.name.sort.label} +{ % + % Author or editor-acting-as-author available. + % => Make author-with-initials label (L1) of one of the forms + % "Last1 F1 Last2 F2 ... LastN FN" + % "Last1 F1 Last2 F2 ... Last6 F6 zzzz" + % (where N <= 6 is the total number of authors, and + % "zzzz" represents et al. if there are more than 6 authors) + % No author, editor, and key: define title or substitute as sort key. + % + % The name field is on top of the stack. + 'field := + % + % numnames is the total number of names contained in field + field num.names$ 'numnames := + % + % If there are more than 6 authors, only 6 are mentioned. + numnames name.max > + { name.max 'format.num.names := } + { numnames 'format.num.names := } + if$ + % Initialize stack with empty string + "" + % + % Cycle over authors. + #1 'nameptr := + { nameptr format.num.names < } + { % Format author and add spaces + field nameptr sort.name.format format.name$ * + " " * + nameptr #1 + 'nameptr := + } + while$ + % Format last author that must be formatted + field nameptr sort.name.format format.name$ * + % Add et al. if necessary + nameptr numnames < + { " zzzz" * } + 'skip$ + if$ + sortify % Clean up and change case + " " * % Add spaces + year.label * % Add year + " " * % Add spaces + title.number conv.int.to.str * % Add sorted title number + " " * % Add spaces + month.number.day * % Add month and day when available + 'author.year.sort.label := % Assign result to sort label. +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.definitive.field.year.sort.label} +{ % + % 'field' acts as author (L1). + % + % Then format year label (L2) of one of the forms: + % "0000" (missing year or explicit `no date') + % "9999" (`in press') + % year (otherwise; don't use originalyear here yet) + % + % From earlier sorting of titles, we have title number. Convert + % to string, which gives title label (L3) . + % + % Then tentative sorting label (author.year.sort.label) is a + % concatenation of + % L1 + % " " + % L2 + % " " + % L3 + % + % 'field' is on top of the stack. It is already supposed to be cleaned + % (i.e., sortified and space-removed), so this is already L1. + " " * % Add spaces + year.label * % Add year + " " * % Add spaces + title.number conv.int.to.str * % Add sorted title number + " " * % Add spaces + month.number.day * % Add month and day when available + 'author.year.sort.label := % Assign result to sort label. +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.definitive.author.editor.sort.label} +{ author empty$ + { editor empty$ + { % + % Use what has previously been stored in title.sort.label + % as author substitute . + title.sort.label make.definitive.field.year.sort.label + } + { editor make.definitive.name.sort.label } + if$ + } + { author make.definitive.name.sort.label } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.definitive.author.sort.label} +{ author empty$ + { % + % Use what has previously been stored in title.sort.label + % as author substitute . + title.sort.label make.definitive.field.year.sort.label + } + { author make.definitive.name.sort.label } + if$ +} +FUNCTION {make.final.sort.key} +{ ref.type #2 = + { make.definitive.author.sort.label } + { make.definitive.author.editor.sort.label } + if$ + unsorted + { citeorder.sort.label 'sort.key$ := } + { author.year.sort.label 'sort.key$ := } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + { s } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {chop.articles} +{ 's := + "a " #2 + "an " #3 + "the " #4 + s + chop.word + chop.word + chop.word +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.sort.title} +{ % + % Remove non-alphanumeric characters and change to lower case . + sortify + % + % Remove "a ", "an ", and "the " from the front . + chop.articles #1 entry.max$ substring$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.sort.title} +{ title empty$ + { text empty$ + { type empty$ + { howpublished empty$ + { note empty$ + { url empty$ + { " " } + { url format.sort.title } + if$ + } + { note format.sort.title } + if$ + } + { howpublished format.sort.title } + if$ + } + { type format.sort.title } + if$ + } + { text format.sort.title } + if$ + } + { title format.sort.title } + if$ + remove.spaces + 'title.sort.label := + title.sort.label 'sort.key$ := +} +FUNCTION {make.title.number} +{ title.sort.label old.label = + { + old.number 'title.number := + } + { + old.number #1 + 'title.number := + title.number 'old.number := + title.sort.label 'old.label := + } + if$ +} +FUNCTION {make.citeorder.number} +{ old.number #1 + 'cite.order := + cite.order 'old.number := + cite.order conv.int.to.str 'citeorder.sort.label := +} + +FUNCTION {last.part.name.format.classic} { "{ll}" } + +FUNCTION {von.junior.name.format.classic} { "{ vv}{, jj}" } + +FUNCTION {last.part.name.format} { "{vv }{ll}" } + +FUNCTION {initials.with.space.name.format} { "{f.}" } + +FUNCTION {von.last.junior.name.format} { "{vv }{ll}{ jj}" } + +FUNCTION {von.junior.name.format} { "{, jj}" } + +FUNCTION {one.complete.name.format} { "{vv }{ll}{, jj}{, ff}" } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {string.length} +{ #0 'pos := + % If the next character exists, i.e., is not empty, + % add 1 to the string length. + % We cannot use empty$ because " " empty$ is true. + { duplicate$ pos #1 + #1 substring$ "" = not } + { pos #1 + 'pos := } + while$ + pop$ pos +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {transform.spaces.and.hyphens} +{ 's := % The original string + s string.length 'len := % Its length (no. of characters) + "" 't := % Initialize the transformed string + #1 'pos := + #0 'brace.level := + % + % while (pos < len) do + % + { pos len < } + { % First, check whether we are at brace level 0 + brace.level #0 = + { + % At least two characters left: check for ". ", ".~", and ".-". + % If so, replace and shift two positions. + s pos #2 substring$ ". " = + s pos #2 substring$ ".~" = or + { t "." * 't := + pos #2 + 'pos := + } + { s pos #2 substring$ ".-" = + { t "\BHBI " * 't := + pos #2 + 'pos := + } + { % neither is true, copy one character and shift one position + t s pos #1 substring$ * 't := + % Check whether we need to increase brace level. + % Note that this is not sophisticated: it does not capture + % \{, \verb+}+, etc. + % Note also that unbalanced braces cause problems. + s pos #1 substring$ "{" = + { brace.level #1 + 'brace.level := } + 'skip$ + if$ + pos #1 + 'pos := + } + if$ + } + if$ + } + { % Not at brace level 0: copy result literally + t s pos #1 substring$ * 't := + % Check whether we need to increase or decrease brace level. + % Note that this is not sophisticated: it does not capture + % \{, \verb+}+, etc. + s pos #1 substring$ "{" = + { brace.level #1 + 'brace.level := } + { s pos #1 substring$ "}" = + { brace.level #1 - 'brace.level := } + 'skip$ + if$ + } + if$ + pos #1 + 'pos := + } + if$ + } + while$ + % + pos len = + { % Last character, copy + t s pos #1 substring$ * 't := + } + { % pos = len + 1, so s ends with ". " or ".-" + % This should not have happened, but make the best out of it. + % Push last two characters of s on the stack, i.e., ". " or ".-". + s len #1 - #2 substring$ + % Remove "\BPBI " or "\BHBI " from t + t text.length$ 'len := % Length of t (no. of characters) + t #1 len #6 - substring$ + % Concatenate and assign to t + swap$ * 't := + } + if$ + % + % Now push the result back on the stack + t +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.initials.with.hyphen} +{ % Format initials. + % Call with + % field authornumber format.initials.with.hyphen + % e.g. + % author #1 format.initials.with.hyphen + % Instead of field, a string may also be used. + % + % First, format initials in the default way, retaining spaces + % and hyphens. + initials.with.space.name.format format.name$ + transform.spaces.and.hyphens +} + +FUNCTION {format.last.part.name} +{ % Format a name with last.part.name.format, + % as part of more complicated things. + % Call with + % field authornumber format.last.part.name + % e.g. + % author #1 format.last.part.name + % Instead of field, a string may also be used. + last.part.name.format format.name$ +} + +FUNCTION {format.von.last.junior.name} +{ % Format a name with von.last.junior.name.format, + % for citing or as part of more complicated things. + % Call with + % field authornumber format.von.last.junior.name + % e.g. + % author #1 format.von.last.junior.name + % Instead of field, a string may also be used. + von.last.junior.name.format format.name$ +} + +FUNCTION {format.von.junior.name} +{ % Format a name with von.last.junior.name.format, + % for citing or as part of more complicated things. + % Call with + % field authornumber format.von.junior.name + % e.g. + % author #1 format.von.junior.name + % Instead of field, a string may also be used. + von.junior.name.format format.name$ +} + +FUNCTION {format.cite.initials.name} +{ % Format a name for citing with initials. + % Call with + % field authornumber format.cite.initials.name + % e.g. + % author #1 format.cite.initials.name + % Instead of field, a string may also be used. + % + % First, extract the complete name, format it in the canonical form, + % and push on the stack. + one.complete.name.format format.name$ + % + % Format the initials and push on the stack. + duplicate$ #1 format.initials.with.hyphen + % + % Format the von-last-junior part and push on the stack. + swap$ #1 format.von.last.junior.name + % + % Connect with "~" hyphen (if they're both non-empty). + "~" connect.check +} + +FUNCTION {format.author.name} +{ % Format an author name for the reference list. + % Call with + % field authornumber format.author.name + % e.g. + % author #1 format.author.name + % Instead of field, a string may also be used. + % + % First, extract the complete name, format it in the canonical form, + % and push on the stack. + one.complete.name.format format.name$ + % + % Make two copies of the name, format the last name and push on the stack. + duplicate$ duplicate$ #1 format.last.part.name + % + % Format the initials and push on the stack. + swap$ #1 format.initials.with.hyphen + % + % Connect with last name. + connect.with.comma.check + % + % Format the von-junior part and connect with initials. + swap$ #1 format.von.junior.name "" connect.check +} + +FUNCTION {format.editor.name} +{ % Format a name for the reference list as an editor. + % Call with + % field authornumber format.editor.name + % e.g. + % author #1 format.editor.name + % Instead of field, a string may also be used. + % + format.cite.initials.name +} + +FUNCTION {format.index.name} +{ % Format an author name for the index. + % Call with + % field authornumber format.index.name + % e.g. + % author #1 format.index.name + % Instead of field, a string may also be used. + % + format.author.name +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FUNCTION {comma.between.two} { "\BCBT {}" } + +FUNCTION {comma.between.names} { ", " } + +FUNCTION {comma.before.last} { "\BCBL {}" } + +FUNCTION {dots.before.last} { "\BDBL {}" } + +FUNCTION {and.before.last} { "\ \BBA {} " } + +FUNCTION {no.and.before.last} { " " } + +FUNCTION {et.al.string.cite} { "\ \protect \BOthers {.}" } + +FUNCTION {et.al.string} { "\ \BOthers {.}" } + +FUNCTION {et.al.string.period} { "\ \BOthersPeriod {.}" } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {add.name.index} +{ % + % + make.index + { "%" * write$ newline$ + % Check for corporate author + field is.bibcorporate + { "\corporateAX{" } + { "\AX{" } + if$ + write$ + field nameptr sort.name.format format.name$ sortify write$ newline$ + "@" write$ + field nameptr format.index.name + "}%" * write$ newline$ + } + { "%" * write$ newline$ } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.name.cite.label} +{ 'field := + 'format.num.names := + % + field num.names$ 'numnames := % numnames is the total number of names + % contained in field + % + % It is implicit in the APA manual that if "et al." would refer + % to exactly one author, then this author should be named + % instead of "et al." + % + format.num.names numnames #1 - = + { numnames 'format.num.names := } + 'skip$ + if$ + % + % Format first author: with or without initials + % + #1 'nameptr := + cite.initials #1 = + { field nameptr format.cite.initials.name } + { field nameptr cite.name.format format.name$ } + if$ + add.name.index % Add index entry when desired. + % + numnames #1 = + 'skip$ + { format.num.names #1 = + { % + % First author et al. + % + et.al.string.cite write$ + } + { numnames #2 = + { % + % Given that format.num.names > 1, it is 2. + % Format second author. + % + #2 'nameptr := + field nameptr cite.name.format format.name$ 's := + % + % Check if 2nd author is explicit "others". + % If so, insert "et al." string. + % + s "others" = + { et.al.string.cite write$ } % First et al. + { % + % First \& Second + % + and.before.last write$ + s + add.name.index % Add index entry when desired. + } + if$ + } + { % + % 3 or more names, 2 or more must be cited + % + % for nameptr := 2 to format.num.names - 1 do + % + #2 'nameptr := + { nameptr format.num.names < } + { % + % Put comma between consecutive authors + % + comma.between.names write$ + % + % Format and add next author + % + field nameptr cite.name.format format.name$ + add.name.index % Add index entry when desired. + % + % Move to next author + % + nameptr #1 + 'nameptr := + } + while$ + % + % nameptr = format.num.names + % Format this author. + % + field nameptr cite.name.format format.name$ 's := + % + format.num.names numnames = + { % + % This is also the last author. Add (optional) comma. + % + comma.before.last write$ + % + % Check if this author is explicit "others". + % If so, insert "et al." string. + % + s "others" = + { et.al.string.cite write$ } + { and.before.last write$ + s + add.name.index % Add index entry when desired. + } + if$ + } + { % + % This is not the last author. + % Add comma, author name, and "et al." + % + comma.between.names write$ + s + add.name.index % Add index entry when desired. + % + comma.before.last et.al.string.cite * write$ + } + if$ + } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.title.cite.label} +{ % + % Formatting: check if formatted as article title or + % as book title, and insert this formatting. + % + is.atype + { "\APACciteatitle {" } + { "\APACcitebtitle {" } + if$ + % + title empty$ + { text empty$ + { type empty$ + { howpublished empty$ + { note empty$ + { url empty$ + { cite$ } + { url } + if$ + } + { note } + if$ + } + { howpublished } + if$ + } + { type } + if$ + } + { text } + if$ + } + { title } + if$ + % + % Connect with formatting. + % + * "}" * + % + % Write to output + % + write$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.author.editor.cite.label} +{ author empty$ + { editor empty$ + { % + % No author or editor: + % Use title or other description as citation label. + % + make.title.cite.label + "}{%" write$ newline$ + make.title.cite.label + } + { cite.num.names.full editor make.name.cite.label + "}{%" write$ newline$ + cite.num.names.short editor make.name.cite.label + } + if$ + } + { cite.num.names.full author make.name.cite.label + "}{%" write$ newline$ + cite.num.names.short author make.name.cite.label + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.author.cite.label} +{ author empty$ + { % + % No author: + % Use title or other description as citation label. + % + make.title.cite.label + "}{%" write$ newline$ + make.title.cite.label + } + { cite.num.names.full author make.name.cite.label + "}{%" write$ newline$ + cite.num.names.short author make.name.cite.label + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.definitive.year.supplement} +{ % + % Add "a", "b", etc. when necessary. + % + add.to.year #0 = + { "" } + { "{\protect " + year empty$ + { "\BCntND " * } + { year "\bibnodate" = + year "l" change.case$ "no date" = or + year "l" change.case$ "n.d." = or + { "\BCntND " * } + { year "\BIP" = + year "l" change.case$ "in press" = or + year "l" change.case$ "forthcoming" = or + { "\BCntIP " * } + { "\BCnt " * } + if$ + } + if$ + } + if$ + "{" * add.to.year int.to.str$ * "}}" * + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {protect.year} +{ year empty$ + { "{\protect \bibnodate {}}" } + { year "\bibnodate" = + year "l" change.case$ "no date" = or + year "l" change.case$ "n.d." = or + { "{\protect \bibnodate {}}" } + { year "\BIP" = + year "l" change.case$ "in press" = or + year "l" change.case$ "forthcoming" = or + { "{\protect \BIP {}}" } + { year } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.definitive.year.label} +{ "{\protect \APACyear {" + originalyear empty$ + { protect.year } + { originalyear "\bibnodate" = % date of original publication unknown + originalyear "l" change.case$ "no date" = or + originalyear "l" change.case$ "n.d." = or + { translator empty$ + { protect.year } + { "{\protect \BTRANSL {}}~" protect.year * } + if$ + } + { year empty$ + { originalyear "/{\protect \bibnodate {}}" * } % 1923/n.d. + { originalyear year = + { protect.year } + { originalyear "/" * protect.year * } % 1923/1961 + if$ + } + if$ + } + if$ + } + if$ + * "}}%" * write$ newline$ + % + % Add "a", "b", etc. when necessary. + % + "{\protect \APACexlab {" "}}" + make.definitive.year.supplement enclose.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.cite.labels} +{ newline$ + % + % Write a few lines for testing purposes. + % + test + { "\bibitem [] {} \fullciteA {" cite$ * "}" * write$ newline$ + "\bibitem [] {} \citeA {" cite$ * "}" * write$ newline$ + } + 'skip$ + if$ + % + "\bibitem [\protect \citeauthoryear {%" write$ newline$ + % + % When key or firstkey is available, this takes precedence. + % + firstkey empty$ not + { % + % Full cite: firstkey. + % + firstkey write$ + "}{%" write$ newline$ + % + % Short cite: if key is not empty and cite.initials is 0, + % then key, else firstkey. + % + cite.initials #0 = + key empty$ not + and + { key } + { firstkey } + if$ + write$ + } + { key empty$ not + { % + % No firstkey, but key available: + % Both full and short labels are key. + % + key write$ + "}{%" write$ newline$ + key write$ + } + { % No key or firstkey, so find out which field + % to use as author. + % + % Check reference type: + % if result is 1 then possibly editor acts as author + % 2 then editor does not act as author + % 3 then key should have been used + % 0 then unknown reference type + ref.type #2 = + { make.author.cite.label } + { make.author.editor.cite.label } + if$ + } + if$ + } + if$ + "}{%" write$ newline$ + % + % Make year label that's used for citations + % + make.definitive.year.label write$ + "}]{%" write$ newline$ + cite$ write$ + "} " write$ newline$ + % author.year.sort.label write$ newline$ % for testing purposes + % year.label write$ newline$ % for testing purposes + % + % If the item is used in a meta-analysis, indicate this with + % a star. + % + "\APACinsertmetastar {%" write$ newline$ + cite$ write$ + "}%" write$ newline$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {editor.postfix} +{ editor num.names$ #1 > + { "(\BEDS)" } + { "(\BED)" } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {editor.trans.postfix} +{ editor num.names$ #1 > + { "(\BEDS{} \BAnd{} \BTRANSS)" } + { "(\BED{} \BAnd{} \BTRANS)" } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % "(Trans.)" postfix + % translator must not be empty + % +FUNCTION {trans.postfix} +{ translator num.names$ #1 > + { "(\BTRANSS)" } + { "(\BTRANS)" } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {authors.editors.reflist.apa5} +{ 'field := + 'dot := + % + field num.names$ 'numnames := % numnames is the total number of names + % contained in field + numnames 'format.num.names := % Format all authors + format.num.names name.max > % Unless this exceeds the maximum of 6. + { dot + { name.max 'format.num.names := } % Format 6 authors + { cite.num.names.full 'format.num.names := } % Format 1 editor + if$ + } + 'skip$ + if$ + % + % Enclose authors in APACrefauthors environment to allow crude style + % options in \LaTeX. + "\begin{APACrefauthors}%" + write$ newline$ + % + % It is kind of explicit in the APA manual that if "et al." would + % refer to exactly one author (the 7th), then this author should + % still be replaced by "et al.", unlike with citations. + % So format.num.names is not adapted. + % + % Format first author + % + #1 'nameptr := + field nameptr format.author.name + % + % Add period if required and if this is the only author. + % + numnames #1 = + dot + and + { add.period$ } + 'skip$ + if$ + add.name.index % Add index entry when desired. + % + numnames #1 = + 'skip$ + { format.num.names #1 = + { % + % First author et al. + % + comma.between.two + % + % Add period if required. + % + dot + { et.al.string.period * } + { et.al.string * } + if$ + write$ + } + { numnames #2 = + { % + % Given that format.num.names > 1, it is 2. + % + comma.between.two write$ + % + % Format second author. + % + #2 'nameptr := + field nameptr format.author.name 's := + % + % Check if 2nd author is explicit "others". + % If so, insert "et al." string. + % + s "others" = + { % + % First et al. + % Add period if required. + % + dot + { et.al.string.period } + { et.al.string } + if$ + write$ + } + { % + % First \& Second + % + and.before.last write$ + % + % Add period if required. + % + dot + { s add.period$ } + { s } + if$ + add.name.index % Add index entry when desired. + } + if$ + } + { % + % 3 or more names, 2 or more must be cited + % + % for nameptr := 2 to format.num.names - 1 do + % + #2 'nameptr := + { nameptr format.num.names < } + { % + % Put comma between consecutive authors + % + comma.between.names write$ + % + % Format and add next author + % + field nameptr format.author.name + add.name.index % Add index entry when desired. + % + % Move to next author + % + nameptr #1 + 'nameptr := + } + while$ + % + % nameptr = format.num.names + % Format this author. + % + field nameptr format.author.name 's := + % + format.num.names numnames = + { % + % This is also the last author. Add (optional) comma. + % + comma.before.last write$ + % + % Check if this author is explicit "others". + % If so, insert "et al." string. + % + s "others" = + { % + % Add period if required. + % + dot + { et.al.string.period } + { et.al.string } + if$ + write$ + } + { and.before.last write$ + % + % Add period if required. + % + dot + { s add.period$ } + { s } + if$ + add.name.index % Add index entry when desired. + } + if$ + } + { % + % This is not the last author. + % Add comma, author name, and "et al." + % + comma.between.names write$ + s + add.name.index % Add index entry when desired. + % + comma.before.last + % + % Add period if required. + % + dot + { et.al.string.period * } + { et.al.string * } + if$ + write$ + } + if$ + } + if$ + } + if$ + } + if$ + % + % End APACrefauthors environment. + "\end{APACrefauthors}%" + write$ newline$ +} + +FUNCTION {authors.reflist.apa6} +{ 'field := + 'dot := + field num.names$ 'numnames := + numnames #7 > + { #7 'format.num.names := } + { numnames 'format.num.names := } + if$ + "\begin{APACrefauthors}%" + write$ newline$ + #1 'nameptr := + field nameptr format.author.name + numnames #1 = + { dot + { %add.period$ +} + 'skip$ + if$ + add.name.index + } + { add.name.index + numnames #2 = + { comma.between.two write$ + #2 'nameptr := + field nameptr format.author.name 's := + s "others" = + { "`others' not consistent with 6th ed. of the APA Manual" + warning$ + dot + { et.al.string.period } + { et.al.string } + if$ + write$ newline$ + } + { and.before.last write$ + dot + { s add.period$ } + { s } + if$ + add.name.index + } + if$ + } + { %% for nameptr := 2 to format.num.names - 1 do + #2 'nameptr := + { nameptr format.num.names < } + { comma.between.names write$ + field nameptr format.author.name + add.name.index + nameptr #1 + 'nameptr := + } + while$ + field numnames format.author.name 's := + format.num.names numnames = + { comma.before.last write$ + s "others" = + { "`others' not consistent with 6th ed. of the APA " + "Manual" * + warning$ + dot + { et.al.string.period } + { et.al.string } + if$ + write$ + } + { no.and.before.last write$ + dot + { s add.period$ } + { s } + if$ + add.name.index + } + if$ + } + { dots.before.last write$ + s + add.name.index + } + if$ + } + if$ + } + if$ + "\end{APACrefauthors}%" + write$ newline$ +} + +FUNCTION {format.author.names} +{ 'field := + 'dot := + dot + { dot field authors.reflist.apa6 } + { dot field authors.editors.reflist.apa5 } + if$ +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.authors} +{ #1 author format.author.names } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.editors.as.authors} +{ #0 editor format.author.names + "\ " editor.postfix * add.period$ write$ newline$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.ed.trans.as.authors} +{ #0 editor format.author.names + "\ " editor.trans.postfix * add.period$ write$ newline$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.editor.names} +{ 'field := + % + field num.names$ 'numnames := % numnames is the total number of names + % contained in field + numnames 'format.num.names := % Format all authors + format.num.names name.max > % Unless this exceeds the maximum of 6. + { #1 'format.num.names := } % Then it becomes 1 (First et al.) + 'skip$ + if$ + % + % Format first editor + % + field #1 format.editor.name + % + numnames #1 = + 'skip$ + { format.num.names #1 = + { et.al.string * } % First editor et al., no comma. + { numnames #2 = + { % + % Given that format.num.names > 1, it is 2. + % No comma. Format second editor. + % + field #2 format.editor.name 's := + % + % Check if 2nd editor is explicit "others". + % If so, insert "et al." string. + % + s "others" = + { et.al.string * } % First et al. + { and.before.last * s * } % First \& Second + if$ + } + { % + % 3 or more names, 2 or more must be cited + % + % for nameptr := 2 to format.num.names - 1 do + % + #2 'nameptr := + { nameptr format.num.names < } + { % + % Put comma between consecutive editors + % + comma.between.names * + % + % Format and add next editor + % + field nameptr format.editor.name * + % + % Move to next editor + % + nameptr #1 + 'nameptr := + } + while$ + % + % nameptr = format.num.names + % Format this editor. + % + field nameptr format.editor.name 's := + % + format.num.names numnames = + { % + % This is also the last editor. Add (optional) comma. + % + comma.before.last * + % + % Check if this editor is explicit "others". + % If so, insert "et al." string. + % + s "others" = + { et.al.string * } + { and.before.last * s * } + if$ + } + { % + % This is not the last editor. + % Add comma, editor name, and "et al." + % + comma.between.names * s * + comma.before.last * et.al.string * + } + if$ + } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format editors in case editors do not act as authors + % (such as reference to chapter in edited book) + % + % L. W. Poon (Ed.) (1 editor) + % or + % A. S. Gurman \& D. P. Kniskern (Eds.) (2 editors) + % or + % L. Poon, A. Jones, \& D. P. Smith (Eds.) (>2 editors) + % + % editor must not be empty + % +FUNCTION {format.editors.in.line} +{ editor format.editor.names + editor.postfix connect.with.space.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format editors in case editors are also translators + % and do not act as authors + % (such as reference to chapter in edited book + % of translated articles) + % + % L. W. Poon (Ed. and Trans.) (1 editor) + % or + % A. S. Gurman \& D. P. Kniskern (Eds. and Trans.) (2 editors) + % or + % L. Poon, A. Jones, \& D. P. Smith (Eds. and Trans.) (>2 editors) + % + % editor must not be empty + % +FUNCTION {format.editors.trans.in.line} +{ editor format.editor.names + editor.trans.postfix connect.with.space.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format translators in case translators act as editors + % (such as reference to chapter in translated book) + % + % L. W. Poon (Trans.) (1 translator) + % or + % A. S. Gurman \& D. P. Kniskern (Trans.) (2 translators) + % or + % L. Poon, A. Jones, \& D. P. Smith (Trans.) (>2 translators) + % + % translator must not be empty + % +FUNCTION {format.translators.in.line} +{ translator format.editor.names + trans.postfix connect.with.space.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format translators in case translator does not act as editor + % (such as reference to translated book) + % + % L. Solotaroff, Trans. + % +FUNCTION {format.translators.in.paren.check} +{ translator empty$ + { "" } + { translator format.editor.names + translator num.names$ #1 > + { ", \BTRANSS{}" * } + { ", \BTRANS{}" * } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format editors and translators in case neither act as editor + % (such as reference to edited or translated book with a + % a single author) + % + % L. Solotaroff, Ed. + % L. Solotaroff, Ed. \& Trans. + % L. Solotaroff, Trans. + % L. Solotaroff, Ed. \& S. Prokofieff, Trans. + % +FUNCTION {format.editors.translators.in.paren.check} +{ editor empty$ + { translator empty$ + { "" } + { translator format.editor.names + translator num.names$ #1 > + { ", \BTRANSS{}" * } + { ", \BTRANS{}" * } + if$ + } + if$ + } + { editor format.editor.names + editor num.names$ #1 > + { ", \BEDS{}" * } + { ", \BED{}" * } + if$ + translator empty$ + 'skip$ + { editor translator = + { editor num.names$ #1 > + { " \BAnd{} \BTRANSS" * } + { " \BAnd{} \BTRANS" * } + if$ + } + { " \BAnd{} " * + translator format.editor.names * + translator num.names$ #1 > + { ", \BTRANSS{}" * } + { ", \BTRANS{}" * } + if$ + } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % translator of article + % +FUNCTION {format.atrans.check} +{ format.translators.in.paren.check parenthesize.check } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format "In editor (Ed.), " + % +FUNCTION {format.in.editors} +{ "\BIn{} " + editor empty$ + 'skip$ + { format.editors.in.line * ", " * } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format "In translator (Trans.)," + % +FUNCTION {format.in.trans} +{ "\BIn{} " + translator empty$ + 'skip$ + { format.translators.in.line * ", " * } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format "In editor (Ed. and Trans.)" + % or "In editor (Ed.)" if editor not equal to translator + % +FUNCTION {format.in.editors.trans} +%{ "\BIn{} " Commented by SPI +{ " " + editor empty$ + { translator empty$ + 'skip$ + { format.translators.in.line * ", " * } + if$ + } + { translator empty$ + { format.editors.in.line * } + { editor translator = + { format.editors.trans.in.line * } + { format.editors.in.line * } + if$ + } + if$ + ", " * + } + if$ +} + +FUNCTION {in.format.in.editors.trans} +{ "\BIn{} " + editor empty$ + { translator empty$ + 'skip$ + { format.translators.in.line * ", " * } + if$ + } + { translator empty$ + { format.editors.in.line * } + { editor translator = + { format.editors.trans.in.line * } + { format.editors.in.line * } + if$ + } + if$ + ", " * + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.year.check} +{ "\APACrefYear{" + protect.year * + % + % Add "a", "b", etc. when necessary. + % + make.definitive.year.supplement * + "}" * +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.year.month.day.check} +{ "\APACrefYearMonthDay{" + protect.year * + % + % Add "a", "b", etc. when necessary. + % + make.definitive.year.supplement * + "}{" * + % + % Add month and day when present. + % + month empty$ + 'skip$ + { month * } + if$ + "}{" * + day empty$ + 'skip$ + { day * } + if$ + "}" * +} +FUNCTION {format.year.nomonth.day.check} +{ "\APACrefYearMonthDay{" + protect.year * + % + % Add "a", "b", etc. when necessary. + % + make.definitive.year.supplement * + "}{" * + % + % Add month and day when present. + % + month empty$ + 'skip$ + { } + if$ + "}{" * + day empty$ + 'skip$ + { day * } + if$ + "}" * +} + +FUNCTION {format.atitle.no.dot} +{ "{\BBOQ}" swap$ + "{\BBCQ}" swap$ + duplicate$ empty$ + 'skip$ + { duplicate$ + % Two arguments: Title twice: (1) don't change case; (2) change case + "\APACrefatitle {" swap$ * "} {" * swap$ + "t" change.case$ + * "}" * + } + if$ + enclose.check +} + +FUNCTION {format.atitle.dot} +{ "{\BBOQ}" swap$ + "{\BBCQ}" swap$ + duplicate$ empty$ + 'skip$ + { duplicate$ + % Two arguments: Title twice: (1) don't change case; (2) change case + "\APACrefatitle {" swap$ * "} {" * swap$ + "t" change.case$ + * "}" * add.period$ + } + if$ + enclose.check +} + +FUNCTION {format.atitle.connect} +{ swap$ + duplicate$ empty$ + { pop$ + format.atitle.dot + } + { swap$ + format.atitle.no.dot + swap$ connect.with.space.check + add.period$ + } + if$ +} + +FUNCTION {format.btitle.no.dot} +{ duplicate$ empty$ + { pop$ + "" + } + { duplicate$ + % Two arguments: Title twice: (1) don't change case; (2) change case + "\APACrefbtitle {" swap$ * "} {" * swap$ + "t" change.case$ + * "}" * + } + if$ +} + +FUNCTION {format.btitle.dot} +{ duplicate$ empty$ + { pop$ + "" + } + { add.period$ format.btitle.no.dot } + if$ +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title of book and similar + % field must be on top of stack + % second element on stack must be connected: + % if that is empty, then btitle.dot + % else btitle.no.dot, connect, and add period + % +FUNCTION {format.btitle.connect} +{ swap$ + duplicate$ empty$ + { pop$ + format.btitle.dot + } + { swap$ + format.btitle.no.dot + swap$ connect.with.space.check + add.period$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title of book and similar + % field must be on top of stack + % second element on stack must be connected + % +FUNCTION {format.btitle.connect.no.dot} +{ swap$ + duplicate$ empty$ + { pop$ + format.btitle.no.dot + } + { swap$ + format.btitle.no.dot + swap$ connect.with.space.check + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format englishtitle (of nonenglish article, etc.) + % +FUNCTION {format.aetitle.check} +{ englishtitle empty$ + { "" } + { % Two arguments: Title twice: (1) don't change case; (2) change case + "\APACrefaetitle {" englishtitle * "} {" * + englishtitle "t" change.case$ * "}" * + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format englishtitle (of nonenglish book, etc.) + % +FUNCTION {format.betitle.check} +{ englishtitle empty$ + { "" } + { % Two arguments: Title twice: (1) don't change case; (2) change case + "\APACrefbetitle {" englishtitle * "} {" * + englishtitle "t" change.case$ * "}" * + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format type (of article, etc.) + % +FUNCTION {format.atype.check} +{ type bracket.check } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format title and englishtitle (of article, etc.) + % +FUNCTION {format.atitle.check} +{ format.aetitle.check + title format.atitle.connect +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format title, englishtitle, and type + % (of article, etc.) + % +FUNCTION {format.atitle.type.check} +{ format.aetitle.check + format.atype.check connect.with.space.check + title format.atitle.connect +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format title, englishtitle, + % and translator (of article, etc.) + % +FUNCTION {format.atitle.trans.check} +{ format.aetitle.check + format.atrans.check connect.with.space.check + title format.atitle.connect +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format title, englishtitle, type, + % and translator (of article, etc.) + % +FUNCTION {format.atitle.type.trans.check} +{ format.aetitle.check + format.atype.check connect.with.space.check + format.atrans.check connect.with.space.check + title format.atitle.connect +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format journal, volume, number and pages + % call with + % formatted.pages format.journal.vol.num.pages.check + % +FUNCTION { format.journal.vol.num.pages.check } +{ "journal" journal warning.if.empty + duplicate$ empty$ + journal empty$ and + volume empty$ and + number empty$ and + { pop$ "" } + { "\APACjournalVolNumPages{" journal "" connect.check + "}{" * volume "" connect.check + "}{" * number "" connect.check + "}{" * swap$ "" connect.check + ",}" * + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % volume of book, checks whether + % "Volume" or "Volumes" + % + % call with + % field format.bvolume.check + % +FUNCTION {format.bvolume.check} +{ duplicate$ empty$ + 'skip$ + { duplicate$ multi.result.check + { "\BVOLS" swap$ tie.or.space.connect } + { "\BVOL" swap$ tie.or.space.connect } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % edition of book, must not be empty + % call with + % field format.edition.check + % +FUNCTION {format.edition.check} +{ duplicate$ empty$ + 'skip$ + { "\PrintOrdinal{" swap$ * "}" * + "\BEd" connect.with.space.check + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % volume and edition of book + % +FUNCTION {format.bvol.edition.check} +{ edition format.edition.check + volume format.bvolume.check + connect.with.comma.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % volume and edition of book + % +FUNCTION {format.bvol.edition} +{ format.bvol.edition.check + parenthesize.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % volume and edition and translator of translated book + % +FUNCTION {format.bvol.edition.trans} +{ format.bvol.edition.check + format.translators.in.paren.check connect.with.semicolon.check + parenthesize.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % volume, edition, editor, and translator of (translated) book + % +FUNCTION {format.bvol.edition.editor.trans} +{ format.bvol.edition.check + format.editors.translators.in.paren.check connect.with.semicolon.check + parenthesize.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % formats pages by first checking if 1 or more pages + % and prefixing pages with "p." or "pp." (these strings + % are given in the commands \BPG and \BPGS, respectively), + % whichever is applicable, and do a tie or space connect + % + % call with + % field format.bpages.check + % +FUNCTION {format.bpages.check} +{ duplicate$ empty$ + 'skip$ + { duplicate$ multi.result.check + { "\BPGS" swap$ tie.or.space.connect } + { "\BPG~" swap$ * } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % formats chapters by first checking if 1 or more chapters + % and prefixing pages with "chap." (this string + % is given in the commands \BCHAP and \BCHAPS, respectively), + % whichever is applicable, and do a tie or space connect + % + % call with + % field format.bchapter.check + % +FUNCTION {format.bchapter.check} +{ duplicate$ empty$ + 'skip$ + { duplicate$ multi.result.check + { "\BCHAPS" swap$ tie.or.space.connect } + { "\BCHAP" swap$ tie.or.space.connect } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % volume, edition, and pages or chapter of article in book etc. + % +FUNCTION {format.bvol.edition.pages} +{ format.bvol.edition.check + pages empty$ + { chapter format.bchapter.check connect.with.comma.check } + { pages format.bpages.check connect.with.comma.check } + if$ + parenthesize.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title, volume, edition of book + % +FUNCTION {format.btitle.vol.edition} +{ format.betitle.check + format.bvol.edition connect.with.space.check + title format.btitle.connect.no.dot +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title, volume, edition, and translator of book + % +FUNCTION {format.btitle.vol.edition.trans} +{ format.betitle.check + format.bvol.edition.trans connect.with.space.check + title format.btitle.connect.no.dot +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title, volume, edition, editor, and translator of book + % +FUNCTION {format.btitle.vol.edition.editor.trans} +{ format.betitle.check + format.bvol.edition.editor.trans connect.with.space.check + title format.btitle.connect.no.dot +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format address and publisher of book etc. + % + % New York: Wiley + % or + % Wiley (if address empty) + % or + % New York (if publisher empty) + % +FUNCTION {format.address.publisher} +{ % + % If publisher = author or publisher = "author" or publisher = "Author" + % then hand over the final choice how to format this to \LaTeX. + % (I could imagine similar code for editors, but the APA manual does + % not mention it and then we'd have to check whether the editor is in + % the author position, so let's keep it simple until someone complains.) + % + author empty$ + publisher empty$ or + { publisher "\APACaddressPublisher{" } + { author publisher = + "author" publisher = or + "Author" publisher = or + { author "\APACaddressPublisherEqAuth{" } + { publisher "\APACaddressPublisher{" } + if$ + } + if$ + address "" connect.check "}{" * + % Recover publisher that was pushed onto the stack previously. + swap$ "" connect.check "}" * +} + +FUNCTION {format.address.publisher.check} +{ publisher empty$ + address empty$ + and + 'skip$ + { + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.address.publisher + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format number as in reports: No. 2017 + % call with + % field format.rnumber.check + % +FUNCTION {format.rnumber.check} +{ duplicate$ empty$ + 'skip$ + { duplicate$ multi.result.check + { "\BNUMS" swap$ tie.or.space.connect } + { "\BNUM" swap$ tie.or.space.connect } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format type and number of a standalone item + % call with + % format.type.number + % +FUNCTION { format.type.number } +{ type empty$ + { type.2 } + { type } + if$ + number empty$ + { bracket.check } + { number format.rnumber.check connect.with.space.check + parenthesize.check + } + if$ +} + +FUNCTION {format.howpublished} +{ howpublished empty$ + 'skip$ + { % clear the stack + duplicate$ empty$ + 'pop$ + { output.dot.new.block } + if$ + "\APAChowpublished {" howpublished * "}" * + } + if$ +} +FUNCTION {output.howpublished} +{ howpublished empty$ + 'skip$ + { "\APAChowpublished {" howpublished * "}" * + output.dot.new.block + } + if$ +} +FUNCTION {howpublished.block} +{ howpublished empty$ + 'skip$ + { start.new.block + "\APAChowpublished {" howpublished * "}" * + output.dot.end.block + } + if$ +} +FUNCTION {begin.end.url.env} +{ "\begin{APACrefURL} " + lastchecked empty$ + { urldate empty$ + 'skip$ + { "[{" * urldate * "}]" * } + if$ + } + { "[{" * lastchecked * "}]" * } + if$ + " \end{APACrefURL} " +} + +FUNCTION {begin.end.doi.env} +{ "\begin{APACrefDOI} " + " \end{APACrefDOI} " +} + +FUNCTION {begin.end.msg.env} +{ "\begin{APACrefURLmsg} " + " \end{APACrefURLmsg} " +} +FUNCTION {format.url} +{ type.2 empty$ + { begin.end.url.env } + { type.2 "\bibmessage" = + { begin.end.msg.env } + { begin.end.url.env } + if$ + } + if$ +%%"\url{" url * "}" * + "{" url * "}" * + enclose.check +} +FUNCTION {url.block} +{ doi empty$ + { url empty$ + 'skip$ + { start.new.block + format.url + output.end.block + } + if$ + } + 'skip$ + if$ +} +FUNCTION {format.doi} +{ begin.end.doi.env + "\doi{" doi * "}" * + enclose.check +} +FUNCTION {doi.block} +{ doi empty$ + 'skip$ + { start.new.block + format.doi + output.end.block + } + if$ +} +FUNCTION {format.note} +{ "\APACrefnote{" "}" note enclose.check } +FUNCTION {note.block} +{ note empty$ + 'skip$ + { start.new.block + format.note + output.end.block + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format original year of publication and note + % (reprint or translation) + % +FUNCTION {format.orig.year.note} +{ originalyear empty$ + { format.note } + { "\APACorigyearnote{" + originalyear "" connect.check "}{" * + note "" connect.check "}" * + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format original journal of publication and note + % (reprint or translation) + % +FUNCTION {format.orig.journal.note} +{ "\APACorigjournalnote{" + originalyear "" connect.check "}{" * + originaljournal "" connect.check "}{" * + originalvolume "" connect.check "}{" * + originalnumber "" connect.check "}{" * + originalpages "" connect.check "}{" * + note "" connect.check "}" * +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format original book of publication and note + % (reprint or translation) + % +FUNCTION {format.orig.book.note} +{ "\APACorigbooknote{" originalyear "" connect.check "}{" * + % + originaleditor empty$ + 'skip$ + { originaleditor num.names$ #1 > + { "\APACorigEDS {" * originaleditor format.editor.names * "}" * } + { "\APACorigED {" * originaleditor format.editor.names * "}" * } + if$ + } + if$ + % + "}{" * + originalbooktitle format.btitle.no.dot "" connect.check "} {" * + originaledition format.edition.check "" connect.check "} {" * + originalvolume format.bvolume.check "" connect.check "} {" * + originalpages format.bpages.check "" connect.check "} {" * + originaladdress "" connect.check "} {" * + originalpublisher "" connect.check "} {" * + note "" connect.check "}" * +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format information about original publication of reprint + % and format optional note + % +FUNCTION {format.orig.note} +{ originaljournal empty$ + { originalbooktitle empty$ + { note empty$ + { originalyear empty$ + 'skip$ + { originalyear "\bibnodate" = + originalyear "l" change.case$ "no date" = or + originalyear "l" change.case$ "n.d." = or + 'skip$ + { output.new.block + format.orig.year.note + } + if$ + } + if$ + } + { output.new.block + format.orig.year.note + } + if$ + } + { output.new.block + format.orig.book.note + } + if$ + } + { output.new.block + format.orig.journal.note + } + if$ +} +FUNCTION {fin.entry} +{ %doi empty$ + % 'skip$ + % { output.new.block + % format.doi + % } + % if$ + output.end.block + "\PrintBackRefs{\CurrentBib}" write$ newline$ + test + { "\vspace{\baselineskip}" write$ newline$ } + 'skip$ + if$ +} +FUNCTION {fin.entry.2} +{ doi.block + "\PrintBackRefs{\CurrentBib}" write$ newline$ + test + { "\vspace{\baselineskip}" write$ newline$ } + 'skip$ + if$ +} + +FUNCTION {format.archive} +{ + archivePrefix empty$ + { "" } + { archivePrefix ":" *} + if$ +} + +FUNCTION {format.primaryClass} +{ + primaryClass empty$ + { "" } + { " {[" primaryClass * "]}" *} + if$ +} + +FUNCTION {format.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + { "{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {format.softmisc.archive} +{ + archivePrefix empty$ + { "" } + { "" } + if$ +} + +FUNCTION {format.softmisc.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {periodical} +{ + author empty$ + % + % no author: possibly special issue with editors as authors + % (APA manual, ex. 11, p. 121) + % + { editor empty$ + % + % no author or editor: title serves as author. + % title formatted as article title (APA manual not consistent in this, + % compare statement on p. 119: ``treat as book title'' and + % example 8, p. 121: no underlining => article title) + % + { format.atitle.type.trans.check output.new.block + % + % now formatted date on top of stack + % + output.dot.new.block + } + % + % format editor and year, and check if year is present + % format article title and check if title or type present + % + { format.editors.as.authors start.new.block + % + % now formatted date on top of stack + % + output.dot.new.block + format.atitle.type.trans.check output.new.block + } + if$ + } + % + % format author and year, and check if year is present + % format article title and check if title or type present + % + { format.authors start.new.block + % + % now formatted date on top of stack + % + output.dot.new.block + format.atitle.type.trans.check output.new.block + } + if$ + % + % format journal name, volume and issue number, and pages + % and check if journal not empty + % + format.journal.vol.num.pages.check +% output.new.block + doi empty$ + 'skip$ + { output.new.block + format.doi + } + if$ + % + % if not empty, insert howpublished. + % (used if article is retrieved from the internet) + % +% format.howpublished add.period$ + % + % format url + % + url empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + % + % possible reprint and optional note + % + format.orig.note + output.new.block + format.eprint + output.new.block + format.primaryClass + fin.entry + } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % journal article + % +FUNCTION {article} +{ pages format.year.month.day.check periodical } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % magazine article + % +FUNCTION {magazine} +{ pages format.year.month.day.check periodical } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % newspaper article + % +FUNCTION {newspaper} +{ pages format.bpages.check format.year.month.day.check periodical } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % (translation of) entire book + % +FUNCTION {book} +{ % + % author or editor, + % year, title, englishtitle, translator + % + author empty$ + % + % no author: possibly edited book with editors as authors + % + { editor empty$ + % + % no author or editor: title serves as author. + % title formatted as book title + % + { format.btitle.vol.edition.trans + format.type.number connect.with.space.check + output.dot.new.block + format.year.check add.period$ + } + % + % format editor and year, and check if year is present + % format booktitle, volume, and edition and check if title present + % + { translator empty$ + { format.editors.as.authors start.new.block + format.year.check output.dot.new.block + format.btitle.vol.edition + } + % + % format translator correctly + % + { translator editor = + not + { format.editors.as.authors start.new.block + format.year.check output.dot.new.block + format.btitle.vol.edition.trans + } + { format.ed.trans.as.authors start.new.block + format.year.check output.dot.new.block + format.btitle.vol.edition + } + if$ + } + if$ + format.type.number connect.with.space.check + add.period$ + } + if$ + } + % + % format author and year, and check if year is present + % format booktitle, volume, and edition and check if title present + % + { format.authors start.new.block + format.year.check output.dot.new.block + format.btitle.vol.edition.editor.trans + format.type.number connect.with.space.check + add.period$ + } + if$ + % + % format address and publisher + % + format.address.publisher.check + % + % if not empty, insert howpublished. + % (used if book is retrieved from the internet) + % + format.howpublished add.period$ + % + % format url + % + url empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + % + % format original publication (of reprint/translation) + % and optional note + % + format.orig.note + fin.entry +} +FUNCTION {incollection} +{ author empty$ + { editor.ne.trans + { format.atitle.type.trans.check } + { format.atitle.type.check } + if$ + output.new.block + format.year.month.day.check add.period$ + } + { format.authors start.new.block + format.year.month.day.check output.dot.new.block + editor.ne.trans + { format.atitle.type.trans.check } + { format.atitle.type.check } + if$ + } + if$ + editor empty$ + translator empty$ and + edition empty$ and + volume empty$ and + pages empty$ and + chapter empty$ and + booktitle empty$ and + 'skip$ + { + output.new.block + format.in.editors.trans + format.bvol.edition.pages + booktitle format.btitle.connect * add.period$ + } + if$ + format.address.publisher.check + format.howpublished add.period$ + url empty$ + 'skip$ + { + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + format.orig.note + fin.entry +} + +FUNCTION {inbookcollection} +{ author empty$ + { editor.ne.trans + { format.atitle.type.trans.check } + { format.atitle.type.check } + if$ + output.new.block + format.year.month.day.check add.period$ + } + { format.authors start.new.block + format.year.month.day.check output.dot.new.block + editor.ne.trans + { format.atitle.type.trans.check } + { format.atitle.type.check } + if$ + } + if$ + editor empty$ + translator empty$ and + edition empty$ and + volume empty$ and + pages empty$ and + chapter empty$ and + booktitle empty$ and + 'skip$ + { + output.new.block + in.format.in.editors.trans + format.bvol.edition.pages + booktitle format.btitle.connect * add.period$ + } + if$ + format.address.publisher.check + format.howpublished add.period$ + url empty$ + 'skip$ + { + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + format.orig.note + fin.entry +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % technical report number + % +FUNCTION {format.tr.number} +{ type empty$ + { "\BTR{}" } + { type "\bibnotype" = + { "" } + { type } + if$ + } + if$ + number format.rnumber.check connect.with.space.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title, volume, edition, report number + % +FUNCTION {format.tr.title.number} +{ format.betitle.check + % Single out the situation in which there is no number + % and type = {\bibnotype}, i.e., no type as well. + % (Why not use book then?) + type empty$ + { % Now, we're in the regular situation with at least a + % number, a type, a volume, or an edition. + "\APACbVolEdTR{" format.bvol.edition.check * "}{" * + format.tr.number * "}" * + } + { type "\bibnotype" = + number empty$ + volume empty$ + edition empty$ + and + and + and + { "" } + { % Now, we're in the regular situation with at least a + % number, a type, a volume, or an edition. + "\APACbVolEdTR {" format.bvol.edition.check * "}{" * + format.tr.number * "}" * + } + if$ + } + if$ + connect.with.space.check + title format.btitle.connect +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format address and institution of reports etc. + % + % Washington, DC: National Institute of Education + % or + % National Institute of Education (if address empty) + % + % warning if no institution + % +FUNCTION {format.address.institution.check} +{ url empty$ + doi empty$ and + { "institution" institution warning.if.empty + "address" address warning.if.empty + } + 'skip$ + if$ + institution empty$ + address empty$ + and + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + % + % If institution = author or institution = "author" + % or institution = "Author" then hand over the final choice how to + % format this to \LaTeX. See also format.address.publisher + % + author empty$ + institution empty$ or + { institution "\APACaddressInstitution{" } + { author institution = + "author" institution = or + "Author" institution = or + { author "\APACaddressInstitutionEqAuth{" } + { institution "\APACaddressInstitution{" } + if$ + } + if$ + address "" connect.check "}{" * + % Recover institution that was pushed onto the stack previously. + swap$ "" connect.check "}" * + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % reports + % +FUNCTION {techreport} +{ author empty$ + % + % no author: possibly edited report with editors as authors + % + { editor empty$ + % + % no author or editor: title serves as author. + % title formatted as book title + % + { format.tr.title.number output.dot.new.block + format.year.month.day.check add.period$ + } + % + % format editor and year, and check if year is present + % format report title and check if title present + % format volume, edition, type, and number + % + { format.editors.as.authors start.new.block + format.year.month.day.check output.dot.new.block + format.tr.title.number add.period$ + } + if$ + } + % + % format author and year, and check if year is present + % format report title and check if title present + % format volume, edition, type, and number + % + { format.authors start.new.block + format.year.month.day.check output.dot.new.block + format.tr.title.number add.period$ + } + if$ + % + % format address and institution, check if institution present + % + format.address.institution.check + % + % if not empty, insert howpublished. + % (used if report is retrieved from the internet) + % + format.howpublished add.period$ + % + % format url + % + url empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + % + % format optional note + % + note empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.note + } + if$ + fin.entry +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % (translated) article or chapter in report + % +FUNCTION {intechreport} +{ author empty$ + % + % no author: title serves as author. + % title formatted as article title (APA manual not consistent in this, + % compare statement on p. 119: ``treat as book title'' and + % example 8, p. 121: no underlining => article title) + % + { editor.ne.trans + { format.atitle.trans.check } + { format.atitle.check } + if$ + output.new.block + format.year.month.day.check output.dot.new.block + } + % + % format author and year, and check if year is present + % format article title and check if title or type present + % + { format.authors start.new.block + format.year.month.day.check output.dot.new.block + editor.ne.trans + { format.atitle.trans.check } + { format.atitle.check } + if$ + output.new.block + } + if$ + % + % format "In " editor " (Ed. \& Trans.), " + % booktitle, volume, edition, pages + % + format.in.editors.trans + % + % volume, edition, report type and number, pages + % + "\APACbVolEdTRpgs {" format.bvol.edition.check * "} {" * + format.tr.number * + "} {" * pages format.bpages.check * + "}" * + % + booktitle format.btitle.connect * + add.period$ + % + % format address and publisher + % + format.address.institution.check + % + % if not empty, insert howpublished. + % (used if report is retrieved from the internet) + % + format.howpublished add.period$ + % + % format url + % + url empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + % + % format original publication (of reprint/translation) + % and optional note + % + format.orig.note + fin.entry +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % papers presented at conferences etc. + % +FUNCTION {lecture} +{ author empty$ + { "author" author warning.if.empty } + { format.authors start.new.block } + if$ + % + % format year, month, and day, and check if year present + % format title and check if title present + % format howpublished and check if howpublished present + % + format.year.month.day.check output.dot.new.block + symposium empty$ + { format.betitle.check + title format.btitle.connect output.new.block + howpublished empty$ + { "symposium and howpublished missing in " cite$ * warning$ + "" + } + { "\APAChowpublished {" howpublished * "}" * } + if$ + address connect.with.comma.check + } + { format.atitle.type.check output.new.block + "\BIn{} " + chair empty$ + 'skip$ + { chair format.editor.names + chair num.names$ #1 > + { "(\BCHAIRS)" } + { "(\BCHAIR)" } + if$ + connect.with.space.check * ", " * + } + if$ + symposium format.btitle.no.dot * + format.howpublished + address connect.with.comma.check + } + if$ + add.period$ + % + % format url + % + url empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + % + % format optional note + % + note empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.note + } + if$ + fin.entry +} + +FUNCTION {format.ttitle.type.school} +{ doi empty$ not + url empty$ not or + howpublished empty$ not or + { pop$ } + { swap$ pop$ } + if$ + type empty$ + 'skip$ + { type "\bibnotype" = + { pop$ + "" + } + { pop$ + type + } + if$ + } + if$ + duplicate$ empty$ + doi empty$ + url empty$ and + howpublished empty$ and + address empty$ + school empty$ and or and + { 'pop$ + title empty$ not + englishtitle empty$ not or + { start.new.block } + 'skip$ + if$ + "" + } + { start.new.block + "\APACtypeAddressSchool {" swap$ * "}{" * + doi empty$ + url empty$ and + howpublished empty$ and + { "}{}" * } + { address "" connect.check "}{" * + school "" connect.check "}" * + } + if$ + } + if$ + format.betitle.check swap$ + connect.with.space.check + "title" title warning.if.empty + title format.btitle.connect +} +FUNCTION {unpub.address.school.block} +{ doi empty$ + url empty$ and + howpublished empty$ and + { "school" school warning.if.empty + school empty$ + address empty$ and + 'skip$ + { start.new.block + "\APACaddressSchool {" address "" connect.check "}{" * + school "" connect.check "}" * + output.dot.end.block + } + if$ + } + 'skip$ + if$ +} +FUNCTION {thesis} +{ journal empty$ not + { pop$ pop$ + article + } + { author empty$ + { "author" author warning.if.empty } + { format.authors start.new.block } + if$ + format.year.check output.dot.end.block + format.ttitle.type.school output.dot.end.block + unpub.address.school.block + howpublished.block + url.block + note.block + fin.entry.2 + } + if$ +} +FUNCTION {phdthesis} +{ "\BPhD" "\BUPhD" thesis } +FUNCTION {mastersthesis} +{ "\BMTh" "\BUMTh" thesis } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title of something (used in unpublished and misc) + % english translation of title + % type and number of something + % +FUNCTION {format.btitle.type.num} +{ format.betitle.check + format.bvol.edition connect.with.space.check + format.type.number + connect.with.space.check + title empty$ + { add.period$ } + { title format.btitle.connect } + if$ +} + +FUNCTION {format.version} +{ + version empty$ + { "" } + { " " * version *} + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title of message or software-related thing (used in misc) + % english translation of title + % type and number of something + % +FUNCTION {format.mtitle.type.num} +{ format.aetitle.check + format.bvol.edition connect.with.space.check + type.2 "\bibmessage" = + { number empty$ + 'skip$ + { type.2 number tie.or.space.connect + bracket.check + connect.with.space.check + } + if$ + } + { format.type.number + connect.with.space.check + } + if$ + title empty$ + { add.period$ } + { title format.atitle.connect } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title, english translation of title, + % type and number of something (used in misc) + % +FUNCTION {output.misctitle.type.num} +{ type.2 empty$ + { format.btitle.type.num } + { type.2 "\bibmessage" = + type.2 "\bibcomputerprogram" = or + type.2 "\bibcomputerprogrammanual" = or + type.2 "\bibcomputerprogramandmanual" = or + type.2 "\bibcomputersoftware" = or + type.2 "\bibcomputersoftwaremanual" = or + type.2 "\bibcomputersoftwareandmanual" = or + type.2 "\bibprogramminglanguage" = or + { format.mtitle.type.num } + { format.btitle.type.num } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % unpublished manuscripts, etc. + % +FUNCTION {unpublished} +{ check.relevant.fields + author empty$ + % + % no author: possibly edited book with editors as authors + % + { editor empty$ + % + % no author or editor: title serves as author. + % title formatted as book title + % + { format.btitle.type.num output.new.block + format.year.month.day.check add.period$ + } + % + % format editor and year, and check if year is present + % format book title, volume, and edition and check if title present + % + { format.editors.as.authors start.new.block + format.year.month.day.check output.dot.new.block + format.btitle.type.num + } + if$ + } + % + % format author and year, and check if year is present + % format book title, volume, and edition + % and check if title or type present + % + { format.authors start.new.block + format.year.month.day.check output.dot.new.block + format.btitle.type.num + } + if$ + howpublished empty$ + organization empty$ and + address empty$ and + 'skip$ + { output.new.block + "\APAChowpublished{" "}" howpublished enclose.check + organization connect.with.comma.check + address connect.with.comma.check + add.period$ + } + if$ + % + % format url + % + url empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + % + % format optional note + % + note empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.note + } + if$ + fin.entry +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % nonprint media and other things that don't fit + % +FUNCTION {misc} +{ % + % To handle @manual: use type.2 instead of type. + type.2 empty$ + type empty$ not and + { type 'type.2 := } + 'skip$ + if$ + % + author empty$ + % + % no author: possibly edited item with editors as authors + % + { editor empty$ + % + % no author or editor: title/type serves as author. + % title formatted as book title + % + % if no title and no type, howpublished is title + % + { title empty$ + type.2 empty$ and + { howpublished empty$ + { "No author, editor, title, type, and howpublished in " + cite$ * warning$ + "" + } + { "\APAChowpublished{" howpublished * "}" * add.period$ } + if$ + format.year.month.day.check add.period$ + } + { output.misctitle.type.num %output.new.block + format.year.month.day.check add.period$ + format.howpublished add.period$ + } + if$ + } + % + % format editor and year, and check if year is present + % format book title, volume, and edition and check if title present + % + { format.editors.as.authors start.new.block + format.year.month.day.check output.dot.new.block + output.misctitle.type.num output.dot.new.block + format.howpublished add.period$ + } + if$ + } + % + % format author and year, and check if year is present + % format book title, volume, and edition + % and check if title or type present + % + { format.authors start.new.block + format.year.month.day.check output.dot.new.block + output.misctitle.type.num + format.howpublished add.period$ + } + if$ + % + address empty$ + publisher empty$ and + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.address.publisher add.period$ + } + if$ + % + % format url + % + url empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + % + % format optional note + % + note empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.note + } + if$ + fin.entry +} + +FUNCTION {softmisc} +{ % + % To handle @manual: use type.2 instead of type. + type.2 empty$ + type empty$ not and + { type 'type.2 := } + 'skip$ + if$ + % + author empty$ + % + % no author: possibly edited item with editors as authors + % + { editor empty$ + % + % no author or editor: title/type serves as author. + % title formatted as book title + % + % if no title and no type, howpublished is title + % + { title empty$ + type.2 empty$ and + { howpublished empty$ + { "No author, editor, title, type, and howpublished in " + cite$ * warning$ + "" + } + { "\APAChowpublished{" howpublished * "}" * add.period$ } + if$ + format.year.month.day.check add.period$ + } + { output.misctitle.type.num %output.new.block + format.year.month.day.check add.period$ + format.howpublished add.period$ + } + if$ + } + % + % format editor and year, and check if year is present + % format book title, volume, and edition and check if title present + % + { format.editors.as.authors start.new.block + format.year.month.day.check output.dot.new.block + output.misctitle.type.num output.dot.new.block + format.howpublished add.period$ + } + if$ + } + % + % format author and year, and check if year is present + % format book title, volume, and edition + % and check if title or type present + % + { format.authors start.new.block + format.year.nomonth.day.check output.dot.new.block + output.misctitle.type.num + format.version + format.howpublished add.period$ + } + if$ + % + address empty$ + publisher empty$ and + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.address.publisher add.period$ + } + if$ + % + % format url + % + url empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + % + % format optional note + % + note empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.note + } + if$ + output.dot.new.block + format.softmisc.eprint + fin.entry +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % for legal cases and other cases that need to be + % done by hand + % +FUNCTION {literal} +{ "key" key warning.if.empty + "text" text warning.if.empty + text empty$ + { "" } + { text } + if$ + fin.entry +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % technical documentation + % +FUNCTION {manual} +{ % + % If type is empty, assume that it is a computer software manual. + % + type empty$ + { "\bibcomputersoftwaremanual" 'type.2 := } + 'skip$ + if$ + misc +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % booklet + % +FUNCTION {booklet} +{ misc } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % part of a book + % +FUNCTION {inbook} +{ inbookcollection } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % article in proceedings + % +FUNCTION {inproceedings} +{ incollection } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % article in proceedings (Kopka & Daly, 2004, p. 230) + % +FUNCTION {conference} +{ inproceedings } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % proceedings + % +FUNCTION {proceedings} +{ misc } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % unknown types + % +FUNCTION {default.type} +{ misc } + +FUNCTION {initialize} +{ + #6 'name.max := +%% #250 'entry.max$ := +%% #5000 'global.max$ := +} +FUNCTION {init.old.number} +{ #0 'old.number := } +FUNCTION {init.old.label} +{ "zzzzzz" 'old.label := } +FUNCTION {init.cite.initials.add.to.year} +{ #0 'cite.initials := + #0 'add.to.year := +} +FUNCTION {move.forward} +{ #1 'forward := } +FUNCTION {move.backward} +{ #0 'forward := } +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{}" write$ newline$ + "\renewcommand{\doi}[1]{\url{https://doi.org/#1}}" + write$ newline$ + "\bibcommenthead" write$ newline$ +} +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} +FUNCTION {write.bbl.entry} +{ + make.cite.labels + call.type$ +} +READ +EXECUTE { identify.apacite.version } +EXECUTE { initialize } +EXECUTE { init.old.number } +ITERATE { make.citeorder.number } +ITERATE { make.sort.title } +SORT +EXECUTE { init.old.number } +EXECUTE { init.old.label } +ITERATE { make.title.number } +ITERATE { make.tentative.sort.label } +SORT +ITERATE { init.cite.initials.add.to.year } +EXECUTE { init.initials } +ITERATE { check.add.initials } +EXECUTE { init.initials } +REVERSE { check.add.initials } +ITERATE { tentative.cite.num.names } +EXECUTE { init.cite.num.names } +EXECUTE { move.forward } +ITERATE { definitive.cite.num.names } +EXECUTE { init.cite.num.names } +EXECUTE { move.backward } +REVERSE { definitive.cite.num.names } +ITERATE { make.final.sort.key } +SORT +EXECUTE { begin.bib } +ITERATE { write.bbl.entry } +EXECUTE { end.bib } + +%% +%% End of file `apacite.bst'. diff --git a/papers/preprint/sn-article-template/bst/sn-apacite.bst b/papers/preprint/sn-article-template/bst/sn-apacite.bst new file mode 100644 index 000000000..be1dc5309 --- /dev/null +++ b/papers/preprint/sn-article-template/bst/sn-apacite.bst @@ -0,0 +1,5364 @@ +%% +%% This is file `apacite.bst', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% apacite.dtx (with options: `bibstyle') +%% +%% This is a generated file. +%% +%% Copyright (C) 1994-2013 Erik Meijer and any individual authors listed +%% elsewhere in this file. +%% +%% This file is part of the `apacite' package. +%% ------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% The `apacite' package consists of the files apacite.dtx and +%% apacite.ins, and the following generated files: +%% apacite.sty, apacdoc.sty, apacite.drv, +%% apacite.bst, apacitex.bst, apacann.bst, apacannx.bst, +%% apa5ex.bib, apacxmpl.tex, +%% english.apc, dutch.apc, finnish.apc, french.apc, +%% german.apc, ngerman.apc, greek.apc, norsk.apc, +%% spanish.apc, swedish.apc. +%% +%% This work has the LPPL maintenance status `maintained' +%% +%% The Current Maintainer of this work is Erik Meijer +%% +%% This file may only be distributed together with a copy of the +%% source files of the apacite package, i.e., apacite.dtx and +%% apacite.ins. You may however distribute the apacite package without +%% the generated files. +%% +%% apacite.bst +%% [2013/07/21 v6.03 APA bibliography style] +%% apacite.bst : reference list according to APA manual +%% Written by Erik Meijer + +FUNCTION {identify.apacite.version} +{ % Put identifying string in the .blg file + "apacite.bst" + " [2013/07/21 v6.03 APA bibliography style]" + * top$ +} +ENTRY + { address + annote + annotate + author + booktitle + chair + chapter + day + doi + edition + editor + englishtitle + firstkey + howpublished + institution + journal + key + keywords + lastchecked + month + nihms + note + number + organization + originaladdress + originalbooktitle + originaledition + originaleditor + originaljournal + originalnumber + originalpages + originalpublisher + originalvolume + originalyear + pages + pmcid + publisher + school + series + symposium + text + title + translator + type + url + urldate + volume + year + eprint + archive + archivePrefix + primaryClass + eid + adsurl + adsnote + version + } + { cite.order %% order of first citation + title.number %% for sorting titles + cite.initials %% dummy (0-1) indicating whether or not + %% initials of the 1st author must + %% be used for citing + cite.num.names.full %% number of names to be cited for full and + cite.num.names.short %% short cite + add.to.year %% For a, b, c, etc. after year + %% in multiple citations with same author-year + } + { year.label %% For sorting entries by year + author.year.sort.label %% For sorting entries and checking whether + %% initials should be added, how many authors + %% should be cited and whether a, b, etc. + %% after year is necessary + title.sort.label %% for sorting titles + citeorder.sort.label %% for sorting by citation order + type.2 %% Replacement for type with misc entries and + %% entries that revert to misc. + } +INTEGERS { len pos name.max old.number numnames numnames.old + nameptr lastname format.num.names cite.initials.old + cite.num.names.old add.to.year.old forward + multiresult dot brace.level + } + +STRINGS { s t u old.label field + aut1f aut1s aut1f.old aut1s.old + aut2 aut2.old + aut3 aut3.old + aut4 aut4.old + aut5 aut5.old + aut6 aut6.old + year.label.old + } +FUNCTION {test} { #0 } +FUNCTION {dump.stack} +{ "---- STACK {" cite$ * "} ----" * top$ + stack$ + "---- END STACK {" cite$ * "} ----" * top$ +} +FUNCTION {make.index} { #0 } +FUNCTION {unsorted} { #0 } +MACRO {jan} {"{\APACmonth{01}}"} +MACRO {feb} {"{\APACmonth{02}}"} +MACRO {mar} {"{\APACmonth{03}}"} +MACRO {apr} {"{\APACmonth{04}}"} +MACRO {may} {"{\APACmonth{05}}"} +MACRO {jun} {"{\APACmonth{06}}"} +MACRO {jul} {"{\APACmonth{07}}"} +MACRO {aug} {"{\APACmonth{08}}"} +MACRO {sep} {"{\APACmonth{09}}"} +MACRO {oct} {"{\APACmonth{10}}"} +MACRO {nov} {"{\APACmonth{11}}"} +MACRO {dec} {"{\APACmonth{12}}"} +MACRO {winter} {"{\APACmonth{13}}"} +MACRO {spring} {"{\APACmonth{14}}"} +MACRO {summer} {"{\APACmonth{15}}"} +MACRO {fall} {"{\APACmonth{16}}"} +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % issues warning if field is empty + % call with + % "field" field warning.if.empty + % Note that the first field must be between quotes + % because it is the fieldname for use in the warning message. + % +FUNCTION {warning.if.empty} +{ empty$ + { "No " swap$ * " in " * cite$ * warning$ } + { pop$ } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % issues warning if title, type, and howpublished are empty + % +FUNCTION {check.relevant.fields} +{ title empty$ + type empty$ and + howpublished empty$ and + { "No title, type, and howpublished in " cite$ * warning$ } + 'skip$ + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % delivers 1 if (both editor and translator + % not empty and not equal to each other) + % 0 if (editor or translator empty) or + % (editor = translator) + % +FUNCTION {editor.ne.trans} +{ translator empty$ + { #0 } + { editor empty$ + { #0 } + { translator editor = + { #0 } + { #1 } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {conv.int.to.str} +{ duplicate$ #10 < + { "0000" swap$ int.to.str$ * } + { duplicate$ #100 < + { "000" swap$ int.to.str$ * } + { duplicate$ #1000 < + { "00" swap$ int.to.str$ * } + { duplicate$ #10000 < + { "0" swap$ int.to.str$ * } + { int.to.str$ } + if$ + } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {ref.type} +{ type$ "article" = + type$ "magazine" = + type$ "newspaper" = + type$ "book" = + type$ "techreport" = + type$ "unpublished" = + type$ "misc" = + type$ "booklet" = + type$ "manual" = + type$ "proceedings" = + or + or + or + or + or + or + or + or + or + { #1 } + { type$ "incollection" = + type$ "phdthesis" = + type$ "mastersthesis" = + type$ "lecture" = + type$ "inbook" = + type$ "inproceedings" = + type$ "conference" = + type$ "intechreport" = + or + or + or + or + or + or + or + { #2 } + { type$ "literal" = + { #3 } + { #0 } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {is.atype} +{ type$ "article" = + type$ "magazine" = + type$ "newspaper" = + type$ "incollection" = + type$ "inbook" = + type$ "inproceedings" = + type$ "conference" = + type$ "intechreport" = + type$ "manual" = + or + or + or + or + or + or + or + or + { #1 } + { journal empty$ not + % + type$ "phdthesis" = + type$ "mastersthesis" = + or + % + and + { #1 } + { type$ "misc" = + type empty$ not and + { type "\bibmessage" = + type "\bibcomputerprogram" = + type "\bibcomputerprogrammanual" = + type "\bibcomputerprogramandmanual" = + type "\bibcomputersoftware" = + type "\bibcomputersoftwaremanual" = + type "\bibcomputersoftwareandmanual" = + type "\bibprogramminglanguage" = + or + or + or + or + or + or + or + { #1 } + { #0 } + if$ + } + { #0 } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % connects two strings with connect string + % if one of them empty, then connect string + % is left out + % + % call with S1 S2 connectstring connect.check + % +FUNCTION {connect.check} +{ 'u := + % + % if S2 = "" + % + duplicate$ empty$ + % + % then remove S2 + % + { pop$ + % + % S1 is on top of stack. + % if it is empty, it is replaced by the empty string "" + % + duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ + } + % + % else swap S1 and S2 so that S1 can be checked + % + { swap$ + % + % if S1 is empty, remove S1 so that S2 is left on the + % stack and is the result is given + % + duplicate$ empty$ + { pop$ } + % + % now the real work starts: + % push the connect string "C" + % so that top of stack is "C" "S1" "S2" + % concatenate, so that top of stack is + % "S1+C" "S2" + % + { u * + % + % swap and concatenate + % + swap$ * + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % connects two strings with space ("\ ") + % if length of second is 4 or larger, + % connects them with non-breaking space ("tie", "~") + % if length of second smaller than 4 + % + % call with S1 S2 tie.or.space.connect + % result: "S1\ S2" or "S1~S2" + % +FUNCTION {tie.or.space.connect} +{ duplicate$ text.length$ #4 < + { "~" } + { "\ " } + if$ + swap$ * * +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % connects two strings with comma (", ") + % if one of them is empty, the comma is left out + % + % call with S1 S2 connect.with.comma.check + % result: "S1, S2" + % +FUNCTION {connect.with.comma.check} +{ ", " connect.check } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % connects two strings with semicolon ("; ") + % if one of them is empty, semicolon is left out + % + % call with S1 S2 connect.with.semicolon.check + % result: "S1; S2" + % +FUNCTION {connect.with.semicolon.check} +{ "; " connect.check } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % connects two strings with colon (": ") + % if one of them is empty, colon is left out + % + % call with S1 S2 connect.with.colon.check + % result: "S1: S2" + % +FUNCTION {connect.with.colon.check} +{ ": " connect.check } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % connects two strings with space ("\ ") + % + % call with S1 S2 connect.with.space.check + % result: "S1\ S2" + % +FUNCTION {connect.with.space.check} +{ "\ " connect.check } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % encloses string in pre- and postfix string + % call with + % prefix postfix S enclose.check + % delivers empty string if S empty + % +FUNCTION {enclose.check} +{ duplicate$ empty$ + { pop$ pop$ pop$ + "" + } + { swap$ * * } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % emphasizes top of stack + % call with + % "string" emphasize.check + % +FUNCTION {emphasize.check} +{ "\Bem{" swap$ + "}" swap$ + enclose.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % brackets top of stack + % call with + % "string" bracket + % +FUNCTION {bracket.check} +{ "[" swap$ + "]" swap$ + enclose.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % parenthesizes top of stack + % call with + % "string" parenthesize + % +FUNCTION {parenthesize.check} +{ "(" swap$ + ")" swap$ + enclose.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % checks whether argument is "multiresult": + % whether it contains '-', '+', or ',' characters + % used with pages to check whether pp. or p. must be used + % +FUNCTION {multi.result.check} +{ 't := + #0 'multiresult := + % + % while (not multiresult) and (length(t) > 1) do + % + { multiresult not + t text.length$ #1 > + and + } + % + % if t(1-2) = "--" or t(1) = "+" or "," + % then multiresult = 1 + % else t = t(2-last) + % + { t #1 #2 substring$ 's := + "--" s = + { #1 'multiresult := } + { t #1 #1 substring$ 's := + "+" s = + "," s = + or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + if$ + } + while$ + multiresult +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % Checks whether an author is a corporate author, i.e., + % whether the field starts with "{\bibcorporate". + % Call with + % field is.bibcorporate + % +FUNCTION {is.bibcorporate} +{ #1 #14 substring$ "{\bibcorporate" = } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {remove.spaces} +{ % Remove spaces from string. + % Works best if string only contains alphanumeric characters and spaces. + 's := % The original string + s text.length$ 'len := % Its length (no. of characters) + "" 't := % Initialize the transformed string + #0 'pos := + % + % while (pos < len) do + % + { pos len < } + { pos #1 + 'pos := + s pos #1 substring$ 'u := + % + % u is the pos-th character in s + % If it is a space, move to next character, + % else copy character to output. + % + u " " = + 'skip$ + { t u * 't := } + if$ + } + while$ + % + % Now push the result back on the stack + t +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % end block by writing what's left on the stack and + % starting a new line + % +FUNCTION {output.end.block} +{ write$ + newline$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % end block by adding a period and writing what's left + % on the stack and starting a new line + % +FUNCTION {output.dot.end.block} +{ add.period$ + output.end.block +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % starting new block by writing what's left on the stack, + % starting a new line and adding some extra space or + % whatever is more defined in \newblock + % +FUNCTION {output.new.block} +{ output.end.block + "\newblock" write$ newline$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % starting new block by writing what's left on the stack, + % starting a new line and adding some extra space or + % whatever is more defined in \newblock + % +FUNCTION {output.dot.new.block} +{ add.period$ + output.new.block +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {start.new.block} +{ "\unskip\ " write$ newline$ + "\newblock " write$ newline$ +} + +FUNCTION {sort.name.format.classic} { "{ll{}}{ f{}}{ vv{}}{ jj{}}" } + +FUNCTION {cite.name.format.classic} { "{ll}" } + +FUNCTION {author.name.format.classic} { "{ll}{, f{.}.}{ vv}{, jj}" } + +FUNCTION {index.name.format.classic} { "{ll}{, f{.}.}{ vv}{, jj}" } + +FUNCTION {sort.name.format} { "{vv{}}{ll{}}{ f{}}{ jj{}}" } + +FUNCTION {cite.name.format} { "{vv }{ll}" } + +FUNCTION {cite.initials.name.format} { "{f{.}.~~}{vv }{ll}{ jj}" } + +FUNCTION {author.name.format} { "{vv }{ll}{, f{.}.}{, jj}" } + +FUNCTION {editor.name.format} { "{f{.}.~~}{vv }{ll}{ jj}" } + +FUNCTION {index.name.format} { "{vv }{ll}{, f{.}.}{, jj}" } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {init.initials} +{ "yyyyy" 'aut1f.old := + "yyyyy" 'aut1s.old := + #0 'cite.initials.old := +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {update.no.initials} +{ 'field := + field 'aut1f.old := + field 'aut1s.old := + #0 'cite.initials.old := +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {check.add.initials.aut} +{ % + % If last name is equal to previous last name + % but initials are different, then initials should + % be cited. If initials are also the same, initials + % should be cited if that is the case for the previous + % author . + % + aut1s aut1s.old = + { aut1f aut1f.old = + { cite.initials.old 'cite.initials := } + { #1 'cite.initials := + aut1f 'aut1f.old := + aut1s 'aut1s.old := + cite.initials 'cite.initials.old := + } + if$ + } + { % + % Different last name. + aut1f 'aut1f.old := + aut1s 'aut1s.old := + cite.initials 'cite.initials.old := + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {check.add.initials.field} +{ 'field := + field #1 cite.initials.name.format format.name$ 'aut1f := + field #1 cite.name.format format.name$ 'aut1s := + % + % Now do the actual work + % + check.add.initials.aut +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {check.add.initials} +{ % + % Check whether author or editor or other field acts as author. + % Initials are only relevant with author or editor. + % + firstkey empty$ not + { key empty$ not + { % + % Both key and firstkey are nonempty. + % Then, key is treated as last name of first author, + % and firstkey is treated as last name + initials of + % first author . + % + firstkey sortify remove.spaces 'aut1f := + key sortify remove.spaces 'aut1s := + check.add.initials.aut + } + { firstkey sortify remove.spaces update.no.initials } + if$ + } + { key empty$ not + { key sortify remove.spaces update.no.initials } + { % + % No key or firstkey, so find out which field + % to use as author. + % + % Check reference type: + % if result is 1 then possibly editor acts as author + % 2 then editor does not act as author + % 3 then key should have been used + % 0 then unknown reference type + ref.type #2 = + { % + % Format first author with and without initials + author empty$ + { title.sort.label update.no.initials } + { author check.add.initials.field } + if$ + } + { % + % Format first author with and without initials + author empty$ + { editor empty$ + { title.sort.label update.no.initials } + { editor check.add.initials.field } + if$ + } + { author check.add.initials.field } + if$ + } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {tentative.cite.num.names.field} +{ 'field := + field num.names$ 'numnames := + numnames #3 < + { % + % 1 or 2 names: always cite all of them. + numnames 'cite.num.names.full := + numnames 'cite.num.names.short := + } + { numnames #6 < + { % + % 3-5 names: cite all of them the first time, + % only the first name later times + numnames 'cite.num.names.full := + #1 'cite.num.names.short := + } + { % + % 6 or more names: cite only the first name + #1 'cite.num.names.full := + #1 'cite.num.names.short := + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {tentative.cite.num.names} +{ % + % Check whether author or editor or other field acts as author. + % Number of names is only relevant with author or editor. + % + firstkey empty$ not + { + #1 'cite.num.names.full := + #1 'cite.num.names.short := + } + { key empty$ not + { + #1 'cite.num.names.full := + #1 'cite.num.names.short := + } + { % + % No key or firstkey, so find out which field + % to use as author. + % + % Check reference type: + % if result is 1 then possibly editor acts as author + % 2 then editor does not act as author + % 3 then key should have been used + % 0 then unknown reference type + ref.type #2 = + { % + % Format first author with and without initials + author empty$ + { + #1 'cite.num.names.full := + #1 'cite.num.names.short := + } + { author tentative.cite.num.names.field } + if$ + } + { % + % Format first author with and without initials + author empty$ + { editor empty$ + { + #1 'cite.num.names.full := + #1 'cite.num.names.short := + } + { editor tentative.cite.num.names.field } + if$ + } + { author tentative.cite.num.names.field } + if$ + } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {init.cite.num.names} +{ #0 'cite.num.names.old := + #0 'numnames.old := + "yyyy" 'year.label.old := + #0 'add.to.year.old := + "" 'aut1f.old := + "" 'aut2.old := + "" 'aut3.old := + "" 'aut4.old := + "" 'aut5.old := + "" 'aut6.old := +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {update.cite.num.names} +{ cite.num.names.short 'cite.num.names.old := + numnames 'numnames.old := + year.label 'year.label.old := + add.to.year 'add.to.year.old := + aut1f 'aut1f.old := + aut2 'aut2.old := + aut3 'aut3.old := + aut4 'aut4.old := + aut5 'aut5.old := + aut6 'aut6.old := +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.6.authors} +{ % + % First author: with initials. + % + field #1 cite.initials.name.format format.name$ 'aut1f := + % + % Second and later authors: without initials. + % + numnames #1 > + name.max #1 > + and + { % + % 2nd author + field #2 cite.name.format format.name$ 'aut2 := + % + numnames #2 > + name.max #2 > + and + { % + % 3nd author + field #3 cite.name.format format.name$ 'aut3 := + % + numnames #3 > + name.max #3 > + and + { % + % 4th author + field #4 cite.name.format format.name$ 'aut4 := + % + numnames #4 > + name.max #4 > + and + { % + % 5th author + field #5 cite.name.format format.name$ 'aut5 := + % + numnames #5 > + name.max #5 > + and + { % + % 6th author + field #6 cite.name.format format.name$ 'aut6 := + } + { % + % 5 authors: 6 is empty + % + "" 'aut6 := + } + if$ + } + { % + % 4 authors: 5-6 are empty + % + "" 'aut5 := + "" 'aut6 := + } + if$ + } + { % + % 3 authors: 4-6 are empty + % + "" 'aut4 := + "" 'aut5 := + "" 'aut6 := + } + if$ + } + { % + % 2 authors: 3-6 are empty + % + "" 'aut3 := + "" 'aut4 := + "" 'aut5 := + "" 'aut6 := + } + if$ + } + { % + % Only 1 author: 2-6 are empty + % + "" 'aut2 := + "" 'aut3 := + "" 'aut4 := + "" 'aut5 := + "" 'aut6 := + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {change.add.to.year} +{ + forward #1 = + { % + % Moving forward: this add.to.year number must be 1 higher than + % previous. + % + add.to.year.old #0 > + { add.to.year.old #1 + 'add.to.year := } + { #2 'add.to.year := } + if$ + } + { % + % Moving backward: this add.to.year number must be 1 lower than + % previous. + % + add.to.year.old #1 - 'add.to.year := + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {definitive.cite.num.names.1.or.2} +{ % + numnames numnames.old = + { % + % Same number of names: ambiguity could arise. Check whether current + % and previous have the same author(s). + % + aut1f aut1f.old = + { % + % Same first author: if the second author is also the same or if + % there is only one author, a's and b's should be added. + % + aut2 aut2.old = + numnames #2 = + and + % + numnames #1 = + or + { % + % Same author(s): add to year. + % + change.add.to.year + } + { % + % Different second author: no ambiguity possible. + % + skip$ + } + if$ + } + { % + % Different first author: no ambiguity possible. + % + skip$ + } + if$ + } + { % + % Different number of names: no ambiguity possible. + % + skip$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {definitive.cite.num.names.3.or.more} +{ % + % Check whether current and previous have the same first author. + % + aut1f aut1f.old = + { % + % Same first author: check second author + % + aut2 aut2.old = + { % + % Same 1st & 2nd author: check 3rd. + % + aut3 aut3.old = + { % + % Same 1st-3rd authors: check 4th. + % + numnames.old #3 = + { numnames #3 = + { % + % Both current and previous have 3 authors, which are + % the same, so both have identical author-year + % combinations, so ambiguity should be resolved by + % a's and b's. Check whether more authors were + % necessary for previous one. + % + change.add.to.year + cite.num.names.short cite.num.names.old < + { cite.num.names.old + 'cite.num.names.short := + } + 'skip$ + if$ + } + { % + % Previous has 3 authors, current has more, with same + % first 3, so at least 4 must be used for current to + % make a difference. + % + cite.num.names.short #4 < + { #4 'cite.num.names.short := } + 'skip$ + if$ + } + if$ + } + { numnames #3 = + { % + % Current has 3 authors, previous has more, with same + % first 3, so all 3 of current must be used. + % + numnames 'cite.num.names.short := + } + { % + % Same 1st-3rd author and both current and previous + % have at least 4 authors: check 4th. + % + aut4 aut4.old = + { % + % Same 1st-4th authors: check 5th. + % + numnames.old #4 = + { numnames #4 = + { % + % Both current and previous have 4 authors, + % which are the same, so both have + % identical author-year combinations, so + % ambiguity should be resolved by a's and + % b's. Check whether more authors were + % necessary for previous one. + % + change.add.to.year + cite.num.names.short cite.num.names.old < + { cite.num.names.old + 'cite.num.names.short := + } + 'skip$ + if$ + } + { % + % Previous has 4 authors, current has more, + % with same first 4, so at least 5 must be + % used for current to make a difference. + % + cite.num.names.short #5 < + { #5 'cite.num.names.short := } + 'skip$ + if$ + } + if$ + } + { numnames #4 = + { % + % Current has 4 authors, previous has more, + % with same first 4, so all 4 of current + % must be used. + % + numnames 'cite.num.names.short := + } + { % + % Same 1st-4th author and both current and + % previous have at least 5 authors: check + % 5th. + % + aut5 aut5.old = + { % + % Same 1st-5th authors: check 6th. + % + numnames.old #5 = + { numnames #5 = + { % + % Both current and previous + % have 5 authors, which are the + % same, so both have identical + % author-year combinations, so + % ambiguity should be resolved + % by a's and b's. Check whether + % more authors were necessary + % for previous one. + % + change.add.to.year + cite.num.names.short + cite.num.names.old < + { cite.num.names.old + 'cite.num.names.short := + } + 'skip$ + if$ + } + { % + % Previous has 5 authors, + % current has more, with same + % first 5, so at least 6 must + % be used for current to make + % a difference. + % + cite.num.names.short #6 < + { #6 'cite.num.names.short := } + 'skip$ + if$ + } + if$ + } + { numnames #5 = + { % + % Current has 5 authors, + % previous has more, with same + % first 5, so all 5 of current + % must be used. + % + numnames 'cite.num.names.short := + } + { % + % Same 1st-5th author and both + % current and previous have at + % least 6 authors. If one has + % 6 authors and the other has + % more or the 6th is different, + % 6 should be used (which is + % the maximum). + % + numnames #6 > + numnames.old #6 = + and + % + numnames #6 = + numnames.old #6 > + and + % + or + % + aut6 aut6.old = + not + % + or + { #6 cite.num.names.short < + { #6 + 'cite.num.names.short + := + } + 'skip$ + if$ + } + { % + % The first 6 authors are + % the same and either both + % have 6 or both have more. + % So for all practical + % purposes they have + % identical author-year + % combination, so ambiguity + % should be resolved by a's + % and b's. Check whether + % more authors were + % necessary for previous + % one. + % + change.add.to.year + cite.num.names.short + cite.num.names.old + < + { cite.num.names.old + 'cite.num.names.short + := + } + 'skip$ + if$ + } + if$ + } + if$ + } + if$ + } + { % + % Different 5th author: citing 5 authors is + % sufficient for this comparison. + % + cite.num.names.short #5 < + { #5 'cite.num.names.short := } + 'skip$ + if$ + } + if$ + } + if$ + } + if$ + } + { % + % Different 4th author: citing 4 authors is + % sufficient for this comparison. + % + cite.num.names.short #4 < + { #4 'cite.num.names.short := } + 'skip$ + if$ + } + if$ + } + if$ + } + if$ + } + { % + % Different 3rd author: citing 3 authors is sufficient for this + % comparison. + % + cite.num.names.short #3 < + { #3 'cite.num.names.short := } + 'skip$ + if$ + } + if$ + } + { % + % Different 2nd author: citing 2 authors is sufficient for this + % comparison. + % + cite.num.names.short #2 < + { #2 'cite.num.names.short := } + 'skip$ + if$ + } + if$ + } + { % + % Different first author: no ambiguity, move to next entry. + % + skip$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {definitive.cite.num.names.field} +{ 'field := + field num.names$ 'numnames := + % + % Format authors + % + format.6.authors + % + % Now compare authors with authors of previous entry. + % + cite.num.names.short numnames.old > + { % + % The previous entry has less authors than already defined + % necessary to be cited. No ambiguity is possible and we're ready. + % + skip$ + } + { % + % Both previous and current entry have at least one author . + % + year.label year.label.old = + { % + % Same year label: possibly ambiguous citation. + % + % First check: current and/or previous have 1 or + % 2 authors. + % + numnames #3 < + numnames.old #3 < + or + % + { definitive.cite.num.names.1.or.2 } + { definitive.cite.num.names.3.or.more } + if$ + } + { % + % Different year label: everything's fine, + % move to next entry. + % + skip$ + } + if$ + } + if$ + % + % If during the previous process the name maximum is exceeded + % (which was not checked), correct this. NOTE: If the name + % maximum is smaller than 6, this could lead to ambiguous + % citations if, e.g., the year and the first 5 authors are + % the same, but the 6th author is different. + % + cite.num.names.short name.max > + { name.max 'cite.num.names.short := } + 'skip$ + if$ + % + % For a "full" cite, the number of names should always be at least + % as large as for a "short" cite. + % + cite.num.names.full cite.num.names.short < + { cite.num.names.short 'cite.num.names.full := } + 'skip$ + if$ + % + % Update "old" variables for next entry. + % + update.cite.num.names +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {definitive.cite.no.names} +{ % + % The formatted field that acts as author is on top + % of the stack. + 'aut1f := + "" 'aut2 := + "" 'aut3 := + "" 'aut4 := + "" 'aut5 := + "" 'aut6 := + #1 'numnames := + % + year.label year.label.old = + { % + % Same year label: possibly ambiguous citation. + % + definitive.cite.num.names.1.or.2 + } + { % + % Different year label: everything's fine, + % move to next entry. + % + skip$ + } + if$ + % + % Update "old" variables for next entry. + % + update.cite.num.names +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {definitive.cite.num.names} +{ % + % Check whether author or editor or other field acts as author. + % Number of names is only relevant with author or editor. + % + firstkey empty$ not + { firstkey sortify remove.spaces definitive.cite.no.names } + { key empty$ not + { key sortify remove.spaces definitive.cite.no.names } + { % + % No key or firstkey, so find out which field + % to use as author. + % + % Check reference type: + % if result is 1 then possibly editor acts as author + % 2 then editor does not act as author + % 3 then key should have been used + % 0 then unknown reference type + ref.type #2 = + { % + % Format first author with and without initials + author empty$ + { title.sort.label definitive.cite.no.names } + { author definitive.cite.num.names.field } + if$ + } + { % + % Format first author with and without initials + author empty$ + { editor empty$ + { title.sort.label definitive.cite.no.names } + { editor definitive.cite.num.names.field } + if$ + } + { author definitive.cite.num.names.field } + if$ + } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.tentative.year.sort.label} +{ % + % Implicit or explicit ``no date'' is put at the front + % (the year zero; years B.C. will imply complications) + % because these are possibly old works. + % ``In press'' is put at the end. + % + year empty$ + { "0000" 'year.label := } + { year "\bibnodate" = + year "l" change.case$ "no date" = or + year "l" change.case$ "n.d." = or + { "0000" 'year.label := } + { year "\BIP" = + year "l" change.case$ "in press" = or + year "l" change.case$ "forthcoming" = or + { "9999" 'year.label := } + { % It is not checked whether the year field + % makes sense. + year sortify remove.spaces 'year.label := + } + if$ + } + if$ + } + if$ + % + % Push year sort label on the stack + year.label +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {month.number.day} +{ month empty$ + { "" } + { month sortify remove.spaces + % + % Add the day when available. + day empty$ + 'skip$ + { "/" * + day sortify remove.spaces * + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.name.sort.label} +{ % + % Author or editor-acting-as-author available. + % => Make tentative "short cite with initials" author + % label (L1) of one of the forms + % "Last1 F1" + % "Last1 F1 Last2" + % "Last1 F1 zzzz" ("zzzz" representing et al.) + % => If more than 2 'authors': make label (L2) for 2nd-6th authors + % of one of the forms + % "Last2 Last3" + % "Last2 Last3 Last4" + % "Last2 Last3 Last4 Last5" + % "Last2 Last3 Last4 Last5 Last6" + % "Last2 Last3 Last4 Last5 Last6 zzzz" + % + % Then format year label (L3) of one of the forms: + % "0000" (missing year or explicit 'no date') + % "9999" ('in press') + % year (otherwise; don't use originalyear here yet) + % + % From earlier sorting of titles, we have title number. Convert + % to string, which gives title label (L4) . + % + % Then tentative sorting label (author.year.sort.label) is a + % concatenation of + % L1 + % " " + % L3 + % " " + % L2 + % " " + % L4 + % + % The name field is on top of the stack. + 'field := + % + % numnames is the total number of names contained in field + field num.names$ 'numnames := + % + % Format first author + field #1 sort.name.format format.name$ + % + % Format the second author if there are two, or else "zzzz" = et al. + numnames #1 = + 'skip$ + { numnames #2 = + { % + % Two authors: format second author + field #2 "{ll{}}" format.name$ 's := + s "others" = + { " zzzz" * } % Add "et al."-substitute + { " " * s * } % Add second author + if$ + } + { " zzzz" * } % 3 or more authors: add "et al."-substitute + if$ + } + if$ + " " * % Add spaces + make.tentative.year.sort.label * % Add year (L3). + " " * % Add spaces + % + % Now build up L2 if applicable + numnames #3 < + 'skip$ + { % + % Treat last author slightly differently + numnames name.max > + { name.max 'lastname := + " zzzz" % Push "et al."-substitute on stack + } + { numnames 'lastname := + "" % Push empty string on stack + } + if$ + % + % Names 2 to "last" - 1 + "" % Push empty string on stack + #2 'nameptr := + { nameptr lastname < } + { % Add name no. nameptr + field nameptr "{ll{}}" format.name$ * + " " * + nameptr #1 + 'nameptr := + } + while$ + % + % "Last" author + field lastname "{ll{}}" format.name$ 's := + s "others" = + { "zzzz" * } % Add "et al."-substitute + { s * } % Add last author + if$ + % + swap$ * % Add the previously formatted empty string or + % "et al."-substitute if there are many authors. + * % Add L2 to the earlier labels. + } + if$ + % + " " * % Add spaces + title.number conv.int.to.str * % Add sorted title number (L4). + sortify % Clean up and convert to lowercase + " " * % Add spaces + month.number.day * % Add month and day when available + 'author.year.sort.label := % Assign result to sort label. +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.field.year.sort.label} +{ % + % 'field' acts as first author (L1), subsequent authors + % are empty (L2). + % + % Then format year label (L3) of one of the forms: + % "0000" (missing year or explicit 'no date') + % "9999" ('in press') + % year (otherwise; don't use originalyear here yet) + % + % From earlier sorting of titles, we have title number. Convert + % to string, which gives title label (L4) . + % + % Then tentative sorting label (author.year.sort.label) is a + % concatenation of + % L1 + % " " + % L3 + % " " + % L2 + % " " + % L4 + % + % 'field' is on top of the stack. It is already supposed to be cleaned + % (i.e., sortified and space-removed), so this is already L1. + " " * % Add spaces to L1 + make.tentative.year.sort.label * % Add year (L3). + " " * % Add spaces + " " * % L2 is empty, add spaces + title.number conv.int.to.str * % Add sorted title number (L4). + sortify % Clean up and convert to lowercase + " " * % Add spaces + month.number.day * % Add month and day when available + 'author.year.sort.label := % Assign result to sort label. +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.author.editor.sort.label} +{ author empty$ + { editor empty$ + { % + % Use what has previously been stored in title.sort.label + % as author substitute . + title.sort.label make.field.year.sort.label + } + { editor make.name.sort.label } + if$ + } + { author make.name.sort.label } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.author.sort.label} +{ author empty$ + { % + % Use what has previously been stored in title.sort.label + % as author substitute . + title.sort.label make.field.year.sort.label + } + { author make.name.sort.label } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.tentative.sort.label} +{ % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % General strategy: + % + % Ordinary situation: author or editor-acting-as-author + % available. + % => Make tentative "short cite with initials" author + % label (L1) of one of the forms + % "Last1 F1" + % "Last1 F1 Last2" + % "Last1 F1 zzzz" ("zzzz" representing et al.) + % => If more than 2 'authors': make label (L2) for 2nd-6th authors + % of one of the forms + % "Last2 Last3" + % "Last2 Last3 Last4" + % "Last2 Last3 Last4 Last5" + % "Last2 Last3 Last4 Last5 Last6" + % "Last2 Last3 Last4 Last5 Last6 zzzz" + % When key is available (overrules author and editor fields): + % => L1 = key, L2 = "" + % No author, editor, and key: define title or substitute as key + % and format as key. + % + % Then format year label (L3) of one of the forms: + % "0000" (missing year or explicit 'no date') + % "9999" ('in press') + % year (otherwise; don't use originalyear here yet) + % + % From earlier sorting of titles, we have title number. Convert + % to string, which gives title label (L4) . + % + % Then tentative sorting label (author.year.sort.label) is a + % concatenation of + % L1 + % " " + % L3 + % " " + % L2 + % " " + % L4 + % + % This can then be sorted, from which it can be derived + % whether initials are necessary, how many names must + % be used for short and full citations, and whether "a"'s and + % "b"'s etc. are necessary behind the year labels. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % key and firstkey overrule author information + % + firstkey empty$ not + { key empty$ not + { % + % Both key and firstkey available: + % for sorting and checking initials, treat key as last + % name and firstkey as initials. + % + key sortify remove.spaces + " " * + firstkey sortify remove.spaces * + make.field.year.sort.label + } + { firstkey sortify remove.spaces make.field.year.sort.label } + if$ + } + { key empty$ not + { key sortify remove.spaces make.field.year.sort.label } + { % + % No key or firstkey, so find out which field + % to use as author. + % + % Check reference type: + % if result is 1 then possibly editor acts as author + % 2 then editor does not act as author + % 3 then key should have been used + % 0 then unknown reference type + ref.type + duplicate$ #1 = + { pop$ + make.author.editor.sort.label + } + { duplicate$ #2 = + { pop$ + make.author.sort.label + } + { #3 = + { "no key in " cite$ * warning$ + make.author.editor.sort.label + } + { make.author.editor.sort.label } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + % + author.year.sort.label 'sort.key$ := +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.definitive.name.sort.label} +{ % + % Author or editor-acting-as-author available. + % => Make author-with-initials label (L1) of one of the forms + % "Last1 F1 Last2 F2 ... LastN FN" + % "Last1 F1 Last2 F2 ... Last6 F6 zzzz" + % (where N <= 6 is the total number of authors, and + % "zzzz" represents et al. if there are more than 6 authors) + % No author, editor, and key: define title or substitute as sort key. + % + % The name field is on top of the stack. + 'field := + % + % numnames is the total number of names contained in field + field num.names$ 'numnames := + % + % If there are more than 6 authors, only 6 are mentioned. + numnames name.max > + { name.max 'format.num.names := } + { numnames 'format.num.names := } + if$ + % Initialize stack with empty string + "" + % + % Cycle over authors. + #1 'nameptr := + { nameptr format.num.names < } + { % Format author and add spaces + field nameptr sort.name.format format.name$ * + " " * + nameptr #1 + 'nameptr := + } + while$ + % Format last author that must be formatted + field nameptr sort.name.format format.name$ * + % Add et al. if necessary + nameptr numnames < + { " zzzz" * } + 'skip$ + if$ + sortify % Clean up and change case + " " * % Add spaces + year.label * % Add year + " " * % Add spaces + title.number conv.int.to.str * % Add sorted title number + " " * % Add spaces + month.number.day * % Add month and day when available + 'author.year.sort.label := % Assign result to sort label. +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.definitive.field.year.sort.label} +{ % + % 'field' acts as author (L1). + % + % Then format year label (L2) of one of the forms: + % "0000" (missing year or explicit `no date') + % "9999" (`in press') + % year (otherwise; don't use originalyear here yet) + % + % From earlier sorting of titles, we have title number. Convert + % to string, which gives title label (L3) . + % + % Then tentative sorting label (author.year.sort.label) is a + % concatenation of + % L1 + % " " + % L2 + % " " + % L3 + % + % 'field' is on top of the stack. It is already supposed to be cleaned + % (i.e., sortified and space-removed), so this is already L1. + " " * % Add spaces + year.label * % Add year + " " * % Add spaces + title.number conv.int.to.str * % Add sorted title number + " " * % Add spaces + month.number.day * % Add month and day when available + 'author.year.sort.label := % Assign result to sort label. +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.definitive.author.editor.sort.label} +{ author empty$ + { editor empty$ + { % + % Use what has previously been stored in title.sort.label + % as author substitute . + title.sort.label make.definitive.field.year.sort.label + } + { editor make.definitive.name.sort.label } + if$ + } + { author make.definitive.name.sort.label } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.definitive.author.sort.label} +{ author empty$ + { % + % Use what has previously been stored in title.sort.label + % as author substitute . + title.sort.label make.definitive.field.year.sort.label + } + { author make.definitive.name.sort.label } + if$ +} +FUNCTION {make.final.sort.key} +{ ref.type #2 = + { make.definitive.author.sort.label } + { make.definitive.author.editor.sort.label } + if$ + unsorted + { citeorder.sort.label 'sort.key$ := } + { author.year.sort.label 'sort.key$ := } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + { s } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {chop.articles} +{ 's := + "a " #2 + "an " #3 + "the " #4 + s + chop.word + chop.word + chop.word +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.sort.title} +{ % + % Remove non-alphanumeric characters and change to lower case . + sortify + % + % Remove "a ", "an ", and "the " from the front . + chop.articles #1 entry.max$ substring$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.sort.title} +{ title empty$ + { text empty$ + { type empty$ + { howpublished empty$ + { note empty$ + { url empty$ + { " " } + { url format.sort.title } + if$ + } + { note format.sort.title } + if$ + } + { howpublished format.sort.title } + if$ + } + { type format.sort.title } + if$ + } + { text format.sort.title } + if$ + } + { title format.sort.title } + if$ + remove.spaces + 'title.sort.label := + title.sort.label 'sort.key$ := +} +FUNCTION {make.title.number} +{ title.sort.label old.label = + { + old.number 'title.number := + } + { + old.number #1 + 'title.number := + title.number 'old.number := + title.sort.label 'old.label := + } + if$ +} +FUNCTION {make.citeorder.number} +{ old.number #1 + 'cite.order := + cite.order 'old.number := + cite.order conv.int.to.str 'citeorder.sort.label := +} + +FUNCTION {last.part.name.format.classic} { "{ll}" } + +FUNCTION {von.junior.name.format.classic} { "{ vv}{, jj}" } + +FUNCTION {last.part.name.format} { "{vv }{ll}" } + +FUNCTION {initials.with.space.name.format} { "{f.}" } + +FUNCTION {von.last.junior.name.format} { "{vv }{ll}{ jj}" } + +FUNCTION {von.junior.name.format} { "{, jj}" } + +FUNCTION {one.complete.name.format} { "{vv }{ll}{, jj}{, ff}" } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {string.length} +{ #0 'pos := + % If the next character exists, i.e., is not empty, + % add 1 to the string length. + % We cannot use empty$ because " " empty$ is true. + { duplicate$ pos #1 + #1 substring$ "" = not } + { pos #1 + 'pos := } + while$ + pop$ pos +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {transform.spaces.and.hyphens} +{ 's := % The original string + s string.length 'len := % Its length (no. of characters) + "" 't := % Initialize the transformed string + #1 'pos := + #0 'brace.level := + % + % while (pos < len) do + % + { pos len < } + { % First, check whether we are at brace level 0 + brace.level #0 = + { + % At least two characters left: check for ". ", ".~", and ".-". + % If so, replace and shift two positions. + s pos #2 substring$ ". " = + s pos #2 substring$ ".~" = or + { t "." * 't := + pos #2 + 'pos := + } + { s pos #2 substring$ ".-" = + { t "\BHBI " * 't := + pos #2 + 'pos := + } + { % neither is true, copy one character and shift one position + t s pos #1 substring$ * 't := + % Check whether we need to increase brace level. + % Note that this is not sophisticated: it does not capture + % \{, \verb+}+, etc. + % Note also that unbalanced braces cause problems. + s pos #1 substring$ "{" = + { brace.level #1 + 'brace.level := } + 'skip$ + if$ + pos #1 + 'pos := + } + if$ + } + if$ + } + { % Not at brace level 0: copy result literally + t s pos #1 substring$ * 't := + % Check whether we need to increase or decrease brace level. + % Note that this is not sophisticated: it does not capture + % \{, \verb+}+, etc. + s pos #1 substring$ "{" = + { brace.level #1 + 'brace.level := } + { s pos #1 substring$ "}" = + { brace.level #1 - 'brace.level := } + 'skip$ + if$ + } + if$ + pos #1 + 'pos := + } + if$ + } + while$ + % + pos len = + { % Last character, copy + t s pos #1 substring$ * 't := + } + { % pos = len + 1, so s ends with ". " or ".-" + % This should not have happened, but make the best out of it. + % Push last two characters of s on the stack, i.e., ". " or ".-". + s len #1 - #2 substring$ + % Remove "\BPBI " or "\BHBI " from t + t text.length$ 'len := % Length of t (no. of characters) + t #1 len #6 - substring$ + % Concatenate and assign to t + swap$ * 't := + } + if$ + % + % Now push the result back on the stack + t +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.initials.with.hyphen} +{ % Format initials. + % Call with + % field authornumber format.initials.with.hyphen + % e.g. + % author #1 format.initials.with.hyphen + % Instead of field, a string may also be used. + % + % First, format initials in the default way, retaining spaces + % and hyphens. + initials.with.space.name.format format.name$ + transform.spaces.and.hyphens +} + +FUNCTION {format.last.part.name} +{ % Format a name with last.part.name.format, + % as part of more complicated things. + % Call with + % field authornumber format.last.part.name + % e.g. + % author #1 format.last.part.name + % Instead of field, a string may also be used. + last.part.name.format format.name$ +} + +FUNCTION {format.von.last.junior.name} +{ % Format a name with von.last.junior.name.format, + % for citing or as part of more complicated things. + % Call with + % field authornumber format.von.last.junior.name + % e.g. + % author #1 format.von.last.junior.name + % Instead of field, a string may also be used. + von.last.junior.name.format format.name$ +} + +FUNCTION {format.von.junior.name} +{ % Format a name with von.last.junior.name.format, + % for citing or as part of more complicated things. + % Call with + % field authornumber format.von.junior.name + % e.g. + % author #1 format.von.junior.name + % Instead of field, a string may also be used. + von.junior.name.format format.name$ +} + +FUNCTION {format.cite.initials.name} +{ % Format a name for citing with initials. + % Call with + % field authornumber format.cite.initials.name + % e.g. + % author #1 format.cite.initials.name + % Instead of field, a string may also be used. + % + % First, extract the complete name, format it in the canonical form, + % and push on the stack. + one.complete.name.format format.name$ + % + % Format the initials and push on the stack. + duplicate$ #1 format.initials.with.hyphen + % + % Format the von-last-junior part and push on the stack. + swap$ #1 format.von.last.junior.name + % + % Connect with "~" hyphen (if they're both non-empty). + "~" connect.check +} + +FUNCTION {format.author.name} +{ % Format an author name for the reference list. + % Call with + % field authornumber format.author.name + % e.g. + % author #1 format.author.name + % Instead of field, a string may also be used. + % + % First, extract the complete name, format it in the canonical form, + % and push on the stack. + one.complete.name.format format.name$ + % + % Make two copies of the name, format the last name and push on the stack. + duplicate$ duplicate$ #1 format.last.part.name + % + % Format the initials and push on the stack. + swap$ #1 format.initials.with.hyphen + % + % Connect with last name. + connect.with.comma.check + % + % Format the von-junior part and connect with initials. + swap$ #1 format.von.junior.name "" connect.check +} + +FUNCTION {format.editor.name} +{ % Format a name for the reference list as an editor. + % Call with + % field authornumber format.editor.name + % e.g. + % author #1 format.editor.name + % Instead of field, a string may also be used. + % + format.cite.initials.name +} + +FUNCTION {format.index.name} +{ % Format an author name for the index. + % Call with + % field authornumber format.index.name + % e.g. + % author #1 format.index.name + % Instead of field, a string may also be used. + % + format.author.name +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FUNCTION {comma.between.two} { "\BCBT {}" } + +FUNCTION {comma.between.names} { ", " } + +FUNCTION {comma.before.last} { "\BCBL {}" } + +FUNCTION {dots.before.last} { "\BDBL {}" } + +FUNCTION {and.before.last} { "\ \BBA {} " } + +FUNCTION {no.and.before.last} { " " } + +FUNCTION {et.al.string.cite} { "\ \protect \BOthers {.}" } + +FUNCTION {et.al.string} { "\ \BOthers {.}" } + +FUNCTION {et.al.string.period} { "\ \BOthersPeriod {.}" } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {add.name.index} +{ % + % + make.index + { "%" * write$ newline$ + % Check for corporate author + field is.bibcorporate + { "\corporateAX{" } + { "\AX{" } + if$ + write$ + field nameptr sort.name.format format.name$ sortify write$ newline$ + "@" write$ + field nameptr format.index.name + "}%" * write$ newline$ + } + { "%" * write$ newline$ } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.name.cite.label} +{ 'field := + 'format.num.names := + % + field num.names$ 'numnames := % numnames is the total number of names + % contained in field + % + % It is implicit in the APA manual that if "et al." would refer + % to exactly one author, then this author should be named + % instead of "et al." + % + format.num.names numnames #1 - = + { numnames 'format.num.names := } + 'skip$ + if$ + % + % Format first author: with or without initials + % + #1 'nameptr := + cite.initials #1 = + { field nameptr format.cite.initials.name } + { field nameptr cite.name.format format.name$ } + if$ + add.name.index % Add index entry when desired. + % + numnames #1 = + 'skip$ + { format.num.names #1 = + { % + % First author et al. + % + et.al.string.cite write$ + } + { numnames #2 = + { % + % Given that format.num.names > 1, it is 2. + % Format second author. + % + #2 'nameptr := + field nameptr cite.name.format format.name$ 's := + % + % Check if 2nd author is explicit "others". + % If so, insert "et al." string. + % + s "others" = + { et.al.string.cite write$ } % First et al. + { % + % First \& Second + % + and.before.last write$ + s + add.name.index % Add index entry when desired. + } + if$ + } + { % + % 3 or more names, 2 or more must be cited + % + % for nameptr := 2 to format.num.names - 1 do + % + #2 'nameptr := + { nameptr format.num.names < } + { % + % Put comma between consecutive authors + % + comma.between.names write$ + % + % Format and add next author + % + field nameptr cite.name.format format.name$ + add.name.index % Add index entry when desired. + % + % Move to next author + % + nameptr #1 + 'nameptr := + } + while$ + % + % nameptr = format.num.names + % Format this author. + % + field nameptr cite.name.format format.name$ 's := + % + format.num.names numnames = + { % + % This is also the last author. Add (optional) comma. + % + comma.before.last write$ + % + % Check if this author is explicit "others". + % If so, insert "et al." string. + % + s "others" = + { et.al.string.cite write$ } + { and.before.last write$ + s + add.name.index % Add index entry when desired. + } + if$ + } + { % + % This is not the last author. + % Add comma, author name, and "et al." + % + comma.between.names write$ + s + add.name.index % Add index entry when desired. + % + comma.before.last et.al.string.cite * write$ + } + if$ + } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.title.cite.label} +{ % + % Formatting: check if formatted as article title or + % as book title, and insert this formatting. + % + is.atype + { "\APACciteatitle {" } + { "\APACcitebtitle {" } + if$ + % + title empty$ + { text empty$ + { type empty$ + { howpublished empty$ + { note empty$ + { url empty$ + { cite$ } + { url } + if$ + } + { note } + if$ + } + { howpublished } + if$ + } + { type } + if$ + } + { text } + if$ + } + { title } + if$ + % + % Connect with formatting. + % + * "}" * + % + % Write to output + % + write$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.author.editor.cite.label} +{ author empty$ + { editor empty$ + { % + % No author or editor: + % Use title or other description as citation label. + % + make.title.cite.label + "}{%" write$ newline$ + make.title.cite.label + } + { cite.num.names.full editor make.name.cite.label + "}{%" write$ newline$ + cite.num.names.short editor make.name.cite.label + } + if$ + } + { cite.num.names.full author make.name.cite.label + "}{%" write$ newline$ + cite.num.names.short author make.name.cite.label + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.author.cite.label} +{ author empty$ + { % + % No author: + % Use title or other description as citation label. + % + make.title.cite.label + "}{%" write$ newline$ + make.title.cite.label + } + { cite.num.names.full author make.name.cite.label + "}{%" write$ newline$ + cite.num.names.short author make.name.cite.label + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.definitive.year.supplement} +{ % + % Add "a", "b", etc. when necessary. + % + add.to.year #0 = + { "" } + { "{\protect " + year empty$ + { "\BCntND " * } + { year "\bibnodate" = + year "l" change.case$ "no date" = or + year "l" change.case$ "n.d." = or + { "\BCntND " * } + { year "\BIP" = + year "l" change.case$ "in press" = or + year "l" change.case$ "forthcoming" = or + { "\BCntIP " * } + { "\BCnt " * } + if$ + } + if$ + } + if$ + "{" * add.to.year int.to.str$ * "}}" * + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {protect.year} +{ year empty$ + { "{\protect \bibnodate {}}" } + { year "\bibnodate" = + year "l" change.case$ "no date" = or + year "l" change.case$ "n.d." = or + { "{\protect \bibnodate {}}" } + { year "\BIP" = + year "l" change.case$ "in press" = or + year "l" change.case$ "forthcoming" = or + { "{\protect \BIP {}}" } + { year } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.definitive.year.label} +{ "{\protect \APACyear {" + originalyear empty$ + { protect.year } + { originalyear "\bibnodate" = % date of original publication unknown + originalyear "l" change.case$ "no date" = or + originalyear "l" change.case$ "n.d." = or + { translator empty$ + { protect.year } + { "{\protect \BTRANSL {}}~" protect.year * } + if$ + } + { year empty$ + { originalyear "/{\protect \bibnodate {}}" * } % 1923/n.d. + { originalyear year = + { protect.year } + { originalyear "/" * protect.year * } % 1923/1961 + if$ + } + if$ + } + if$ + } + if$ + * "}}%" * write$ newline$ + % + % Add "a", "b", etc. when necessary. + % + "{\protect \APACexlab {" "}}" + make.definitive.year.supplement enclose.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {make.cite.labels} +{ newline$ + % + % Write a few lines for testing purposes. + % + test + { "\bibitem [] {} \fullciteA {" cite$ * "}" * write$ newline$ + "\bibitem [] {} \citeA {" cite$ * "}" * write$ newline$ + } + 'skip$ + if$ + % + "\bibitem [\protect \citeauthoryear {%" write$ newline$ + % + % When key or firstkey is available, this takes precedence. + % + firstkey empty$ not + { % + % Full cite: firstkey. + % + firstkey write$ + "}{%" write$ newline$ + % + % Short cite: if key is not empty and cite.initials is 0, + % then key, else firstkey. + % + cite.initials #0 = + key empty$ not + and + { key } + { firstkey } + if$ + write$ + } + { key empty$ not + { % + % No firstkey, but key available: + % Both full and short labels are key. + % + key write$ + "}{%" write$ newline$ + key write$ + } + { % No key or firstkey, so find out which field + % to use as author. + % + % Check reference type: + % if result is 1 then possibly editor acts as author + % 2 then editor does not act as author + % 3 then key should have been used + % 0 then unknown reference type + ref.type #2 = + { make.author.cite.label } + { make.author.editor.cite.label } + if$ + } + if$ + } + if$ + "}{%" write$ newline$ + % + % Make year label that's used for citations + % + make.definitive.year.label write$ + "}]{%" write$ newline$ + cite$ write$ + "} " write$ newline$ + % author.year.sort.label write$ newline$ % for testing purposes + % year.label write$ newline$ % for testing purposes + % + % If the item is used in a meta-analysis, indicate this with + % a star. + % + "\APACinsertmetastar {%" write$ newline$ + cite$ write$ + "}%" write$ newline$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {editor.postfix} +{ editor num.names$ #1 > + { "(\BEDS)" } + { "(\BED)" } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {editor.trans.postfix} +{ editor num.names$ #1 > + { "(\BEDS{} \BAnd{} \BTRANSS)" } + { "(\BED{} \BAnd{} \BTRANS)" } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % "(Trans.)" postfix + % translator must not be empty + % +FUNCTION {trans.postfix} +{ translator num.names$ #1 > + { "(\BTRANSS)" } + { "(\BTRANS)" } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {authors.editors.reflist.apa5} +{ 'field := + 'dot := + % + field num.names$ 'numnames := % numnames is the total number of names + % contained in field + numnames 'format.num.names := % Format all authors + format.num.names name.max > % Unless this exceeds the maximum of 6. + { dot + { name.max 'format.num.names := } % Format 6 authors + { cite.num.names.full 'format.num.names := } % Format 1 editor + if$ + } + 'skip$ + if$ + % + % Enclose authors in APACrefauthors environment to allow crude style + % options in \LaTeX. + "\begin{APACrefauthors}%" + write$ newline$ + % + % It is kind of explicit in the APA manual that if "et al." would + % refer to exactly one author (the 7th), then this author should + % still be replaced by "et al.", unlike with citations. + % So format.num.names is not adapted. + % + % Format first author + % + #1 'nameptr := + field nameptr format.author.name + % + % Add period if required and if this is the only author. + % + numnames #1 = + dot + and + { add.period$ } + 'skip$ + if$ + add.name.index % Add index entry when desired. + % + numnames #1 = + 'skip$ + { format.num.names #1 = + { % + % First author et al. + % + comma.between.two + % + % Add period if required. + % + dot + { et.al.string.period * } + { et.al.string * } + if$ + write$ + } + { numnames #2 = + { % + % Given that format.num.names > 1, it is 2. + % + comma.between.two write$ + % + % Format second author. + % + #2 'nameptr := + field nameptr format.author.name 's := + % + % Check if 2nd author is explicit "others". + % If so, insert "et al." string. + % + s "others" = + { % + % First et al. + % Add period if required. + % + dot + { et.al.string.period } + { et.al.string } + if$ + write$ + } + { % + % First \& Second + % + and.before.last write$ + % + % Add period if required. + % + dot + { s add.period$ } + { s } + if$ + add.name.index % Add index entry when desired. + } + if$ + } + { % + % 3 or more names, 2 or more must be cited + % + % for nameptr := 2 to format.num.names - 1 do + % + #2 'nameptr := + { nameptr format.num.names < } + { % + % Put comma between consecutive authors + % + comma.between.names write$ + % + % Format and add next author + % + field nameptr format.author.name + add.name.index % Add index entry when desired. + % + % Move to next author + % + nameptr #1 + 'nameptr := + } + while$ + % + % nameptr = format.num.names + % Format this author. + % + field nameptr format.author.name 's := + % + format.num.names numnames = + { % + % This is also the last author. Add (optional) comma. + % + comma.before.last write$ + % + % Check if this author is explicit "others". + % If so, insert "et al." string. + % + s "others" = + { % + % Add period if required. + % + dot + { et.al.string.period } + { et.al.string } + if$ + write$ + } + { and.before.last write$ + % + % Add period if required. + % + dot + { s add.period$ } + { s } + if$ + add.name.index % Add index entry when desired. + } + if$ + } + { % + % This is not the last author. + % Add comma, author name, and "et al." + % + comma.between.names write$ + s + add.name.index % Add index entry when desired. + % + comma.before.last + % + % Add period if required. + % + dot + { et.al.string.period * } + { et.al.string * } + if$ + write$ + } + if$ + } + if$ + } + if$ + } + if$ + % + % End APACrefauthors environment. + "\end{APACrefauthors}%" + write$ newline$ +} + +FUNCTION {authors.reflist.apa6} +{ 'field := + 'dot := + field num.names$ 'numnames := + numnames #7 > + { #7 'format.num.names := } + { numnames 'format.num.names := } + if$ + "\begin{APACrefauthors}%" + write$ newline$ + #1 'nameptr := + field nameptr format.author.name + numnames #1 = + { dot + { %add.period$ +} + 'skip$ + if$ + add.name.index + } + { add.name.index + numnames #2 = + { comma.between.two write$ + #2 'nameptr := + field nameptr format.author.name 's := + s "others" = + { "`others' not consistent with 6th ed. of the APA Manual" + warning$ + dot + { et.al.string.period } + { et.al.string } + if$ + write$ newline$ + } + { and.before.last write$ + dot + { s add.period$ } + { s } + if$ + add.name.index + } + if$ + } + { %% for nameptr := 2 to format.num.names - 1 do + #2 'nameptr := + { nameptr format.num.names < } + { comma.between.names write$ + field nameptr format.author.name + add.name.index + nameptr #1 + 'nameptr := + } + while$ + field numnames format.author.name 's := + format.num.names numnames = + { comma.before.last write$ + s "others" = + { "`others' not consistent with 6th ed. of the APA " + "Manual" * + warning$ + dot + { et.al.string.period } + { et.al.string } + if$ + write$ + } + { no.and.before.last write$ + dot + { s add.period$ } + { s } + if$ + add.name.index + } + if$ + } + { dots.before.last write$ + s + add.name.index + } + if$ + } + if$ + } + if$ + "\end{APACrefauthors}%" + write$ newline$ +} + +FUNCTION {format.author.names} +{ 'field := + 'dot := + dot + { dot field authors.reflist.apa6 } + { dot field authors.editors.reflist.apa5 } + if$ +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.authors} +{ #1 author format.author.names } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.editors.as.authors} +{ #0 editor format.author.names + "\ " editor.postfix * add.period$ write$ newline$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.ed.trans.as.authors} +{ #0 editor format.author.names + "\ " editor.trans.postfix * add.period$ write$ newline$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.editor.names} +{ 'field := + % + field num.names$ 'numnames := % numnames is the total number of names + % contained in field + numnames 'format.num.names := % Format all authors + format.num.names name.max > % Unless this exceeds the maximum of 6. + { #1 'format.num.names := } % Then it becomes 1 (First et al.) + 'skip$ + if$ + % + % Format first editor + % + field #1 format.editor.name + % + numnames #1 = + 'skip$ + { format.num.names #1 = + { et.al.string * } % First editor et al., no comma. + { numnames #2 = + { % + % Given that format.num.names > 1, it is 2. + % No comma. Format second editor. + % + field #2 format.editor.name 's := + % + % Check if 2nd editor is explicit "others". + % If so, insert "et al." string. + % + s "others" = + { et.al.string * } % First et al. + { and.before.last * s * } % First \& Second + if$ + } + { % + % 3 or more names, 2 or more must be cited + % + % for nameptr := 2 to format.num.names - 1 do + % + #2 'nameptr := + { nameptr format.num.names < } + { % + % Put comma between consecutive editors + % + comma.between.names * + % + % Format and add next editor + % + field nameptr format.editor.name * + % + % Move to next editor + % + nameptr #1 + 'nameptr := + } + while$ + % + % nameptr = format.num.names + % Format this editor. + % + field nameptr format.editor.name 's := + % + format.num.names numnames = + { % + % This is also the last editor. Add (optional) comma. + % + comma.before.last * + % + % Check if this editor is explicit "others". + % If so, insert "et al." string. + % + s "others" = + { et.al.string * } + { and.before.last * s * } + if$ + } + { % + % This is not the last editor. + % Add comma, editor name, and "et al." + % + comma.between.names * s * + comma.before.last * et.al.string * + } + if$ + } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format editors in case editors do not act as authors + % (such as reference to chapter in edited book) + % + % L. W. Poon (Ed.) (1 editor) + % or + % A. S. Gurman \& D. P. Kniskern (Eds.) (2 editors) + % or + % L. Poon, A. Jones, \& D. P. Smith (Eds.) (>2 editors) + % + % editor must not be empty + % +FUNCTION {format.editors.in.line} +{ editor format.editor.names + editor.postfix connect.with.space.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format editors in case editors are also translators + % and do not act as authors + % (such as reference to chapter in edited book + % of translated articles) + % + % L. W. Poon (Ed. and Trans.) (1 editor) + % or + % A. S. Gurman \& D. P. Kniskern (Eds. and Trans.) (2 editors) + % or + % L. Poon, A. Jones, \& D. P. Smith (Eds. and Trans.) (>2 editors) + % + % editor must not be empty + % +FUNCTION {format.editors.trans.in.line} +{ editor format.editor.names + editor.trans.postfix connect.with.space.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format translators in case translators act as editors + % (such as reference to chapter in translated book) + % + % L. W. Poon (Trans.) (1 translator) + % or + % A. S. Gurman \& D. P. Kniskern (Trans.) (2 translators) + % or + % L. Poon, A. Jones, \& D. P. Smith (Trans.) (>2 translators) + % + % translator must not be empty + % +FUNCTION {format.translators.in.line} +{ translator format.editor.names + trans.postfix connect.with.space.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format translators in case translator does not act as editor + % (such as reference to translated book) + % + % L. Solotaroff, Trans. + % +FUNCTION {format.translators.in.paren.check} +{ translator empty$ + { "" } + { translator format.editor.names + translator num.names$ #1 > + { ", \BTRANSS{}" * } + { ", \BTRANS{}" * } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format editors and translators in case neither act as editor + % (such as reference to edited or translated book with a + % a single author) + % + % L. Solotaroff, Ed. + % L. Solotaroff, Ed. \& Trans. + % L. Solotaroff, Trans. + % L. Solotaroff, Ed. \& S. Prokofieff, Trans. + % +FUNCTION {format.editors.translators.in.paren.check} +{ editor empty$ + { translator empty$ + { "" } + { translator format.editor.names + translator num.names$ #1 > + { ", \BTRANSS{}" * } + { ", \BTRANS{}" * } + if$ + } + if$ + } + { editor format.editor.names + editor num.names$ #1 > + { ", \BEDS{}" * } + { ", \BED{}" * } + if$ + translator empty$ + 'skip$ + { editor translator = + { editor num.names$ #1 > + { " \BAnd{} \BTRANSS" * } + { " \BAnd{} \BTRANS" * } + if$ + } + { " \BAnd{} " * + translator format.editor.names * + translator num.names$ #1 > + { ", \BTRANSS{}" * } + { ", \BTRANS{}" * } + if$ + } + if$ + } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % translator of article + % +FUNCTION {format.atrans.check} +{ format.translators.in.paren.check parenthesize.check } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format "In editor (Ed.), " + % +FUNCTION {format.in.editors} +{ "\BIn{} " + editor empty$ + 'skip$ + { format.editors.in.line * ", " * } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format "In translator (Trans.)," + % +FUNCTION {format.in.trans} +{ "\BIn{} " + translator empty$ + 'skip$ + { format.translators.in.line * ", " * } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format "In editor (Ed. and Trans.)" + % or "In editor (Ed.)" if editor not equal to translator + % +FUNCTION {format.in.editors.trans} +%{ "\BIn{} " Commented by SPI +{ " " + editor empty$ + { translator empty$ + 'skip$ + { format.translators.in.line * ", " * } + if$ + } + { translator empty$ + { format.editors.in.line * } + { editor translator = + { format.editors.trans.in.line * } + { format.editors.in.line * } + if$ + } + if$ + ", " * + } + if$ +} + +FUNCTION {in.format.in.editors.trans} +{ "\BIn{} " + editor empty$ + { translator empty$ + 'skip$ + { format.translators.in.line * ", " * } + if$ + } + { translator empty$ + { format.editors.in.line * } + { editor translator = + { format.editors.trans.in.line * } + { format.editors.in.line * } + if$ + } + if$ + ", " * + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.year.check} +{ "\APACrefYear{" + protect.year * + % + % Add "a", "b", etc. when necessary. + % + make.definitive.year.supplement * + "}" * +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {format.year.month.day.check} +{ "\APACrefYearMonthDay{" + protect.year * + % + % Add "a", "b", etc. when necessary. + % + make.definitive.year.supplement * + "}{" * + % + % Add month and day when present. + % + month empty$ + 'skip$ + { month * } + if$ + "}{" * + day empty$ + 'skip$ + { day * } + if$ + "}" * +} +FUNCTION {format.year.nomonth.day.check} +{ "\APACrefYearMonthDay{" + protect.year * + % + % Add "a", "b", etc. when necessary. + % + make.definitive.year.supplement * + "}{" * + % + % Add month and day when present. + % + month empty$ + 'skip$ + { } + if$ + "}{" * + day empty$ + 'skip$ + { day * } + if$ + "}" * +} + +FUNCTION {format.atitle.no.dot} +{ "{\BBOQ}" swap$ + "{\BBCQ}" swap$ + duplicate$ empty$ + 'skip$ + { duplicate$ + % Two arguments: Title twice: (1) don't change case; (2) change case + "\APACrefatitle {" swap$ * "} {" * swap$ + "t" change.case$ + * "}" * + } + if$ + enclose.check +} + +FUNCTION {format.atitle.dot} +{ "{\BBOQ}" swap$ + "{\BBCQ}" swap$ + duplicate$ empty$ + 'skip$ + { duplicate$ + % Two arguments: Title twice: (1) don't change case; (2) change case + "\APACrefatitle {" swap$ * "} {" * swap$ + "t" change.case$ + * "}" * add.period$ + } + if$ + enclose.check +} + +FUNCTION {format.atitle.connect} +{ swap$ + duplicate$ empty$ + { pop$ + format.atitle.dot + } + { swap$ + format.atitle.no.dot + swap$ connect.with.space.check + add.period$ + } + if$ +} + +FUNCTION {format.btitle.no.dot} +{ duplicate$ empty$ + { pop$ + "" + } + { duplicate$ + % Two arguments: Title twice: (1) don't change case; (2) change case + "\APACrefbtitle {" swap$ * "} {" * swap$ + "t" change.case$ + * "}" * + } + if$ +} + +FUNCTION {format.btitle.dot} +{ duplicate$ empty$ + { pop$ + "" + } + { add.period$ format.btitle.no.dot } + if$ +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title of book and similar + % field must be on top of stack + % second element on stack must be connected: + % if that is empty, then btitle.dot + % else btitle.no.dot, connect, and add period + % +FUNCTION {format.btitle.connect} +{ swap$ + duplicate$ empty$ + { pop$ + format.btitle.dot + } + { swap$ + format.btitle.no.dot + swap$ connect.with.space.check + add.period$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title of book and similar + % field must be on top of stack + % second element on stack must be connected + % +FUNCTION {format.btitle.connect.no.dot} +{ swap$ + duplicate$ empty$ + { pop$ + format.btitle.no.dot + } + { swap$ + format.btitle.no.dot + swap$ connect.with.space.check + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format englishtitle (of nonenglish article, etc.) + % +FUNCTION {format.aetitle.check} +{ englishtitle empty$ + { "" } + { % Two arguments: Title twice: (1) don't change case; (2) change case + "\APACrefaetitle {" englishtitle * "} {" * + englishtitle "t" change.case$ * "}" * + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format englishtitle (of nonenglish book, etc.) + % +FUNCTION {format.betitle.check} +{ englishtitle empty$ + { "" } + { % Two arguments: Title twice: (1) don't change case; (2) change case + "\APACrefbetitle {" englishtitle * "} {" * + englishtitle "t" change.case$ * "}" * + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format type (of article, etc.) + % +FUNCTION {format.atype.check} +{ type bracket.check } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format title and englishtitle (of article, etc.) + % +FUNCTION {format.atitle.check} +{ format.aetitle.check + title format.atitle.connect +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format title, englishtitle, and type + % (of article, etc.) + % +FUNCTION {format.atitle.type.check} +{ format.aetitle.check + format.atype.check connect.with.space.check + title format.atitle.connect +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format title, englishtitle, + % and translator (of article, etc.) + % +FUNCTION {format.atitle.trans.check} +{ format.aetitle.check + format.atrans.check connect.with.space.check + title format.atitle.connect +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format title, englishtitle, type, + % and translator (of article, etc.) + % +FUNCTION {format.atitle.type.trans.check} +{ format.aetitle.check + format.atype.check connect.with.space.check + format.atrans.check connect.with.space.check + title format.atitle.connect +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format journal, volume, number and pages + % call with + % formatted.pages format.journal.vol.num.pages.check + % +FUNCTION { format.journal.vol.num.pages.check } +{ "journal" journal warning.if.empty + duplicate$ empty$ + journal empty$ and + volume empty$ and + number empty$ and + { pop$ "" } + { "\APACjournalVolNumPages{" journal "" connect.check + "}{" * volume "" connect.check + "}{" * number "" connect.check + "}{" * swap$ "" connect.check + ",}" * + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % volume of book, checks whether + % "Volume" or "Volumes" + % + % call with + % field format.bvolume.check + % +FUNCTION {format.bvolume.check} +{ duplicate$ empty$ + 'skip$ + { duplicate$ multi.result.check + { "\BVOLS" swap$ tie.or.space.connect } + { "\BVOL" swap$ tie.or.space.connect } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % edition of book, must not be empty + % call with + % field format.edition.check + % +FUNCTION {format.edition.check} +{ duplicate$ empty$ + 'skip$ + { "\PrintOrdinal{" swap$ * "}" * + "\BEd" connect.with.space.check + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % volume and edition of book + % +FUNCTION {format.bvol.edition.check} +{ edition format.edition.check + volume format.bvolume.check + connect.with.comma.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % volume and edition of book + % +FUNCTION {format.bvol.edition} +{ format.bvol.edition.check + parenthesize.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % volume and edition and translator of translated book + % +FUNCTION {format.bvol.edition.trans} +{ format.bvol.edition.check + format.translators.in.paren.check connect.with.semicolon.check + parenthesize.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % volume, edition, editor, and translator of (translated) book + % +FUNCTION {format.bvol.edition.editor.trans} +{ format.bvol.edition.check + format.editors.translators.in.paren.check connect.with.semicolon.check + parenthesize.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % formats pages by first checking if 1 or more pages + % and prefixing pages with "p." or "pp." (these strings + % are given in the commands \BPG and \BPGS, respectively), + % whichever is applicable, and do a tie or space connect + % + % call with + % field format.bpages.check + % +FUNCTION {format.bpages.check} +{ duplicate$ empty$ + 'skip$ + { duplicate$ multi.result.check + { "\BPGS" swap$ tie.or.space.connect } + { "\BPG~" swap$ * } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % formats chapters by first checking if 1 or more chapters + % and prefixing pages with "chap." (this string + % is given in the commands \BCHAP and \BCHAPS, respectively), + % whichever is applicable, and do a tie or space connect + % + % call with + % field format.bchapter.check + % +FUNCTION {format.bchapter.check} +{ duplicate$ empty$ + 'skip$ + { duplicate$ multi.result.check + { "\BCHAPS" swap$ tie.or.space.connect } + { "\BCHAP" swap$ tie.or.space.connect } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % volume, edition, and pages or chapter of article in book etc. + % +FUNCTION {format.bvol.edition.pages} +{ format.bvol.edition.check + pages empty$ + { chapter format.bchapter.check connect.with.comma.check } + { pages format.bpages.check connect.with.comma.check } + if$ + parenthesize.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title, volume, edition of book + % +FUNCTION {format.btitle.vol.edition} +{ format.betitle.check + format.bvol.edition connect.with.space.check + title format.btitle.connect.no.dot +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title, volume, edition, and translator of book + % +FUNCTION {format.btitle.vol.edition.trans} +{ format.betitle.check + format.bvol.edition.trans connect.with.space.check + title format.btitle.connect.no.dot +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title, volume, edition, editor, and translator of book + % +FUNCTION {format.btitle.vol.edition.editor.trans} +{ format.betitle.check + format.bvol.edition.editor.trans connect.with.space.check + title format.btitle.connect.no.dot +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format address and publisher of book etc. + % + % New York: Wiley + % or + % Wiley (if address empty) + % or + % New York (if publisher empty) + % +FUNCTION {format.address.publisher} +{ % + % If publisher = author or publisher = "author" or publisher = "Author" + % then hand over the final choice how to format this to \LaTeX. + % (I could imagine similar code for editors, but the APA manual does + % not mention it and then we'd have to check whether the editor is in + % the author position, so let's keep it simple until someone complains.) + % + author empty$ + publisher empty$ or + { publisher "\APACaddressPublisher{" } + { author publisher = + "author" publisher = or + "Author" publisher = or + { author "\APACaddressPublisherEqAuth{" } + { publisher "\APACaddressPublisher{" } + if$ + } + if$ + address "" connect.check "}{" * + % Recover publisher that was pushed onto the stack previously. + swap$ "" connect.check "}" * +} + +FUNCTION {format.address.publisher.check} +{ publisher empty$ + address empty$ + and + 'skip$ + { + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.address.publisher + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format number as in reports: No. 2017 + % call with + % field format.rnumber.check + % +FUNCTION {format.rnumber.check} +{ duplicate$ empty$ + 'skip$ + { duplicate$ multi.result.check + { "\BNUMS" swap$ tie.or.space.connect } + { "\BNUM" swap$ tie.or.space.connect } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format type and number of a standalone item + % call with + % format.type.number + % +FUNCTION { format.type.number } +{ type empty$ + { type.2 } + { type } + if$ + number empty$ + { bracket.check } + { number format.rnumber.check connect.with.space.check + parenthesize.check + } + if$ +} + +FUNCTION {format.howpublished} +{ howpublished empty$ + 'skip$ + { % clear the stack + duplicate$ empty$ + 'pop$ + { output.dot.new.block } + if$ + "\APAChowpublished {" howpublished * "}" * + } + if$ +} +FUNCTION {output.howpublished} +{ howpublished empty$ + 'skip$ + { "\APAChowpublished {" howpublished * "}" * + output.dot.new.block + } + if$ +} +FUNCTION {howpublished.block} +{ howpublished empty$ + 'skip$ + { start.new.block + "\APAChowpublished {" howpublished * "}" * + output.dot.end.block + } + if$ +} +FUNCTION {begin.end.url.env} +{ "\begin{APACrefURL} " + lastchecked empty$ + { urldate empty$ + 'skip$ + { "[{" * urldate * "}]" * } + if$ + } + { "[{" * lastchecked * "}]" * } + if$ + " \end{APACrefURL} " +} + +FUNCTION {begin.end.doi.env} +{ "\begin{APACrefDOI} " + " \end{APACrefDOI} " +} + +FUNCTION {begin.end.msg.env} +{ "\begin{APACrefURLmsg} " + " \end{APACrefURLmsg} " +} +FUNCTION {format.url} +{ type.2 empty$ + { begin.end.url.env } + { type.2 "\bibmessage" = + { begin.end.msg.env } + { begin.end.url.env } + if$ + } + if$ +%%"\url{" url * "}" * + "{" url * "}" * + enclose.check +} +FUNCTION {url.block} +{ doi empty$ + { url empty$ + 'skip$ + { start.new.block + format.url + output.end.block + } + if$ + } + 'skip$ + if$ +} +FUNCTION {format.doi} +{ begin.end.doi.env + "\doi{" doi * "}" * + enclose.check +} +FUNCTION {doi.block} +{ doi empty$ + 'skip$ + { start.new.block + format.doi + output.end.block + } + if$ +} +FUNCTION {format.note} +{ "\APACrefnote{" "}" note enclose.check } +FUNCTION {note.block} +{ note empty$ + 'skip$ + { start.new.block + format.note + output.end.block + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format original year of publication and note + % (reprint or translation) + % +FUNCTION {format.orig.year.note} +{ originalyear empty$ + { format.note } + { "\APACorigyearnote{" + originalyear "" connect.check "}{" * + note "" connect.check "}" * + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format original journal of publication and note + % (reprint or translation) + % +FUNCTION {format.orig.journal.note} +{ "\APACorigjournalnote{" + originalyear "" connect.check "}{" * + originaljournal "" connect.check "}{" * + originalvolume "" connect.check "}{" * + originalnumber "" connect.check "}{" * + originalpages "" connect.check "}{" * + note "" connect.check "}" * +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format original book of publication and note + % (reprint or translation) + % +FUNCTION {format.orig.book.note} +{ "\APACorigbooknote{" originalyear "" connect.check "}{" * + % + originaleditor empty$ + 'skip$ + { originaleditor num.names$ #1 > + { "\APACorigEDS {" * originaleditor format.editor.names * "}" * } + { "\APACorigED {" * originaleditor format.editor.names * "}" * } + if$ + } + if$ + % + "}{" * + originalbooktitle format.btitle.no.dot "" connect.check "} {" * + originaledition format.edition.check "" connect.check "} {" * + originalvolume format.bvolume.check "" connect.check "} {" * + originalpages format.bpages.check "" connect.check "} {" * + originaladdress "" connect.check "} {" * + originalpublisher "" connect.check "} {" * + note "" connect.check "}" * +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format information about original publication of reprint + % and format optional note + % +FUNCTION {format.orig.note} +{ originaljournal empty$ + { originalbooktitle empty$ + { note empty$ + { originalyear empty$ + 'skip$ + { originalyear "\bibnodate" = + originalyear "l" change.case$ "no date" = or + originalyear "l" change.case$ "n.d." = or + 'skip$ + { output.new.block + format.orig.year.note + } + if$ + } + if$ + } + { output.new.block + format.orig.year.note + } + if$ + } + { output.new.block + format.orig.book.note + } + if$ + } + { output.new.block + format.orig.journal.note + } + if$ +} +FUNCTION {fin.entry} +{ %doi empty$ + % 'skip$ + % { output.new.block + % format.doi + % } + % if$ + output.end.block + "\PrintBackRefs{\CurrentBib}" write$ newline$ + test + { "\vspace{\baselineskip}" write$ newline$ } + 'skip$ + if$ +} +FUNCTION {fin.entry.2} +{ doi.block + "\PrintBackRefs{\CurrentBib}" write$ newline$ + test + { "\vspace{\baselineskip}" write$ newline$ } + 'skip$ + if$ +} + +FUNCTION {format.archive} +{ + archivePrefix empty$ + { "" } + { archivePrefix ":" *} + if$ +} + +FUNCTION {format.primaryClass} +{ + primaryClass empty$ + { "" } + { " {[" primaryClass * "]}" *} + if$ +} + +FUNCTION {format.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + { "{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {format.softmisc.archive} +{ + archivePrefix empty$ + { "" } + { "" } + if$ +} + +FUNCTION {format.softmisc.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {periodical} +{ + author empty$ + % + % no author: possibly special issue with editors as authors + % (APA manual, ex. 11, p. 121) + % + { editor empty$ + % + % no author or editor: title serves as author. + % title formatted as article title (APA manual not consistent in this, + % compare statement on p. 119: ``treat as book title'' and + % example 8, p. 121: no underlining => article title) + % + { format.atitle.type.trans.check output.new.block + % + % now formatted date on top of stack + % + output.dot.new.block + } + % + % format editor and year, and check if year is present + % format article title and check if title or type present + % + { format.editors.as.authors start.new.block + % + % now formatted date on top of stack + % + output.dot.new.block + format.atitle.type.trans.check output.new.block + } + if$ + } + % + % format author and year, and check if year is present + % format article title and check if title or type present + % + { format.authors start.new.block + % + % now formatted date on top of stack + % + output.dot.new.block + format.atitle.type.trans.check output.new.block + } + if$ + % + % format journal name, volume and issue number, and pages + % and check if journal not empty + % + format.journal.vol.num.pages.check +% output.new.block + doi empty$ + 'skip$ + { output.new.block + format.doi + } + if$ + % + % if not empty, insert howpublished. + % (used if article is retrieved from the internet) + % +% format.howpublished add.period$ + % + % format url + % + url empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + % + % possible reprint and optional note + % + format.orig.note + output.new.block + format.eprint + output.new.block + format.primaryClass + fin.entry + } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % journal article + % +FUNCTION {article} +{ pages format.year.month.day.check periodical } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % magazine article + % +FUNCTION {magazine} +{ pages format.year.month.day.check periodical } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % newspaper article + % +FUNCTION {newspaper} +{ pages format.bpages.check format.year.month.day.check periodical } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % (translation of) entire book + % +FUNCTION {book} +{ % + % author or editor, + % year, title, englishtitle, translator + % + author empty$ + % + % no author: possibly edited book with editors as authors + % + { editor empty$ + % + % no author or editor: title serves as author. + % title formatted as book title + % + { format.btitle.vol.edition.trans + format.type.number connect.with.space.check + output.dot.new.block + format.year.check add.period$ + } + % + % format editor and year, and check if year is present + % format booktitle, volume, and edition and check if title present + % + { translator empty$ + { format.editors.as.authors start.new.block + format.year.check output.dot.new.block + format.btitle.vol.edition + } + % + % format translator correctly + % + { translator editor = + not + { format.editors.as.authors start.new.block + format.year.check output.dot.new.block + format.btitle.vol.edition.trans + } + { format.ed.trans.as.authors start.new.block + format.year.check output.dot.new.block + format.btitle.vol.edition + } + if$ + } + if$ + format.type.number connect.with.space.check + add.period$ + } + if$ + } + % + % format author and year, and check if year is present + % format booktitle, volume, and edition and check if title present + % + { format.authors start.new.block + format.year.check output.dot.new.block + format.btitle.vol.edition.editor.trans + format.type.number connect.with.space.check + add.period$ + } + if$ + % + % format address and publisher + % + format.address.publisher.check + % + % if not empty, insert howpublished. + % (used if book is retrieved from the internet) + % + format.howpublished add.period$ + % + % format url + % + url empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + % + % format original publication (of reprint/translation) + % and optional note + % + format.orig.note + fin.entry +} +FUNCTION {incollection} +{ author empty$ + { editor.ne.trans + { format.atitle.type.trans.check } + { format.atitle.type.check } + if$ + output.new.block + format.year.month.day.check add.period$ + } + { format.authors start.new.block + format.year.month.day.check output.dot.new.block + editor.ne.trans + { format.atitle.type.trans.check } + { format.atitle.type.check } + if$ + } + if$ + editor empty$ + translator empty$ and + edition empty$ and + volume empty$ and + pages empty$ and + chapter empty$ and + booktitle empty$ and + 'skip$ + { + output.new.block + format.in.editors.trans + format.bvol.edition.pages + booktitle format.btitle.connect * add.period$ + } + if$ + format.address.publisher.check + format.howpublished add.period$ + url empty$ + 'skip$ + { + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + format.orig.note + fin.entry +} + +FUNCTION {inbookcollection} +{ author empty$ + { editor.ne.trans + { format.atitle.type.trans.check } + { format.atitle.type.check } + if$ + output.new.block + format.year.month.day.check add.period$ + } + { format.authors start.new.block + format.year.month.day.check output.dot.new.block + editor.ne.trans + { format.atitle.type.trans.check } + { format.atitle.type.check } + if$ + } + if$ + editor empty$ + translator empty$ and + edition empty$ and + volume empty$ and + pages empty$ and + chapter empty$ and + booktitle empty$ and + 'skip$ + { + output.new.block + in.format.in.editors.trans + format.bvol.edition.pages + booktitle format.btitle.connect * add.period$ + } + if$ + format.address.publisher.check + format.howpublished add.period$ + url empty$ + 'skip$ + { + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + format.orig.note + fin.entry +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % technical report number + % +FUNCTION {format.tr.number} +{ type empty$ + { "\BTR{}" } + { type "\bibnotype" = + { "" } + { type } + if$ + } + if$ + number format.rnumber.check connect.with.space.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title, volume, edition, report number + % +FUNCTION {format.tr.title.number} +{ format.betitle.check + % Single out the situation in which there is no number + % and type = {\bibnotype}, i.e., no type as well. + % (Why not use book then?) + type empty$ + { % Now, we're in the regular situation with at least a + % number, a type, a volume, or an edition. + "\APACbVolEdTR{" format.bvol.edition.check * "}{" * + format.tr.number * "}" * + } + { type "\bibnotype" = + number empty$ + volume empty$ + edition empty$ + and + and + and + { "" } + { % Now, we're in the regular situation with at least a + % number, a type, a volume, or an edition. + "\APACbVolEdTR {" format.bvol.edition.check * "}{" * + format.tr.number * "}" * + } + if$ + } + if$ + connect.with.space.check + title format.btitle.connect +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % format address and institution of reports etc. + % + % Washington, DC: National Institute of Education + % or + % National Institute of Education (if address empty) + % + % warning if no institution + % +FUNCTION {format.address.institution.check} +{ url empty$ + doi empty$ and + { "institution" institution warning.if.empty + "address" address warning.if.empty + } + 'skip$ + if$ + institution empty$ + address empty$ + and + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + % + % If institution = author or institution = "author" + % or institution = "Author" then hand over the final choice how to + % format this to \LaTeX. See also format.address.publisher + % + author empty$ + institution empty$ or + { institution "\APACaddressInstitution{" } + { author institution = + "author" institution = or + "Author" institution = or + { author "\APACaddressInstitutionEqAuth{" } + { institution "\APACaddressInstitution{" } + if$ + } + if$ + address "" connect.check "}{" * + % Recover institution that was pushed onto the stack previously. + swap$ "" connect.check "}" * + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % reports + % +FUNCTION {techreport} +{ author empty$ + % + % no author: possibly edited report with editors as authors + % + { editor empty$ + % + % no author or editor: title serves as author. + % title formatted as book title + % + { format.tr.title.number output.dot.new.block + format.year.month.day.check add.period$ + } + % + % format editor and year, and check if year is present + % format report title and check if title present + % format volume, edition, type, and number + % + { format.editors.as.authors start.new.block + format.year.month.day.check output.dot.new.block + format.tr.title.number add.period$ + } + if$ + } + % + % format author and year, and check if year is present + % format report title and check if title present + % format volume, edition, type, and number + % + { format.authors start.new.block + format.year.month.day.check output.dot.new.block + format.tr.title.number add.period$ + } + if$ + % + % format address and institution, check if institution present + % + format.address.institution.check + % + % if not empty, insert howpublished. + % (used if report is retrieved from the internet) + % + format.howpublished add.period$ + % + % format url + % + url empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + % + % format optional note + % + note empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.note + } + if$ + fin.entry +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % (translated) article or chapter in report + % +FUNCTION {intechreport} +{ author empty$ + % + % no author: title serves as author. + % title formatted as article title (APA manual not consistent in this, + % compare statement on p. 119: ``treat as book title'' and + % example 8, p. 121: no underlining => article title) + % + { editor.ne.trans + { format.atitle.trans.check } + { format.atitle.check } + if$ + output.new.block + format.year.month.day.check output.dot.new.block + } + % + % format author and year, and check if year is present + % format article title and check if title or type present + % + { format.authors start.new.block + format.year.month.day.check output.dot.new.block + editor.ne.trans + { format.atitle.trans.check } + { format.atitle.check } + if$ + output.new.block + } + if$ + % + % format "In " editor " (Ed. \& Trans.), " + % booktitle, volume, edition, pages + % + format.in.editors.trans + % + % volume, edition, report type and number, pages + % + "\APACbVolEdTRpgs {" format.bvol.edition.check * "} {" * + format.tr.number * + "} {" * pages format.bpages.check * + "}" * + % + booktitle format.btitle.connect * + add.period$ + % + % format address and publisher + % + format.address.institution.check + % + % if not empty, insert howpublished. + % (used if report is retrieved from the internet) + % + format.howpublished add.period$ + % + % format url + % + url empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + % + % format original publication (of reprint/translation) + % and optional note + % + format.orig.note + fin.entry +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % papers presented at conferences etc. + % +FUNCTION {lecture} +{ author empty$ + { "author" author warning.if.empty } + { format.authors start.new.block } + if$ + % + % format year, month, and day, and check if year present + % format title and check if title present + % format howpublished and check if howpublished present + % + format.year.month.day.check output.dot.new.block + symposium empty$ + { format.betitle.check + title format.btitle.connect output.new.block + howpublished empty$ + { "symposium and howpublished missing in " cite$ * warning$ + "" + } + { "\APAChowpublished {" howpublished * "}" * } + if$ + address connect.with.comma.check + } + { format.atitle.type.check output.new.block + "\BIn{} " + chair empty$ + 'skip$ + { chair format.editor.names + chair num.names$ #1 > + { "(\BCHAIRS)" } + { "(\BCHAIR)" } + if$ + connect.with.space.check * ", " * + } + if$ + symposium format.btitle.no.dot * + format.howpublished + address connect.with.comma.check + } + if$ + add.period$ + % + % format url + % + url empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + % + % format optional note + % + note empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.note + } + if$ + fin.entry +} + +FUNCTION {format.ttitle.type.school} +{ doi empty$ not + url empty$ not or + howpublished empty$ not or + { pop$ } + { swap$ pop$ } + if$ + type empty$ + 'skip$ + { type "\bibnotype" = + { pop$ + "" + } + { pop$ + type + } + if$ + } + if$ + duplicate$ empty$ + doi empty$ + url empty$ and + howpublished empty$ and + address empty$ + school empty$ and or and + { 'pop$ + title empty$ not + englishtitle empty$ not or + { start.new.block } + 'skip$ + if$ + "" + } + { start.new.block + "\APACtypeAddressSchool {" swap$ * "}{" * + doi empty$ + url empty$ and + howpublished empty$ and + { "}{}" * } + { address "" connect.check "}{" * + school "" connect.check "}" * + } + if$ + } + if$ + format.betitle.check swap$ + connect.with.space.check + "title" title warning.if.empty + title format.btitle.connect +} +FUNCTION {unpub.address.school.block} +{ doi empty$ + url empty$ and + howpublished empty$ and + { "school" school warning.if.empty + school empty$ + address empty$ and + 'skip$ + { start.new.block + "\APACaddressSchool {" address "" connect.check "}{" * + school "" connect.check "}" * + output.dot.end.block + } + if$ + } + 'skip$ + if$ +} +FUNCTION {thesis} +{ journal empty$ not + { pop$ pop$ + article + } + { author empty$ + { "author" author warning.if.empty } + { format.authors start.new.block } + if$ + format.year.check output.dot.end.block + format.ttitle.type.school output.dot.end.block + unpub.address.school.block + howpublished.block + url.block + note.block + fin.entry.2 + } + if$ +} +FUNCTION {phdthesis} +{ "\BPhD" "\BUPhD" thesis } +FUNCTION {mastersthesis} +{ "\BMTh" "\BUMTh" thesis } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title of something (used in unpublished and misc) + % english translation of title + % type and number of something + % +FUNCTION {format.btitle.type.num} +{ format.betitle.check + format.bvol.edition connect.with.space.check + format.type.number + connect.with.space.check + title empty$ + { add.period$ } + { title format.btitle.connect } + if$ +} + +FUNCTION {format.version} +{ + version empty$ + { "" } + { " " * version *} + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title of message or software-related thing (used in misc) + % english translation of title + % type and number of something + % +FUNCTION {format.mtitle.type.num} +{ format.aetitle.check + format.bvol.edition connect.with.space.check + type.2 "\bibmessage" = + { number empty$ + 'skip$ + { type.2 number tie.or.space.connect + bracket.check + connect.with.space.check + } + if$ + } + { format.type.number + connect.with.space.check + } + if$ + title empty$ + { add.period$ } + { title format.atitle.connect } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % title, english translation of title, + % type and number of something (used in misc) + % +FUNCTION {output.misctitle.type.num} +{ type.2 empty$ + { format.btitle.type.num } + { type.2 "\bibmessage" = + type.2 "\bibcomputerprogram" = or + type.2 "\bibcomputerprogrammanual" = or + type.2 "\bibcomputerprogramandmanual" = or + type.2 "\bibcomputersoftware" = or + type.2 "\bibcomputersoftwaremanual" = or + type.2 "\bibcomputersoftwareandmanual" = or + type.2 "\bibprogramminglanguage" = or + { format.mtitle.type.num } + { format.btitle.type.num } + if$ + } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % unpublished manuscripts, etc. + % +FUNCTION {unpublished} +{ check.relevant.fields + author empty$ + % + % no author: possibly edited book with editors as authors + % + { editor empty$ + % + % no author or editor: title serves as author. + % title formatted as book title + % + { format.btitle.type.num output.new.block + format.year.month.day.check add.period$ + } + % + % format editor and year, and check if year is present + % format book title, volume, and edition and check if title present + % + { format.editors.as.authors start.new.block + format.year.month.day.check output.dot.new.block + format.btitle.type.num + } + if$ + } + % + % format author and year, and check if year is present + % format book title, volume, and edition + % and check if title or type present + % + { format.authors start.new.block + format.year.month.day.check output.dot.new.block + format.btitle.type.num + } + if$ + howpublished empty$ + organization empty$ and + address empty$ and + 'skip$ + { output.new.block + "\APAChowpublished{" "}" howpublished enclose.check + organization connect.with.comma.check + address connect.with.comma.check + add.period$ + } + if$ + % + % format url + % + url empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + % + % format optional note + % + note empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.note + } + if$ + fin.entry +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % nonprint media and other things that don't fit + % +FUNCTION {misc} +{ % + % To handle @manual: use type.2 instead of type. + type.2 empty$ + type empty$ not and + { type 'type.2 := } + 'skip$ + if$ + % + author empty$ + % + % no author: possibly edited item with editors as authors + % + { editor empty$ + % + % no author or editor: title/type serves as author. + % title formatted as book title + % + % if no title and no type, howpublished is title + % + { title empty$ + type.2 empty$ and + { howpublished empty$ + { "No author, editor, title, type, and howpublished in " + cite$ * warning$ + "" + } + { "\APAChowpublished{" howpublished * "}" * add.period$ } + if$ + format.year.month.day.check add.period$ + } + { output.misctitle.type.num %output.new.block + format.year.month.day.check add.period$ + format.howpublished add.period$ + } + if$ + } + % + % format editor and year, and check if year is present + % format book title, volume, and edition and check if title present + % + { format.editors.as.authors start.new.block + format.year.month.day.check output.dot.new.block + output.misctitle.type.num output.dot.new.block + format.howpublished add.period$ + } + if$ + } + % + % format author and year, and check if year is present + % format book title, volume, and edition + % and check if title or type present + % + { format.authors start.new.block + format.year.month.day.check output.dot.new.block + output.misctitle.type.num + format.howpublished add.period$ + } + if$ + % + address empty$ + publisher empty$ and + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.address.publisher add.period$ + } + if$ + % + % format url + % + url empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + % + % format optional note + % + note empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.note + } + if$ + fin.entry +} + +FUNCTION {softmisc} +{ % + % To handle @manual: use type.2 instead of type. + type.2 empty$ + type empty$ not and + { type 'type.2 := } + 'skip$ + if$ + % + author empty$ + % + % no author: possibly edited item with editors as authors + % + { editor empty$ + % + % no author or editor: title/type serves as author. + % title formatted as book title + % + % if no title and no type, howpublished is title + % + { title empty$ + type.2 empty$ and + { howpublished empty$ + { "No author, editor, title, type, and howpublished in " + cite$ * warning$ + "" + } + { "\APAChowpublished{" howpublished * "}" * add.period$ } + if$ + format.year.month.day.check add.period$ + } + { output.misctitle.type.num %output.new.block + format.year.month.day.check add.period$ + format.howpublished add.period$ + } + if$ + } + % + % format editor and year, and check if year is present + % format book title, volume, and edition and check if title present + % + { format.editors.as.authors start.new.block + format.year.month.day.check output.dot.new.block + output.misctitle.type.num output.dot.new.block + format.howpublished add.period$ + } + if$ + } + % + % format author and year, and check if year is present + % format book title, volume, and edition + % and check if title or type present + % + { format.authors start.new.block + format.year.nomonth.day.check output.dot.new.block + output.misctitle.type.num + format.version + format.howpublished add.period$ + } + if$ + % + address empty$ + publisher empty$ and + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.address.publisher add.period$ + } + if$ + % + % format url + % + url empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.url + } + if$ + % + % format optional note + % + note empty$ + 'skip$ + { % Clear the stack + duplicate$ empty$ + 'skip$ + { output.new.block } + if$ + format.note + } + if$ + output.dot.new.block + format.softmisc.eprint + fin.entry +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % for legal cases and other cases that need to be + % done by hand + % +FUNCTION {literal} +{ "key" key warning.if.empty + "text" text warning.if.empty + text empty$ + { "" } + { text } + if$ + fin.entry +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % technical documentation + % +FUNCTION {manual} +{ % + % If type is empty, assume that it is a computer software manual. + % + type empty$ + { "\bibcomputersoftwaremanual" 'type.2 := } + 'skip$ + if$ + misc +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % booklet + % +FUNCTION {booklet} +{ misc } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % part of a book + % +FUNCTION {inbook} +{ inbookcollection } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % article in proceedings + % +FUNCTION {inproceedings} +{ incollection } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % article in proceedings (Kopka & Daly, 2004, p. 230) + % +FUNCTION {conference} +{ inproceedings } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % proceedings + % +FUNCTION {proceedings} +{ misc } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % unknown types + % +FUNCTION {default.type} +{ misc } + +FUNCTION {initialize} +{ + #6 'name.max := +%% #250 'entry.max$ := +%% #5000 'global.max$ := +} +FUNCTION {init.old.number} +{ #0 'old.number := } +FUNCTION {init.old.label} +{ "zzzzzz" 'old.label := } +FUNCTION {init.cite.initials.add.to.year} +{ #0 'cite.initials := + #0 'add.to.year := +} +FUNCTION {move.forward} +{ #1 'forward := } +FUNCTION {move.backward} +{ #0 'forward := } +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{}" write$ newline$ + "\renewcommand{\doi}[1]{\url{https://doi.org/#1}}" + write$ newline$ + "\bibcommenthead" write$ newline$ +} +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} +FUNCTION {write.bbl.entry} +{ + make.cite.labels + call.type$ +} +READ +EXECUTE { identify.apacite.version } +EXECUTE { initialize } +EXECUTE { init.old.number } +ITERATE { make.citeorder.number } +ITERATE { make.sort.title } +SORT +EXECUTE { init.old.number } +EXECUTE { init.old.label } +ITERATE { make.title.number } +ITERATE { make.tentative.sort.label } +SORT +ITERATE { init.cite.initials.add.to.year } +EXECUTE { init.initials } +ITERATE { check.add.initials } +EXECUTE { init.initials } +REVERSE { check.add.initials } +ITERATE { tentative.cite.num.names } +EXECUTE { init.cite.num.names } +EXECUTE { move.forward } +ITERATE { definitive.cite.num.names } +EXECUTE { init.cite.num.names } +EXECUTE { move.backward } +REVERSE { definitive.cite.num.names } +ITERATE { make.final.sort.key } +SORT +EXECUTE { begin.bib } +ITERATE { write.bbl.entry } +EXECUTE { end.bib } + +%% +%% End of file `apacite.bst'. diff --git a/papers/preprint/sn-article-template/bst/sn-aps.bst b/papers/preprint/sn-article-template/bst/sn-aps.bst new file mode 100644 index 000000000..4cc13dda7 --- /dev/null +++ b/papers/preprint/sn-article-template/bst/sn-aps.bst @@ -0,0 +1,1530 @@ +%% +%% This is file `spphys.bst', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% merlin.mbs (with options: `seq-no,vonx,nm-init,ed-au,yr-par,xmth,jtit-x,jttl-rm,thtit-a,vol-bf,volp-com,jpg-1,pgsep-c,num-xser,ser-vol,ser-ed,jnm-x,pub-date,pre-pub,doi,edpar,edby,fin-bare,pp,ed,abr,ord,jabr,xand,url,url-blk,nfss,') +%% ---------------------------------------- +%%********************************************************************************%% +%% %% +%% For Springer physics publications. Based on the APS reference style. %% +%% Report bugs and improvements to: Joylene Vette-Guillaume or Frank Holzwarth %% +%% Springer-Verlag 2004/10/15 %% +%% %% +%%********************************************************************************%% +%% +%% Copyright 1994-2004 Patrick W Daly + % =============================================================== + % IMPORTANT NOTICE: + % This bibliographic style (bst) file has been generated from one or + % more master bibliographic style (mbs) files, listed above. + % + % This generated file can be redistributed and/or modified under the terms + % of the LaTeX Project Public License Distributed from CTAN + % archives in directory macros/latex/base/lppl.txt; either + % version 1 of the License, or any later version. + % =============================================================== + % Name and version information of the main mbs file: + % \ProvidesFile{merlin.mbs}[2004/02/09 4.13 (PWD, AO, DPC)] + % For use with BibTeX version 0.99a or later + %------------------------------------------------------------------- + % This bibliography style file is intended for texts in ENGLISH + % This is a numerical citation style, and as such is standard LaTeX. + % It requires no extra package to interface to the main text. + % The form of the \bibitem entries is + % \bibitem{key}... + % Usage of \cite is as follows: + % \cite{key} ==>> [#] + % \cite[chap. 2]{key} ==>> [#, chap. 2] + % where # is a number determined by the ordering in the reference list. + % The order in the reference list is that by which the works were originally + % cited in the text, or that in the database. + %--------------------------------------------------------------------- + +ENTRY + { address + author + booktitle + chapter + doi + edition + editor + eid + howpublished + institution + journal + key + keywords + month + note + number + organization + pages + publisher + school + series + title + type + url + volume + year + eprint + archive + archivePrefix + primaryClass + adsurl + adsnote + version + } + {} + { label } +INTEGERS { output.state before.all mid.sentence after.sentence after.block } +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} +STRINGS { s t} +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} +FUNCTION {fin.entry} +{ duplicate$ empty$ + 'pop$ + 'write$ + if$ + newline$ +} + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} +FUNCTION {add.blank} +{ " " * before.all 'output.state := +} + +FUNCTION {add.comma} +{ duplicate$ empty$ + 'skip$ + { "," * add.blank } + if$ +} + +FUNCTION {date.block} +{ + new.block +} + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} +FUNCTION {new.block.checka} +{ empty$ + 'skip$ + 'new.block + if$ +} +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} +FUNCTION {new.sentence.checka} +{ empty$ + 'skip$ + 'new.sentence + if$ +} +FUNCTION {new.sentence.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.sentence + if$ +} +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "\emph{" swap$ * "}" * } + if$ +} +FUNCTION {bolden} +{ duplicate$ empty$ + { pop$ "" } + { "\textbf{" swap$ * "}" * } + if$ +} +FUNCTION {tie.or.space.prefix} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ +} + +FUNCTION {capitalize} +{ "u" change.case$ "t" change.case$ } + +FUNCTION {space.word} +{ " " swap$ * " " * } + % Here are the language-specific definitions for explicit words. + % Each function has a name bbl.xxx where xxx is the English word. + % The language selected here is ENGLISH +FUNCTION {bbl.and} +{ "and"} + +FUNCTION {bbl.etal} +{ "et~al." } + +FUNCTION {bbl.editors} +{ "eds." } + +FUNCTION {bbl.editor} +{ "ed." } + +FUNCTION {bbl.edby} +{ "ed. by" } + +FUNCTION {bbl.edition} +{ "edn." } + +FUNCTION {bbl.volume} +{ "vol." } + +FUNCTION {bbl.of} +{ "of" } + +FUNCTION {bbl.number} +{ "no." } + +FUNCTION {bbl.nr} +{ "no." } + +FUNCTION {bbl.in} +{ "in" } + +FUNCTION {bbl.pages} +{ "pp." } + +FUNCTION {bbl.page} +{ "p." } + +FUNCTION {bbl.chapter} +{ "chap." } + +FUNCTION {bbl.techrep} +{ "Tech. Rep." } + +FUNCTION {bbl.mthesis} +{ "Master's thesis" } + +FUNCTION {bbl.phdthesis} +{ "Ph.D. thesis" } + +FUNCTION {bbl.first} +{ "1st" } + +FUNCTION {bbl.second} +{ "2nd" } + +FUNCTION {bbl.third} +{ "3rd" } + +FUNCTION {bbl.fourth} +{ "4th" } + +FUNCTION {bbl.fifth} +{ "5th" } + +FUNCTION {bbl.st} +{ "st" } + +FUNCTION {bbl.nd} +{ "nd" } + +FUNCTION {bbl.rd} +{ "rd" } + +FUNCTION {bbl.th} +{ "th" } + +MACRO {jan} {"Jan."} + +MACRO {feb} {"Feb."} + +MACRO {mar} {"Mar."} + +MACRO {apr} {"Apr."} + +MACRO {may} {"May"} + +MACRO {jun} {"Jun."} + +MACRO {jul} {"Jul."} + +MACRO {aug} {"Aug."} + +MACRO {sep} {"Sep."} + +MACRO {oct} {"Oct."} + +MACRO {nov} {"Nov."} + +MACRO {dec} {"Dec."} + +FUNCTION {eng.ord} +{ duplicate$ "1" swap$ * + #-2 #1 substring$ "1" = + { bbl.th * } + { duplicate$ #-1 #1 substring$ + duplicate$ "1" = + { pop$ bbl.st * } + { duplicate$ "2" = + { pop$ bbl.nd * } + { "3" = + { bbl.rd * } + { bbl.th * } + if$ + } + if$ + } + if$ + } + if$ +} + +MACRO {acmcs} {"ACM Comput. Surv."} + +MACRO {acta} {"Acta Inf."} + +MACRO {cacm} {"Commun. ACM"} + +MACRO {ibmjrd} {"IBM J. Res. Dev."} + +MACRO {ibmsj} {"IBM Syst.~J."} + +MACRO {ieeese} {"IEEE Trans. Software Eng."} + +MACRO {ieeetc} {"IEEE Trans. Comput."} + +MACRO {ieeetcad} + {"IEEE Trans. Comput. Aid. Des."} + +MACRO {ipl} {"Inf. Process. Lett."} + +MACRO {jacm} {"J.~ACM"} + +MACRO {jcss} {"J.~Comput. Syst. Sci."} + +MACRO {scp} {"Sci. Comput. Program."} + +MACRO {sicomp} {"SIAM J. Comput."} + +MACRO {tocs} {"ACM Trans. Comput. Syst."} + +MACRO {tods} {"ACM Trans. Database Syst."} + +MACRO {tog} {"ACM Trans. Graphic."} + +MACRO {toms} {"ACM Trans. Math. Software"} + +MACRO {toois} {"ACM Trans. Office Inf. Syst."} + +MACRO {toplas} {"ACM Trans. Progr. Lang. Syst."} + +MACRO {tcs} {"Theor. Comput. Sci."} + +FUNCTION {bibinfo.check} +{ swap$ + duplicate$ missing$ + { + pop$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ pop$ + } + { swap$ + pop$ + } + if$ + } + if$ +} +FUNCTION {bibinfo.warn} +{ swap$ + duplicate$ missing$ + { + swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ "empty " swap$ * " in " * cite$ * warning$ + } + { swap$ + pop$ + } + if$ + } + if$ +} +FUNCTION {format.url} +{ url empty$ + { "" } + { "\urlprefix\url{" url * "}" * } + if$ +} + +STRINGS { bibinfo} +INTEGERS { nameptr namesleft numnames } + +FUNCTION {format.names} +{ 'bibinfo := + duplicate$ empty$ 'skip$ { + 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{f{.}.~}{vv~}{ll}{, jj}" + format.name$ + bibinfo bibinfo.check + 't := + nameptr #1 > + { + namesleft #1 > + { ", " * t * } + { + "," * + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal * + } + { " " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } if$ +} +FUNCTION {format.names.ed} +{ + format.names +} +FUNCTION {format.authors} +{ author "author" format.names +} +FUNCTION {get.bbl.editor} +{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } + +FUNCTION {format.editors} +{ editor "editor" format.names duplicate$ empty$ 'skip$ + { + " " * + get.bbl.editor + "(" swap$ * ")" * + * + } + if$ +} +FUNCTION {format.doi} +{ doi "doi" bibinfo.check + duplicate$ empty$ 'skip$ + { + new.block + "\doi{" swap$ * "}" * + } + if$ +} +FUNCTION {format.note} +{ + note empty$ + { "" } + { note #1 #1 substring$ + duplicate$ "{" = + 'skip$ + { output.state mid.sentence = + { "l" } + { "u" } + if$ + change.case$ + } + if$ + note #2 global.max$ substring$ * "note" bibinfo.check + } + if$ +} + +FUNCTION {format.title} +{ title + duplicate$ empty$ 'skip$ + { "t" change.case$ } + if$ + "title" bibinfo.check +} +FUNCTION {output.bibitem} +{ newline$ + "\bibitem{" write$ + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {if.digit} +{ duplicate$ "0" = + swap$ duplicate$ "1" = + swap$ duplicate$ "2" = + swap$ duplicate$ "3" = + swap$ duplicate$ "4" = + swap$ duplicate$ "5" = + swap$ duplicate$ "6" = + swap$ duplicate$ "7" = + swap$ duplicate$ "8" = + swap$ "9" = or or or or or or or or or +} +FUNCTION {n.separate} +{ 't := + "" + #0 'numnames := + { t empty$ not } + { t #-1 #1 substring$ if.digit + { numnames #1 + 'numnames := } + { #0 'numnames := } + if$ + t #-1 #1 substring$ swap$ * + t #-2 global.max$ substring$ 't := + numnames #5 = + { duplicate$ #1 #2 substring$ swap$ + #3 global.max$ substring$ + "," swap$ * * + } + 'skip$ + if$ + } + while$ +} +FUNCTION {n.dashify} +{ +%% n.separate + 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {word.in} +{ bbl.in + " " * } + +FUNCTION {format.date} +{ + "" + duplicate$ empty$ + year "year" bibinfo.check duplicate$ empty$ + { swap$ 'skip$ + { "there's a month but no year in " cite$ * warning$ } + if$ + * + } + { swap$ 'skip$ + { + swap$ + " " * swap$ + } + if$ + * + } + if$ + duplicate$ empty$ + 'skip$ + { + before.all 'output.state := + " (" swap$ * ")" * + } + if$ +} +FUNCTION {format.btitle} +{ title "title" bibinfo.check + duplicate$ empty$ 'skip$ + { + emphasize + } + if$ +} +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { bbl.volume volume tie.or.space.prefix + "volume" bibinfo.check * * + series "series" bibinfo.check + duplicate$ empty$ 'pop$ + { emphasize ", " * swap$ * } + if$ + "volume and number" number either.or.check + } + if$ +} +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { series empty$ + { number "number" bibinfo.check } + { output.state mid.sentence = + { bbl.number } + { bbl.number capitalize } + if$ + number tie.or.space.prefix "number" bibinfo.check * * + bbl.in space.word * + series "series" bibinfo.check * + } + if$ + } + if$ + } + { "" } + if$ +} +FUNCTION {is.num} +{ chr.to.int$ + duplicate$ "0" chr.to.int$ < not + swap$ "9" chr.to.int$ > not and +} + +FUNCTION {extract.num} +{ duplicate$ 't := + "" 's := + { t empty$ not } + { t #1 #1 substring$ + t #2 global.max$ substring$ 't := + duplicate$ is.num + { s swap$ * 's := } + { pop$ "" 't := } + if$ + } + while$ + s empty$ + 'skip$ + { pop$ s } + if$ +} + +FUNCTION {convert.edition} +{ extract.num "l" change.case$ 's := + s "first" = s "1" = or + { bbl.first 't := } + { s "second" = s "2" = or + { bbl.second 't := } + { s "third" = s "3" = or + { bbl.third 't := } + { s "fourth" = s "4" = or + { bbl.fourth 't := } + { s "fifth" = s "5" = or + { bbl.fifth 't := } + { s #1 #1 substring$ is.num + { s eng.ord 't := } + { edition 't := } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + t +} + +FUNCTION {format.edition} +{ edition duplicate$ empty$ 'skip$ + { + convert.edition + output.state mid.sentence = + { "l" } + { "t" } + if$ change.case$ + "edition" bibinfo.check + " " * bbl.edition * + } + if$ +} +INTEGERS { multiresult } +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} +FUNCTION {format.pages} +{ pages duplicate$ empty$ 'skip$ + { duplicate$ multi.page.check + { + bbl.pages swap$ + n.dashify + } + { + bbl.page swap$ + } + if$ + tie.or.space.prefix + "pages" bibinfo.check + * * + } + if$ +} +FUNCTION {first.page} +{ 't := + "" + { t empty$ not t #1 #1 substring$ "-" = not and } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + while$ +} + +FUNCTION {format.journal.pages} +{ pages duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ + { pop$ pop$ format.pages } + { + ", " * + swap$ + n.dashify + "pages" bibinfo.check + * + } + if$ + } + if$ +} +FUNCTION {format.journal.eid} +{ eid "eid" bibinfo.check + duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ 'skip$ + { + ", " * + } + if$ + swap$ * + } + if$ +} +FUNCTION {format.vol.num.pages} +{ volume field.or.null + duplicate$ empty$ 'skip$ + { + "volume" bibinfo.check + } + if$ + bolden + number "number" bibinfo.check duplicate$ empty$ 'skip$ + { + swap$ duplicate$ empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + swap$ + "(" swap$ * ")" * + } + if$ * + eid empty$ + { format.journal.pages } + { format.journal.eid } + if$ +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { bbl.chapter } + { type "l" change.case$ + "type" bibinfo.check + } + if$ + chapter tie.or.space.prefix + "chapter" bibinfo.check + * * + pages empty$ + 'skip$ + { ", " * format.pages * } + if$ + } + if$ +} + +FUNCTION {format.booktitle} +{ + booktitle "booktitle" bibinfo.check + emphasize +} +FUNCTION {format.in.ed.booktitle} +{ format.booktitle duplicate$ empty$ 'skip$ + { + format.bvolume duplicate$ empty$ 'pop$ + { ", " swap$ * * } + if$ + editor "editor" format.names.ed duplicate$ empty$ 'pop$ + { + bbl.edby + " " * swap$ * + swap$ + "," * + " " * swap$ + * } + if$ + word.in swap$ * + } + 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 duplicate$ empty$ + 'pop$ + { swap$ pop$ + "t" change.case$ "type" bibinfo.check + } + if$ +} +FUNCTION {format.tr.number} +{ number "number" bibinfo.check + type duplicate$ empty$ + { pop$ bbl.techrep } + 'skip$ + if$ + "type" bibinfo.check + swap$ duplicate$ empty$ + { pop$ "t" change.case$ } + { tie.or.space.prefix * * } + if$ +} +FUNCTION {format.article.crossref} +{ + key duplicate$ empty$ + { pop$ + journal duplicate$ empty$ + { "need key or journal for " cite$ * " to crossref " * crossref * warning$ } + { "journal" bibinfo.check emphasize word.in swap$ * } + if$ + } + { word.in swap$ * " " *} + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {format.crossref.editor} +{ editor #1 "{vv~}{ll}" format.name$ + "editor" bibinfo.check + editor num.names$ duplicate$ + #2 > + { pop$ + "editor" bibinfo.check + " " * bbl.etal + * + } + { #2 < + 'skip$ + { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { + "editor" bibinfo.check + " " * bbl.etal + * + } + { + bbl.and space.word + * editor #2 "{vv~}{ll}" format.name$ + "editor" bibinfo.check + * + } + if$ + } + if$ + } + if$ +} +FUNCTION {format.book.crossref} +{ volume duplicate$ empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + pop$ word.in + } + { bbl.volume + capitalize + swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word * + } + if$ + editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { series empty$ + { "need editor, key, or series for " cite$ * " to crossref " * + crossref * warning$ + "" * + } + { series emphasize * } + if$ + } + { key * } + if$ + } + { format.crossref.editor * } + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {format.incoll.inproc.crossref} +{ + editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { format.booktitle duplicate$ empty$ + { "need editor, key, or booktitle for " cite$ * " to crossref " * + crossref * warning$ + } + { word.in swap$ * } + if$ + } + { word.in key * " " *} + if$ + } + { word.in format.crossref.editor * " " *} + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {format.org.or.pub} +{ 't := + "" + year empty$ + { "empty year in " cite$ * warning$ } + 'skip$ + if$ + address empty$ t empty$ and + year empty$ and + 'skip$ + { + add.blank "(" * + t empty$ + { address "address" bibinfo.check * + } + { t * + address empty$ + 'skip$ + { ", " * address "address" bibinfo.check * } + if$ + } + if$ + year empty$ + 'skip$ + { t empty$ address empty$ and + 'skip$ + { ", " * } + if$ + year "year" bibinfo.check + * + } + if$ + ")" * + } + if$ +} +FUNCTION {format.publisher.address} +{ publisher "publisher" bibinfo.warn format.org.or.pub +} + +FUNCTION {format.organization.address} +{ organization "organization" bibinfo.check format.org.or.pub +} + +FUNCTION {format.softmisc.archive} +{ + archivePrefix empty$ + { "" } + { "" } + if$ +} + +FUNCTION {format.archive} +{ + archivePrefix empty$ + { "" } + { archivePrefix ":" *} + if$ +} + +FUNCTION {format.primaryClass} +{ + primaryClass empty$ + { "" } + { "{[" primaryClass * "]}" *} + if$ +} + +FUNCTION {format.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {format.softmisc.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + add.comma + format.title "title" output.check + new.block + crossref missing$ + { + journal + "journal" bibinfo.check + "journal" output.check + add.blank + format.vol.num.pages output + format.date "year" output.check + } + { format.article.crossref output.nonnull + format.pages output + } + if$ + format.doi output + new.block + format.url output + new.block + format.note output + new.block + format.eprint output + add.blank + format.primaryClass output + fin.entry +} + +FUNCTION {book} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + add.comma + format.btitle "title" output.check + crossref missing$ + { format.bvolume output + format.edition output + new.block + format.number.series output + new.sentence + format.publisher.address output + format.pages output + } + { + new.block + format.book.crossref output.nonnull + format.date "year" output.check + } + if$ + format.doi output + new.block + format.url output + new.block + format.note output + fin.entry +} +FUNCTION {booklet} +{ output.bibitem + format.authors output + add.comma + format.title "title" output.check + new.block + howpublished "howpublished" bibinfo.check output + address "address" bibinfo.check output + format.date output + format.doi output + new.block + format.url output + new.block + format.note output + fin.entry +} + +FUNCTION {inbook} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + add.comma + format.btitle "title" output.check + crossref missing$ + { + format.publisher.address output + format.bvolume output + format.edition output + format.chapter.pages "chapter and pages" output.check + new.block + format.number.series output + new.sentence + } + { + format.chapter.pages "chapter and pages" output.check + new.block + format.book.crossref output.nonnull + format.date "year" output.check + } + if$ + format.doi output + new.block + format.url output + new.block + format.note output + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + add.comma + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.edition output + format.number.series output + format.publisher.address output + format.chapter.pages output + new.sentence + } + { format.incoll.inproc.crossref output.nonnull + format.chapter.pages output + } + if$ + format.doi output + new.block + format.url output + new.block + format.note output + fin.entry +} +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check + add.comma + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + new.sentence + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + format.number.series output + format.pages output + } + { format.incoll.inproc.crossref output.nonnull + format.pages output + } + if$ + format.doi output + new.block + format.url output + new.block + format.note output + fin.entry +} +FUNCTION {conference} { inproceedings } +FUNCTION {manual} +{ output.bibitem + author empty$ + { organization "organization" bibinfo.check + duplicate$ empty$ 'pop$ + { output + address "address" bibinfo.check output + } + if$ + } + { format.authors output.nonnull } + if$ + add.comma + format.btitle "title" output.check + author empty$ + { organization empty$ + { + address new.block.checka + address "address" bibinfo.check output + } + 'skip$ + if$ + } + { + organization address new.block.checkb + organization "organization" bibinfo.check output + address "address" bibinfo.check output + } + if$ + format.edition output + format.date output + format.doi output + new.block + format.url output + new.block + format.note output + fin.entry +} + +FUNCTION {mastersthesis} +{ output.bibitem + format.authors "author" output.check + add.comma + format.title + "title" output.check + new.block + bbl.mthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.date "year" output.check + format.doi output + new.block + format.url output + new.block + format.note output + fin.entry +} + +FUNCTION {misc} +{ output.bibitem + format.authors output + title howpublished new.block.checkb + format.title output + howpublished new.block.checka + howpublished "howpublished" bibinfo.check output + format.date output + format.doi output + new.block + format.url output + new.block + format.note output + fin.entry + empty.misc.check +} + +FUNCTION {softmisc} +{ output.bibitem + format.authors output + title howpublished new.block.checkb + format.title output + version output + howpublished new.block.checka + howpublished "howpublished" bibinfo.check output + format.date output + format.doi output + new.block + format.url output + new.block + format.note output + new.block + format.softmisc.eprint output + fin.entry + empty.misc.check +} + +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" output.check + add.comma + format.title + "title" output.check + new.block + bbl.phdthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.date "year" output.check + format.doi output + new.block + format.url output + new.block + format.note output + fin.entry +} + +FUNCTION {proceedings} +{ output.bibitem + editor empty$ + { organization "organization" bibinfo.check output + } + { format.editors output.nonnull } + if$ + new.block + format.btitle "title" output.check + format.bvolume output + format.number.series output + editor empty$ + { publisher empty$ + 'skip$ + { + new.sentence + format.publisher.address output + } + if$ + } + { publisher empty$ + { + new.sentence + format.organization.address output } + { + new.sentence + organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + } + if$ + format.doi output + new.block + format.url output + new.block + format.note output + fin.entry +} + +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check + add.comma + format.title + "title" output.check + new.block + format.tr.number output.nonnull + institution "institution" bibinfo.warn output + address "address" bibinfo.check output + format.date "year" output.check + format.doi output + new.block + format.url output + new.block + format.note output + fin.entry +} + +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check + add.comma + format.title "title" output.check + format.date output + format.doi output + new.block + format.url output + new.block + format.note "note" output.check + fin.entry +} + +FUNCTION {default.type} { misc } +READ +STRINGS { longest.label } +INTEGERS { number.label longest.label.width } +FUNCTION {initialize.longest.label} +{ "" 'longest.label := + #1 'number.label := + #0 'longest.label.width := +} +FUNCTION {longest.label.pass} +{ number.label int.to.str$ 'label := + number.label #1 + 'number.label := + label width$ longest.label.width > + { label 'longest.label := + label width$ 'longest.label.width := + } + 'skip$ + if$ +} +EXECUTE {initialize.longest.label} +ITERATE {longest.label.pass} +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" longest.label * "}" * + write$ newline$ + "\providecommand{\url}[1]{{#1}}" + write$ newline$ + "\providecommand{\urlprefix}{URL }" + write$ newline$ + %%"\expandafter\ifx\csname urlstyle\endcsname\relax" + %% write$ newline$ + %%" \providecommand{\doi}[1]{\discretionary{}{}{}#1}\else" + %%write$ newline$ + %%" \providecommand{\doi}{\discretionary{}{}{}\begingroup \urlstyle{rm}\Url}\fi" + "\providecommand{\doi}[1]{\url{https://doi.org/#1}}" + write$ newline$ + "\bibcommenthead" write$ newline$ +} +EXECUTE {begin.bib} +EXECUTE {init.state.consts} +ITERATE {call.type$} +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} +EXECUTE {end.bib} +%% End of customized bst file +%% +%% End of file `spphys.bst'. + diff --git a/papers/preprint/sn-article-template/bst/sn-basic.bst b/papers/preprint/sn-article-template/bst/sn-basic.bst new file mode 100644 index 000000000..5072a4d9d --- /dev/null +++ b/papers/preprint/sn-article-template/bst/sn-basic.bst @@ -0,0 +1,1798 @@ +%% +%% This is file `spbasic.bst', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% merlin.mbs (with options: `ay,nat,seq-lab,vonx,nm-rvx,ed-rev,jnrlst,dt-beg,yr-par,yrp-x,yrpp-xsp,note-yr,jxper,jttl-rm,thtit-a,pgsep-c,num-xser,ser-vol,jnm-x,btit-rm,bt-rm,pre-pub,doi,edparxc,blk-tit,in-col,fin-bare,pp,ed,abr,mth-bare,ord,jabr,xand,eprint,url,url-blk,em-x,nfss,') +%% ---------------------------------------- +%% +%%********************************************************************************%% +%% %% +%% For Springer medical, life sciences, chemistry, geology, engineering and %% +%% computer science publications. %% +%% For use with the natbib package (see below). Default is author-year citations. %% +%% When citations are numbered, please use \usepackage[numbers]{natbib}. %% +%% %% +%%********************************************************************************%% +%% +%% Copyright 1994-2004 Patrick W Daly + % =============================================================== + % IMPORTANT NOTICE: + % This bibliographic style (bst) file has been generated from one or + % more master bibliographic style (mbs) files, listed above. + % + % This generated file can be redistributed and/or modified under the terms + % of the LaTeX Project Public License Distributed from CTAN + % archives in directory macros/latex/base/lppl.txt; either + % version 1 of the License, or any later version. + % =============================================================== + % Name and version information of the main mbs file: + % \ProvidesFile{merlin.mbs}[2004/02/09 4.13 (PWD, AO, DPC)] + % For use with BibTeX version 0.99a or later + %------------------------------------------------------------------- + % This bibliography style file is intended for texts in ENGLISH + % This is an author-year citation style bibliography. As such, it is + % non-standard LaTeX, and requires a special package file to function properly. + % Such a package is natbib.sty by Patrick W. Daly + % The form of the \bibitem entries is + % \bibitem[Jones et al.(1990)]{key}... + % \bibitem[Jones et al.(1990)Jones, Baker, and Smith]{key}... + % The essential feature is that the label (the part in brackets) consists + % of the author names, as they should appear in the citation, with the year + % in parentheses following. There must be no space before the opening + % parenthesis! + % With natbib v5.3, a full list of authors may also follow the year. + % In natbib.sty, it is possible to define the type of enclosures that is + % really wanted (brackets or parentheses), but in either case, there must + % be parentheses in the label. + % The \cite command functions as follows: + % \citet{key} ==>> Jones et al. (1990) + % \citet*{key} ==>> Jones, Baker, and Smith (1990) + % \citep{key} ==>> (Jones et al., 1990) + % \citep*{key} ==>> (Jones, Baker, and Smith, 1990) + % \citep[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2) + % \citep[e.g.][]{key} ==>> (e.g. Jones et al., 1990) + % \citep[e.g.][p. 32]{key} ==>> (e.g. Jones et al., p. 32) + % \citeauthor{key} ==>> Jones et al. + % \citeauthor*{key} ==>> Jones, Baker, and Smith + % \citeyear{key} ==>> 1990 + %--------------------------------------------------------------------- + +ENTRY + { address + archive + author + booktitle + chapter + doi + edition + editor + eid + eprint + howpublished + institution + journal + key + keywords + month + note + number + organization + pages + publisher + school + series + title + type + url + volume + year + archivePrefix + primaryClass + adsurl + adsnote + version + } + {} + { label extra.label sort.label short.list } +INTEGERS { output.state before.all mid.sentence after.sentence after.block } +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} +STRINGS { s t} +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} +FUNCTION {fin.entry} +{ duplicate$ empty$ + 'pop$ + 'write$ + if$ + newline$ +} + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} +FUNCTION {add.blank} +{ " " * before.all 'output.state := +} + +FUNCTION {no.blank.or.punct} +{ "\hspace{0pt}" * before.all 'output.state := +} + +FUNCTION {date.block} +{ + add.blank +} + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} +STRINGS {z} +FUNCTION {remove.dots} +{ 'z := + "" + { z empty$ not } + { z #1 #1 substring$ + z #2 global.max$ substring$ 'z := + duplicate$ "." = 'pop$ + { * } + if$ + } + while$ +} +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} +FUNCTION {emphasize} +{ skip$ } +FUNCTION {tie.or.space.prefix} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ +} + +FUNCTION {capitalize} +{ "u" change.case$ "t" change.case$ } + +FUNCTION {space.word} +{ " " swap$ * " " * } + % Here are the language-specific definitions for explicit words. + % Each function has a name bbl.xxx where xxx is the English word. + % The language selected here is ENGLISH +FUNCTION {bbl.and} +{ "and"} + +FUNCTION {bbl.etal} +{ "et~al" } + +FUNCTION {bbl.editors} +{ "eds" } + +FUNCTION {bbl.editor} +{ "ed" } + +FUNCTION {bbl.edby} +{ "edited by" } + +FUNCTION {bbl.edition} +{ "edn." } + +FUNCTION {bbl.volume} +{ "vol" } + +FUNCTION {bbl.of} +{ "of" } + +FUNCTION {bbl.number} +{ "no." } + +FUNCTION {bbl.nr} +{ "no." } + +FUNCTION {bbl.in} +{ "in" } + +FUNCTION {bbl.pages} +{ "pp" } + +FUNCTION {bbl.incoll.pages} +{ "p" } + +FUNCTION {bbl.page} +{ "p" } + +FUNCTION {bbl.chapter} +{ "chap" } + +FUNCTION {bbl.techrep} +{ "Tech. Rep." } + +FUNCTION {bbl.mthesis} +{ "Master's thesis" } + +FUNCTION {bbl.phdthesis} +{ "PhD thesis" } + +FUNCTION {bbl.first} +{ "1st" } + +FUNCTION {bbl.second} +{ "2nd" } + +FUNCTION {bbl.third} +{ "3rd" } + +FUNCTION {bbl.fourth} +{ "4th" } + +FUNCTION {bbl.fifth} +{ "5th" } + +FUNCTION {bbl.st} +{ "st" } + +FUNCTION {bbl.nd} +{ "nd" } + +FUNCTION {bbl.rd} +{ "rd" } + +FUNCTION {bbl.th} +{ "th" } + +MACRO {jan} {"Jan."} + +MACRO {feb} {"Feb."} + +MACRO {mar} {"Mar."} + +MACRO {apr} {"Apr."} + +MACRO {may} {"May"} + +MACRO {jun} {"Jun."} + +MACRO {jul} {"Jul."} + +MACRO {aug} {"Aug."} + +MACRO {sep} {"Sep."} + +MACRO {oct} {"Oct."} + +MACRO {nov} {"Nov."} + +MACRO {dec} {"Dec."} + +FUNCTION {eng.ord} +{ duplicate$ "1" swap$ * + #-2 #1 substring$ "1" = + { bbl.th * } + { duplicate$ #-1 #1 substring$ + duplicate$ "1" = + { pop$ bbl.st * } + { duplicate$ "2" = + { pop$ bbl.nd * } + { "3" = + { bbl.rd * } + { bbl.th * } + if$ + } + if$ + } + if$ + } + if$ +} + +MACRO {acmcs} {"ACM Comput Surv"} + +MACRO {acta} {"Acta Inf"} + +MACRO {cacm} {"Commun ACM"} + +MACRO {ibmjrd} {"IBM~J~Res Dev"} + +MACRO {ibmsj} {"IBM Syst~J"} + +MACRO {ieeese} {"IEEE Trans Softw Eng"} + +MACRO {ieeetc} {"IEEE Trans Comput"} + +MACRO {ieeetcad} + {"IEEE Trans Comput Aid Des"} + +MACRO {ipl} {"Inf Process Lett"} + +MACRO {jacm} {"J~ACM"} + +MACRO {jcss} {"J~Comput Syst Sci"} + +MACRO {scp} {"Sci Comput Program"} + +MACRO {sicomp} {"SIAM J~Comput"} + +MACRO {tocs} {"ACM Trans Comput Syst"} + +MACRO {tods} {"ACM Trans Database Syst"} + +MACRO {tog} {"ACM Trans Graphic"} + +MACRO {toms} {"ACM Trans Math Softw"} + +MACRO {toois} {"ACM Trans Office Inf Syst"} + +MACRO {toplas} {"ACM Trans Program Lang Syst"} + +MACRO {tcs} {"Theor Comput Sci"} + +FUNCTION {bibinfo.check} +{ swap$ + duplicate$ missing$ + { + pop$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ pop$ + } + { swap$ + pop$ + } + if$ + } + if$ +} +FUNCTION {bibinfo.warn} +{ swap$ + duplicate$ missing$ + { + swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ "empty " swap$ * " in " * cite$ * warning$ + } + { swap$ + pop$ + } + if$ + } + if$ +} + +FUNCTION {format.eprint} +{ eprint duplicate$ empty$ + 'skip$ + { "\eprint" + archive empty$ + 'skip$ + { "[" * archive * "]" * } + if$ + "{" * swap$ * "}" * + } + if$ +} + +FUNCTION {format.archive} +{ + archivePrefix empty$ + { "" } + { archivePrefix ":" *} + if$ +} + +FUNCTION {format.primaryClass} +{ + primaryClass empty$ + { "" } + { "{[" primaryClass * "]}" *} + if$ +} + +FUNCTION {format.soft.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {format.softmisc.archive} +{ + archivePrefix empty$ + { "" } + { "" } + if$ +} + +FUNCTION {format.softmisc.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {format.url} +{ url empty$ + { "" } + { "\urlprefix\url{" url * "}" * } + if$ +} + +STRINGS { bibinfo} +INTEGERS { nameptr namesleft numnames } + +FUNCTION {format.names} +{ 'bibinfo := + duplicate$ empty$ 'skip$ { + 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv~}{ll}{ f{}}{jj}" + format.name$ 't := + nameptr #1 > + { + nameptr #3 + #1 + = + numnames #3 + > and + { "others" 't := + #1 'namesleft := } + 'skip$ + if$ + namesleft #1 > + { ", " * t * } + { + "," * + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal * + } + { " " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } if$ +} + +FUNCTION {format.names.ed} +{ + format.names +} +FUNCTION {format.key} +{ empty$ + { key field.or.null } + { "" } + if$ +} + +FUNCTION {format.authors} +{ author "author" format.names +} +FUNCTION {get.bbl.editor} +{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } + +FUNCTION {format.editors} +{ editor "editor" format.names duplicate$ empty$ 'skip$ + { + " " * + get.bbl.editor + "(" swap$ * ")" * + * + } + if$ +} +FUNCTION {format.doi} +{ doi "doi" bibinfo.check + duplicate$ empty$ 'skip$ + { + "\doi{" swap$ * "}" * + } + if$ +} +FUNCTION {format.note} +{ + note empty$ + { "" } + { note #1 #1 substring$ + duplicate$ "{" = + 'skip$ + { output.state mid.sentence = + { "l" } + { "u" } + if$ + change.case$ + } + if$ + note #2 global.max$ substring$ * "note" bibinfo.check + } + if$ +} + +FUNCTION {format.title} +{ title + duplicate$ empty$ 'skip$ + { "t" change.case$ } + if$ + "title" bibinfo.check +} +FUNCTION {format.full.names} +{'s := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv~}{ll}" format.name$ + 't := + nameptr #1 > + { + namesleft #1 > + { ", " * t * } + { + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal * + } + { + numnames #2 > + { "," * } + 'skip$ + if$ + bbl.and + space.word * t * + } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {author.editor.key.full} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.full.names } + if$ + } + { author format.full.names } + if$ +} + +FUNCTION {author.key.full} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.full.names } + if$ +} + +FUNCTION {editor.key.full} +{ editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.full.names } + if$ +} + +FUNCTION {make.full.names} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.full + { type$ "proceedings" = + 'editor.key.full + 'author.key.full + if$ + } + if$ +} + +FUNCTION {output.bibitem} +{ newline$ + "\bibitem[{" write$ + label write$ + ")" make.full.names duplicate$ short.list = + { pop$ } + { * } + if$ + "}]{" * write$ + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {add.period} +{ duplicate$ empty$ + 'skip$ + { "." * add.blank } + if$ +} + +FUNCTION {if.digit} +{ duplicate$ "0" = + swap$ duplicate$ "1" = + swap$ duplicate$ "2" = + swap$ duplicate$ "3" = + swap$ duplicate$ "4" = + swap$ duplicate$ "5" = + swap$ duplicate$ "6" = + swap$ duplicate$ "7" = + swap$ duplicate$ "8" = + swap$ "9" = or or or or or or or or or +} +FUNCTION {n.separate} +{ 't := + "" + #0 'numnames := + { t empty$ not } + { t #-1 #1 substring$ if.digit + { numnames #1 + 'numnames := } + { #0 'numnames := } + if$ + t #-1 #1 substring$ swap$ * + t #-2 global.max$ substring$ 't := + numnames #5 = + { duplicate$ #1 #2 substring$ swap$ + #3 global.max$ substring$ + "," swap$ * * + } + 'skip$ + if$ + } + while$ +} +FUNCTION {n.dashify} +{ +%% n.separate + 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {word.in} +{ bbl.in capitalize + ":" * + " " * } + +FUNCTION {format.date} +{ year "year" bibinfo.check duplicate$ empty$ + { + "empty year in " cite$ * "; set to ????" * warning$ + pop$ "????" + } + 'skip$ + if$ + extra.label * + before.all 'output.state := + " (" swap$ * ")" * +} +FUNCTION {format.btitle} +{ title "title" bibinfo.check + duplicate$ empty$ 'skip$ + { + } + if$ +} +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { bbl.volume volume tie.or.space.prefix + "volume" bibinfo.check * * + series "series" bibinfo.check + duplicate$ empty$ 'pop$ + { emphasize ", " * swap$ * } + if$ + "volume and number" number either.or.check + } + if$ +} +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { series empty$ + { number "number" bibinfo.check } + { output.state mid.sentence = + { bbl.number } + { bbl.number capitalize } + if$ + number tie.or.space.prefix "number" bibinfo.check * * + bbl.in space.word * + series "series" bibinfo.check * + } + if$ + } + if$ + } + { "" } + if$ +} +FUNCTION {is.num} +{ chr.to.int$ + duplicate$ "0" chr.to.int$ < not + swap$ "9" chr.to.int$ > not and +} + +FUNCTION {extract.num} +{ duplicate$ 't := + "" 's := + { t empty$ not } + { t #1 #1 substring$ + t #2 global.max$ substring$ 't := + duplicate$ is.num + { s swap$ * 's := } + { pop$ "" 't := } + if$ + } + while$ + s empty$ + 'skip$ + { pop$ s } + if$ +} + +FUNCTION {convert.edition} +{ extract.num "l" change.case$ 's := + s "first" = s "1" = or + { bbl.first 't := } + { s "second" = s "2" = or + { bbl.second 't := } + { s "third" = s "3" = or + { bbl.third 't := } + { s "fourth" = s "4" = or + { bbl.fourth 't := } + { s "fifth" = s "5" = or + { bbl.fifth 't := } + { s #1 #1 substring$ is.num + { s eng.ord 't := } + { edition 't := } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + t +} + +FUNCTION {format.edition} +{ edition duplicate$ empty$ 'skip$ + { + convert.edition + output.state mid.sentence = + { "l" } + { "t" } + if$ change.case$ + "edition" bibinfo.check + " " * bbl.edition * + } + if$ +} +INTEGERS { multiresult } +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} +FUNCTION {format.pages} +{ pages duplicate$ empty$ 'skip$ + { duplicate$ multi.page.check + { + bbl.pages swap$ + n.dashify + } + { + bbl.page swap$ + } + if$ + tie.or.space.prefix + "pages" bibinfo.check + * * + } + if$ +} +FUNCTION {format.journal.pages} +{ pages duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ + { pop$ pop$ format.pages } + { + ":" * + swap$ + n.dashify + "pages" bibinfo.check + * + } + if$ + } + if$ +} +FUNCTION {format.journal.eid} +{ eid "eid" bibinfo.check + duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ 'skip$ + { + ":" * + } + if$ + swap$ * + } + if$ +} + +FUNCTION {format.incoll.pages} +{ pages duplicate$ empty$ 'skip$ + { duplicate$ multi.page.check + { + bbl.incoll.pages swap$ + n.dashify + } + { + bbl.page swap$ + } + if$ + tie.or.space.prefix + "pages" bibinfo.check + * * + } + if$ +} + +FUNCTION {format.incoll.chapter.pages} +{ chapter empty$ + 'format.incoll.pages + { type empty$ + { bbl.chapter } + { type "l" change.case$ + "type" bibinfo.check + } + if$ + chapter tie.or.space.prefix + "chapter" bibinfo.check + * * + pages empty$ + 'skip$ + { ", " * format.incoll.pages * } + if$ + } + if$ +} + +FUNCTION {format.vol.num.pages} +{ volume field.or.null + duplicate$ empty$ 'skip$ + { + "volume" bibinfo.check + } + if$ + number "number" bibinfo.check duplicate$ empty$ 'skip$ + { + swap$ duplicate$ empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + swap$ + "(" swap$ * ")" * + } + if$ * + eid empty$ + { format.journal.pages } + { format.journal.eid } + if$ +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { bbl.chapter } + { type "l" change.case$ + "type" bibinfo.check + } + if$ + chapter tie.or.space.prefix + "chapter" bibinfo.check + * * + pages empty$ + 'skip$ + { ", " * format.pages * } + if$ + } + if$ +} + +FUNCTION {format.booktitle} +{ + booktitle "booktitle" bibinfo.check +} +FUNCTION {format.in.ed.booktitle} +{ format.booktitle duplicate$ empty$ 'skip$ + { + editor "editor" format.names.ed duplicate$ empty$ 'pop$ + { + " " * + get.bbl.editor + "(" swap$ * ") " * + * swap$ + * } + if$ + word.in swap$ * + } + if$ +} +FUNCTION {format.thesis.type} +{ type duplicate$ empty$ + 'pop$ + { swap$ pop$ + "t" change.case$ "type" bibinfo.check + } + if$ +} +FUNCTION {format.tr.number} +{ number "number" bibinfo.check + type duplicate$ empty$ + { pop$ bbl.techrep } + 'skip$ + if$ + "type" bibinfo.check + swap$ duplicate$ empty$ + { pop$ "t" change.case$ } + { tie.or.space.prefix * * } + if$ +} +FUNCTION {format.article.crossref} +{ + word.in + " \cite{" * crossref * "}" * +} +FUNCTION {format.book.crossref} +{ volume duplicate$ empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + pop$ word.in + } + { bbl.volume + capitalize + swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word * + } + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {format.incoll.inproc.crossref} +{ + word.in + " \cite{" * crossref * "}" * +} +FUNCTION {format.org.or.pub} +{ 't := + "" + address empty$ t empty$ and + 'skip$ + { + t empty$ + { address "address" bibinfo.check * + } + { t * + address empty$ + 'skip$ + { ", " * address "address" bibinfo.check * } + if$ + } + if$ + } + if$ +} +FUNCTION {format.publisher.address} +{ publisher "publisher" bibinfo.warn format.org.or.pub +} + +FUNCTION {format.organization.address} +{ organization "organization" bibinfo.check format.org.or.pub +} + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + new.sentence + crossref missing$ + { + journal + remove.dots + "journal" bibinfo.check + "journal" output.check + add.blank + format.vol.num.pages output + } + { format.article.crossref output.nonnull + format.pages output + } + if$ + new.sentence + format.doi output + format.url output + format.note output + format.soft.eprint output + add.blank + format.primaryClass output + fin.entry +} + +FUNCTION {book} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + editor format.key output + add.blank + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + format.date "year" output.check + date.block + format.btitle "title" output.check + crossref missing$ + { format.bvolume output + format.edition output + new.sentence + format.number.series output + format.publisher.address output + } + { + new.sentence + format.book.crossref output.nonnull + } + if$ + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} +FUNCTION {booklet} +{ output.bibitem + format.authors output + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + new.sentence + howpublished "howpublished" bibinfo.check output + address "address" bibinfo.check output + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} + +FUNCTION {inbook} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + editor format.key output + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + format.date "year" output.check + date.block + format.btitle "title" output.check + crossref missing$ + { + format.bvolume output + format.edition output + format.publisher.address output + format.chapter.pages "chapter and pages" output.check + new.sentence + format.number.series output + } + { + format.chapter.pages "chapter and pages" output.check + new.sentence + format.book.crossref output.nonnull + } + if$ + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + new.sentence + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.edition output + new.sentence + format.number.series output + format.publisher.address output + format.incoll.chapter.pages output + } + { format.incoll.inproc.crossref output.nonnull + format.incoll.chapter.pages output + } + if$ + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + new.sentence + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.bvolume output + new.sentence + format.publisher.address output + } + if$ + format.number.series output + format.pages output + } + { format.incoll.inproc.crossref output.nonnull + format.pages output + } + if$ + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} +FUNCTION {conference} { inproceedings } +FUNCTION {manual} +{ output.bibitem + format.authors output + author format.key output + format.date "year" output.check + date.block + format.btitle "title" output.check + new.sentence + organization "organization" bibinfo.check output + address "address" bibinfo.check output + format.edition output + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} + +FUNCTION {mastersthesis} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title + "title" output.check + new.sentence + bbl.mthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} + +FUNCTION {misc} +{ output.bibitem + format.authors output + author format.key output + format.date "year" output.check + date.block + format.title output + new.sentence + howpublished "howpublished" bibinfo.check output + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} + +FUNCTION {insert.comma} +{ duplicate$ empty$ + 'skip$ + { ", " * add.blank } + if$ +} + +FUNCTION {softmisc} +{ output.bibitem + format.authors output + author format.key output + format.date "year" output.check + date.block + format.title output + insert.comma + version output + new.sentence + howpublished "howpublished" bibinfo.check output + format.doi output + format.url output + format.note output + format.softmisc.eprint output + fin.entry +} + +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title + "title" output.check + new.sentence + bbl.phdthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} + +FUNCTION {proceedings} +{ output.bibitem + format.editors output + editor format.key output + format.date "year" output.check + date.block + format.btitle "title" output.check + format.bvolume output + format.number.series output + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} + +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title + "title" output.check + new.sentence + format.tr.number output.nonnull + institution "institution" bibinfo.warn output + address "address" bibinfo.check output + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} + +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + format.doi output + format.url output + format.note "note" output.check + format.eprint output + fin.entry +} + +FUNCTION {default.type} { misc } +READ +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} +INTEGERS { len } +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} +FUNCTION {format.lab.names} +{ 's := + "" 't := + s #1 "{vv~}{ll}" format.name$ + s num.names$ duplicate$ + #2 > + { pop$ + " " * bbl.etal * + } + { #2 < + 'skip$ + { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { + " " * bbl.etal * + } + { bbl.and space.word * s #2 "{vv~}{ll}" format.name$ + * } + if$ + } + if$ + } + if$ +} + +FUNCTION {author.key.label} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.editor.key.label} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {editor.key.label} +{ editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ +} + +FUNCTION {calc.short.authors} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.label + { type$ "proceedings" = + 'editor.key.label + 'author.key.label + if$ + } + if$ + 'short.list := +} + +FUNCTION {calc.label} +{ calc.short.authors + short.list + "(" + * + year duplicate$ empty$ + { pop$ "????" } + 'skip$ + if$ + * + 'label := +} + +FUNCTION {sort.format.names} +{ 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{ll{ }}{ f{ }}{ jj{ }}" + format.name$ 't := + nameptr #1 > + { + " " * + namesleft #1 = t "others" = and + { "zzzzz" * } + { numnames #2 > nameptr #2 = and + { "zz" * year field.or.null * " " * } + 'skip$ + if$ + t sortify * + } + if$ + } + { t sortify * } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {sort.format.title} +{ 't := + "A " #2 + "An " #3 + "The " #4 t chop.word + chop.word + chop.word + sortify + #1 global.max$ substring$ +} +FUNCTION {author.sort} +{ author empty$ + { key empty$ + { "to sort, need author or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { author sort.format.names } + if$ +} +FUNCTION {author.editor.sort} +{ author empty$ + { editor empty$ + { key empty$ + { "to sort, need author, editor, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ + } + { author sort.format.names } + if$ +} +FUNCTION {editor.sort} +{ editor empty$ + { key empty$ + { "to sort, need editor or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ +} +FUNCTION {presort} +{ calc.label + label sortify + " " + * + type$ "book" = + type$ "inbook" = + or + 'author.editor.sort + { type$ "proceedings" = + 'editor.sort + 'author.sort + if$ + } + if$ + #1 entry.max$ substring$ + 'sort.label := + sort.label + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} + +ITERATE {presort} +SORT +STRINGS { last.label next.extra } +INTEGERS { last.extra.num number.label } +FUNCTION {initialize.extra.label.stuff} +{ #0 int.to.chr$ 'last.label := + "" 'next.extra := + #0 'last.extra.num := + #0 'number.label := +} +FUNCTION {forward.pass} +{ last.label label = + { last.extra.num #1 + 'last.extra.num := + last.extra.num int.to.chr$ 'extra.label := + } + { "a" chr.to.int$ 'last.extra.num := + "" 'extra.label := + label 'last.label := + } + if$ + number.label #1 + 'number.label := +} +FUNCTION {reverse.pass} +{ next.extra "b" = + { "a" 'extra.label := } + 'skip$ + if$ + extra.label 'next.extra := + extra.label + duplicate$ empty$ + 'skip$ + { "{\natexlab{" swap$ * "}}" * } + if$ + 'extra.label := + label extra.label * 'label := +} +EXECUTE {initialize.extra.label.stuff} +ITERATE {forward.pass} +REVERSE {reverse.pass} +FUNCTION {bib.sort.order} +{ sort.label + " " + * + year field.or.null sortify + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} +ITERATE {bib.sort.order} +SORT +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" number.label int.to.str$ * "}" * + write$ newline$ + "\providecommand{\natexlab}[1]{#1}" + write$ newline$ + "\providecommand{\url}[1]{{#1}}" + write$ newline$ + "\providecommand{\urlprefix}{URL }" + write$ newline$ + %%"\expandafter\ifx\csname urlstyle\endcsname\relax" + %%write$ newline$ + %%" \providecommand{\doi}[1]{\discretionary{}{}{}https://doi.org/#1}\else" + %%write$ newline$ + %%" \providecommand{\doi}{\discretionary{}{}{}\begingroup \urlstyle{rm}\Url}\fi" + "\providecommand{\doi}[1]{\url{https://doi.org/#1}}" + write$ newline$ + "\providecommand{\eprint}[2][]{\url{#2}}" + write$ newline$ + " \bibcommenthead " + write$ newline$ +} +EXECUTE {begin.bib} +EXECUTE {init.state.consts} +ITERATE {call.type$} +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} +EXECUTE {end.bib} +%% End of customized bst file +%% +%% End of file `spbasic.bst'. + diff --git a/papers/preprint/sn-article-template/bst/sn-chicago.bst b/papers/preprint/sn-article-template/bst/sn-chicago.bst new file mode 100644 index 000000000..bb6d2c6fd --- /dev/null +++ b/papers/preprint/sn-article-template/bst/sn-chicago.bst @@ -0,0 +1,1808 @@ +%%% ==================================================================== +%%% @BibTeX-style-file{ +%%% author = "Glenn Paulley", +%%% version = "4", +%%% date = "28 August 1992", +%%% time = "10:23:39 199", +%%% filename = "chicago.bst", +%%% address = "Data Structuring Group +%%% Department of Computer Science +%%% University of Waterloo +%%% Waterloo, Ontario, Canada +%%% N2L 3G1", +%%% telephone = "(519) 885-1211", +%%% FAX = "(519) 885-1208", +%%% checksum = "26323 1654 5143 37417", +%%% email = "gnpaulle@bluebox.uwaterloo.ca", +%%% codetable = "ISO/ASCII", +%%% keywords = "", +%%% supported = "yes", +%%% abstract = "A BibTeX bibliography style that follows the +%%% `B' reference style of the 13th Edition of +%%% the Chicago Manual of Style. A detailed +%%% feature list is given below.", +%%% docstring = "The checksum field above contains a CRC-16 +%%% checksum as the first value, followed by the +%%% equivalent of the standard UNIX wc (word +%%% count) utility output of lines, words, and +%%% characters. This is produced by Robert +%%% Solovay's checksum utility.", +%%% } +%%% ==================================================================== +% +% "Chicago" BibTeX style, chicago.bst +% =================================== +% +% BibTeX `chicago' style file for BibTeX version 0.99c, LaTeX version 2.09 +% Place it in a file called chicago.bst in the BibTeX search path. +% You need to include chicago.sty as a \documentstyle option. +% (Placing it in the same directory as the LaTeX document should also work.) +% This "chicago" style is based on newapa.bst (American Psych. Assoc.) +% found at ymir.claremont.edu. +% +% Citation format: (author-last-name year) +% (author-last-name and author-last-name year) +% (author-last-name, author-last-name, and author-last-name year) +% (author-last-name et al. year) +% (author-last-name) +% author-last-name (year) +% (author-last-name and author-last-name) +% (author-last-name et al.) +% (year) or (year,year) +% year or year,year +% +% Reference list ordering: alphabetical by author or whatever passes +% for author in the absence of one. +% +% This BibTeX style has support for abbreviated author lists and for +% year-only citations. This is done by having the citations +% actually look like +% +% \citeauthoryear{full-author-info}{abbrev-author-info}{year} +% +% The LaTeX style has to have the following (or similar) +% +% \let\@internalcite\cite +% \def\fullcite{\def\citeauthoryear##1##2##3{##1, ##3}\@internalcite} +% \def\fullciteA{\def\citeauthoryear##1##2##3{##1}\@internalcite} +% \def\shortcite{\def\citeauthoryear##1##2##3{##2, ##3}\@internalcite} +% \def\shortciteA{\def\citeauthoryear##1##2##3{##2}\@internalcite} +% \def\citeyear{\def\citeauthoryear##1##2##3{##3}\@internalcite} +% +% These TeX macro definitions are found in chicago.sty. Additional +% commands to manipulate different components of a citation can be defined +% so that, for example, you can list author's names without parentheses +% if using a citation as a noun or object in a sentence. +% +% This file was originally copied from newapa.bst at ymir.claremont.edu. +% +% Features of chicago.bst: +% ======================= +% +% - full names used in citations, but abbreviated citations are available +% (see above) +% - if an entry has a "month", then the month and year are also printed +% as part of that bibitem. +% - all conjunctions use "and" instead of "\&" +% - major modification from Chicago Manual of Style (13th ed.) is that +% only the first author in a reference appears last name first- +% additional authors appear as J. Q. Public. +% - pages are listed as "pp. xx-xx" in all entry types except +% article entries. +% - book, inbook, and manual use "location: publisher" (or organization) +% for address and publisher. All other types list publishers separately. +% - "pp." are used to identify page numbers for all entry types except +% articles. +% - organization is used as a citation label if neither author nor editor +% is present (for manuals). +% - "et al." is used for long author and editor lists, or when "others" +% is used. +% +% Modifications and bug fixes from newapa.bst: +% =========================================== +% +% - added month, year to bib entries if month is present +% - fixed bug with In proceedings, added necessary comma after title +% - all conjunctions changed to "and" from "\&" +% - fixed bug with author labels in my.full.label: "et al." now is +% generated when "others" is an author name +% - major modification from Chicago Manual of Style (13th ed.) is that +% only the first author in a reference appears last name first- +% additional authors appear as J. Q. Public. +% - pages are listed as "pp. xx-xx" in all entry types except +% article entries. Unnecessary (IMHO) "()" around page numbers +% were removed, and page numbers now don't end with a period. +% - created chicago.sty for use with this bibstyle (required). +% - fixed bugs in FUNCTION {format.vol.num.pages} for missing volume, +% number, and /or pages. Renamed to format.jour.vol. +% - fixed bug in formatting booktitles: additional period an error if +% book has a volume. +% - fixed bug: editors usually given redundant period before next clause +% (format.editors.dot) removed. +% - added label support for organizations, if both author and editor +% are missing (from alpha.bst). If organization is too long, then +% the key field is used for abbreviated citations. +% - In proceedings or books of several volumes, no comma was written +% between the "Volume x" and the page numbers (this was intentional +% in newapa.bst). Fixed. +% - Some journals may not have volumes/numbers, only month/year (eg. +% IEEE Computer). Fixed bug in article style that assumed volume/number +% was always present. +% +% Original documentation for newapa.sty: +% ===================================== +% +% This version was made by modifying the master file made by +% Oren Patashnik (PATASHNIK@SCORE.STANFORD.EDU), and the 'named' BibTeX +% style of Peter F. Patel-Schneider. +% +% Copyright (C) 1985, all rights reserved. +% Copying of this file is authorized only if either +% (1) you make absolutely no changes to your copy, including name, or +% (2) if you do make changes, you name it something other than 'newapa.bst'. +% There are undoubtably bugs in this style. If you make bug fixes, +% improvements, etc. please let me know. My e-mail address is: +% spencer@cgrg.ohio.state.edu or 71160.3141@compuserve.com +% +% This style was made from 'plain.bst', 'named.bst', and 'apalike.bst', +% with lots of tweaking to make it look like APA style, along with tips +% from Young Ryu and Brian Reiser's modifications of 'apalike.bst'. + +ENTRY + { address + author + booktitle + chapter + edition + editor + howpublished + institution + journal + key + keywords + month + note + doi + number + organization + pages + publisher + school + series + title + type + volume + year + eprint + archive + archivePrefix + primaryClass + eid + adsurl + adsnote + version + } + {} + { label.year extra.label sort.year sort.label } + +INTEGERS { output.state before.all mid.sentence after.sentence after.block } + +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} + +STRINGS { s t u } + +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} + +FUNCTION {add.blank} +{ " " * before.all 'output.state := +} + +% Use a colon to separate output. Used only for address/publisher +% combination in book/inbook types, address/institution for manuals, +% and organization:publisher for proceedings (inproceedings). +% +FUNCTION {output.nonnull.colon} +{ 's := + output.state mid.sentence = + { ": " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} + +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} + +FUNCTION {output.colon} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull.colon + if$ +} + +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} + +FUNCTION {output.check.colon} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull.colon + if$ +} + +FUNCTION {output.year.check} +{ year empty$ + { "empty year in " cite$ * warning$ } + { write$ + " " year * extra.label * + month empty$ + { "" * } + { ", " * month * "" * } + if$ + mid.sentence 'output.state := + } + if$ +} + + +FUNCTION {fin.entry} +{ add.period$ + write$ + newline$ +} + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} + +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} + +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} + +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} + +FUNCTION {new.block.checka} +{ empty$ + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.sentence.checka} +{ empty$ + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {new.sentence.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} + +% +% Emphasize the top string on the stack. +% +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "{\em " swap$ * "}" * } + if$ +} + +% +% Emphasize the top string on the stack, but add a trailing space. +% +FUNCTION {emphasize.space} +{ duplicate$ empty$ + { pop$ "" } + { "{\em " swap$ * "\/}" * } + if$ +} + +INTEGERS { nameptr namesleft numnames } +% +% Format bibliographical entries with the first author last name first, +% and subsequent authors with initials followed by last name. +% All names are formatted in this routine. +% +FUNCTION {format.names} +{ 's := + #1 'nameptr := % nameptr = 1; + s num.names$ 'numnames := % numnames = num.name$(s); + numnames 'namesleft := + { namesleft #0 > } + + { nameptr #1 = + {s nameptr "{vv~}{ll}{, jj}{, f{.}.}" format.name$ 't := } + {s nameptr "{f{.}.~}{vv~}{ll}{, jj}" format.name$ 't := } + if$ + nameptr #1 > + { namesleft #1 > + { ", " * t * } + { numnames #2 > + { "," * } + 'skip$ + if$ + t "others" = + { " et~al." * } + { " and " * t * } % from Chicago Manual of Style + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := % nameptr += 1; + namesleft #1 - 'namesleft := % namesleft =- 1; + } + while$ +} + +FUNCTION {my.full.label} +{ 's := + #1 'nameptr := % nameptr = 1; + s num.names$ 'numnames := % numnames = num.name$(s); + numnames 'namesleft := + { namesleft #0 > } + + { s nameptr "{vv~}{ll}" format.name$ 't := % get the next name + nameptr #1 > + { namesleft #1 > + { ", " * t * } + { numnames #2 > + { "," * } + 'skip$ + if$ + t "others" = + { " et~al." * } + { " and " * t * } % from Chicago Manual of Style + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := % nameptr += 1; + namesleft #1 - 'namesleft := % namesleft =- 1; + } + while$ + +} + +FUNCTION {format.names.fml} +% +% Format names in "familiar" format, with first initial followed by +% last name. Like format.names, ALL names are formatted. +% +{ 's := + #1 'nameptr := % nameptr = 1; + s num.names$ 'numnames := % numnames = num.name$(s); + numnames 'namesleft := + { namesleft #0 > } + + { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't := + + nameptr #1 > + { namesleft #1 > + { ", " * t * } + { numnames #2 > + { "," * } + 'skip$ + if$ + t "others" = + { " et~al." * } + { " and " * t * } +% { " \& " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := % nameptr += 1; + namesleft #1 - 'namesleft := % namesleft =- 1; + } + while$ +} + +FUNCTION {format.authors} +{ author empty$ + { "" } + { author format.names } + if$ +} + +FUNCTION {format.key} +{ empty$ + { key field.or.null } + { "" } + if$ +} + +% +% Format editor names for use in the "in" types: inbook, incollection, +% inproceedings: first initial, then last names. When editors are the +% LABEL for an entry, then format.editor is used which lists editors +% by last name first. +% +FUNCTION {format.editors.fml} +{ editor empty$ + { "" } + { editor format.names.fml + editor num.names$ #1 > + { " (Eds.)" * } + { " (Ed.)" * } + if$ + } + if$ +} + +% +% Format editor names for use in labels, last names first. +% +FUNCTION {format.editors} +{ editor empty$ + { "" } + { editor format.names + editor num.names$ #1 > + { " eds." * } + { " ed." * } + if$ + } + if$ +} + +FUNCTION {in.format.editors} +{ editor empty$ + { "" } + { editor format.names + editor num.names$ #1 > + { " eds. " swap$ * } + { " ed. " swap$ * } + if$ + } + if$ +} + +FUNCTION {format.title} +{ title empty$ + { "" } + { title "t" change.case$ } + if$ +} + +% Note that the APA style requres case changes +% in article titles. The following does not +% change cases. If you perfer it, uncomment the +% following and comment out the above. + +%FUNCTION {format.title} +%{ title empty$ +% { "" } +% { title } +% if$ +%} + +FUNCTION {n.dashify} +{ 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {format.btitle} +{ edition empty$ + { title emphasize } + { title empty$ + { title emphasize } + { volume empty$ % gnp - check for volume, then don't need period + { "{\em " title * "\/} (" * edition * " ed.)" * "." * } + { "{\em " title * "\/} (" * edition * " ed.)" * } + if$ + } + if$ + } + if$ +} + +FUNCTION {format.emphasize.booktitle} +{ edition empty$ + { booktitle emphasize } + { booktitle empty$ + { booktitle emphasize } + { volume empty$ % gnp - extra period an error if book has a volume + { "{\em " booktitle * "\/} (" * edition * " ed.)" * "." *} + { "{\em " booktitle * "\/} (" * edition * " ed.)" * } + if$ + } + if$ + } + if$ + } + + +FUNCTION {tie.or.space.connect} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ * * +} + +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} + +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { "Volume" volume tie.or.space.connect % gnp - changed to mixed case + series empty$ + 'skip$ + { " of " * series emphasize * } + if$ + "volume and number" number either.or.check + } + if$ +} + +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { output.state mid.sentence = + { "Number" } % gnp - changed to mixed case always + { "Number" } + if$ + number tie.or.space.connect + series empty$ + { "there's a number but no series in " cite$ * warning$ } + { " in " * series * } + if$ + } + if$ + } + { "" } + if$ +} + +INTEGERS { multiresult } + +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} + +FUNCTION {format.pages} +{ pages empty$ + { "" } + { pages multi.page.check + { "pp.\ " pages n.dashify tie.or.space.connect } % gnp - removed () + { "pp.\ " pages tie.or.space.connect } + if$ + } + if$ +} + + +FUNCTION {format.in.pages} +{ pages empty$ + { "" } + { pages multi.page.check + { "" pages n.dashify tie.or.space.connect } % gnp - removed () + { "" pages tie.or.space.connect } + if$ + } + if$ +} + +% By Young (and Spencer) +% GNP - fixed bugs with missing volume, number, and/or pages +% +% Format journal, volume, number, pages for article types. +% +FUNCTION {format.jour.vol} +{ journal empty$ + { "no journal in " cite$ * warning$ + "" } + { journal emphasize.space } + if$ + number empty$ + { volume empty$ + { "no number and no volume in " cite$ * warning$ + "" * } + { "~" * Volume * "" * } + if$ + } + { volume empty$ + {"no volume for " cite$ * warning$ + "~(" * number * ")" * } + { "~" * + volume emphasize.space + "(" * number * ")" * * } + if$ + } + if$ + pages empty$ + {"page numbers missing in " cite$ * warning$ + "" * } % gnp - place a null string on the stack for output + { duplicate$ empty$ + { pop$ format.pages } + { ": " * pages n.dashify * } % gnp - removed pp. for articles + if$ + } + if$ +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { "Chapter" } % gnp - changed to mixed case + { type "t" change.case$ } + if$ + chapter tie.or.space.connect + pages empty$ + {"page numbers missing in " cite$ * warning$} % gnp - added check + { ", " * format.pages * } + if$ + } + if$ +} + + +FUNCTION {format.in.chapter.pages} +{ chapter empty$ + 'format.in.pages + { type empty$ + { "Chapter" } % gnp - changed to mixed case + { type "t" change.case$ } + if$ + chapter tie.or.space.connect + pages empty$ + {"page numbers missing in " cite$ * warning$} % gnp - added check + { ", " * format.in.pages * } + if$ + } + if$ +} + +FUNCTION {format.in.ed.booktitle} +{ booktitle empty$ + { "" } + { editor empty$ + { "In " format.emphasize.booktitle * } + { "In " format.editors.fml * ", " * format.emphasize.booktitle * } + if$ + } + if$ +} + +FUNCTION {format.in.coll.ed.booktitle} +{ booktitle empty$ + { "" } + { editor empty$ + { "" format.emphasize.booktitle * } + { "In " format.emphasize.booktitle * ", " * in.format.editors * } + if$ + } + if$ +} + +FUNCTION {format.thesis.type} +{ type empty$ + 'skip$ + { pop$ + type "t" change.case$ + } + if$ +} + +FUNCTION {format.tr.number} +{ type empty$ + { "Technical Report" } + 'type + if$ + number empty$ + { "t" change.case$ } + { number tie.or.space.connect } + if$ +} + +FUNCTION {format.article.crossref} +{ "See" + "\citeN{" * crossref * "}" * +} + +FUNCTION {format.crossref.editor} +{ editor #1 "{vv~}{ll}" format.name$ + editor num.names$ duplicate$ + #2 > + { pop$ " et~al." * } + { #2 < + 'skip$ + { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { " et~al." * } + { " and " * editor #2 "{vv~}{ll}" format.name$ * } + if$ + } + if$ + } + if$ +} + +FUNCTION {format.book.crossref} +{ volume empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + "In " + } + { "Volume" volume tie.or.space.connect % gnp - changed to mixed case + " of " * + } + if$ + editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { series empty$ + { "need editor, key, or series for " cite$ * " to crossref " * + crossref * warning$ + "" * + } + { "{\em " * series * "\/}" * } + if$ + } + { key * } + if$ + } + { format.crossref.editor * } + if$ + " \citeN{" * crossref * "}" * +} + +FUNCTION {format.incoll.inproc.crossref} +{ "See" + " \citeN{" * crossref * "}" * +} + +% format.lab.names: +% +% determines "short" names for the abbreviated author information. +% "Long" labels are created in calc.label, using the routine my.full.label +% to format author and editor fields. +% +% There are 4 cases for labels. (n=3 in the example) +% a) one author Foo +% b) one to n Foo, Bar and Baz +% c) use of "and others" Foo, Bar et al. +% d) more than n Foo et al. +% +FUNCTION {format.lab.names} +{ 's := + s num.names$ 'numnames := + numnames #2 > % change number to number of others allowed before + % forcing "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 {author.key.label} +{ author empty$ + { key empty$ + { "no key, author in " cite$ * warning$ + cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {editor.key.label} +{ editor empty$ + { key empty$ + { "no key, editor in " cite$ * warning$ + cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ +} + +FUNCTION {author.key.organization.label} +% +% added - gnp. Provide label formatting by organization if author is null. +% +{ author empty$ + { organization empty$ + { key empty$ + { "no key, author or organization in " cite$ * warning$ + cite$ #1 #3 substring$ } + 'key + if$ + } + { organization } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {editor.key.organization.label} +% +% added - gnp. Provide label formatting by organization if editor is null. +% +{ editor empty$ + { organization empty$ + { key empty$ + { "no key, editor or organization in " cite$ * warning$ + cite$ #1 #3 substring$ } + 'key + if$ + } + { organization } + if$ + } + { editor format.lab.names } + if$ +} + +FUNCTION {author.editor.key.label} +{ author empty$ + { editor empty$ + { key empty$ + { "no key, author, or editor in " cite$ * warning$ + cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {calc.label} +% +% Changed - GNP. See also author.organization.sort, editor.organization.sort +% Form label for BibTeX entry. The classification of which fields are used +% for which type of entry (book, inbook, etc.) are taken from alpha.bst. +% The change here from newapa is to also include organization as a +% citation label if author or editor is missing. +% +{ 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$ + + author empty$ % generate the full label citation information. + { editor empty$ + { organization empty$ + { "no author, editor, or organization in " cite$ * warning$ + "??" } + { organization } + if$ + } + { editor my.full.label } + if$ + } + { author my.full.label } + if$ + +% leave label on the stack, to be popped when required. + + "}{" * swap$ * "}{" * +% year field.or.null purify$ #-1 #4 substring$ * +% +% save the year for sort processing afterwards (adding a, b, c, etc.) +% + year field.or.null purify$ #-1 #4 substring$ + 'label.year := +} + +FUNCTION {output.bibitem} +{ newline$ + + "\bibitem[\protect\citeauthoryear{" write$ + calc.label write$ + sort.year write$ + "}]{" write$ + + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {output.doi} +{ + doi empty$ + { skip$ } + { "\doi{" doi * "}" * output } + if$ +} + +FUNCTION {format.archive} +{ + archivePrefix empty$ + { "" } + { archivePrefix ":" *} + if$ +} + +FUNCTION {format.primaryClass} +{ + primaryClass empty$ + { "" } + { "{[" primaryClass * "]}" *} + if$ +} + +FUNCTION {format.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {format.softmisc.archive} +{ + archivePrefix empty$ + { "" } + { "" } + if$ +} + +FUNCTION {format.softmisc.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {article} +{ output.bibitem + format.authors + "author" output.check +add.period$ "" * + author format.key output % added + output.year.check % added + new.block + format.title + "title" output.check + new.block + crossref missing$ + { format.jour.vol output + } + { format.article.crossref output.nonnull + format.pages output + } + if$ + new.block + output.doi + new.block + format.eprint output + add.blank + format.primaryClass output + fin.entry +} + +FUNCTION {book} +{ output.bibitem + author empty$ + { format.editors + "author and editor" output.check } + { format.authors + output.nonnull +add.period$ "" * + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + output.year.check % added + new.block + format.btitle + "title" output.check + crossref missing$ + { format.bvolume output + new.block + format.number.series output + new.sentence + address output + publisher "publisher" output.check.colon + } + { new.block + format.book.crossref output.nonnull + } + if$ + new.block + note output + fin.entry +} + +FUNCTION {booklet} +{ output.bibitem + format.authors output + author format.key output % added + output.year.check % added + new.block + format.title + "title" output.check + new.block + howpublished output + address output + new.block + note output + fin.entry +} + +FUNCTION {inbook} +{ output.bibitem + author empty$ + { format.editors + "author and editor" output.check + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + output.year.check % added + new.block + format.btitle + "title" output.check + crossref missing$ + { format.bvolume output + format.chapter.pages + "chapter and pages" output.check + new.block + format.number.series output + new.sentence + address output + publisher + "publisher" output.check.colon + } + { format.chapter.pages "chapter and pages" output.check + new.block + format.book.crossref output.nonnull + } + if$ + new.block + note output + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + format.authors + "author" output.check +add.period$ "" * + author format.key output % added + output.year.check % added + new.block + format.title + "title" output.check + crossref missing$ + { format.in.coll.ed.booktitle +"booktitle" output.check + format.bvolume output + format.number.series output + format.in.chapter.pages output % gnp - was special.output.nonnull +% left out comma before page numbers + new.sentence + address output + publisher "publisher" output.check.colon + } + { format.incoll.inproc.crossref + output.nonnull + format.in.chapter.pages output + } + if$ + new.block + note output + new.block + output.doi + fin.entry +} + +FUNCTION {inproceedings} +{ output.bibitem + format.authors + "author" output.check + author format.key output % added + output.year.check % added + new.block + format.title + "title" output.check + new.block + crossref missing$ + { format.in.ed.booktitle + "booktitle" output.check + format.bvolume output + format.number.series output + address output + format.pages output + new.sentence + organization output + publisher output.colon + } + { format.incoll.inproc.crossref output.nonnull + format.pages output + } + if$ + new.block + note output + fin.entry +} + +FUNCTION {conference} { inproceedings } + +FUNCTION {manual} +{ output.bibitem + author empty$ + { editor empty$ + { organization "organization" output.check + organization format.key output } % if all else fails, use key + { format.editors "author and editor" output.check } + if$ + } + { format.authors output.nonnull } + if$ + output.year.check % added + new.block + format.btitle + "title" output.check + organization address new.block.checkb +% Reversed the order of "address" and "organization", added the ":". + address output + organization "organization" output.check.colon +% address output +% ":" output +% organization output + new.block + note output + fin.entry +} + +FUNCTION {mastersthesis} +{ output.bibitem + format.authors + "author" output.check + author format.key output % added + output.year.check % added + new.block + format.title + "title" output.check + new.block + "Master's thesis" format.thesis.type output.nonnull + school "school" output.check + address output + new.block + note output + fin.entry +} + +FUNCTION {misc} +{ output.bibitem + format.authors output +add.period$ "" * + author format.key output % added + output.year.check % added + title howpublished new.block.checkb + format.title output + new.block + howpublished output + new.block + note output + fin.entry +} + +FUNCTION {softmisc} +{ output.bibitem + format.authors output +add.period$ "" * + author format.key output % added + %%output.year.check % added + year output + title howpublished new.block.checkb + format.title output + version output + new.block + howpublished output + new.block + note output + new.block + format.softmisc.eprint output + fin.entry +} + +FUNCTION {phdthesis} +{ output.bibitem + format.authors + "author" output.check + author format.key output % added + output.year.check % added + new.block + format.btitle + "title" output.check + new.block + "Ph.\ D. thesis" format.thesis.type output.nonnull + school "school" output.check + address output + new.block + note output + fin.entry +} + +FUNCTION {proceedings} +{ output.bibitem + editor empty$ + { organization output + organization format.key output } % gnp - changed from author format.key + { format.editors output.nonnull } + if$ +% author format.key output % gnp - removed (should be either +% editor or organization + output.year.check % added (newapa) + new.block + format.btitle + "title" output.check + format.bvolume output + format.number.series output + address output + new.sentence + organization output + publisher output.colon + new.block + note output + fin.entry +} + +FUNCTION {techreport} +{ output.bibitem + format.authors + "author" output.check + author format.key output % added + output.year.check % added + new.block + format.title + "title" output.check + new.block + format.tr.number output.nonnull + institution + "institution" output.check + address output + new.block + note output + fin.entry +} + +FUNCTION {unpublished} +{ output.bibitem + format.authors + "author" output.check + author format.key output % added + output.year.check % added + new.block + format.title + "title" output.check + new.block + note "note" output.check + fin.entry +} + +FUNCTION {default.type} { misc } + +MACRO {jan} {"January"} + +MACRO {feb} {"February"} + +MACRO {mar} {"March"} + +MACRO {apr} {"April"} + +MACRO {may} {"May"} + +MACRO {jun} {"June"} + +MACRO {jul} {"July"} + +MACRO {aug} {"August"} + +MACRO {sep} {"September"} + +MACRO {oct} {"October"} + +MACRO {nov} {"November"} + +MACRO {dec} {"December"} + +MACRO {acmcs} {"ACM Computing Surveys"} + +MACRO {acta} {"Acta Informatica"} + +MACRO {ai} {"Artificial Intelligence"} + +MACRO {cacm} {"Communications of the ACM"} + +MACRO {ibmjrd} {"IBM Journal of Research and Development"} + +MACRO {ibmsj} {"IBM Systems Journal"} + +MACRO {ieeese} {"IEEE Transactions on Software Engineering"} + +MACRO {ieeetc} {"IEEE Transactions on Computers"} + +MACRO {ieeetcad} + {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} + +MACRO {ipl} {"Information Processing Letters"} + +MACRO {jacm} {"Journal of the ACM"} + +MACRO {jcss} {"Journal of Computer and System Sciences"} + +MACRO {scp} {"Science of Computer Programming"} + +MACRO {sicomp} {"SIAM Journal on Computing"} + +MACRO {tocs} {"ACM Transactions on Computer Systems"} + +MACRO {tods} {"ACM Transactions on Database Systems"} + +MACRO {tog} {"ACM Transactions on Graphics"} + +MACRO {toms} {"ACM Transactions on Mathematical Software"} + +MACRO {toois} {"ACM Transactions on Office Information Systems"} + +MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} + +MACRO {tcs} {"Theoretical Computer Science"} + +READ + +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} + +INTEGERS { len } + +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} + + + +FUNCTION {sort.format.names} +{ 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { nameptr #1 > + { " " * } + 'skip$ + if$ + 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.title} +{ 't := + "A " #2 + "An " #3 + "The " #4 t chop.word + chop.word + chop.word + sortify + #1 global.max$ substring$ +} + +FUNCTION {author.sort} +{ author empty$ + { key empty$ + { "to sort, need author or key in " cite$ * warning$ + "" } + { key sortify } + if$ + } + { author sort.format.names } + if$ +} + +FUNCTION {editor.sort} +{ editor empty$ + { key empty$ + { "to sort, need editor or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ +} + +FUNCTION {author.editor.sort} +{ author empty$ + { "missing author in " cite$ * warning$ + editor empty$ + { key empty$ + { "to sort, need author, editor, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ + } + { author sort.format.names } + if$ +} + +FUNCTION {author.organization.sort} +% +% added - GNP. Stack author or organization for sorting (from alpha.bst). +% Unlike alpha.bst, we need entire names, not abbreviations +% +{ author empty$ + { organization empty$ + { key empty$ + { "to sort, need author, organization, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { organization sortify } + if$ + } + { author sort.format.names } + if$ +} + +FUNCTION {editor.organization.sort} +% +% added - GNP. Stack editor or organization for sorting (from alpha.bst). +% Unlike alpha.bst, we need entire names, not abbreviations +% +{ editor empty$ + { organization empty$ + { key empty$ + { "to sort, need editor, organization, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { organization sortify } + if$ + } + { editor sort.format.names } + if$ +} + +FUNCTION {presort} +% +% Presort creates the bibentry's label via a call to calc.label, and then +% sorts the entries based on entry type. Chicago.bst adds support for +% including organizations as the sort key; the following is stolen from +% alpha.bst. +% +{ calc.label sortify % recalculate bibitem label + year field.or.null purify$ #-1 #4 substring$ * % add year + " " + * + type$ "book" = + type$ "inbook" = + or + 'author.editor.sort + { type$ "proceedings" = + 'editor.organization.sort + { type$ "manual" = + 'author.organization.sort + 'author.sort + if$ + } + if$ + } + if$ + #1 entry.max$ substring$ % added for newapa + 'sort.label := % added for newapa + sort.label % added for newapa + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} + +ITERATE {presort} + +SORT % by label, year, author/editor, title + +STRINGS { last.label next.extra } + +INTEGERS { last.extra.num } + +FUNCTION {initialize.extra.label.stuff} +{ #0 int.to.chr$ 'last.label := + "" 'next.extra := + #0 'last.extra.num := +} + +FUNCTION {forward.pass} +% +% Pass through all entries, comparing current entry to last one. +% Need to concatenate year to the stack (done by calc.label) to determine +% if two entries are the same (see presort) +% +{ last.label + calc.label year field.or.null purify$ #-1 #4 substring$ * % add year + #1 entry.max$ substring$ = % are they equal? + { last.extra.num #1 + 'last.extra.num := + last.extra.num int.to.chr$ 'extra.label := + } + { "a" chr.to.int$ 'last.extra.num := + "" 'extra.label := + calc.label year field.or.null purify$ #-1 #4 substring$ * % add year + #1 entry.max$ substring$ 'last.label := % assign to last.label + } + if$ +} + +FUNCTION {reverse.pass} +{ next.extra "b" = + { "a" 'extra.label := } + 'skip$ + if$ + label.year extra.label * 'sort.year := + extra.label 'next.extra := +} + +EXECUTE {initialize.extra.label.stuff} + +ITERATE {forward.pass} + +REVERSE {reverse.pass} + +FUNCTION {bib.sort.order} +{ sort.label + " " + * + year field.or.null sortify + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} + +ITERATE {bib.sort.order} + +SORT % by sort.label, year, title --- giving final bib. order. + +FUNCTION {begin.bib} + +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{}" write$ newline$ + "\providecommand{\doi}[1]{\url{https://doi.org/#1}}" + write$ newline$ + "\bibcommenthead" write$ newline$ +} + + +EXECUTE {begin.bib} + +EXECUTE {init.state.consts} + +ITERATE {call.type$} + +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} + +EXECUTE {end.bib} + diff --git a/papers/preprint/sn-article-template/bst/sn-mathphys.bst b/papers/preprint/sn-article-template/bst/sn-mathphys.bst new file mode 100644 index 000000000..236a058ff --- /dev/null +++ b/papers/preprint/sn-article-template/bst/sn-mathphys.bst @@ -0,0 +1,3208 @@ +%% This is file `bmc-mathphys.bst' (created: 2011-12-27) +%% Compatible with bibtex version 0.99d. +%% +%% Please submit bugs or your comments to vtex@vtex.lt +%% Start subject with a "[BMC] bibtex: " + subject +%% +%% Sorting entries is done by name and year fields! +%% +%% 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. +%% +%% LIMITATIONS: +%% If you are getting error like +%% "Sorry---you've exceeded BibTeX's number of string global-variables" +%% that means you are using to old bibtex version. You should download latest version 0.99d. +%% (One of the binaries location is minimals.contextgarden.net/current/bin/common/) +%% +%% BibTeX programming: Linas Stonys, VTeX, Lithuania, lstonys@vtex.lt +% +% Changes: +% 2013-07-15 -- added XML output (taken from bmc_article.bst) v2.0 +% + +ENTRY + { address + author + booktitle + bnumber + chapter + doi + edition + editor + howpublished + institution + isbn + journal + key + keywords + month + note + number + organization + pages + publisher + school + series + title + type + volume + year + url + info + options + urldate + eprint + archive + archivePrefix + primaryClass + eid + adsurl + adsnote + version + } + {} + { label extra.label sort.label short.list} + +INTEGERS { output.state before.all mid.sentence after.sentence + after.block after.authors between.elements bother + Nisbn Nmonth slen set.settings tmp month.printed} + +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := + #4 'after.authors := + #5 'between.elements := +} + +STRINGS { s t element} +STRINGS { longest.label last.label list.string default.list} +STRINGS { v l f j b temp.str} + +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { " " * write$ newline$} + { output.state after.block = + { add.period$ write$ + newline$ + } + { + output.state after.authors = + { ": " * write$ + newline$ + } + { output.state between.elements = + { ", " * write$ newline$} + { output.state before.all = + 'write$ + { add.period$ " " * write$ newline$} + if$ + } + 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 {fin.entry} +{ write$ newline$ } + +FUNCTION {stupid.colon} +{ after.authors 'output.state := } + + +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 {not} +{ { #0 } + { #1 } + if$ +} + +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} + +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} + + +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} + +FUNCTION {sort.format.month} +{ 't := + t #1 #2 substring$ "01" = + t #1 #1 substring$ "1" = + t #2 #2 substring$ "" = + and or + { "January" } + { t #1 #2 substring$ "02" = + t #1 #1 substring$ "2" = + t #2 #2 substring$ "" = + and or + { "February" } + { t #1 #2 substring$ "03" = + t #1 #1 substring$ "3" = + t #2 #2 substring$ "" = + and or + { "March" } + { t #1 #2 substring$ "04" = + t #1 #1 substring$ "4" = + or + { "April" } + { t #1 #2 substring$ "05" = + t #1 #1 substring$ "5" = + or + { "May" } + { t #1 #2 substring$ "06" = + t #1 #1 substring$ "6" = + or + { "June" } + { t #1 #2 substring$ "07" = + t #1 #1 substring$ "7" = + or + { "July" } + { t #1 #2 substring$ "08" = + t #1 #1 substring$ "8" = + or + { "August" } + { t #1 #2 substring$ "09" = + t #1 #1 substring$ "9" = + or + { "September" } + { t #1 #2 substring$ "10" = + { "October" } + { t #1 #2 substring$ "11" = + { "November" } + { t #1 #2 substring$ "12" = + { "December" } + { t } % No match + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + +} + +INTEGERS {sk} +FUNCTION {is.num} +{ chr.to.int$ + duplicate$ "0" chr.to.int$ < not + swap$ "9" chr.to.int$ > not and +} + +FUNCTION {make.tag} +{ 't := + duplicate$ empty$ + { pop$ "" } + { bother #0 = + { + t "volume" = + {"\textbf{" swap$ * "}" * } + 'skip$ + if$ + } + { "\b" t * "{" * swap$ * "}" * } + if$ + } + if$ +} + + + +FUNCTION {springer.publisher} +{publisher #1 #8 substring$ "Springer" = + { "Springer" } + { publisher } + if$ +} + +FUNCTION {format.adsurl} +{ + adsurl empty$ + { "" } + {" \href{" adsurl "}" *} + if$ +} + +FUNCTION {format.adsnote} +{ + adsnote empty$ + { "" } + { ". " * adsnote *} + if$ +} + + +FUNCTION {format.soft.title} +{ + title empty$ + { "" } + { title "," *} + if$ +} + +FUNCTION {format.softmisctitle} +{ title empty$ + { ""} + { version empty$ + { title ", " *} + { title ", " * version " " *} + if$ + } + if$ +} + +FUNCTION {format.softmisc.archive} +{ + archivePrefix empty$ + { "" } + { "" } + if$ +} + +FUNCTION {format.archive} +{ + archivePrefix empty$ + { "" } + { archivePrefix ":" *} + if$ +} + +FUNCTION {format.primaryClass} +{ + primaryClass empty$ + { "" } + { "{[" primaryClass * "]}" *} + if$ +} + +FUNCTION {format.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {format.softmisc.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {format.pub.address} +{ publisher empty$ + howpublished empty$ + and + { + address empty$ + 'skip$ + { volume empty$ + 'insert.comma + 'new.sentence + if$ + address + type$ "inproceedings" = + {"conflocation"} + {"location"} + if$ + make.tag output + } + if$ + } + { + address empty$ + { publisher empty$ + {howpublished} + {springer.publisher} + if$ + "publisher" make.tag + #1 bother = + {", \blocation{???}" * } + 'skip$ + if$ + output + } + { + publisher empty$ + {howpublished } + {springer.publisher } + if$ + "publisher" make.tag output + insert.comma + address "location" make.tag output + } + if$ + } + if$ +} + +INTEGERS { nameptr namesleft numnames } + +FUNCTION {mk.tag} +{ 'temp.str := + duplicate$ empty$ + { pop$ "" } + { + b "nothing" = + 'skip$ + { "\b" temp.str * "{" * swap$ * "}" * } + if$ + } + if$ +} + +FUNCTION {space.after.dot} +{'j := + t 'f := + j 't := + s 'j := + "" 'l := + "" 's := + { t empty$ not } + { + t #1 #3 substring$ "{-}" = + { l " {q}. " * 'l := + t #4 global.max$ substring$ 't := + } + 'skip$ + if$ + + 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$ + f 't := + j 's := + l +} + +FUNCTION {fix.inits}{ + 't := + "" 'element := + { t empty$ not } + { + t #1 #3 substring$ ".q." = + { element ".-" * 'element := + t #3 global.max$ substring$ 't := + } + {element t #1 #1 substring$ * 'element :=} + if$ + + t #2 global.max$ substring$ 't := + } + while$ + element +} + +FUNCTION {fix.snm}{ + 't := + "" 'element := + { t empty$ not } + { + t #1 #3 substring$ "{-}" = + {element "-" * 'element := + t #3 global.max$ substring$ 't := + } + {element t #1 #1 substring$ * 'element :=} + if$ + + t #2 global.max$ substring$ 't := + } + while$ + element +} + +FUNCTION {enbrace.dash}{ + 't := + "" 'element := + { t empty$ not } + { + t #1 #1 substring$ "-" = + {element "{-}" * 'element :=} + {element t #1 #1 substring$ * 'element :=} + if$ + t #2 global.max$ substring$ 't := + } + while$ + element +} + +FUNCTION {fix.name}{ + + enbrace.dash 's := + "" 'l := + "" 't := + + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { + s nameptr "{vv~}{ll}{, jj}" format.name$ + s nameptr "{, ff}" format.name$ space.after.dot * 'l := + #1 nameptr = + {l 't :=} + {t " and " * l * 't := } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + t +} + +FUNCTION {name.separator}{ + namesleft #1 > + {", " * } + 'skip$ + if$ +} + +FUNCTION {format.author.editor} +{ 'b := + + bother #1 = + b "nothing" = + or + 'skip$ + {"b" b * 'b :=} + if$ + + b "editor" = + b "beditor" = + b "nothing" = + or or + {editor 's :=} + {author 's :=} + if$ + + %% modifying name + s fix.name 's := + + "" 't := + + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + + s numnames "{ll}" format.name$ 'l := + l "others" = + l "{others}" = + l "et al." = + l "{et al.}" = + or or or + {#1 'tmp :=} + {#0 'tmp :=} + if$ + + { namesleft #0 > } + { s nameptr "{vv}" format.name$ "particle" mk.tag 'v := + s nameptr "{ll}" format.name$ fix.snm "snm" mk.tag 'l := + s nameptr "{f{.}.}" format.name$ fix.inits "inits" mk.tag 'f := + s nameptr "{jj}" format.name$ "suffix" mk.tag 'j := + + + namesleft #1 = + tmp #1 = + and + { b "bauthor" = + b "beditor" = + or + {"et al."} + {"\betal"} + if$ + #1 'tmp := + } + { + b "bauthor" = + b "beditor" = + or + {"\oauthor{"} + { + b "nothing" = + {""} + {"\b" b * "{" *} + if$ + } +%% if$ +%% +%% v empty$ +%% 'skip$ +%% {v * " " *} + if$ + + l empty$ + 'skip$ + { l *} + if$ + + f empty$ + 'skip$ + {", " * f *} + if$ + + j empty$ + 'skip$ + {" " * j *} + if$ + + b "nothing" = + {""} + {"}"} + if$ + + * "" 't := + } + if$ + + name.separator + write$ + + namesleft #1 > + b "nothing" = not + and + { namesleft #2 = + tmp #1 = + and + 'skip$ + 'newline$ + if$ + } + 'skip$ + if$ + + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {format.editors} +{ editor empty$ + 'skip$ + { + bother #0 = + { author empty$ + {"editor"} + {"nothing"} + if$ + } + {"editor"} + if$ + format.author.editor + editor num.names$ #1 > + { " (eds.)" } + { " (ed.)" } + if$ + write$ + } + if$ +} + +FUNCTION {format.authors} +{ author empty$ + 'skip$ + {"author" format.author.editor} + if$ +} + +FUNCTION {cite.author.editor} +{ 's := + s #1 "{vv~}{ll}" format.name$ + s num.names$ duplicate$ + #2 > + { pop$ " et~al." * } + { #2 = + { s #2 "{vv~}{ll}{ jj}{ f}" format.name$ "others" = + { " et~al." * } + { " and " * s #2 "{vv~}{ll}" format.name$ * } + if$ + } + 'skip$ + 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$ +} + +INTEGERS { multiresult char.num k int} +INTEGERS {str.length count return save.num1 save.num2} +FUNCTION {is.in.list}{ + 'f := + %%%% saveing "s" and "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 := + } + while$ + + save.num1 'int := + save.num2 'count := + + #0 return = + { s t = + {#1 'return :=} + 'skip$ + if$ + } + 'skip$ + if$ + %%%% returning original "s" and "t" + j 's := + f 't := + + return +} + +INTEGERS {bibitem.count} + +FUNCTION {print.count} +{ bibitem.count #1 + 'bibitem.count := + newline$ + "%%% " + bibitem.count int.to.str$ * write$ +} + + +FUNCTION {output.bibitem} +{ print.count + newline$ + "\bibitem[\protect\citeauthoryear{" write$ + check.auth.edit.org write$ + "}{" write$ + check.year write$ + "}]{" write$ + cite$ write$ + "}" write$ + newline$ + "" before.all 'output.state := +} + + + + +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 {find.integer} +{ 't := + #0 'int := + { int not + t empty$ not + and + } + { t #1 #1 substring$ 's := + s is.num + {#1 'int :=} + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + int +} + +function{title.lowerwords}{ +"a,an,and,of,the,for,in,to,over,from,on,or,so,than,that,this,as,but,with,by,at,down,up,upon,al,ale,aus,aux,d'Analyse,d'Analystes,d'Architecture,d'Etudes,d'Histoire,da,dans,de,degli,dei,del," +"dell',dell'Accademia,dell'Istituto,dell'Universita,della,delle,dem,der,des,detta,di,die,din,dlia,do,du,e,eXpress,ed,ego,el,em,en,et,fur,i,iz,l'Academie,l'Age,l'Antiquite," * +"l'Approximation,l'Ecole,l'Histoire,l'I.S.U.P.,l'INSA,l'IREM,l'Indirizzo,l'Institut,l'Institute,l'UFR,l'Union,l'Universite,la,las,les,na,nella,per,po,si,sue,sur,ta,tes,und,van,voor,zu,zum,zur" * +} + +FUNCTION {upercase.first.letters}{ + 't := + "" 's := + #1 'int := + #1 'count := + list.string 'v := + "" 'b := + title.lowerwords 'list.string := + + t text.length$ 'slen := + + {count slen = not } + {t int #1 substring$ " " = + { + int #1 - 'int := + t #1 int substring$ 'b := + + % if word not in title.lowerwords - uppercase first letter + b is.in.list not + { b "l" change.case$ b = + { b "u" change.case$ "t" change.case$ 'b := } + 'skip$ + if$ + } + 'skip$ + if$ + + int #1 + 'int := + + s b " " * * 's := + int #1 + 'int := + t int global.max$ substring$ 't := + #0 'int := + } + 'skip$ + if$ + int #1 + 'int := + count #1 + 'count := +% "count=" count int.to.str$ * " slen=" * slen int.to.str$ * top$ + } + while$ + v 'list.string := + % last word is "t" and need to check it too + s t + t "l" change.case$ t = + { "u" change.case$ "t" change.case$ } + 'skip$ + if$ + * +} + + +FUNCTION {format.title} +{ title empty$ + { "" } + { title + "article" type$ = + type$ "techreport" = + type$ "inbook" = + type$ "inproceedings" = + type$ "incollection" = + type$ "phdthesis" = + type$ "mastersthesis" = + or or or or or or + {"t" change.case$} + { type$ "unpublished" = + type$ "misc" = + or + 'skip$ + 'upercase.first.letters + if$ + } + if$ + } + if$ +} + + +FUNCTION {note.presented} +{ note #1 #9 substring$ "presented" = + note #1 #9 substring$ "Presented" = + or +} + +FUNCTION {n.filter} +{ 't := + "" + { t empty$ not } + { t #1 #1 substring$ "," = + t #1 #1 substring$ "\" = + t #1 #1 substring$ "~" = + or or + { "" * + t #2 global.max$ substring$ 't := + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +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 + {s "year" make.tag + "nameyear" is.in.list + {longest.label * } + 'skip$ + if$ + } + {t "year" make.tag } + if$ + } + { t "year" make.tag + "nameyear" is.in.list + {extra.label *} + 'skip$ + if$ + } + if$ + } + if$ +} + +FUNCTION {format.date} +{ year empty$ + { "" } + { year byear } + if$ +} + +FUNCTION {parens} +{ "(" swap$ * ")" * } + +FUNCTION {format.date.parens} +{ year empty$ + { "" } + { year byear parens } + if$ +} + +FUNCTION {noparens} +{ " " swap$ * "" * } + +FUNCTION {format.softmiscdate} +{ year empty$ + { "" } + { year byear parens } + if$ +} + +FUNCTION {format.month}{ + month empty$ + {""} + {month sort.format.month "confdate" make.tag} + if$ +} + +FUNCTION {formatpatent.date} +{ year empty$ + 'skip$ + { month empty$ + { year } + {format.month " " * year *} + if$ + } + if$ +} + +FUNCTION {month.year.date} +{ year empty$ + {""} + { month empty$ + {year byear} + { format.month " " * year byear * } + if$ + type$ "inproceedings" = + 'skip$ + {"(" swap$ * ")" * } + if$ + } + if$ +} + +FUNCTION {tie.or.space.connect} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ * * +} +FUNCTION {format.volume} +{ volume empty$ + { "book" type$ = + {number empty$ + {""} + {"vol. " number "seriesno" make.tag *} + if$ + } + {""} + if$ + } + {"vol. " volume "seriesno" make.tag *} + if$ +} +FUNCTION {format.volume2} +{ volume empty$ + {""} + {"vol. " volume "seriesno" make.tag *} + if$ +} + +FUNCTION {format.art.vol} +{ + volume empty$ + {""} + {volume n.filter "volume" make.tag} + if$ + number empty$ + 'skip$ + { "(" number "issue" make.tag * ")" * * } + if$ +} + +FUNCTION {format.series} +{ series empty$ + 'skip$ + {series "sertitle" make.tag} + if$ +} + +FUNCTION {format.edition} +{ edition empty$ + { "" } + { "" 'v := + "" 'l := + "" 'f := + edition "l" change.case$ 's := + "1" s = + "first" s = + or + { + "1" 'v := + "st" 'l := + } + { + "2" s = + "second" s = + or + { + "2" 'v := + "nd" 'l := + } + { + "3" s = + "third" s = + or + { + "3" 'v := + "rd" 'l := + } + { + "4" s = + "fourth" s = + or + { + "4" 'v := + "th" 'l := + } + { + "5" s = + "fifth" s = + or + { + "5" 'v := + "th" 'l := + } + { + "6" s = + "sixth" s = + or + { + "6" 'v := + "th" 'l := + } + { + "7" s = + "seventh" s = + or + { + "7" 'v := + "th" 'l := + } + { + "8" s = + "eighth" s = + or + { + "8" 'v := + "th" 'l := + } + { + "9" s = + "nineth" s = + or + { + "9" 'v := + "th" 'l := + } + { + edition "t" change.case$ 'f := + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + #0 bother = + { f "" = + { v l * 'f :=} + 'skip$ + if$ + } + { f "" = + { "\bedition{" v * "}" * l * 'f :=} + { "\bedition{" f * "}" * 'f :=} + if$ + } + if$ + f " edn." * + } + if$ +} +FUNCTION {format.isbn} +{ isbn empty$ + { "" } + { isbn "isbn" make.tag} + if$ +} + +INTEGERS {default.info} + + +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + "" 'l := + + {t empty$ not} + { t #1 #1 substring$ 's := + + s is.num not + { "" l = not + {t find.integer + {#1 'multiresult := } + {#0 'multiresult := } + if$ + "" 't := + } + { + t #2 global.max$ substring$ 't := + } + if$ + } + { l s * 'l := + t #2 global.max$ substring$ 't := + } + if$ + } + while$ + multiresult +} +FUNCTION {clearpage} +{ 't := + "" 's := + "" 'l := + + { t empty$ not } + { + t #1 #1 substring$ 's := + s is.num not + 'skip$ + { l s * 'l := } + if$ + t #2 global.max$ substring$ 't := + } + while$ + l + +} +FUNCTION {do.pages} +{'t := + "" 'j := + "" 'v := + {t empty$ not} + { t #1 #1 substring$ 's := + s is.num not + s "," = not + and + { "" j = + { + t #2 global.max$ substring$ 't := + } + {t find.integer + { t clearpage 'v := } + 'skip$ + if$ + "" 't := + } + if$ + } + { j s * 'j := + t #2 global.max$ substring$ 't := + } + if$ + } + while$ + j clearpage 'j := + j "fpage" make.tag + "cnd" is.in.list + 'skip$ + {"--" * v "lpage" make.tag *} + if$ +} + + +FUNCTION {format.pages} +{ pages empty$ + { "" } + { pages multi.page.check + {type$ "article" = + {""} + {"cnd" is.in.list + {"p. "} + {"pp. "} + if$ + } + if$ + pages do.pages * + } + {type$ "article" = + {""} + {"p. "} + if$ + pages clearpage "fpage" make.tag * + } + + if$ + } + if$ +} + +FUNCTION {replace.tilde} +{ 't := + "" + { t empty$ not } + { t #1 #1 substring$ "~" = + { { t #1 #1 substring$ "~" = } + { "\texttildelow " * + t #2 global.max$ substring$ 't := + } + while$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + + +FUNCTION {format.url} +{ url empty$ + 'skip$ + { type$ "article" = + 'skip$ + { #0 bother = + { "\url{" } + { "\burl{" } + if$ + url replace.tilde * "}" * + output + } + if$ + + urldate empty$ + 'skip$ + { "Accessed " urldate * output } + if$ + } + if$ +} + + +FUNCTION {publisher.month.pages}{ + publisher empty$ series empty$ and + { address empty$ + 'skip$ + 'new.sentence + if$ + format.pub.address + + pages empty$ + 'skip$ + {insert.comma} + if$ + format.pages output + + } + { + pages empty$ + 'skip$ + {insert.comma} + if$ + format.pages output + publisher empty$ + 'skip$ + {new.sentence} + if$ + format.pub.address + } + if$ +} + +function{process.doi}{ + doi 't := + "" 'b := + #1 'int := +% "doi =" t * top$ + + t text.length$ 'slen := + + {int slen = not } + {t int #3 substring$ "10." = + { + t int #1 - #1 substring$ 'b := + b "" = + {"a" 'b :=} % if b is empty need to set a letter + 'skip$ + if$ + + b is.num not + { + t int slen int - #1 + substring$ 't := + slen #1 - 'int := + } + 'skip$ + if$ + + } + 'skip$ + if$ + int #1 + 'int := + } + while$ + t +} + +FUNCTION {format.doi} +{ doi empty$ + {""} + { + "nodoi" is.in.list + {""} + %%{"doi:\doiurl{" process.doi * "}" * } + {"\doiurl{" process.doi * "} " * } + if$ + } + if$ +} + +FUNCTION {format.in.ed.booktitle} +{ booktitle empty$ + {#1 bother = + "cnd" is.in.list not + and + { editor empty$ + 'skip$ + { "In: " output write$ format.editors } + if$ + } + 'skip$ + if$ + } + { editor empty$ + { "In: " booktitle upercase.first.letters "btitle" make.tag * output} + { "In: " output write$ format.editors "" %%% pushing empty string to the empty stack + booktitle upercase.first.letters "btitle" make.tag output + } + if$ + } + + if$ +} + +FUNCTION {format.in.ed} +{ title empty$ + 'skip$ + { editor empty$ + { title "btitle" make.tag output} + { author empty$ + { format.editors + stupid.colon + %format.date output + title "btitle" make.tag output + } + { "In: " output write$ format.editors "" %%% pushing empty string to the empty stack + title "btitle" make.tag output + } + if$ + } + if$ + } + if$ +} + +FUNCTION {format.tr.number} +{ type empty$ + { "Technical Report" } + 'type + if$ + number empty$ + { "t" change.case$ } + { number tie.or.space.connect } + if$ +} + +FUNCTION {patent.number} +{ number empty$ + 'skip$ + { number } + if$ +} +INTEGERS { len } + +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} + +FUNCTION {format.inpres} +{ "l" change.case$ 't := + "in press: " #10 + "in press. " #10 + "in press " #9 t chop.word + chop.word + chop.word + #1 global.max$ substring$ +} + +FUNCTION {bcomment.note} +{ note empty$ + 'skip$ + {note format.inpres "comment" make.tag output} + 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$ + type "t" change.case$ + } + if$ +} + +FUNCTION {format.chapter.and.note} +{ note empty$ chapter empty$ organization empty$ and and + 'skip$ + { chapter empty$ + "notnumber" last.label = + or + {organization empty$ + { note "comment" make.tag output } + { note empty$ + { organization "comment" make.tag output } + { organization ". " * note * "comment" make.tag output } + if$ + } + if$ + } + { note empty$ + { "Chap. " chapter * "comment" make.tag output} + { type empty$ + { "Chap. " } + { type "t" change.case$ "Section" = + { "Sect. " } + { "Chap. " } + if$ + } + if$ + chapter * ". " * note * "comment" make.tag output + } + if$ + } + if$ + } + if$ +} + +FUNCTION {item.end} +{ chapter empty$ + type$ "unpublished" = not + type$ "misc" = not + and and + { new.sentence + format.doi output + } + 'skip$ + if$ + + type$ "unpublished" = + type$ "misc" = + or + { note empty$ + 'skip$ + {note.presented + 'skip$ + {new.sentence note output} + if$ + } + if$ + format.date.parens output + } + { new.sentence + type$ "proceedings" = + { author empty$ editor empty$ and + 'bcomment.note + 'format.chapter.and.note + if$ + } + 'format.chapter.and.note + if$ + } + if$ + list.string 'v := + default.list 'list.string := + + type$ ".isbn" * is.in.list + "cnd" is.in.list + or + { + new.sentence +% format.isbn output + } + 'skip$ + if$ + new.sentence + %% commented by SPi as we are using format.eprint %% + %% and also to avoide eprint being printed twice - Start %% + %%eprint empty$ + %% 'skip$ + %% {"\arxivurl{" eprint * "}" * output} + %%if$ + %% End %% + chapter empty$ + type$ "unpublished" = not + type$ "misc" = not + and and + 'skip$ + { new.sentence + format.doi output + } + if$ + new.sentence + format.url + v 'list.string := + fin.entry +} + +FUNCTION {article.item.end} +{ chapter empty$ + type$ "unpublished" = not + type$ "misc" = not + and and + { new.sentence +% format.doi output + } + 'skip$ + if$ + + type$ "unpublished" = + type$ "misc" = + or + { note empty$ + 'skip$ + {note.presented + 'skip$ + {new.sentence note output} + if$ + } + if$ + format.date.parens output + } + { new.sentence + type$ "proceedings" = + { author empty$ editor empty$ and + 'bcomment.note + 'format.chapter.and.note + if$ + } + 'format.chapter.and.note + if$ + } + if$ + list.string 'v := + default.list 'list.string := + + type$ ".isbn" * is.in.list + "cnd" is.in.list + or + { + new.sentence +% format.isbn output + } + 'skip$ + if$ + new.sentence + %% commented by SPi as we are using format.eprint %% + %% and also to avoide eprint being printed twice - Start %% + %%eprint empty$ + %% 'skip$ + %% {"\arxivurl{" eprint * "}" * output} + %%if$ + %% End %% + chapter empty$ + type$ "unpublished" = not + type$ "misc" = not + and and + 'skip$ + { new.sentence +%% format.doi output + } + if$ + new.sentence + format.url + v 'list.string := + fin.entry +} + + +FUNCTION {insert.element} +{ #0 bother = + { element "{botherref}" * write$ newline$} + { + type$ "article" = + {element "{barticle}" * write$ newline$} + 'skip$ + if$ + type$ "book" = + type$ "proceedings" = + type$ "manual" = + type$ "booklet" = + or or or + {element "{bbook}" * write$ newline$} + 'skip$ + if$ + + type$ "inbook" = + { "notnumber" last.label = + {element "{bchapter}" * write$ newline$} + {element "{bbook}" * write$ newline$} + if$ + } + 'skip$ + if$ + + type$ "incollection" = + type$ "inproceedings" = + type$ "conference" = + or or + {element "{bchapter}" * write$ newline$} + 'skip$ + if$ + } + if$ +} + +FUNCTION {end.element} +{ "\end" 'element := + item.end + insert.element + "\endbibitem" write$ newline$ +} + +FUNCTION {article.end.element} +{ "\end" 'element := + article.item.end + insert.element + "\endbibitem" write$ newline$ +} + + +FUNCTION {begin.element} +{ "\begin" 'element := + insert.element +} +function {set.options}{ + options empty$ + 'skip$ + {options 'list.string :=} + if$ +} + +FUNCTION {settings} +{} + +FUNCTION {article} +{ output.bibitem + author empty$ + institution empty$ + editor empty$ + and and + journal empty$ + or + year empty$ + or + % above tagging rule means: + % nead: (volume & (pages or number) ) or (doi [without volume, pages and number]) + volume empty$ not + pages empty$ not bnumber empty$ not or + and + + volume empty$ pages empty$ bnumber empty$ and and + doi empty$ not and + or + not + or + {#0 'bother :=} + {#1 'bother :=} + if$ + begin.element + author empty$ + { editor empty$ + 'skip$ + {format.editors stupid.colon} + if$ + } + { format.authors stupid.colon} + if$ + "cnd" is.in.list + { + journal empty$ + {format.title "atitle" make.tag "title" output.check} + {journal "jtitle" make.tag output} + if$ + } + { + format.title "atitle" make.tag "title" output.check + journal empty$ + 'skip$ + {new.sentence journal "jtitle" make.tag output} + if$ + } + if$ + format.art.vol output + pages empty$ + 'skip$ + {insert.comma} + if$ + format.pages output + format.date.parens output + format.doi output + format.eprint output + format.primaryClass output + article.end.element +} + + +FUNCTION {patent} +{ output.bibitem + #0 'bother := + begin.element + author empty$ + 'skip$ + {format.authors stupid.colon} + if$ + format.title "title" output.check + add.period$ + patent.number output + insert.comma + formatpatent.date output + end.element +} + +FUNCTION { other } { patent } + +FUNCTION {book} +{ output.bibitem + author empty$ + institution empty$ + organization empty$ + editor empty$ + and and and + title empty$ + year empty$ + or or + {#0 'bother :=} + { + publisher empty$ address empty$ not and + {#0 'bother :=} + {#1 'bother :=} + if$ + } + if$ + begin.element + author empty$ + { editor empty$ + 'skip$ + {format.editors stupid.colon} + if$ + } + { format.authors stupid.colon} + if$ + format.title "btitle" make.tag "title" output.check + series empty$ + { + format.volume output + insert.comma + format.edition output + } + { edition empty$ + 'skip$ + 'insert.comma + if$ + format.edition output + new.sentence + format.series output + insert.comma + format.volume output + } + if$ + publisher.month.pages + format.date.parens output + end.element +} + +FUNCTION {booklet} +{output.bibitem + author empty$ + title empty$ + year empty$ + howpublished empty$ + or or or + {#0 'bother :=} + {#1 'bother :=} + if$ + + begin.element + author empty$ + 'skip$ + {format.authors stupid.colon} + if$ + format.title "btitle" make.tag "title" output.check + address empty$ publisher empty$ howpublished empty$ and and + 'skip$ + 'new.sentence + if$ + format.pub.address + format.date.parens output + end.element +} + +FUNCTION {misc} +{output.bibitem + #0 'bother := + begin.element + author empty$ + 'skip$ + {format.authors stupid.colon} + if$ + format.title "btitle" make.tag "title" output.check + address empty$ publisher empty$ howpublished empty$ and and + 'skip$ + 'new.sentence + if$ + format.pub.address + end.element +} + +FUNCTION {softmisc} +{output.bibitem + #0 'bother := + begin.element + author empty$ + 'skip$ + {format.authors} + if$ + stupid.colon + format.title "btitle" make.tag "title" output.check + insert.comma + version output + insert.comma + %%address empty$ publisher empty$ howpublished empty$ and and + %%'skip$ + %% 'new.sentence + %%if$ + format.pub.address + format.softmiscdate output + insert.comma + format.softmisc.eprint output + end.element +} + +FUNCTION {inbook} +{ output.bibitem + author empty$ + institution empty$ + organization empty$ + editor empty$ + and and and + title empty$ + year empty$ + or or + {#0 'bother :=} + { + publisher empty$ address empty$ not and + {#0 'bother :=} + {#1 'bother :=} + if$ + } + if$ + + chapter empty$ + { "" 'last.label :=} + { chapter string.to.integer empty$ author empty$ not and + { "notnumber" 'last.label :=} + { "" 'last.label :=} + if$ + } + if$ + + begin.element + author empty$ + 'skip$ + {format.authors stupid.colon} + if$ + "notnumber" last.label = + { chapter "ctitle" make.tag output + add.period$ + } + 'skip$ + if$ + format.in.ed + series empty$ + { + insert.comma + format.volume output + insert.comma + format.edition output + new.sentence + } + { + insert.comma + format.edition output + new.sentence + format.series output + volume empty$ + 'skip$ + 'insert.comma + if$ + format.volume output + } + if$ + publisher.month.pages + publisher empty$ address empty$ edition empty$ series empty$ pages empty$ volume empty$ and and and and and + 'insert.comma + 'skip$ + if$ + format.date.parens output + end.element +} +FUNCTION {incollection} +{ output.bibitem + author empty$ + institution empty$ + and + booktitle empty$ + title empty$ + year empty$ + or or or + {#0 'bother :=} + { + publisher empty$ address empty$ not and + {#0 'bother :=} + {#1 'bother :=} + if$ + } + if$ + begin.element + author empty$ + 'skip$ + {format.authors stupid.colon} + if$ + + "cnd" is.in.list + { + booktitle empty$ title empty$ not and + { + format.title "ctitle" make.tag "title" output.check + new.sentence + } + 'skip$ + if$ + } + { + format.title "ctitle" make.tag "title" output.check + title empty$ + 'skip$ + {new.sentence} + if$ + } + if$ + format.in.ed.booktitle + series empty$ + { + format.volume output + insert.comma + format.edition output + } + { + edition empty$ + 'skip$ + { insert.comma + format.edition output + } + if$ + new.sentence + format.series output + insert.comma + format.volume output + } + if$ + publisher.month.pages + format.date.parens output + end.element +} + +FUNCTION {inproceedings} +{ output.bibitem + author empty$ + institution empty$ + and + title empty$ + year empty$ + or or + {#0 'bother :=} + {#1 'bother :=} + if$ + begin.element + author empty$ + 'skip$ + {format.authors stupid.colon} + if$ + + "cnd" is.in.list + { + booktitle empty$ title empty$ not and + { + format.title "ctitle" make.tag "title" output.check + new.sentence + } + 'skip$ + if$ + } + { + format.title "ctitle" make.tag "title" output.check + title empty$ booktitle empty$ not and + 'skip$ + {new.sentence} + if$ + } + if$ + + format.in.ed.booktitle + series empty$ + 'skip$ + {new.sentence format.series output} + if$ + volume empty$ address empty$ publisher empty$ and and + 'skip$ + 'insert.comma + if$ + format.volume output + publisher.month.pages + format.date.parens output + end.element +} + +FUNCTION {conference} { inproceedings } + +FUNCTION {manual} +{ output.bibitem + author empty$ + organization empty$ + title empty$ + year empty$ + address empty$ + or or or or + {#0 'bother :=} + {#1 'bother :=} + if$ + begin.element + + author empty$ + { organization empty$ + 'skip$ + { organization "publisher" make.tag output.nonnull + stupid.colon% add.period$ + } + if$ + } + { format.authors stupid.colon} + if$ + title empty$ + 'skip$ + {format.title "btitle" make.tag output} + if$ + edition empty$ + {new.sentence} + {insert.comma} + if$ + format.edition output + edition empty$ + 'skip$ + {new.sentence} + if$ + author empty$ organization empty$ + or + 'skip$ + { organization "publisher" make.tag output.nonnull + insert.comma + } + if$ + address empty$ + 'skip$ + {address "location" make.tag output} + if$ + format.date.parens output + end.element +} + + +FUNCTION {phdthesis} +{output.bibitem + #0 'bother := + begin.element + author empty$ + 'skip$ + {format.authors stupid.colon} + if$ + format.title "title" output.check + new.sentence + type$ "mastersthesis" = + {"Master's thesis" format.thesis.type output.nonnull} + {"PhD thesis" format.thesis.type output.nonnull} + if$ + school empty$ + 'skip$ + 'insert.comma + if$ + school "school" output.check + address empty$ + 'skip$ + 'insert.comma + if$ + address output + month.year.date output + end.element +} +FUNCTION {mastersthesis}{phdthesis} + + +FUNCTION {proceedings} +{ output.bibitem + author empty$ + institution empty$ + organization empty$ + editor empty$ + and and and + title empty$ + year empty$ + or or + {#0 'bother :=} + { + publisher empty$ address empty$ not and + {#0 'bother :=} + {#1 'bother :=} + if$ + } + if$ + + begin.element + author empty$ + { editor empty$ + {organization "institutionaled" make.tag "organization" output.check } + { format.editors } + if$ + } + { format.authors } + if$ + stupid.colon + format.title "btitle" make.tag output + series empty$ + 'skip$ + {new.sentence format.series output} + if$ + volume empty$ + 'skip$ + 'insert.comma + if$ + format.volume output + publisher.month.pages + format.date.parens output + end.element +} + +FUNCTION {techreport} +{ output.bibitem + #0 'bother := + begin.element + author empty$ + 'skip$ + {format.authors stupid.colon} + if$ + format.title "title" output.check + new.sentence + format.tr.number output.nonnull + institution empty$ + 'skip$ + 'insert.comma + if$ + institution "institution" output.check + address empty$ + 'skip$ + 'insert.comma + if$ + address output + month.year.date output + end.element +} + +FUNCTION {unpublished} +{ output.bibitem + #0 'bother := + + begin.element + author empty$ + 'skip$ + {format.authors stupid.colon} + if$ + format.title "title" output.check + note empty$ + 'skip$ + { note.presented + {note output} + 'skip$ + if$ + } + if$ + end.element +} + +FUNCTION {default.type} { unpublished } + +MACRO {jan} {"January"} +MACRO {feb} {"February"} +MACRO {mar} {"March"} +MACRO {apr} {"April"} +MACRO {may} {"May"} +MACRO {jun} {"June"} +MACRO {jul} {"July"} +MACRO {aug} {"August"} +MACRO {sep} {"September"} +MACRO {oct} {"October"} +MACRO {nov} {"November"} +MACRO {dec} {"December"} + +READ + +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} + +INTEGERS { et.al.char.used } + +FUNCTION {initialize.et.al.char.used} +{ #0 'et.al.char.used := +} + +%%%%% setting default options +FUNCTION {set.default.opt} +{"unsort" 'list.string :=} + +EXECUTE {set.default.opt} + +FUNCTION {assign.opt}{ + % First need to set options + "settings" type$ = + { options empty$ + 'skip$ + {options 'list.string :=} + if$ + } + 'skip$ + if$ +} + +ITERATE {assign.opt} +EXECUTE {initialize.et.al.char.used} + +FUNCTION {alpha.format.lab.names} +{ '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 {standard.format.lab.names} +{ 's := + s #1 "{vv~}{ll}" format.name$ + s num.names$ duplicate$ + #2 > + { pop$ " et~al." * } + { #2 < + 'skip$ + { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { " et~al." * } + { " and " * s #2 "{vv~}{ll}" format.name$ * } + if$ + } + if$ + } + if$ +} +FUNCTION {format.lab.names}{ + "alpha" is.in.list + 'alpha.format.lab.names + 'standard.format.lab.names + if$ +} + +FUNCTION {author.key.label} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + { key #3 text.prefix$ } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.editor.key.label} +{ author empty$ + { editor empty$ + { key empty$ + { "zzz" } + { key #3 text.prefix$ } + if$ + } + { editor format.lab.names } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.key.organization.label} +{ author empty$ + { key empty$ + { organization empty$ + { "zzz" } + { "The " #4 organization chop.word #3 text.prefix$ } + if$ + } + { key #3 text.prefix$ } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {editor.key.organization.label} +{ editor empty$ + { key empty$ + { organization empty$ + { "zzz" } + { "The " #4 organization chop.word #3 text.prefix$ } + if$ + } + { key #3 text.prefix$ } + 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 + + "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} +{ 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { nameptr #1 > + { " " * + "alpha" is.in.list + 'skip$ + {numnames int.to.str$ * " " *} + if$ + } + 'skip$ + if$ + s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't := + nameptr numnames = + t "others" = + and + { "et al" * } + { t sortify * } + if$ + #3 numnames < + "alpha" is.in.list not + and + {#0 'namesleft := + " zzz " * + } + { + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + if$ + } + while$ +} + +FUNCTION {sort.format.title} +{ 't := + "A " #2 + "An " #3 + "The " #4 t chop.word + chop.word + chop.word + sortify + #1 global.max$ substring$ +} + +FUNCTION {author.sort} +{ author empty$ + { key empty$ + { "to sort, need author or key in " cite$ * warning$ + "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" = + 'author.organization.sort + 'author.sort + if$ + } + if$ + } + if$ + " " + * + year field.or.null sortify + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ 'sort.label := + sort.label * + #1 entry.max$ substring$ 'sort.key$ := + + "settings" type$ = + {"aaa"} + {"unsort" is.in.list + {"bb"} + {"alpha" is.in.list + {sort.key$} + {sort.label} + if$ + } + if$ + } + if$ + 'sort.key$ := +} + + +ITERATE {presort} + +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 label = + { last.extra.num #1 + 'last.extra.num := + last.extra.num int.to.chr$ 'extra.label := + } + { "a" chr.to.int$ 'last.extra.num := + "" 'extra.label := + label 'last.label := + } + if$ + number.label #1 + 'number.label := +} + +FUNCTION {reverse.pass} +{ j "b" = + { "a" 'extra.label := } + 'skip$ + if$ + extra.label 'j := + label extra.label * 'label := +} + +EXECUTE {initialize.longest.label} + +ITERATE {forward.pass} + +REVERSE {reverse.pass} + +FUNCTION {write.preambule} +{ "%% BioMed_Central_Bib_Style_v1.01" write$ newline$ newline$ + "\begin{thebibliography}{" number.label int.to.str$ * "}" * write$ newline$ + "% BibTex style file: bmc-mathphys.bst (version 2.1), 2014-07-24" write$ newline$ + "\ifx \bisbn \undefined \def \bisbn #1{ISBN #1}\fi" write$ newline$ + "\ifx \binits \undefined \def \binits#1{#1}\fi" write$ newline$ + "\ifx \bauthor \undefined \def \bauthor#1{#1}\fi" write$ newline$ + "\ifx \batitle \undefined \def \batitle#1{#1}\fi" write$ newline$ + "\ifx \bjtitle \undefined \def \bjtitle#1{#1}\fi" write$ newline$ + "\ifx \bvolume \undefined \def \bvolume#1{\textbf{#1}}\fi" write$ newline$ + "\ifx \byear \undefined \def \byear#1{#1}\fi" write$ newline$ + "\ifx \bissue \undefined \def \bissue#1{#1}\fi" write$ newline$ + "\ifx \bfpage \undefined \def \bfpage#1{#1}\fi" write$ newline$ + "\ifx \blpage \undefined \def \blpage #1{#1}\fi" write$ newline$ + "\ifx \burl \undefined \def \burl#1{\textsf{#1}}\fi" write$ newline$ + %%"\ifx \doiurl \undefined \def \doiurl#1{\textsf{#1}}\fi" write$ newline$ + "\ifx \doiurl \undefined \def \doiurl#1{\url{https://doi.org/#1}}\fi" write$ newline$ + "\ifx \betal \undefined \def \betal{\textit{et al.}}\fi" write$ newline$ + "\ifx \binstitute \undefined \def \binstitute#1{#1}\fi" write$ newline$ + "\ifx \binstitutionaled \undefined \def \binstitutionaled#1{#1}\fi" write$ newline$ + "\ifx \bctitle \undefined \def \bctitle#1{#1}\fi" write$ newline$ + "\ifx \beditor \undefined \def \beditor#1{#1}\fi" write$ newline$ + "\ifx \bpublisher \undefined \def \bpublisher#1{#1}\fi" write$ newline$ + "\ifx \bbtitle \undefined \def \bbtitle#1{#1}\fi" write$ newline$ + "\ifx \bedition \undefined \def \bedition#1{#1}\fi" write$ newline$ + "\ifx \bseriesno \undefined \def \bseriesno#1{#1}\fi" write$ newline$ + "\ifx \blocation \undefined \def \blocation#1{#1}\fi" write$ newline$ + "\ifx \bsertitle \undefined \def \bsertitle#1{#1}\fi" write$ newline$ + "\ifx \bsnm \undefined \def \bsnm#1{#1}\fi" write$ newline$ + "\ifx \bsuffix \undefined \def \bsuffix#1{#1}\fi" write$ newline$ + "\ifx \bparticle \undefined \def \bparticle#1{#1}\fi" write$ newline$ + "\ifx \barticle \undefined \def \barticle#1{#1}\fi" write$ newline$ + "\bibcommenthead" write$ newline$ +} + + +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + write.preambule + "\ifx \bconfdate \undefined \def \bconfdate #1{#1}\fi" write$ newline$ + "\ifx \botherref \undefined \def \botherref #1{#1}\fi" write$ newline$ + "\ifx \url \undefined \def \url#1{\textsf{#1}}\fi" write$ newline$ + "\ifx \bchapter \undefined \def \bchapter#1{#1}\fi" write$ newline$ + "\ifx \bbook \undefined \def \bbook#1{#1}\fi" write$ newline$ + "\ifx \bcomment \undefined \def \bcomment#1{#1}\fi" write$ newline$ + "\ifx \oauthor \undefined \def \oauthor#1{#1}\fi" write$ newline$ + "\ifx \citeauthoryear \undefined \def \citeauthoryear#1{#1}\fi" write$ newline$ + "\ifx \endbibitem \undefined \def \endbibitem {}\fi" write$ newline$ + "\ifx \bconflocation \undefined \def \bconflocation#1{#1}\fi" write$ newline$ + "\ifx \arxivurl \undefined \def \arxivurl#1{\textsf{#1}}\fi" write$ newline$ + "\csname PreBibitemsHook\endcsname" write$ newline$ +} + +EXECUTE {begin.bib} + +EXECUTE {init.state.consts} + +ITERATE {call.type$} + +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} + +EXECUTE {end.bib} + + +%% XML output - done for each entry referenced in the BibTeX database +INTEGERS {i ll li j.int global.counter} +STRINGS {lr lp lt ls } + +FUNCTION {replace} +{ + 'lr := % replace string + 'lp := % pattern + 'lt := % text to search + "" 'ls := % result string + lp text.length$ 'll := % length of the search pattern + { lt empty$ not } + { lt #1 ll substring$ lp = + { ls lr * 'ls := + lt ll #1 + global.max$ substring$ 'lt := } + { ls lt #1 #1 substring$ * 'ls := + lt #2 global.max$ substring$ 'lt := } + if$ + } + while$ + ls +} + +FUNCTION {strip.letters} +{ + "" 's := + duplicate$ missing$ + 'pop$ + { + 't := + { t "" = not } + { % ascii '0' = 48, '9' = 57 + t #1 #1 substring$ chr.to.int$ 'i := + i #47 > i #58 < and + { s t #1 #1 substring$ * 's := } + 'skip$ + if$ + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + s +} +FUNCTION {output.xml} +{ duplicate$ "" = + 'pop$ + { " " swap$ * write$ newline$ } + if$ +} + +%% + % markup.xml + % + % Takes 2 args text & tag {"the text " "tag"} + % Returns 1 string {"the text <\tag>"} +%% +FUNCTION {markup.xml} +{ + "" 'v := % result + 't := % tag + duplicate$ missing$ + 'pop$ + { 'v := } + if$ + v "" = + 'skip$ + { "<" t * ">" * v * "" * 'v := } + if$ + v +} + +%% Takes 2 args - tag, string +FUNCTION{markup.xml.title} +{ pop$ % tag + duplicate$ missing$ + 'pop$ + { + 's := % string + s "\&" "&" replace 's := + s "p" markup.xml 's := + s "title" markup.xml output.xml + } + if$ +} + + +%% + % markup.xml.pages + % + % Takes 1 arg (pages string) + % seperates into and if + % there is a - seperator. else no lpage. + % + % need to remove others +%% +FUNCTION{markup.xml.pages} +{ + "" 'v := % fpage + "" 's := % lpage + duplicate$ missing$ + 'pop$ + { + 't := + t " " "" replace 't := % remove all spaces. pgs must be - seperated + { t empty$ not } + { + t #1 #1 substring$ "-" = + { + t #2 global.max$ substring$ 's := + "" 't := % break while loop + }{ + v t #1 #1 substring$ * 'v := + t #2 global.max$ substring$ 't := + } + if$ + } + while$ + } + if$ + v "fpage" markup.xml output.xml + s "lpage" markup.xml output.xml +} + + +%% + % markup.xml.names + % + % Takes 2 args + % tag, namefield (eg. author "au") + % splits fields into and + % writes info + % returns nothing +%% +FUNCTION {markup.xml.names} +{ + 't := % tag + "" 'v := + "" 's := + duplicate$ empty$ + { pop$ + organization missing$ + { institution "cnm" markup.xml + "au" markup.xml "aug" markup.xml output.xml } + { organization "cnm" markup.xml + "au" markup.xml "aug" markup.xml output.xml } + if$ } + { + " " write$ newline$ + 'temp.str := % names string + temp.str num.names$ 'j.int := % num of names + #1 'i := % init counter + { i #1 j.int + < } % while (i <= j.int) + { + " " write$ + + % Initial first names + % if first name all in capitals + % - assume is initial list of first names. + temp.str i "{ff{ }}" format.name$ + duplicate$ "u" change.case$ = + { temp.str i "{ff{ }}" format.name$ } + { temp.str i "{f{}}" format.name$ } + if$ + + % if last name but no first name use cnm; else snm + duplicate$ "" = + { temp.str i "{ll{ }}" format.name$ % last names space seperated. + "cnm" markup.xml write$ } + { temp.str i "{ll{ }}" format.name$ % last names space seperated. + "snm" markup.xml write$ } + if$ + + "fnm" markup.xml write$ + + "" write$ newline$ + i #1 + 'i := + } + while$ + " " write$ newline$ + } + if$ +} + + +%% + % markup.xml.pub + % + % Takes 4 args (school address publisher tag) + % prints concatenation + % returns nothing +%% +FUNCTION {markup.xml.pub} +{ + 't := % Tag + "" 'v := % Publisher + "" 'l := % Address + "" 'f := % School + "" 's := % Answer + duplicate$ missing$ 'pop$ { 'v := } if$ + duplicate$ missing$ 'pop$ { 'l := } if$ + duplicate$ missing$ 'pop$ { 'f := } if$ + "" f = not % school not empty + { f 's := } % return school as publisher + { % else + "" v = "" l = and % address and pub empty + 'skip$ + { + "" l = + { v 's := } % return pub + { "" v = + { l 's := } % return add + { l ": " * v * 's := } % return add : pub + if$ + } + if$ + } + if$ + } + if$ + s t markup.xml output.xml +} + +%% + % xml.phd + % + % Takes nothing + % Returns type (phd/msc) of empty string +%% +FUNCTION {xml.phd} +{ + "phdthesis" type$ = + "mastersthesis" type$ = or + { "phdthesis" type$ = + { "PhD thesis" } + { "Master's thesis" } + if$ + } + { type } % usually empty + if$ +} + +% markup.xml.edition +% +% edition is a numeric value. ie "2" +% if format 2nd 1st etc.. strip letters. +% +FUNCTION {markup.xml.edition} +{ pop$ pop$ %clear stack + edition strip.letters duplicate$ "" = + { pop$ edition } + 'skip$ + if$ + "edition" markup.xml output.xml +} + + +FUNCTION{begin.bmcxmlcomment}{ + newline$ + "\newcommand{\BMCxmlcomment}[1]{}" write$ newline$ + newline$ + "\BMCxmlcomment{" write$ newline$ + newline$ "" write$ newline$ +} + +FUNCTION{end.bmcxmlcomment}{ + newline$ + "" write$ newline$ + "} % end of \BMCxmlcomment" write$ newline$ +} + +FUNCTION {export.xml}{ + newline$ + global.counter #1 + 'global.counter := + "" * + write$ newline$ +% title "\&" "&" replace "title" markup.xml.title + title "title" markup.xml.title + author "aug" markup.xml.names % org. and inst. here + howpublished missing$ + { booktitle missing$ + { journal missing$ + { xml.phd } % Phd/Msc + {journal} + if$ + } {booktitle} + if$ + } { howpublished } + if$ "source" markup.xml output.xml + school + address + publisher "publisher" markup.xml.pub + editor "editor" markup.xml output.xml + edition "edition" markup.xml.edition + series "p" markup.xml + "title" markup.xml + "series" markup.xml output.xml + chapter "p" markup.xml + "title" markup.xml + "section" markup.xml output.xml + % month % ignore + year "pubdate" markup.xml output.xml + + note missing$ + { volume "volume" markup.xml output.xml + number "issue" markup.xml output.xml + pages markup.xml.pages + url "url" markup.xml output.xml } + { note "l" change.case$ "in press" = + { " " write$ newline$ } + { volume "volume" markup.xml output.xml + number "issue" markup.xml output.xml + pages markup.xml.pages + url "url" markup.xml output.xml + note "note" markup.xml output.xml + } + if$ + } + if$ + "" write$ newline$ +} + +%%EXECUTE {begin.bmcxmlcomment} +%%ITERATE {export.xml} +%%EXECUTE {end.bmcxmlcomment} + + + + diff --git a/papers/preprint/sn-article-template/bst/sn-nature.bst b/papers/preprint/sn-article-template/bst/sn-nature.bst new file mode 100644 index 000000000..cae8f64c2 --- /dev/null +++ b/papers/preprint/sn-article-template/bst/sn-nature.bst @@ -0,0 +1,1710 @@ +%% +%% This is file `naturemag.bst', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% merlin.mbs (with options: `head,seq-no,nm-rev,ed-rev,jnrlst,nmlm,x5,m1,yr-par,xmth,vol-bf,vnum-x,volp-com,num-xser,jnm-x,bkpg-x,pub-date,edparxc,ppx,ed,abr,xedn,jabr,amper,and-xcom,etal-it,eprint,url,url-blk,bibinfo,nfss,{}') +%% physjour.mbs (with options: `seq-no,nm-rev,ed-rev,jnrlst,nmlm,x5,m1,yr-par,xmth,vol-bf,vnum-x,volp-com,num-xser,jnm-x,bkpg-x,pub-date,edparxc,ppx,ed,abr,xedn,jabr,amper,and-xcom,etal-it,eprint,url,url-blk,bibinfo,nfss,{}') +%% geojour.mbs (with options: `seq-no,nm-rev,ed-rev,jnrlst,nmlm,x5,m1,yr-par,xmth,vol-bf,vnum-x,volp-com,num-xser,jnm-x,bkpg-x,pub-date,edparxc,ppx,ed,abr,xedn,jabr,amper,and-xcom,etal-it,eprint,url,url-blk,bibinfo,nfss,{}') +%% photjour.mbs (with options: `seq-no,nm-rev,ed-rev,jnrlst,nmlm,x5,m1,yr-par,xmth,vol-bf,vnum-x,volp-com,num-xser,jnm-x,bkpg-x,pub-date,edparxc,ppx,ed,abr,xedn,jabr,amper,and-xcom,etal-it,eprint,url,url-blk,bibinfo,nfss,{}') +%% merlin.mbs (with options: `tail,seq-no,nm-rev,ed-rev,jnrlst,nmlm,x5,m1,yr-par,xmth,vol-bf,vnum-x,volp-com,num-xser,jnm-x,bkpg-x,pub-date,edparxc,ppx,ed,abr,xedn,jabr,amper,and-xcom,etal-it,eprint,url,url-blk,bibinfo,nfss,{}') +%% ---------------------------------------- +%% *** Style for the journal Nature (created by Peter Czoschke) *** +%% +%% Copyright 1994-2002 Patrick W Daly + % =============================================================== + % IMPORTANT NOTICE: + % This bibliographic style (bst) file has been generated from one or + % more master bibliographic style (mbs) files, listed above. + % + % This generated file can be redistributed and/or modified under the terms + % of the LaTeX Project Public License Distributed from CTAN + % archives in directory macros/latex/base/lppl.txt; either + % version 1 of the License, or any later version. + % =============================================================== + % Name and version information of the main mbs file: + % \ProvidesFile{merlin.mbs}[2002/10/21 4.05 (PWD, AO, DPC)] + % For use with BibTeX version 0.99a or later + %------------------------------------------------------------------- + % This bibliography style file is intended for texts in ENGLISH + % This is a numerical citation style, and as such is standard LaTeX. + % It requires no extra package to interface to the main text. + % The form of the \bibitem entries is + % \bibitem{key}... + % Usage of \cite is as follows: + % \cite{key} ==>> [#] + % \cite[chap. 2]{key} ==>> [#, chap. 2] + % where # is a number determined by the ordering in the reference list. + % The order in the reference list is that by which the works were originally + % cited in the text, or that in the database. + %--------------------------------------------------------------------- + +ENTRY + { address + archive + author + booktitle + chapter + edition + editor + eprint + howpublished + institution + journal + key + keywords + month + note + number + organization + pages + publisher + school + series + title + type + url + doi + volume + year + archivePrefix + primaryClass + eid + adsurl + adsnote + version + } + {} + { label } +INTEGERS { output.state before.all mid.sentence after.sentence after.block } +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} +STRINGS { s t} +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} + +FUNCTION {output.in.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} + +FUNCTION {in.output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.in.nonnull + if$ +} +FUNCTION {fin.entry} +{ add.period$ + write$ + newline$ +} + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} +FUNCTION {add.blank} +{ " " * before.all 'output.state := +} + +FUNCTION {date.block} +{ + new.block +} + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} +FUNCTION {new.block.checka} +{ empty$ + 'skip$ + 'new.block + if$ +} +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} +FUNCTION {new.sentence.checka} +{ empty$ + 'skip$ + 'new.sentence + if$ +} +FUNCTION {new.sentence.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.sentence + if$ +} +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "\emph{" swap$ * "}" * } + if$ +} +FUNCTION {bolden} +{ duplicate$ empty$ + { pop$ "" } + { "\textbf{" swap$ * "}" * } + if$ +} +FUNCTION {tie.or.space.prefix} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ +} + +FUNCTION {capitalize} +{ "u" change.case$ "t" change.case$ } + +FUNCTION {space.word} +{ " " swap$ * " " * } + % Here are the language-specific definitions for explicit words. + % Each function has a name bbl.xxx where xxx is the English word. + % The language selected here is ENGLISH +FUNCTION {bbl.and} +{ "and"} + +FUNCTION {bbl.etal} +{ "et~al." } + +FUNCTION {bbl.in.editors} +{ "eds " } + +FUNCTION {bbl.editors} +{ "eds" } + +FUNCTION {bbl.editor} +{ "ed." } + +FUNCTION {bbl.edby} +{ "edited by" } + +FUNCTION {bbl.edition} +{ "edn" } + +FUNCTION {bbl.volume} +{ "Vol." } + +FUNCTION {bbl.of} +{ "of" } + +FUNCTION {bbl.number} +{ "no." } + +FUNCTION {bbl.nr} +{ "no." } + +FUNCTION {bbl.in} +{ "in" } + +FUNCTION {bbl.pages} +{ "" } + +FUNCTION {bbl.page} +{ "" } + +FUNCTION {bbl.chapter} +{ "Ch." } + +FUNCTION {bbl.techrep} +{ "Tech. Rep." } + +FUNCTION {bbl.mthesis} +{ "Master's thesis" } + +FUNCTION {bbl.phdthesis} +{ "Ph.D. thesis" } + +MACRO {jan} {"Jan."} + +MACRO {feb} {"Feb."} + +MACRO {mar} {"Mar."} + +MACRO {apr} {"Apr."} + +MACRO {may} {"May"} + +MACRO {jun} {"Jun."} + +MACRO {jul} {"Jul."} + +MACRO {aug} {"Aug."} + +MACRO {sep} {"Sep."} + +MACRO {oct} {"Oct."} + +MACRO {nov} {"Nov."} + +MACRO {dec} {"Dec."} + + %------------------------------------------------------------------- + % Begin module: + % \ProvidesFile{physjour.mbs}[2002/01/14 2.2 (PWD)] +MACRO {aa}{"Astron. \& Astrophys."} +MACRO {aasup}{"Astron. \& Astrophys. Suppl. Ser."} +MACRO {aj} {"Astron. J."} +MACRO {aph} {"Acta Phys."} +MACRO {advp} {"Adv. Phys."} +MACRO {ajp} {"Amer. J. Phys."} +MACRO {ajm} {"Amer. J. Math."} +MACRO {amsci} {"Amer. Sci."} +MACRO {anofd} {"Ann. Fluid Dyn."} +MACRO {am} {"Ann. Math."} +MACRO {ap} {"Ann. Phys. (NY)"} +MACRO {adp} {"Ann. Phys. (Leipzig)"} +MACRO {ao} {"Appl. Opt."} +MACRO {apl} {"Appl. Phys. Lett."} +MACRO {app} {"Astroparticle Phys."} +MACRO {apj} {"Astrophys. J."} +MACRO {apjsup} {"Astrophys. J. Suppl."} +MACRO {apss} {"Astrophys. Space Sci."} +MACRO {araa} {"Ann. Rev. Astron. Astrophys."} +MACRO {baas} {"Bull. Amer. Astron. Soc."} +MACRO {baps} {"Bull. Amer. Phys. Soc."} +MACRO {cmp} {"Comm. Math. Phys."} +MACRO {cpam} {"Commun. Pure Appl. Math."} +MACRO {cppcf} {"Comm. Plasma Phys. \& Controlled Fusion"} +MACRO {cpc} {"Comp. Phys. Comm."} +MACRO {cqg} {"Class. Quant. Grav."} +MACRO {cra} {"C. R. Acad. Sci. A"} +MACRO {fed} {"Fusion Eng. \& Design"} +MACRO {ft} {"Fusion Tech."} +MACRO {grg} {"Gen. Relativ. Gravit."} +MACRO {ieeens} {"IEEE Trans. Nucl. Sci."} +MACRO {ieeeps} {"IEEE Trans. Plasma Sci."} +MACRO {ijimw} {"Interntl. J. Infrared \& Millimeter Waves"} +MACRO {ip} {"Infrared Phys."} +MACRO {irp} {"Infrared Phys."} +MACRO {jap} {"J. Appl. Phys."} +MACRO {jasa} {"J. Acoust. Soc. America"} +MACRO {jcp} {"J. Comp. Phys."} +MACRO {jetp} {"Sov. Phys.--JETP"} +MACRO {jfe} {"J. Fusion Energy"} +MACRO {jfm} {"J. Fluid Mech."} +MACRO {jmp} {"J. Math. Phys."} +MACRO {jne} {"J. Nucl. Energy"} +MACRO {jnec} {"J. Nucl. Energy, C: Plasma Phys., Accelerators, Thermonucl. Res."} +MACRO {jnm} {"J. Nucl. Mat."} +MACRO {jpc} {"J. Phys. Chem."} +MACRO {jpp} {"J. Plasma Phys."} +MACRO {jpsj} {"J. Phys. Soc. Japan"} +MACRO {jsi} {"J. Sci. Instrum."} +MACRO {jvst} {"J. Vac. Sci. \& Tech."} +MACRO {nat} {"Nature"} +MACRO {nature} {"Nature"} +MACRO {nedf} {"Nucl. Eng. \& Design/Fusion"} +MACRO {nf} {"Nucl. Fusion"} +MACRO {nim} {"Nucl. Inst. \& Meth."} +MACRO {nimpr} {"Nucl. Inst. \& Meth. in Phys. Res."} +MACRO {np} {"Nucl. Phys."} +MACRO {npb} {"Nucl. Phys. B"} +MACRO {nt/f} {"Nucl. Tech./Fusion"} +MACRO {npbpc} {"Nucl. Phys. B (Proc. Suppl.)"} +MACRO {inc} {"Nuovo Cimento"} +MACRO {nc} {"Nuovo Cimento"} +MACRO {pf} {"Phys. Fluids"} +MACRO {pfa} {"Phys. Fluids A: Fluid Dyn."} +MACRO {pfb} {"Phys. Fluids B: Plasma Phys."} +MACRO {pl} {"Phys. Lett."} +MACRO {pla} {"Phys. Lett. A"} +MACRO {plb} {"Phys. Lett. B"} +MACRO {prep} {"Phys. Rep."} +MACRO {pnas} {"Proc. Nat. Acad. Sci. USA"} +MACRO {pp} {"Phys. Plasmas"} +MACRO {ppcf} {"Plasma Phys. \& Controlled Fusion"} +MACRO {phitrsl} {"Philos. Trans. Roy. Soc. London"} +MACRO {prl} {"Phys. Rev. Lett."} +MACRO {pr} {"Phys. Rev."} +MACRO {physrev} {"Phys. Rev."} +MACRO {pra} {"Phys. Rev. A"} +MACRO {prb} {"Phys. Rev. B"} +MACRO {prc} {"Phys. Rev. C"} +MACRO {prd} {"Phys. Rev. D"} +MACRO {pre} {"Phys. Rev. E"} +MACRO {ps} {"Phys. Scripta"} +MACRO {procrsl} {"Proc. Roy. Soc. London"} +MACRO {rmp} {"Rev. Mod. Phys."} +MACRO {rsi} {"Rev. Sci. Inst."} +MACRO {science} {"Science"} +MACRO {sciam} {"Sci. Am."} +MACRO {sam} {"Stud. Appl. Math."} +MACRO {sjpp} {"Sov. J. Plasma Phys."} +MACRO {spd} {"Sov. Phys.--Doklady"} +MACRO {sptp} {"Sov. Phys.--Tech. Phys."} +MACRO {spu} {"Sov. Phys.--Uspeki"} +MACRO {st} {"Sky and Telesc."} + % End module: physjour.mbs + %------------------------------------------------------------------- + % Begin module: + % \ProvidesFile{geojour.mbs}[2002/07/10 2.0h (PWD)] +MACRO {aisr} {"Adv. Space Res."} +MACRO {ag} {"Ann. Geophys."} +MACRO {anigeo} {"Ann. Geofis."} +MACRO {angl} {"Ann. Glaciol."} +MACRO {andmet} {"Ann. d. Meteor."} +MACRO {andgeo} {"Ann. d. Geophys."} +MACRO {andphy} {"Ann. Phys.-Paris"} +MACRO {afmgb} {"Arch. Meteor. Geophys. Bioklimatol."} +MACRO {atph} {"Atm\'osphera"} +MACRO {aao} {"Atmos. Ocean"} +MACRO {ass}{"Astrophys. Space Sci."} +MACRO {atenv} {"Atmos. Environ."} +MACRO {aujag} {"Aust. J. Agr. Res."} +MACRO {aumet} {"Aust. Meteorol. Mag."} +MACRO {blmet} {"Bound.-Lay. Meteorol."} +MACRO {bams} {"Bull. Amer. Meteorol. Soc."} +MACRO {cch} {"Clim. Change"} +MACRO {cdyn} {"Clim. Dynam."} +MACRO {cbul} {"Climatol. Bull."} +MACRO {cap} {"Contrib. Atmos. Phys."} +MACRO {dsr} {"Deep-Sea Res."} +MACRO {dhz} {"Dtsch. Hydrogr. Z."} +MACRO {dao} {"Dynam. Atmos. Oceans"} +MACRO {eco} {"Ecology"} +MACRO {empl}{"Earth, Moon and Planets"} +MACRO {envres} {"Environ. Res."} +MACRO {envst} {"Environ. Sci. Technol."} +MACRO {ecms} {"Estuarine Coastal Mar. Sci."} +MACRO {expa}{"Exper. Astron."} +MACRO {geoint} {"Geofis. Int."} +MACRO {geopub} {"Geofys. Publ."} +MACRO {geogeo} {"Geol. Geofiz."} +MACRO {gafd} {"Geophys. Astrophys. Fluid Dyn."} +MACRO {gfd} {"Geophys. Fluid Dyn."} +MACRO {geomag} {"Geophys. Mag."} +MACRO {georl} {"Geophys. Res. Lett."} +MACRO {grl} {"Geophys. Res. Lett."} +MACRO {ga} {"Geophysica"} +MACRO {gs} {"Geophysics"} +MACRO {ieeetap} {"IEEE Trans. Antenn. Propag."} +MACRO {ijawp} {"Int. J. Air Water Pollut."} +MACRO {ijc} {"Int. J. Climatol."} +MACRO {ijrs} {"Int. J. Remote Sens."} +MACRO {jam} {"J. Appl. Meteorol."} +MACRO {jaot} {"J. Atmos. Ocean. Technol."} +MACRO {jatp} {"J. Atmos. Terr. Phys."} +MACRO {jastp} {"J. Atmos. Solar-Terr. Phys."} +MACRO {jce} {"J. Climate"} +MACRO {jcam} {"J. Climate Appl. Meteor."} +MACRO {jcm} {"J. Climate Meteor."} +MACRO {jcy} {"J. Climatol."} +MACRO {jgr} {"J. Geophys. Res."} +MACRO {jga} {"J. Glaciol."} +MACRO {jh} {"J. Hydrol."} +MACRO {jmr} {"J. Mar. Res."} +MACRO {jmrj} {"J. Meteor. Res. Japan"} +MACRO {jm} {"J. Meteor."} +MACRO {jpo} {"J. Phys. Oceanogr."} +MACRO {jra} {"J. Rech. Atmos."} +MACRO {jaes} {"J. Aeronaut. Sci."} +MACRO {japca} {"J. Air Pollut. Control Assoc."} +MACRO {jas} {"J. Atmos. Sci."} +MACRO {jmts} {"J. Mar. Technol. Soc."} +MACRO {jmsj} {"J. Meteorol. Soc. Japan"} +MACRO {josj} {"J. Oceanogr. Soc. Japan"} +MACRO {jwm} {"J. Wea. Mod."} +MACRO {lao} {"Limnol. Oceanogr."} +MACRO {mwl} {"Mar. Wea. Log"} +MACRO {mau} {"Mausam"} +MACRO {meteor} {"``Meteor'' Forschungsergeb."} +MACRO {map} {"Meteorol. Atmos. Phys."} +MACRO {metmag} {"Meteor. Mag."} +MACRO {metmon} {"Meteor. Monogr."} +MACRO {metrun} {"Meteor. Rundsch."} +MACRO {metzeit} {"Meteor. Z."} +MACRO {metgid} {"Meteor. Gidrol."} +MACRO {mwr} {"Mon. Weather Rev."} +MACRO {nwd} {"Natl. Weather Dig."} +MACRO {nzjmfr} {"New Zeal. J. Mar. Freshwater Res."} +MACRO {npg} {"Nonlin. Proc. Geophys."} +MACRO {om} {"Oceanogr. Meteorol."} +MACRO {ocac} {"Oceanol. Acta"} +MACRO {oceanus} {"Oceanus"} +MACRO {paleoc} {"Paleoceanography"} +MACRO {pce} {"Phys. Chem. Earth"} +MACRO {pmg} {"Pap. Meteor. Geophys."} +MACRO {ppom} {"Pap. Phys. Oceanogr. Meteor."} +MACRO {physzeit} {"Phys. Z."} +MACRO {pps} {"Planet. Space Sci."} +MACRO {pss} {"Planet. Space Sci."} +MACRO {pag} {"Pure Appl. Geophys."} +MACRO {qjrms} {"Quart. J. Roy. Meteorol. Soc."} +MACRO {quatres} {"Quat. Res."} +MACRO {rsci} {"Radio Sci."} +MACRO {rse} {"Remote Sens. Environ."} +MACRO {rgeo} {"Rev. Geophys."} +MACRO {rgsp} {"Rev. Geophys. Space Phys."} +MACRO {rdgeo} {"Rev. Geofis."} +MACRO {revmeta} {"Rev. Meteorol."} +MACRO {sgp}{"Surveys in Geophys."} +MACRO {sp} {"Solar Phys."} +MACRO {ssr} {"Space Sci. Rev."} +MACRO {tellus} {"Tellus"} +MACRO {tac} {"Theor. Appl. Climatol."} +MACRO {tagu} {"Trans. Am. Geophys. Union (EOS)"} +MACRO {wrr} {"Water Resour. Res."} +MACRO {weather} {"Weather"} +MACRO {wafc} {"Weather Forecast."} +MACRO {ww} {"Weatherwise"} +MACRO {wmob} {"WMO Bull."} +MACRO {zeitmet} {"Z. Meteorol."} + % End module: geojour.mbs + %------------------------------------------------------------------- + % Begin module: + % \ProvidesFile{photjour.mbs}[1999/02/24 2.0b (PWD)] + +MACRO {appopt} {"Appl. Opt."} +MACRO {bell} {"Bell Syst. Tech. J."} +MACRO {ell} {"Electron. Lett."} +MACRO {jasp} {"J. Appl. Spectr."} +MACRO {jqe} {"IEEE J. Quantum Electron."} +MACRO {jlwt} {"J. Lightwave Technol."} +MACRO {jmo} {"J. Mod. Opt."} +MACRO {josa} {"J. Opt. Soc. America"} +MACRO {josaa} {"J. Opt. Soc. Amer.~A"} +MACRO {josab} {"J. Opt. Soc. Amer.~B"} +MACRO {jdp} {"J. Phys. (Paris)"} +MACRO {oc} {"Opt. Commun."} +MACRO {ol} {"Opt. Lett."} +MACRO {phtl} {"IEEE Photon. Technol. Lett."} +MACRO {pspie} {"Proc. Soc. Photo-Opt. Instrum. Eng."} +MACRO {sse} {"Solid-State Electron."} +MACRO {sjot} {"Sov. J. Opt. Technol."} +MACRO {sjqe} {"Sov. J. Quantum Electron."} +MACRO {sleb} {"Sov. Phys.--Leb. Inst. Rep."} +MACRO {stph} {"Sov. Phys.--Techn. Phys."} +MACRO {stphl} {"Sov. Techn. Phys. Lett."} +MACRO {vr} {"Vision Res."} +MACRO {zph} {"Z. f. Physik"} +MACRO {zphb} {"Z. f. Physik~B"} +MACRO {zphd} {"Z. f. Physik~D"} + +MACRO {CLEO} {"CLEO"} +MACRO {ASSL} {"Adv. Sol.-State Lasers"} +MACRO {OSA} {"OSA"} + % End module: photjour.mbs +%% Copyright 1994-2002 Patrick W Daly +MACRO {acmcs} {"ACM Comput. Surv."} + +MACRO {acta} {"Acta Inf."} + +MACRO {cacm} {"Commun. ACM"} + +MACRO {ibmjrd} {"IBM J. Res. Dev."} + +MACRO {ibmsj} {"IBM Syst.~J."} + +MACRO {ieeese} {"IEEE Trans. Software Eng."} + +MACRO {ieeetc} {"IEEE Trans. Comput."} + +MACRO {ieeetcad} + {"IEEE Trans. Comput. Aid. Des."} + +MACRO {ipl} {"Inf. Process. Lett."} + +MACRO {jacm} {"J.~ACM"} + +MACRO {jcss} {"J.~Comput. Syst. Sci."} + +MACRO {scp} {"Sci. Comput. Program."} + +MACRO {sicomp} {"SIAM J. Comput."} + +MACRO {tocs} {"ACM Trans. Comput. Syst."} + +MACRO {tods} {"ACM Trans. Database Syst."} + +MACRO {tog} {"ACM Trans. Graphic."} + +MACRO {toms} {"ACM Trans. Math. Software"} + +MACRO {toois} {"ACM Trans. Office Inf. Syst."} + +MACRO {toplas} {"ACM Trans. Progr. Lang. Syst."} + +MACRO {tcs} {"Theor. Comput. Sci."} + +FUNCTION {bibinfo.check} +{ swap$ + duplicate$ missing$ + { + pop$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ pop$ + } + { swap$ + "\bibinfo{" swap$ * "}{" * swap$ * "}" * + } + if$ + } + if$ +} +FUNCTION {bibinfo.warn} +{ swap$ + duplicate$ missing$ + { + swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ "empty " swap$ * " in " * cite$ * warning$ + } + { swap$ + "\bibinfo{" swap$ * "}{" * swap$ * "}" * + } + if$ + } + if$ +} +FUNCTION {format.eprint} +{ eprint duplicate$ empty$ + 'skip$ + { "\eprint" + archive empty$ + 'skip$ + { "[" * archive * "]" * } + if$ + "{" * swap$ * "}" * + } + if$ +} +FUNCTION {format.url} +{ url empty$ + { "" } + { "\urlprefix\url{" url * "}" * } + if$ +} + +FUNCTION {format.doi} +{ doi empty$ + { "" } + { "\doi{" doi * "}" * } + if$ +} + +STRINGS { bibinfo} +INTEGERS { nameptr namesleft numnames } + +FUNCTION {format.names} +{ 'bibinfo := + duplicate$ empty$ 'skip$ { + 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv~}{ll}{, f.}{, jj}" + format.name$ + bibinfo bibinfo.check + 't := + nameptr #1 > + { + nameptr #1 + #1 + = + numnames #5 + > and + { "others" 't := + #1 'namesleft := } + 'skip$ + if$ + namesleft #1 > + { ", " * t * } + { + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal emphasize * + } + { + "\&" + space.word * t * + } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } if$ +} +FUNCTION {format.names.ed} +{ + format.names +} +FUNCTION {format.authors} +{ author "author" format.names +} +FUNCTION {get.bbl.editor} +{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } + +FUNCTION {get.in.bbl.editor} +{ } + +FUNCTION {format.editors} +{ editor "editor" format.names duplicate$ empty$ 'skip$ + { + " " * + get.bbl.editor + "(" swap$ * ")" * + * + } + if$ +} + +FUNCTION {format.in.editors} +{ "" editor "editor" format.names duplicate$ empty$ 'skip$ + { swap$ "(eds" * + " " * swap$ * + swap$ " " * + swap$ * ")" * + } + if$ +} + +FUNCTION {format.note} +{ + note empty$ + { "" } + { note #1 #1 substring$ + duplicate$ "{" = + 'skip$ + { output.state mid.sentence = + { "l" } + { "u" } + if$ + change.case$ + } + if$ + note #2 global.max$ substring$ * "note" bibinfo.check + } + if$ +} + + + +FUNCTION {format.in.title} +{ title + duplicate$ empty$ 'skip$ + { "t" change.case$ } + if$ + " in \textit{" swap$ * "}" * "title" bibinfo.check +} + +FUNCTION {format.title} +{ title + duplicate$ empty$ 'skip$ + { "t" change.case$ } + if$ + "title" bibinfo.check +} + +FUNCTION {format.inpro.title} +{ title + duplicate$ empty$ 'skip$ + { "t" change.case$ } + if$ + "title" bibinfo.check + emphasize} + +FUNCTION {format.version} +{ version + duplicate$ empty$ 'skip$ + { "t" change.case$ } + if$ + "version" bibinfo.check +} + +%FUNCTION {format.inpro.title} +%{ title +% duplicate$ empty$ 'skip$ +% { "t" change.case$ } +% if$ +% "title" bibinfo.check +% emphasize} + +FUNCTION {output.bibitem} +{ newline$ + "\bibitem{" write$ + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {n.dashify} +{ + 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {word.in} +{ bbl.in capitalize + " " * } + +FUNCTION {format.date} +{ + "" + duplicate$ empty$ + year "year" bibinfo.check duplicate$ empty$ + { swap$ 'skip$ + { "there's a month but no year in " cite$ * warning$ } + if$ + * + } + { swap$ 'skip$ + { + swap$ + " " * swap$ + } + if$ + * + } + if$ + duplicate$ empty$ + 'skip$ + { + before.all 'output.state := + " (" swap$ * ")" * + } + if$ +} +FUNCTION {format.btitle} +{ title "title" bibinfo.check + duplicate$ empty$ 'skip$ + { + emphasize + } + if$ +} +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { bbl.volume volume tie.or.space.prefix + "volume" bibinfo.check * * + series "series" bibinfo.check + duplicate$ empty$ 'pop$ + { swap$ bbl.of space.word * swap$ + emphasize * } + if$ + "volume and number" number either.or.check + } + if$ +} +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { series empty$ + { number "number" bibinfo.check } + { output.state mid.sentence = + { bbl.number } + { bbl.number capitalize } + if$ + number tie.or.space.prefix "number" bibinfo.check * * + bbl.in space.word * + series "series" bibinfo.check * + } + if$ + } + if$ + } + { "" } + if$ +} + +FUNCTION {format.edition} +{ edition duplicate$ empty$ 'skip$ + { + output.state mid.sentence = + { "l" } + { "t" } + if$ change.case$ + "edition" bibinfo.check + " " * bbl.edition * + } + if$ +} +INTEGERS { multiresult } +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} +FUNCTION {format.pages} +{ pages duplicate$ empty$ 'skip$ + { duplicate$ multi.page.check + { + n.dashify + } + { + } + if$ + "pages" bibinfo.check + } + if$ +} +FUNCTION {format.journal.pages} +{ pages duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ + { pop$ pop$ format.pages } + { + ", " * + swap$ + n.dashify + "pages" bibinfo.check + * + } + if$ + } + if$ +} +FUNCTION {format.number} + {number empty$ + 'skip$ + { "~(" number * ")" * * } + if$ + } +FUNCTION {format.vol.num.pages} +{ volume field.or.null + duplicate$ empty$ 'skip$ + { + "volume" bibinfo.check + } + if$ + bolden +% format.number + format.journal.pages +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { bbl.chapter } + { type "l" change.case$ + "type" bibinfo.check + } + if$ + chapter tie.or.space.prefix + "chapter" bibinfo.check + * * + pages empty$ + 'skip$ + { ", " * format.pages * } + if$ + } + if$ +} + +FUNCTION {format.booktitle} +{ + booktitle "booktitle" bibinfo.check + emphasize +} +FUNCTION {format.in.ed.booktitle} +{ duplicate$ empty$ 'skip$ + { +editor "editor" format.names.ed duplicate$ empty$ 'pop$ + { +format.booktitle swap$ +"(" editor num.names$ #1 > 'bbl.in.editors 'bbl.editor if$ * swap$ ") " * + * swap$ + * } + if$ + } + 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 duplicate$ empty$ + 'pop$ + { swap$ pop$ + "t" change.case$ "type" bibinfo.check + } + if$ +} +FUNCTION {format.tr.number} +{ number "number" bibinfo.check + type duplicate$ empty$ + { pop$ bbl.techrep } + 'skip$ + if$ + "type" bibinfo.check + swap$ duplicate$ empty$ + { pop$ "t" change.case$ } + { tie.or.space.prefix * * } + if$ +} +FUNCTION {format.article.crossref} +{ + key duplicate$ empty$ + { pop$ + journal duplicate$ empty$ + { "need key or journal for " cite$ * " to crossref " * crossref * warning$ } + { "journal" bibinfo.check emphasize word.in swap$ * } + if$ + } + { word.in swap$ * " " *} + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {format.crossref.editor} +{ editor #1 "{vv~}{ll}" format.name$ + "editor" bibinfo.check + editor num.names$ duplicate$ + #2 > + { pop$ + "editor" bibinfo.check + " " * bbl.etal + emphasize + * + } + { #2 < + 'skip$ + { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { + "editor" bibinfo.check + " " * bbl.etal + emphasize + * + } + { + " \& " + * editor #2 "{vv~}{ll}" format.name$ + "editor" bibinfo.check + * + } + if$ + } + if$ + } + if$ +} +FUNCTION {format.book.crossref} +{ volume duplicate$ empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + pop$ word.in + } + { bbl.volume + capitalize + swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word * + } + if$ + editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { series empty$ + { "need editor, key, or series for " cite$ * " to crossref " * + crossref * warning$ + "" * + } + { series emphasize * } + if$ + } + { key * } + if$ + } + { format.crossref.editor * } + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {format.incoll.inproc.crossref} +{ + editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { format.booktitle duplicate$ empty$ + { "need editor, key, or booktitle for " cite$ * " to crossref " * + crossref * warning$ + } + { word.in swap$ * } + if$ + } + { word.in key * " " *} + if$ + } + { word.in format.crossref.editor * " " *} + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {format.org.or.pub} +{ 't := + "" + year empty$ + { "empty year in " cite$ * warning$ } + 'skip$ + if$ + address empty$ t empty$ and + year empty$ and + 'skip$ + { + add.blank "(" * + t empty$ + { address "address" bibinfo.check * + } + { t * + address empty$ + 'skip$ + { ", " * address "address" bibinfo.check * } + if$ + } + if$ + year empty$ + 'skip$ + { t empty$ address empty$ and + 'skip$ + { ", " * } + if$ + year "year" bibinfo.check + * + } + if$ + ")" * + } + if$ +} +FUNCTION {format.publisher.address} +{ publisher "publisher" bibinfo.warn format.org.or.pub +} + +FUNCTION {format.organization.address} +{ organization "organization" bibinfo.check format.org.or.pub +} + +FUNCTION {format.archive} +{ + archivePrefix empty$ + { "" } + { archivePrefix ":" *} + if$ +} + +FUNCTION {format.primaryClass} +{ + primaryClass empty$ + { "" } + { " {[" primaryClass * "]}" *} + if$ +} + +FUNCTION {format.soft.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ + "eprint" bibinfo.check +} + +FUNCTION {format.softmisc.archive} +{ + archivePrefix empty$ + { "" } + { "" } + if$ +} + +FUNCTION {format.softmisc.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + crossref missing$ + { + journal + "journal" bibinfo.check + emphasize + "journal" output.check + add.blank + format.vol.num.pages output + format.date "year" output.check + } + { format.article.crossref output.nonnull + format.pages output + } + if$ + new.block + format.url output + new.block + %% format.doi output + format.note output + %%format.eprint output + %% format.soft.eprint output + %% add.blank + %% format.primaryClass output + fin.entry +} + +FUNCTION {book} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + add.blank + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + new.block + format.btitle "title" output.check + add.blank + format.edition output + crossref missing$ + { format.bvolume output + new.block + format.number.series output + new.sentence + format.publisher.address output + } + { + new.block + format.book.crossref output.nonnull + format.date "year" output.check + } + if$ + new.block + format.url output + new.block + format.note output + format.eprint output + fin.entry +} +FUNCTION {booklet} +{ output.bibitem + format.authors output + new.block + format.title "title" output.check + new.block + howpublished "howpublished" bibinfo.check output + address "address" bibinfo.check output + format.date output + new.block + format.url output + new.block + format.note output + format.eprint output + fin.entry +} + +FUNCTION {inbook} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + new.block + format.btitle "title" output.check + crossref missing$ + { + format.bvolume output + format.chapter.pages "chapter and pages" output.check + new.block + format.number.series output + new.sentence + format.publisher.address output + } + { + format.chapter.pages "chapter and pages" output.check + new.block + format.book.crossref output.nonnull + format.date "year" output.check + } + if$ + format.edition output + new.block + format.url output + new.block + format.note output + format.eprint output + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + new.block + format.in.title "title" output.check + add.blank + format.edition output +% new.block + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + add.blank + format.number.series output + format.chapter.pages output + new.sentence + format.publisher.address output + } + { format.incoll.inproc.crossref output.nonnull + format.chapter.pages output + } + if$ + new.block + format.url output + new.block + format.note output + format.eprint output + fin.entry +} +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check + new.block + format.editors output +add.blank + format.inpro.title "title" output.check + new.block + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.number.series output + format.pages output + new.sentence + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + } + { format.incoll.inproc.crossref output.nonnull + format.pages output + } + if$ + new.block + format.url output + new.block + format.note output + format.eprint output + fin.entry +} +FUNCTION {conference} { inproceedings } +FUNCTION {manual} +{ output.bibitem + author empty$ + { organization "organization" bibinfo.check + duplicate$ empty$ 'pop$ + { output + address "address" bibinfo.check output + } + if$ + } + { format.authors output.nonnull } + if$ + new.block + format.btitle "title" output.check + author empty$ + { organization empty$ + { + address new.block.checka + address "address" bibinfo.check output + } + 'skip$ + if$ + } + { + organization address new.block.checkb + organization "organization" bibinfo.check output + address "address" bibinfo.check output + } + if$ + format.edition output + format.date output + new.block + format.url output + new.block + format.note output + format.eprint output + fin.entry +} + +FUNCTION {mastersthesis} +{ output.bibitem + format.authors "author" output.check + new.block + format.btitle + "title" output.check + new.block + bbl.mthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.date "year" output.check + new.block + format.url output + new.block + format.note output + format.eprint output + fin.entry +} + +FUNCTION {misc} +{ output.bibitem + format.authors output + title howpublished new.block.checkb + format.title output + howpublished new.block.checka + howpublished "howpublished" bibinfo.check output + format.date output + new.block + format.url output + new.block + format.note output + format.eprint output + fin.entry + empty.misc.check +} + +FUNCTION {softmisc} +{ output.bibitem + format.authors output + title howpublished new.block.checkb + format.title output + format.version output + howpublished new.block.checka + howpublished "howpublished" bibinfo.check output + format.date output + new.block + format.url output + new.block + format.note output + %%format.eprint output + format.softmisc.eprint output + fin.entry + empty.misc.check +} + +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" output.check + new.block + format.btitle + "title" output.check + new.block + bbl.phdthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.date "year" output.check + new.block + format.url output + new.block + format.note output + format.eprint output + fin.entry +} + +FUNCTION {proceedings} +{ output.bibitem + editor empty$ + { organization "organization" bibinfo.check output + } + { format.editors output.nonnull } + if$ + new.block + format.btitle "title" output.check + format.bvolume output + format.number.series output + editor empty$ + { publisher empty$ + 'skip$ + { + new.sentence + format.publisher.address output + } + if$ + } + { publisher empty$ + { + new.sentence + format.organization.address output } + { + new.sentence + organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + } + if$ + new.block + format.url output + new.block + format.note output + format.eprint output + fin.entry +} + +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check + new.block + format.title + "title" output.check + new.block + format.tr.number output.nonnull + institution "institution" bibinfo.warn output + address "address" bibinfo.check output + format.date "year" output.check + new.block + format.url output + new.block + format.note output + format.eprint output + fin.entry +} + +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + format.date output + new.block + format.url output + new.block + format.note "note" output.check + format.eprint output + fin.entry +} + +FUNCTION {default.type} { misc } +READ +STRINGS { longest.label } +INTEGERS { number.label longest.label.width } +FUNCTION {initialize.longest.label} +{ "" 'longest.label := + #1 'number.label := + #0 'longest.label.width := +} +FUNCTION {longest.label.pass} +{ number.label int.to.str$ 'label := + number.label #1 + 'number.label := + label width$ longest.label.width > + { label 'longest.label := + label width$ 'longest.label.width := + } + 'skip$ + if$ +} +EXECUTE {initialize.longest.label} +ITERATE {longest.label.pass} +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" longest.label * "}" * + write$ newline$ + "\expandafter\ifx\csname url\endcsname\relax" + write$ newline$ + %%" \def\url#1{\texttt{#1}}\fi" + " \def\url#1{\burl{#1}}\fi" + write$ newline$ + "\expandafter\ifx\csname urlprefix\endcsname\relax\def\urlprefix{URL }\fi" + write$ newline$ + "\providecommand{\bibinfo}[2]{#2}" + write$ newline$ + "\providecommand{\eprint}[2][]{\url{#2}}" + write$ newline$ + "\providecommand{\doi}[1]{\url{https://doi.org/#1}}" + write$ newline$ + "\bibcommenthead" write$ newline$ +} +EXECUTE {begin.bib} +EXECUTE {init.state.consts} +ITERATE {call.type$} +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} +EXECUTE {end.bib} +%% End of customized bst file +%% +%% End of file `nature.bst'. \ No newline at end of file diff --git a/papers/preprint/sn-article-template/bst/sn-vancouver.bst b/papers/preprint/sn-article-template/bst/sn-vancouver.bst new file mode 100644 index 000000000..5af90528b --- /dev/null +++ b/papers/preprint/sn-article-template/bst/sn-vancouver.bst @@ -0,0 +1,2033 @@ +%% +%% This `vancouver.bst' bibliographic style file (for LaTeX/BibTeX) is +%% generated with the docstrip utility and modified manually to meet the +%% ``Uniform Requirements for Manuscripts Submitted to Biomedical Journals'' +%% as published in N Engl J Med 1997;336:309-315. +%% (also known as the Vancouver style) +%% This specification may be found on the web page of the +%% International Committe of Medical Journal Editors: +%% +%% http://www.icmje.org +%% +%%------------------------------------------------------------------- +%% +%% Copyright 2004 Folkert van der Beek +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Folkert van der Beek. +%% +%% Complaints, suggestions and comments may be sent to +%% +%% Folkert van der Beek +%% +%%------------------------------------------------------------------- +%% +%% This bibliography style file is intended for texts in ENGLISH +%% This is a numerical citation style, and as such is standard LaTeX. +%% It requires no extra package to interface to the main text. +%% The form of the \bibitem entries is +%% \bibitem{key}... +%% Usage of \cite is as follows: +%% \cite{key} ==>> [#] +%% \cite[chap. 2]{key} ==>> [#, chap. 2] +%% where # is a number determined by the ordering in the reference list. +%% The order in the reference list is that by which the works were originally +%% cited in the text, or that in the database. + % +%% To change the reference numbering system from [1] to 1, +%% put the following code in the preamble: +%% \makeatletter % Reference list option change +%% \renewcommand\@biblabel[1]{#1} % from [1] to 1 +%% \makeatother % +%% +%%--------------------------------------------------------------------- + +%% List of all possible fields +ENTRY + { address + assignee % for patents + author + booktitle % for articles in books + chapter % for incollection, esp. internet documents + cartographer % for maps + day + edition + editor + howpublished + institution % for technical reports + inventor % for patents + journal + key + keywords + month + note + number + organization + pages + part + publisher + school + series + title + type + volume + word + year + eprint % urlbst + doi % urlbst + url % urlbst + lastchecked % urlbst + updated % urlbst + archive + archivePrefix + primaryClass + eid + adsurl + adsnote + version + } + {} + { label } +%% Declaration of integer variables +INTEGERS { output.state before.all mid.sentence after.sentence after.block } +STRINGS { urlintro eprinturl eprintprefix doiprefix doiurl } % urlbst... +INTEGERS { hrefform addeprints adddoiresolver } +% Following constants may be adjusted by hand, if desired +FUNCTION {init.config.constants} +{ + "Available from: " 'urlintro := % prefix before URL + "http://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref + "arXiv:" 'eprintprefix := % text prefix printed before eprint ref + "http://dx.doi.org/" 'doiurl := % prefix to make URL from DOI + "" 'doiprefix := % text prefix printed before DOI ref + #0 'addeprints := % 0=no eprints; 1=include eprints + #0 'adddoiresolver := % 0=no DOI resolver; 1=include it + #0 'hrefform := % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs +} +INTEGERS { + bracket.state + outside.brackets + open.brackets + within.brackets + close.brackets +} +% ...urlbst to here +FUNCTION {init.state.consts} +{ #0 'outside.brackets := % urlbst + #1 'open.brackets := + #2 'within.brackets := + #3 'close.brackets := + + #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} +%% Declaration of string variables +STRINGS { s t} + +% urlbst +FUNCTION {output.nonnull.original} +{ 's := + output.state mid.sentence = + { ". " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} + +% urlbst... +FUNCTION {output.nonnull} +{ % Save the thing we've been asked to output + 's := + % If the bracket-state is close.brackets, then add a close-bracket to + % what is currently at the top of the stack, and set bracket.state + % to outside.brackets + bracket.state close.brackets = + { "]" * + outside.brackets 'bracket.state := + } + 'skip$ + if$ + bracket.state outside.brackets = + { % We're outside all brackets -- this is the normal situation. + % Write out what's currently at the top of the stack, using the + % original output.nonnull function. + s + output.nonnull.original + } + { % Still in brackets. Add open-bracket or (continuation) comma, add the + % new text (in s) to the top of the stack, and move to the close-brackets + % state, ready for next time (unless inbrackets resets it). If we come + % into this branch, then output.state is carefully undisturbed. + bracket.state open.brackets = + { " [" * } + { ", " * } % bracket.state will be within.brackets + if$ + s * + close.brackets 'bracket.state := + } + if$ +} + +% Call this function just before adding something which should be presented in +% brackets. bracket.state is handled specially within output.nonnull. +FUNCTION {inbrackets} +{ bracket.state close.brackets = + { within.brackets 'bracket.state := } % reset the state: not open nor closed + { open.brackets 'bracket.state := } + if$ +} + +FUNCTION {format.lastchecked} +{ lastchecked empty$ + { "" } + { updated empty$ + { inbrackets "cited " lastchecked * } + { inbrackets "updated " updated * "; cited " * lastchecked * } + if$ + } + if$ +} +% ...urlbst to here + +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} + +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} + +FUNCTION {fin.entry} +{ + bracket.state close.brackets = % urlbst + { "]" * } + 'skip$ + if$ + add.period$ + write$ + newline$ +} + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} + +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} + +FUNCTION {add.blank} +{ " " * before.all 'output.state := +} + +FUNCTION {no.blank.or.punct} +{ "" * before.all 'output.state := +} + +FUNCTION {add.semicolon} +{ + ";" * + no.blank.or.punct +} + + +FUNCTION {misc.add.colon} +{ + ": " * + } + +FUNCTION {misc.add.comma} +{ + ", " * + } + +FUNCTION {date.block} +{ + "." * + no.blank.or.punct +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% LOGICAL `NOT', `AND', AND `OR' % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Logical 'not': +% If the first element on the stack is A then this function +% does the following: +% push { #0 } +% push { #1 } +% So now the first 3 elements of the stack are +% { #1 } { #0 } A +% The first 3 are popped and subjected to 'if': +% If A > 0 then { #0 } is executed, else { #1 } is executed: +% if A > 0 +% then 0 +% else 1 +% So consider integers as logicals, where 1 = true and 0 = false, +% then this does +% (if A then false else true) +% which is a logical 'not'. + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Logical 'and': +% If the first 2 elements on the stack are A B +% then this function does the following: +% push 'skip$ +% push { pop$ #0 } +% So now first 4 elements are +% { pop$ #0 } 'skip$ A B +% The first 3 are popped and subjected to 'if' (B is on top of +% the stack): +% If A > 0 then 'skip$ is executed, else { pop$ #0 } is executed: +% if A > 0 +% then (B stays on top of stack) +% else (B is popped and #0 is pushed) +% So consider integers as logicals, where 1 = true and 0 = false, +% then this does +% (if A then B else false) +% which is a logical 'and'. + +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Logical 'or': +% If the first 2 elements on the stack are A B +% then this function does the following: +% push { pop$ #1 } +% push 'skip$ +% So now first 4 elements are +% 'skip$ { pop$ #1 } A B +% The first 3 are popped and subjected to 'if' (B is on top of +% the stack): +% If A > 0 then { pop$ #1 } is executed, else 'skip$ is executed: +% if A > 0 +% then (B is popped and #1 is pushed) +% else (B stays on top of stack) +% So consider integers as logicals, where 1 = true and 0 = false, +% then this does +% (if A then true else B) +% which is a logical 'or'. + +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% GENERAL PURPOSE FUNCTIONS FOR FORMATTING % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% issues warning if field is empty +% call with +% "field" field warning.if.empty +% Note that the first field must be between quotes +% because it is the fieldname for use in the warning message. +% + +FUNCTION {warning.if.empty} +{ empty$ + { "No " swap$ * " in " * cite$ * warning$ } + { pop$ } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % encloses string in pre- and postfix string + % call with + % prefix postfix S enclose.check + % delivers empty string if S empty + % +FUNCTION {enclose.check} +{ duplicate$ empty$ + { pop$ pop$ pop$ + "" + } + { swap$ * * } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% emphasizes top of stack +% call with +% string" emphasize.check +% + +FUNCTION {emphasize.check} +{ "\Bem{" swap$ + "}" swap$ + enclose.check +} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % brackets top of stack + % call with + % "string" bracket.check + % +FUNCTION {bracket.check} +{ "[" swap$ + "]" swap$ + enclose.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % parenthesizes top of stack + % call with + % "string" parenthesize + % +FUNCTION {parenthesize.check} +{ "(" swap$ + ")" swap$ + enclose.check +} + +STRINGS {z} + +FUNCTION {remove.dots} +{ 'z := % expects string on top of the stack, pops the string and assigns it to variable z + "" % push empty string + { z empty$ not } % returns 0 if variable z is empty + { z #1 #1 substring$ % push the first character of variable z + z #2 global.max$ substring$ 'z := % assigns the 2nd to last character of variable z to variable z + duplicate$ "\" = % pushes 1 if the last character is "\", otherwise 0 + { * % concatenates the last 2 literals + z #1 #1 substring$ % push the first character of variable z + z #2 global.max$ substring$ 'z := % assigns the 2nd to last character of variable z to variable z + * % concatenates the last 2 literals, i.e. every character, even a dot, following a "\" will be printed + } + { duplicate$ "." = % pushes 1 if the last character is ".", otherwise 0 + 'pop$ % pushes the pop$ function + { * } % concatenates the last 2 literals + if$ % pops the last character if it is a dot, otherwise concatenates it with the string on top of the stack + } + if$ + } + while$ +} + +INTEGERS {l} +FUNCTION{string.length} +{ + #1 'l := + { duplicate$ duplicate$ #1 l substring$ = not } + { l #1 + 'l := } + while$ + pop$ l +} + +STRINGS {replace find text} +INTEGERS {find_length} +FUNCTION {find.replace} +{ + 'replace := + 'find := + 'text := + find string.length 'find_length := + "" + { text empty$ not } + { text #1 find_length substring$ find = + { + replace * + text #1 find_length + global.max$ substring$ 'text := + } + { text #1 #1 substring$ * + text #2 global.max$ substring$ 'text := + } + if$ + } + while$ +} + +FUNCTION {new.block.checka} +{ empty$ + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.sentence.checka} +{ empty$ + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {new.sentence.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} + +FUNCTION {emphasize} +{ skip$ } + +FUNCTION {tie.or.space.prefix} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ +} + +FUNCTION {capitalize} +{ "u" change.case$ "t" change.case$ } + +FUNCTION {space.word} +{ " " swap$ * " " * } + + % Here are the language-specific definitions for explicit words. + % Each function has a name bbl.xxx where xxx is the English word. + % The language selected here is ENGLISH + +FUNCTION {bbl.and} +{ "and"} + +FUNCTION {bbl.etal} +{ "et~al." } + +FUNCTION {bbl.editors} +{ "editors" } + +FUNCTION {bbl.editor} +{ "editor" } + +FUNCTION {bbl.cartographers} +{ "cartographers" } + +FUNCTION {bbl.cartographer} +{ "cartographer" } + +FUNCTION {bbl.inventors} +{ "inventors" } + +FUNCTION {bbl.inventor} +{ "inventor" } + +FUNCTION {bbl.assignees} +{ "assignees" } + +FUNCTION {bbl.assignee} +{ "assignee" } + +FUNCTION {bbl.edby} +{ "edited by" } + +FUNCTION {bbl.edition} +{ "ed." } + +FUNCTION {bbl.volume} +{ "vol." } + +FUNCTION {bbl.of} +{ "of" } + +FUNCTION {bbl.number} +{ "no." } + +FUNCTION {bbl.nr} +{ "no." } + +FUNCTION {bbl.in} +{ "in" } + +FUNCTION {bbl.pages} +{ "p." } + +FUNCTION {bbl.page} +{ "p." } + +FUNCTION {bbl.chapter} +{ "chap." } + +FUNCTION {bbl.techrep} +{ "Tech. Rep." } + +FUNCTION {bbl.mthesis} +{ "Master's thesis" } + +FUNCTION {bbl.phdthesis} +{ "Ph.D. thesis" } + +FUNCTION {bbl.first} +{ "1st" } + +FUNCTION {bbl.second} +{ "2nd" } + +FUNCTION {bbl.third} +{ "3rd" } + +FUNCTION {bbl.fourth} +{ "4th" } + +FUNCTION {bbl.fifth} +{ "5th" } + +FUNCTION {bbl.st} +{ "st" } + +FUNCTION {bbl.nd} +{ "nd" } + +FUNCTION {bbl.rd} +{ "rd" } + +FUNCTION {bbl.th} +{ "th" } + +MACRO {jan} {"Jan."} + +MACRO {feb} {"Feb."} + +MACRO {mar} {"Mar."} + +MACRO {apr} {"Apr."} + +MACRO {may} {"May"} + +MACRO {jun} {"Jun."} + +MACRO {jul} {"Jul."} + +MACRO {aug} {"Aug."} + +MACRO {sep} {"Sep."} + +MACRO {oct} {"Oct."} + +MACRO {nov} {"Nov."} + +MACRO {dec} {"Dec."} + +FUNCTION {eng.ord} +{ duplicate$ "1" swap$ * + #-2 #1 substring$ "1" = + { bbl.th * } + { duplicate$ #-1 #1 substring$ + duplicate$ "1" = + { pop$ bbl.st * } + { duplicate$ "2" = + { pop$ bbl.nd * } + { "3" = + { bbl.rd * } + { bbl.th * } + if$ + } + if$ + } + if$ + } + if$ +} + +FUNCTION {bibinfo.check} +{ swap$ + duplicate$ missing$ + { + pop$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ pop$ + } + { swap$ + pop$ + } + if$ + } + if$ +} + +FUNCTION {bibinfo.warn} +{ swap$ + duplicate$ missing$ + { + swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ "empty " swap$ * " in " * cite$ * warning$ + } + { swap$ + pop$ + } + if$ + } + if$ +} + +STRINGS { bibinfo} +INTEGERS { nameptr namesleft numnames } + +FUNCTION {format.names} +{ 'bibinfo := + duplicate$ empty$ 'skip$ { + "." ". " find.replace 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv~}{ll}{ f{}}{ jj}" + format.name$ + remove.dots + bibinfo bibinfo.check + 't := + nameptr #1 > + { + nameptr #6 + #1 + = + numnames #6 + > and + { "others" 't := + #1 'namesleft := } + 'skip$ + if$ + namesleft #1 > + { ", " * t * } + { + "," * + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal * + } + { " " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } if$ +} + +FUNCTION {format.names.org} +{ 'bibinfo := + duplicate$ empty$ 'skip$ { + 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{ff~}{vv~}{ll}" + format.name$ + bibinfo bibinfo.check + 't := + nameptr #1 > + { + namesleft #1 > + { "; " * t * } + { + ";" * + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal * + } + { " " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } if$ +} + +FUNCTION {format.names.ed} +{ + format.names +} + +FUNCTION {format.authors} +{ + author "author" format.names + %%"." " " "author" find.replace format.names +} + +FUNCTION {format.organizations} +{ organization "organization" format.names.org +} + +FUNCTION {get.bbl.editor} +{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } + +FUNCTION {get.bbl.cartographer} +{ cartographer num.names$ #1 > 'bbl.cartographers 'bbl.cartographer if$ } + +FUNCTION {get.bbl.inventor} +{ inventor num.names$ #1 > 'bbl.inventors 'bbl.inventor if$ } + +FUNCTION {get.bbl.assignee} +{ assignee num.names$ #1 > 'bbl.assignees 'bbl.assignee if$ } + +FUNCTION {format.editors} +{ editor "editor" format.names duplicate$ empty$ 'skip$ + { + "," * + " " * + get.bbl.editor + * + } + if$ +} + +FUNCTION {format.assignees} +{ assignee "assignee" format.names.org duplicate$ empty$ 'skip$ + { + "," * + " " * + get.bbl.assignee + * + } + if$ +} + +FUNCTION {format.cartographers} +{ cartographer "cartographer" format.names duplicate$ empty$ 'skip$ + { + "," * + " " * + get.bbl.cartographer + * + } + if$ +} + +FUNCTION {format.inventors} +{ inventor "inventor" format.names duplicate$ empty$ 'skip$ + { + "," * + " " * + get.bbl.inventor + * + } + if$ +} + +FUNCTION {format.note} +{ + note empty$ + { "" } + { note #1 #1 substring$ + duplicate$ "{" = + 'skip$ + { output.state mid.sentence = + { "l" } + { "u" } + if$ + change.case$ + } + if$ + note #2 global.max$ substring$ * "note" bibinfo.check + } + if$ +} + +FUNCTION {format.title} +{ title +%%duplicate$ empty$ 'skip$ +%% { "t" change.case$ } +%%if$ + "title" bibinfo.check +} + +FUNCTION {format.type} +{ type empty$ + 'skip$ + { inbrackets type } + %%{ add.blank "[" type * "]" * } + if$ +} + +FUNCTION {cite.author.editor} +{ 's := + s #1 "{vv~}{ll}" format.name$ + s num.names$ duplicate$ + #2 > + { pop$ " et~al." * } + { #2 = + { s #2 "{vv~}{ll}{ jj}{ f}" format.name$ "others" = + { " et~al." * } + { " and " * s #2 "{vv~}{ll}" format.name$ * } + if$ + } + 'skip$ + 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} + if$ +} + +FUNCTION {output.bibitem} +{ outside.brackets 'bracket.state := % urlbst + newline$ + "\bibitem[\protect\citeauthoryear{" write$ +check.auth.edit.org write$ +"}{" write$ check.year write$ "}]{" write$ cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {n.dashify} +{ + 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {word.in} +{ bbl.in capitalize + ":" * + " " * } + +FUNCTION {format.journal.date} +{ + month "month" bibinfo.check + duplicate$ empty$ + year "year" bibinfo.check duplicate$ empty$ + { + swap$ 'skip$ + { "there's a month but no year in " cite$ * warning$ } + if$ + * + } + { swap$ 'skip$ + { + " " * swap$ + } + if$ + * + remove.dots + } + if$ + duplicate$ empty$ + 'skip$ + { + before.all 'output.state := + after.sentence 'output.state := + } + if$ +} + +FUNCTION {format.date} +{ + no.blank.or.punct + ";" + duplicate$ empty$ + year "year" bibinfo.check duplicate$ empty$ + { swap$ 'skip$ + { "there's a month but no year in " cite$ * warning$ } + if$ + * + } + { swap$ 'skip$ + { + swap$ + " " * swap$ + } + if$ + * + } + if$ +} + +FUNCTION {format.btitle} +{ title "title" bibinfo.check + duplicate$ empty$ 'skip$ + { + } + if$ +} + +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} + +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { bbl.volume volume tie.or.space.prefix + "volume" bibinfo.check * * + series "series" bibinfo.check + duplicate$ empty$ 'pop$ + { swap$ bbl.of space.word * swap$ + emphasize * } + if$ + "volume and number" number either.or.check + } + if$ +} + +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { series empty$ + { number "number" bibinfo.check } + { output.state mid.sentence = + { bbl.number } + { bbl.number capitalize } + if$ + number tie.or.space.prefix "number" bibinfo.check * * + bbl.in space.word * + series "series" bibinfo.check * + } + if$ + } + if$ + } + { "" } + if$ +} + +FUNCTION {is.num} +{ chr.to.int$ + duplicate$ "0" chr.to.int$ < not + swap$ "9" chr.to.int$ > not and +} + +FUNCTION {extract.num} +{ duplicate$ 't := + "" 's := + { t empty$ not } + { t #1 #1 substring$ + t #2 global.max$ substring$ 't := + duplicate$ is.num + { s swap$ * 's := } + { pop$ "" 't := } + if$ + } + while$ + s empty$ + 'skip$ + { pop$ s } + if$ +} + +FUNCTION {convert.edition} +{ extract.num "l" change.case$ 's := + s "first" = s "1" = or + { bbl.first 't := } + { s "second" = s "2" = or + { bbl.second 't := } + { s "third" = s "3" = or + { bbl.third 't := } + { s "fourth" = s "4" = or + { bbl.fourth 't := } + { s "fifth" = s "5" = or + { bbl.fifth 't := } + { s #1 #1 substring$ is.num + { s eng.ord 't := } + { edition 't := } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + t +} + +FUNCTION {format.edition} +{ edition duplicate$ empty$ 'skip$ + { + convert.edition + output.state mid.sentence = + { "l" } + { "t" } + if$ change.case$ + "edition" bibinfo.check + " " * bbl.edition * + } + if$ +} +INTEGERS { multiresult } +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} + +FUNCTION {format.pages} +{ pages duplicate$ empty$ 'skip$ + { duplicate$ multi.page.check + { + bbl.pages swap$ + n.dashify + } + { + bbl.page swap$ + } + if$ + tie.or.space.prefix + "pages" bibinfo.check + * * + } + if$ +} + +FUNCTION {format.journal.pages} +{ pages duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ + { pop$ pop$ format.pages } + { + ":" * + swap$ + n.dashify + "pages" bibinfo.check + * + } + if$ + } + if$ +} + +FUNCTION {format.vol.num} +{ volume field.or.null + duplicate$ empty$ 'skip$ + { + "volume" bibinfo.check + } + if$ + number "number" bibinfo.check duplicate$ empty$ 'skip$ + { + swap$ duplicate$ empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + swap$ + "(" swap$ * ")" * + } + if$ * +} + +FUNCTION {format.vol.num.pages} +{ volume field.or.null + duplicate$ empty$ 'skip$ + { + "volume" bibinfo.check + } + if$ + number "number" bibinfo.check duplicate$ empty$ 'skip$ + { + swap$ duplicate$ empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + swap$ + "(" swap$ * ")" * + } + if$ * + format.journal.pages +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { bbl.chapter } + { type "l" change.case$ + "type" bibinfo.check + } + if$ + chapter tie.or.space.prefix + "chapter" bibinfo.check + * * + pages empty$ + 'skip$ + { ", " * format.pages * } + if$ + } + if$ + } + + FUNCTION {format.booktitle} + { + booktitle "booktitle" bibinfo.check + } + + FUNCTION {format.in.ed.booktitle} + { format.booktitle duplicate$ empty$ 'skip$ + { + editor "editor" format.names.ed duplicate$ empty$ 'pop$ + { + "," * + " " * + get.bbl.editor + ". " * + * swap$ + * } + if$ + word.in swap$ * + } + if$ + } + + FUNCTION {format.in.ed.title} + { format.title duplicate$ empty$ 'skip$ + { + editor "editor" format.names.ed duplicate$ empty$ 'pop$ + { + "," * + " " * + get.bbl.editor + ". " * + * swap$ + * } + if$ + word.in swap$ * + } + 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 duplicate$ empty$ + 'pop$ + { swap$ pop$ + "t" change.case$ "type" bibinfo.check + } + if$ +} +FUNCTION {format.tr.number} +{ + number "number" bibinfo.check + %%type duplicate$ empty$ + %%{ pop$ bbl.techrep } + %%'skip$ + %%if$ + %%"type" bibinfo.check + %%swap$ duplicate$ empty$ + %%{ pop$ "t" change.case$ } + %%{ tie.or.space.prefix * * } + %%if$ +} + +FUNCTION {format.org.or.pub} +{ 't := + "" + address empty$ t empty$ and + 'skip$ + { + address "address" bibinfo.check * + t empty$ + 'skip$ + { address empty$ + 'skip$ + { ": " * } + if$ + t * + } + if$ + } + if$ +} + +FUNCTION {format.publisher.address} +{ publisher "publisher" bibinfo.warn format.org.or.pub +} + +FUNCTION {format.organization.address} +{ organization "organization" bibinfo.check format.org.or.pub +} + +FUNCTION {format.institution.address} +{ institution "institution" bibinfo.check format.org.or.pub +} + + +% urlbst... +% Functions for making hypertext links. +% In all cases, the stack has (link-text href-url) +% +% make 'null' specials +FUNCTION {make.href.null} +{ + pop$ +} +% make hypertex specials +FUNCTION {make.href.hypertex} +{ + "\special {html: }" * swap$ * + "\special {html:}" * +} +% make hyperref specials +FUNCTION {make.href.hyperref} +{ + "\href {" swap$ * "} {" * swap$ * "}" * +} +FUNCTION {make.href} +{ hrefform #2 = + 'make.href.hyperref % hrefform = 2 + { hrefform #1 = + 'make.href.hypertex % hrefform = 1 + 'make.href.null % hrefform = 0 (or anything else) + if$ + } + if$ +} + +FUNCTION {format.url} +{ url empty$ + { "" } + { hrefform #1 = + { % special case -- add HyperTeX specials + urlintro "\url{" url * "}" * url make.href.hypertex * } + { urlintro "\url{" * url * "}" * } + if$ + } + if$ +} + +FUNCTION {format.eprint} +{ eprint empty$ + { "" } + { eprintprefix eprint * eprinturl eprint * make.href } + if$ +} + +FUNCTION {format.doi} +{ doi empty$ + { "" } + { doiprefix doi * doiurl doi * make.href } + if$ +} + +FUNCTION {format.ddoi} +{ doi "doi" bibinfo.check + duplicate$ empty$ 'skip$ + { + "\doi{" swap$ * "}" * + } + if$ +} + +% Output a URL. We can't use the more normal idiom (something like +% `format.url output'), because the `inbrackets' within +% format.lastchecked applies to everything between calls to `output', +% so that `format.url format.lastchecked * output' ends up with both +% the URL and the lastchecked in brackets. +FUNCTION {output.url} +{ url empty$ + 'skip$ + { new.block + format.url output + format.lastchecked output + } + if$ +} + +FUNCTION {output.web.refs} +{ + new.block + output.url + addeprints eprint empty$ not and + { format.eprint output.nonnull } + 'skip$ + if$ + adddoiresolver doi empty$ not and + { format.doi output.nonnull } + 'skip$ + if$ +% addeprints +% { eprint empty$ +% 'skip$ +% { format.eprint output.nonnull } +% if$ +% } +% 'skip$ +% if$ +} + +% Webpage entry type. +% Title and url fields required; +% author, note, year, month, and lastchecked fields optional +STRINGS {database} +FUNCTION {webpage} +{ output.bibitem + author empty$ + { editor empty$ + 'skip$ % author and editor both optional + { format.editors output.nonnull } + if$ + } + { editor empty$ + { format.authors output.nonnull } + { "can't use both author and editor fields in " cite$ * warning$ } + if$ + } + if$ +% author empty$ +% 'skip$ +% { format.authors output.nonnull } +% if$ + new.block + format.title "title" output.check + journal empty$ + { + format.type "type" output.check + publisher empty$ + 'skip$ + { format.publisher.address output } + if$ + "database on the Internet" 'database := + type database = + { format.journal.date "year" output.check } + { format.date "year" output.check } + if$ + lastchecked empty$ + 'skip$ + { format.lastchecked output } + if$ + new.block + part empty$ + 'skip$ + { part output } + if$ + pages empty$ + 'skip$ + { pages bracket.check output } + if$ + } + { journal + remove.dots + "journal" bibinfo.check + "journal" output.check + format.type "type" output.check + format.journal.date "year" output.check + lastchecked empty$ + 'skip$ + { format.lastchecked output + ";" no.blank.or.punct output + } + if$ + no.blank.or.punct format.vol.num output + pages empty$ + 'skip$ + { ":" no.blank.or.punct output + no.blank.or.punct pages bracket.check output + } + if$ + new.block + } + if$ + format.url "url" output.check + new.block + note output + fin.entry +} +% ...urlbst to here + +FUNCTION {misc} +{ output.bibitem + format.authors "author" output.check + format.editors "author and editor" output.check + no.blank.or.punct + add.period$ misc.add.colon +format.title "title" output.check + type missing$ + { skip$ } + { format.type "type" output.check } + %%{ inbrackets type output } + if$ + new.block + format.publisher.address output +% format.date "year" output.check + new.block + format.note output + new.block + howpublished new.block.checka + howpublished "howpublished" bibinfo.check output + output.web.refs % urlbst + fin.entry + empty.misc.check +} + +FUNCTION {format.archive} +{ + archivePrefix empty$ + { "" } + { archivePrefix ":" *} + if$ +} + +FUNCTION {format.primaryClass} +{ + primaryClass empty$ + { "" } + { "{[" primaryClass * "]}" *} + if$ +} + +FUNCTION {format.soft.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {format.softmisc.archive} +{ + archivePrefix empty$ + { "" } + { "" } + if$ +} + +FUNCTION {format.softmisc.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + organization empty$ + 'skip$ + { author empty$ + { + format.organizations "organization" output.check + } + { + "; " * + no.blank.or.punct + format.organizations "organization" output.check + } + if$ + } + if$ + new.block + format.title "title" output.check + type missing$ + { skip$ } + { format.type "type" output.check } + if$ + new.block + journal + remove.dots + "journal" bibinfo.check + "journal" output.check + format.journal.date "year" output.check + add.semicolon + format.vol.num.pages output + new.block + format.note output + format.ddoi output + new.block + format.soft.eprint output + format.primaryClass output + fin.entry +} + +FUNCTION {softmisc} +{ output.bibitem + format.authors "author" output.check + format.editors "author and editor" output.check + no.blank.or.punct + add.period$ misc.add.colon + format.title "title" output.check misc.add.comma + no.blank.or.punct + version output + type missing$ + { skip$ } + { format.type "type" output.check } + %%{ inbrackets type output } + if$ + new.block + format.publisher.address output +% format.date "year" output.check + new.block + format.note output + new.block + howpublished new.block.checka + howpublished "howpublished" bibinfo.check output + format.date "year" output.check + output.web.refs % urlbst + new.block + format.softmisc.eprint output + fin.entry + empty.misc.check +} + +FUNCTION {book} +{ output.bibitem + author empty$ + { editor empty$ + { format.organizations "organization" output.check } + { format.editors "author and editor" output.check } + if$ + } + { format.authors output.nonnull + "author and editor" editor either.or.check + } + if$ + new.block + format.btitle "title" output.check + format.bvolume output + new.block + format.edition output + new.sentence + author empty$ not + editor empty$ not + and + { format.editors "author and editor" output.check } + 'skip$ + if$ + format.number.series output + format.publisher.address output + format.date "year" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {booklet} +{ misc } + +FUNCTION {dictionary} +{ output.bibitem + format.booktitle "booktitle" output.check + format.bvolume output + new.block + format.edition output + new.sentence + format.publisher.address output + format.date "year" output.check + format.btitle "title" output.check + add.semicolon + add.blank + format.pages "pages" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {inbook} +{ output.bibitem + format.authors "author" output.check + new.block + chapter "chapter" output.check + new.block + format.in.ed.title "title" output.check + format.bvolume output + format.edition output + new.sentence + format.number.series output + format.publisher.address output + format.date "year" output.check + date.block + add.blank + format.pages "pages" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.edition output + new.sentence + format.number.series output + format.publisher.address output + format.date "year" output.check + date.block + add.blank + format.pages "pages" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + format.in.ed.booktitle "booktitle" output.check + format.bvolume output + new.sentence + format.number.series output + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + format.date "year" output.check + date.block + add.blank + format.pages "pages" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {conference} +{inproceedings} + +FUNCTION {manual} +{misc} + +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" output.check + new.block + format.btitle + "title" output.check + format.type "type" output.check + new.block + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.date "year" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {mastersthesis} +{phdthesis} + +FUNCTION {proceedings} +{ output.bibitem + editor empty$ + { organization "organization" bibinfo.check output + } + { format.editors output.nonnull } + if$ + new.block + format.btitle "title" output.check + format.bvolume output + editor empty$ + { publisher empty$ + 'skip$ + { + new.sentence + format.number.series output + format.publisher.address output + } + if$ + } + { publisher empty$ + { + new.sentence + format.organization.address output } + { + new.sentence + organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + } + if$ + format.date "year" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check + new.block + format.title + "title" output.check + new.block + format.institution.address output + format.date "year" output.check + format.tr.number output.nonnull + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {map} +{ output.bibitem + format.cartographers "cartographer" output.check + new.block + format.title + "title" output.check + format.type "type" output.check + new.block + format.publisher.address output + format.date "year" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {patent} +{ output.bibitem + format.inventors "inventor" output.check + "; " * + no.blank.or.punct + format.assignees "assignee" output.check + new.block + format.title + "title" output.check + new.block + format.tr.number output.nonnull + format.date "year" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + format.date output + new.block + format.note "note" output.check + output.web.refs % urlbst + fin.entry +} + +FUNCTION {default.type} { misc } +READ +STRINGS { longest.label } +INTEGERS { number.label longest.label.width } +FUNCTION {initialize.longest.label} +{ "" 'longest.label := + #1 'number.label := + #0 'longest.label.width := +} +FUNCTION {longest.label.pass} +{ number.label int.to.str$ 'label := + number.label #1 + 'number.label := + label width$ longest.label.width > + { label 'longest.label := + label width$ 'longest.label.width := + } + 'skip$ + if$ +} +EXECUTE {initialize.longest.label} +ITERATE {longest.label.pass} +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" longest.label * "}" * + write$ newline$ + "\providecommand{\doi}[1]{\url{https://doi.org/#1}}" + write$ newline$ + "\bibcommenthead" write$ newline$ +} +EXECUTE {begin.bib} +EXECUTE {init.config.constants} +EXECUTE {init.state.consts} +ITERATE {call.type$} +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} +EXECUTE {end.bib} +%% End of customized bst file +%% +%% End of file `vancouver.bst'. + diff --git a/papers/preprint/sn-article-template/empty.eps b/papers/preprint/sn-article-template/empty.eps new file mode 100644 index 000000000..d216d5b70 --- /dev/null +++ b/papers/preprint/sn-article-template/empty.eps @@ -0,0 +1,80 @@ +%!PS-Adobe-3.0 +%%Pages: (atend) +%%BoundingBox: 0 0 115 87 +%%HiResBoundingBox: 0.563794 0.527295 114.418213 86.036206 +%........................................... +%%Creator: GNU Ghostscript 653 (pswrite) +%%CreationDate: 2002/07/10 13:09:14 +%%DocumentData: Clean7Bit +%%LanguageLevel: 2 +%%EndComments +%%BeginProlog +% This copyright applies to everything between here and the %%EndProlog: +% Copyright (C) 2002 artofcode LLC, Benicia, CA. All rights reserved. +%%BeginResource: procset GS_pswrite_2_0_1001 +/GS_pswrite_2_0_1001 80 dict dup begin +/PageSize 2 array def/setpagesize{ PageSize aload pop 3 index eq exch +4 index eq and{ pop pop pop}{ PageSize dup 1 +5 -1 roll put 0 4 -1 roll put dup where{ exch get exec} +{ pop/setpagedevice where +{ pop 1 dict dup /PageSize PageSize put setpagedevice} +{ /setpage where{ pop PageSize aload pop pageparams 3 {exch pop} repeat +setpage}if}ifelse}ifelse}ifelse} bind def +/!{bind def}bind def/#{load def}!/N/counttomark # +/rG{3{3 -1 roll 255 div}repeat setrgbcolor}!/G{255 div setgray}!/K{0 G}! +/r6{dup 3 -1 roll rG}!/r5{dup 3 1 roll rG}!/r3{dup rG}! +/w/setlinewidth #/J/setlinecap # +/j/setlinejoin #/M/setmiterlimit #/d/setdash #/i/setflat # +/m/moveto #/l/lineto #/c/rcurveto # +/p{N 2 idiv{N -2 roll rlineto}repeat}! +/P{N 0 gt{N -2 roll moveto p}if}! +/h{p closepath}!/H{P closepath}! +/lx{0 rlineto}!/ly{0 exch rlineto}!/v{0 0 6 2 roll c}!/y{2 copy c}! +/re{4 -2 roll m exch dup lx exch ly neg lx h}! +/^{3 index neg 3 index neg}! +/f{P fill}!/f*{P eofill}!/s{H stroke}!/S{P stroke}! +/q/gsave #/Q/grestore #/rf{re fill}! +/Y{P clip newpath}!/Y*{P eoclip newpath}!/rY{re Y}! +/|={pop exch 4 1 roll 3 array astore cvx exch 1 index def exec}! +/|{exch string readstring |=}! +/+{dup type/nametype eq{2 index 7 add -3 bitshift 2 index mul}if}! +/@/currentfile #/${+ @ |}! +/B{{2 copy string{readstring pop}aload pop 4 array astore cvx +3 1 roll}repeat pop pop true}! +/Ix{[1 0 0 1 11 -2 roll exch neg exch neg]exch}! +/,{true exch Ix imagemask}!/If{false exch Ix imagemask}!/I{exch Ix image}! +/Ic{exch Ix false 3 colorimage}! +/F{/Columns counttomark 3 add -2 roll/Rows exch/K -1/BlackIs1 true>> +/CCITTFaxDecode filter}!/FX{< + +\usepackage{graphicx}% +\usepackage{multirow}% +\usepackage{amsmath,amssymb,amsfonts}% +\usepackage{amsthm}% +\usepackage{mathrsfs}% +\usepackage[title]{appendix}% +\usepackage{xcolor}% +\usepackage{textcomp}% +\usepackage{manyfoot}% +\usepackage{booktabs}% +\usepackage{algorithm}% +\usepackage{algorithmicx}% +\usepackage{algpseudocode}% +\usepackage{listings}% +%%%% + +%%%%%=============================================================================%%%% +%%%% Remarks: This template is provided to aid authors with the preparation +%%%% of original research articles intended for submission to journals published +%%%% by Springer Nature. The guidance has been prepared in partnership with +%%%% production teams to conform to Springer Nature technical requirements. +%%%% Editorial and presentation requirements differ among journal portfolios and +%%%% research disciplines. You may find sections in this template are irrelevant +%%%% to your work and are empowered to omit any such section if allowed by the +%%%% journal you intend to submit to. The submission guidelines and policies +%%%% of the journal take precedence. A detailed User Manual is available in the +%%%% template package for technical guidance. +%%%%%=============================================================================%%%% + +%\jyear{2021}% + +%% as per the requirement new theorem styles can be included as shown below +\theoremstyle{thmstyleone}% +\newtheorem{theorem}{Theorem}% meant for continuous numbers +%%\newtheorem{theorem}{Theorem}[section]% meant for sectionwise numbers +%% optional argument [theorem] produces theorem numbering sequence instead of independent numbers for Proposition +\newtheorem{proposition}[theorem]{Proposition}% +%%\newtheorem{proposition}{Proposition}% to get separate numbers for theorem and proposition etc. + +\theoremstyle{thmstyletwo}% +\newtheorem{example}{Example}% +\newtheorem{remark}{Remark}% + +\theoremstyle{thmstylethree}% +\newtheorem{definition}{Definition}% + +\raggedbottom +%%\unnumbered% uncomment this for unnumbered level heads + +\begin{document} + +\title[Article Title]{Article Title} + +%%=============================================================%% +%% Prefix -> \pfx{Dr} +%% GivenName -> \fnm{Joergen W.} +%% Particle -> \spfx{van der} -> surname prefix +%% FamilyName -> \sur{Ploeg} +%% Suffix -> \sfx{IV} +%% NatureName -> \tanm{Poet Laureate} -> Title after name +%% Degrees -> \dgr{MSc, PhD} +%% \author*[1,2]{\pfx{Dr} \fnm{Joergen W.} \spfx{van der} \sur{Ploeg} \sfx{IV} \tanm{Poet Laureate} +%% \dgr{MSc, PhD}}\email{iauthor@gmail.com} +%%=============================================================%% + +\author*[1,2]{\fnm{First} \sur{Author}}\email{iauthor@gmail.com} + +\author[2,3]{\fnm{Second} \sur{Author}}\email{iiauthor@gmail.com} +\equalcont{These authors contributed equally to this work.} + +\author[1,2]{\fnm{Third} \sur{Author}}\email{iiiauthor@gmail.com} +\equalcont{These authors contributed equally to this work.} + +\affil*[1]{\orgdiv{Department}, \orgname{Organization}, \orgaddress{\street{Street}, \city{City}, \postcode{100190}, \state{State}, \country{Country}}} + +\affil[2]{\orgdiv{Department}, \orgname{Organization}, \orgaddress{\street{Street}, \city{City}, \postcode{10587}, \state{State}, \country{Country}}} + +\affil[3]{\orgdiv{Department}, \orgname{Organization}, \orgaddress{\street{Street}, \city{City}, \postcode{610101}, \state{State}, \country{Country}}} + +%%==================================%% +%% sample for unstructured abstract %% +%%==================================%% + +\abstract{The abstract serves both as a general introduction to the topic and as a brief, non-technical summary of the main results and their implications. Authors are advised to check the author instructions for the journal they are submitting to for word limits and if structural elements like subheadings, citations, or equations are permitted.} + +%%================================%% +%% Sample for structured abstract %% +%%================================%% + +% \abstract{\textbf{Purpose:} The abstract serves both as a general introduction to the topic and as a brief, non-technical summary of the main results and their implications. The abstract must not include subheadings (unless expressly permitted in the journal's Instructions to Authors), equations or citations. As a guide the abstract should not exceed 200 words. Most journals do not set a hard limit however authors are advised to check the author instructions for the journal they are submitting to. +% +% \textbf{Methods:} The abstract serves both as a general introduction to the topic and as a brief, non-technical summary of the main results and their implications. The abstract must not include subheadings (unless expressly permitted in the journal's Instructions to Authors), equations or citations. As a guide the abstract should not exceed 200 words. Most journals do not set a hard limit however authors are advised to check the author instructions for the journal they are submitting to. +% +% \textbf{Results:} The abstract serves both as a general introduction to the topic and as a brief, non-technical summary of the main results and their implications. The abstract must not include subheadings (unless expressly permitted in the journal's Instructions to Authors), equations or citations. As a guide the abstract should not exceed 200 words. Most journals do not set a hard limit however authors are advised to check the author instructions for the journal they are submitting to. +% +% \textbf{Conclusion:} The abstract serves both as a general introduction to the topic and as a brief, non-technical summary of the main results and their implications. The abstract must not include subheadings (unless expressly permitted in the journal's Instructions to Authors), equations or citations. As a guide the abstract should not exceed 200 words. Most journals do not set a hard limit however authors are advised to check the author instructions for the journal they are submitting to.} + +\keywords{keyword1, Keyword2, Keyword3, Keyword4} + +%%\pacs[JEL Classification]{D8, H51} + +%%\pacs[MSC Classification]{35A01, 65L10, 65L12, 65L20, 65L70} + +\maketitle + +\section{Introduction}\label{sec1} + +The Introduction section, of referenced text \cite{bib1} expands on the background of the work (some overlap with the Abstract is acceptable). The introduction should not include subheadings. + +Springer Nature does not impose a strict layout as standard however authors are advised to check the individual requirements for the journal they are planning to submit to as there may be journal-level preferences. When preparing your text please also be aware that some stylistic choices are not supported in full text XML (publication version), including coloured font. These will not be replicated in the typeset article if it is accepted. + +\section{Results}\label{sec2} + +Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. + +\section{This is an example for first level head---section head}\label{sec3} + +\subsection{This is an example for second level head---subsection head}\label{subsec2} + +\subsubsection{This is an example for third level head---subsubsection head}\label{subsubsec2} + +Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. + +\section{Equations}\label{sec4} + +Equations in \LaTeX\ can either be inline or on-a-line by itself (``display equations''). For +inline equations use the \verb+$...$+ commands. E.g.: The equation +$H\psi = E \psi$ is written via the command \verb+$H \psi = E \psi$+. + +For display equations (with auto generated equation numbers) +one can use the equation or align environments: +\begin{equation} +\|\tilde{X}(k)\|^2 \leq\frac{\sum\limits_{i=1}^{p}\left\|\tilde{Y}_i(k)\right\|^2+\sum\limits_{j=1}^{q}\left\|\tilde{Z}_j(k)\right\|^2 }{p+q}.\label{eq1} +\end{equation} +where, +\begin{align} +D_\mu &= \partial_\mu - ig \frac{\lambda^a}{2} A^a_\mu \nonumber \\ +F^a_{\mu\nu} &= \partial_\mu A^a_\nu - \partial_\nu A^a_\mu + g f^{abc} A^b_\mu A^a_\nu \label{eq2} +\end{align} +Notice the use of \verb+\nonumber+ in the align environment at the end +of each line, except the last, so as not to produce equation numbers on +lines where no equation numbers are required. The \verb+\label{}+ command +should only be used at the last line of an align environment where +\verb+\nonumber+ is not used. +\begin{equation} +Y_\infty = \left( \frac{m}{\textrm{GeV}} \right)^{-3} + \left[ 1 + \frac{3 \ln(m/\textrm{GeV})}{15} + + \frac{\ln(c_2/5)}{15} \right] +\end{equation} +The class file also supports the use of \verb+\mathbb{}+, \verb+\mathscr{}+ and +\verb+\mathcal{}+ commands. As such \verb+\mathbb{R}+, \verb+\mathscr{R}+ +and \verb+\mathcal{R}+ produces $\mathbb{R}$, $\mathscr{R}$ and $\mathcal{R}$ +respectively (refer Subsubsection~\ref{subsubsec2}). + +\section{Tables}\label{sec5} + +Tables can be inserted via the normal table and tabular environment. To put +footnotes inside tables you should use \verb+\footnotetext[]{...}+ tag. +The footnote appears just below the table itself (refer Tables~\ref{tab1} and \ref{tab2}). +For the corresponding footnotemark use \verb+\footnotemark[...]+ + +\begin{table}[h] +\caption{Caption text}\label{tab1}% +\begin{tabular}{@{}llll@{}} +\toprule +Column 1 & Column 2 & Column 3 & Column 4\\ +\midrule +row 1 & data 1 & data 2 & data 3 \\ +row 2 & data 4 & data 5\footnotemark[1] & data 6 \\ +row 3 & data 7 & data 8 & data 9\footnotemark[2] \\ +\botrule +\end{tabular} +\footnotetext{Source: This is an example of table footnote. This is an example of table footnote.} +\footnotetext[1]{Example for a first table footnote. This is an example of table footnote.} +\footnotetext[2]{Example for a second table footnote. This is an example of table footnote.} +\end{table} + +\noindent +The input format for the above table is as follows: + +%%=============================================%% +%% For presentation purpose, we have included %% +%% \bigskip command. please ignore this. %% +%%=============================================%% +\bigskip +\begin{verbatim} +\begin{table}[] +\caption{}\label{}% +\begin{tabular}{@{}llll@{}} +\toprule +Column 1 & Column 2 & Column 3 & Column 4\\ +\midrule +row 1 & data 1 & data 2 & data 3 \\ +row 2 & data 4 & data 5\footnotemark[1] & data 6 \\ +row 3 & data 7 & data 8 & data 9\footnotemark[2]\\ +\botrule +\end{tabular} +\footnotetext{Source: This is an example of table footnote. +This is an example of table footnote.} +\footnotetext[1]{Example for a first table footnote. +This is an example of table footnote.} +\footnotetext[2]{Example for a second table footnote. +This is an example of table footnote.} +\end{table} +\end{verbatim} +\bigskip +%%=============================================%% +%% For presentation purpose, we have included %% +%% \bigskip command. please ignore this. %% +%%=============================================%% + +\begin{table}[h] +\caption{Example of a lengthy table which is set to full textwidth}\label{tab2} +\begin{tabular*}{\textwidth}{@{\extracolsep\fill}lcccccc} +\toprule% +& \multicolumn{3}{@{}c@{}}{Element 1\footnotemark[1]} & \multicolumn{3}{@{}c@{}}{Element 2\footnotemark[2]} \\\cmidrule{2-4}\cmidrule{5-7}% +Project & Energy & $\sigma_{calc}$ & $\sigma_{expt}$ & Energy & $\sigma_{calc}$ & $\sigma_{expt}$ \\ +\midrule +Element 3 & 990 A & 1168 & $1547\pm12$ & 780 A & 1166 & $1239\pm100$\\ +Element 4 & 500 A & 961 & $922\pm10$ & 900 A & 1268 & $1092\pm40$\\ +\botrule +\end{tabular*} +\footnotetext{Note: This is an example of table footnote. This is an example of table footnote this is an example of table footnote this is an example of~table footnote this is an example of table footnote.} +\footnotetext[1]{Example for a first table footnote.} +\footnotetext[2]{Example for a second table footnote.} +\end{table} + +\vfill\eject + +In case of double column layout, tables which do not fit in single column width should be set to full text width. For this, you need to use \verb+\begin{table*}+ \verb+...+ \verb+\end{table*}+ instead of \verb+\begin{table}+ \verb+...+ \verb+\end{table}+ environment. Lengthy tables which do not fit in textwidth should be set as rotated table. For this, you need to use \verb+\begin{sidewaystable}+ \verb+...+ \verb+\end{sidewaystable}+ instead of \verb+\begin{table*}+ \verb+...+ \verb+\end{table*}+ environment. This environment puts tables rotated to single column width. For tables rotated to double column width, use \verb+\begin{sidewaystable*}+ \verb+...+ \verb+\end{sidewaystable*}+. + +\begin{sidewaystable} +\caption{Tables which are too long to fit, should be written using the ``sidewaystable'' environment as shown here}\label{tab3} +\begin{tabular*}{\textheight}{@{\extracolsep\fill}lcccccc} +\toprule% +& \multicolumn{3}{@{}c@{}}{Element 1\footnotemark[1]}& \multicolumn{3}{@{}c@{}}{Element\footnotemark[2]} \\\cmidrule{2-4}\cmidrule{5-7}% +Projectile & Energy & $\sigma_{calc}$ & $\sigma_{expt}$ & Energy & $\sigma_{calc}$ & $\sigma_{expt}$ \\ +\midrule +Element 3 & 990 A & 1168 & $1547\pm12$ & 780 A & 1166 & $1239\pm100$ \\ +Element 4 & 500 A & 961 & $922\pm10$ & 900 A & 1268 & $1092\pm40$ \\ +Element 5 & 990 A & 1168 & $1547\pm12$ & 780 A & 1166 & $1239\pm100$ \\ +Element 6 & 500 A & 961 & $922\pm10$ & 900 A & 1268 & $1092\pm40$ \\ +\botrule +\end{tabular*} +\footnotetext{Note: This is an example of table footnote this is an example of table footnote this is an example of table footnote this is an example of~table footnote this is an example of table footnote.} +\footnotetext[1]{This is an example of table footnote.} +\end{sidewaystable} + +\section{Figures}\label{sec6} + +As per the \LaTeX\ standards you need to use eps images for \LaTeX\ compilation and \verb+pdf/jpg/png+ images for \verb+PDFLaTeX+ compilation. This is one of the major difference between \LaTeX\ and \verb+PDFLaTeX+. Each image should be from a single input .eps/vector image file. Avoid using subfigures. The command for inserting images for \LaTeX\ and \verb+PDFLaTeX+ can be generalized. The package used to insert images in \verb+LaTeX/PDFLaTeX+ is the graphicx package. Figures can be inserted via the normal figure environment as shown in the below example: + +%%=============================================%% +%% For presentation purpose, we have included %% +%% \bigskip command. please ignore this. %% +%%=============================================%% +\bigskip +\begin{verbatim} +\begin{figure}[] +\centering +\includegraphics{} +\caption{}\label{} +\end{figure} +\end{verbatim} +\bigskip +%%=============================================%% +%% For presentation purpose, we have included %% +%% \bigskip command. please ignore this. %% +%%=============================================%% + +\begin{figure}[h]% +\centering +\includegraphics[width=0.9\textwidth]{fig.eps} +\caption{This is a widefig. This is an example of long caption this is an example of long caption this is an example of long caption this is an example of long caption}\label{fig1} +\end{figure} + +In case of double column layout, the above format puts figure captions/images to single column width. To get spanned images, we need to provide \verb+\begin{figure*}+ \verb+...+ \verb+\end{figure*}+. + +For sample purpose, we have included the width of images in the optional argument of \verb+\includegraphics+ tag. Please ignore this. + +\section{Algorithms, Program codes and Listings}\label{sec7} + +Packages \verb+algorithm+, \verb+algorithmicx+ and \verb+algpseudocode+ are used for setting algorithms in \LaTeX\ using the format: + +%%=============================================%% +%% For presentation purpose, we have included %% +%% \bigskip command. please ignore this. %% +%%=============================================%% +\bigskip +\begin{verbatim} +\begin{algorithm} +\caption{}\label{} +\begin{algorithmic}[1] +. . . +\end{algorithmic} +\end{algorithm} +\end{verbatim} +\bigskip +%%=============================================%% +%% For presentation purpose, we have included %% +%% \bigskip command. please ignore this. %% +%%=============================================%% + +You may refer above listed package documentations for more details before setting \verb+algorithm+ environment. For program codes, the ``verbatim'' package is required and the command to be used is \verb+\begin{verbatim}+ \verb+...+ \verb+\end{verbatim}+. + +Similarly, for \verb+listings+, use the \verb+listings+ package. \verb+\begin{lstlisting}+ \verb+...+ \verb+\end{lstlisting}+ is used to set environments similar to \verb+verbatim+ environment. Refer to the \verb+lstlisting+ package documentation for more details. + +A fast exponentiation procedure: + +\lstset{texcl=true,basicstyle=\small\sf,commentstyle=\small\rm,mathescape=true,escapeinside={(*}{*)}} +\begin{lstlisting} +begin + for $i:=1$ to $10$ step $1$ do + expt($2,i$); + newline() od (*\textrm{Comments will be set flush to the right margin}*) +where +proc expt($x,n$) $\equiv$ + $z:=1$; + do if $n=0$ then exit fi; + do if odd($n$) then exit fi; + comment: (*\textrm{This is a comment statement;}*) + $n:=n/2$; $x:=x*x$ od; + { $n>0$ }; + $n:=n-1$; $z:=z*x$ od; + print($z$). +end +\end{lstlisting} + +\begin{algorithm} +\caption{Calculate $y = x^n$}\label{algo1} +\begin{algorithmic}[1] +\Require $n \geq 0 \vee x \neq 0$ +\Ensure $y = x^n$ +\State $y \Leftarrow 1$ +\If{$n < 0$}\label{algln2} + \State $X \Leftarrow 1 / x$ + \State $N \Leftarrow -n$ +\Else + \State $X \Leftarrow x$ + \State $N \Leftarrow n$ +\EndIf +\While{$N \neq 0$} + \If{$N$ is even} + \State $X \Leftarrow X \times X$ + \State $N \Leftarrow N / 2$ + \Else[$N$ is odd] + \State $y \Leftarrow y \times X$ + \State $N \Leftarrow N - 1$ + \EndIf +\EndWhile +\end{algorithmic} +\end{algorithm} + +%%=============================================%% +%% For presentation purpose, we have included %% +%% \bigskip command. please ignore this. %% +%%=============================================%% +\bigskip +\begin{minipage}{\hsize}% +\lstset{frame=single,framexleftmargin=-1pt,framexrightmargin=-17pt,framesep=12pt,linewidth=0.98\textwidth,language=pascal}% Set your language (you can change the language for each code-block optionally) +%%% Start your code-block +\begin{lstlisting} +for i:=maxint to 0 do +begin +{ do nothing } +end; +Write('Case insensitive '); +Write('Pascal keywords.'); +\end{lstlisting} +\end{minipage} + +\section{Cross referencing}\label{sec8} + +Environments such as figure, table, equation and align can have a label +declared via the \verb+\label{#label}+ command. For figures and table +environments use the \verb+\label{}+ command inside or just +below the \verb+\caption{}+ command. You can then use the +\verb+\ref{#label}+ command to cross-reference them. As an example, consider +the label declared for Figure~\ref{fig1} which is +\verb+\label{fig1}+. To cross-reference it, use the command +\verb+Figure \ref{fig1}+, for which it comes up as +``Figure~\ref{fig1}''. + +To reference line numbers in an algorithm, consider the label declared for the line number 2 of Algorithm~\ref{algo1} is \verb+\label{algln2}+. To cross-reference it, use the command \verb+\ref{algln2}+ for which it comes up as line~\ref{algln2} of Algorithm~\ref{algo1}. + +\subsection{Details on reference citations}\label{subsec7} + +Standard \LaTeX\ permits only numerical citations. To support both numerical and author-year citations this template uses \verb+natbib+ \LaTeX\ package. For style guidance please refer to the template user manual. + +Here is an example for \verb+\cite{...}+: \cite{bib1}. Another example for \verb+\citep{...}+: \citep{bib2}. For author-year citation mode, \verb+\cite{...}+ prints Jones et al. (1990) and \verb+\citep{...}+ prints (Jones et al., 1990). + +All cited bib entries are printed at the end of this article: \cite{bib3}, \cite{bib4}, \cite{bib5}, \cite{bib6}, \cite{bib7}, \cite{bib8}, \cite{bib9}, \cite{bib10}, \cite{bib11}, \cite{bib12} and \cite{bib13}. + +\section{Examples for theorem like environments}\label{sec10} + +For theorem like environments, we require \verb+amsthm+ package. There are three types of predefined theorem styles exists---\verb+thmstyleone+, \verb+thmstyletwo+ and \verb+thmstylethree+ + +%%=============================================%% +%% For presentation purpose, we have included %% +%% \bigskip command. please ignore this. %% +%%=============================================%% +\bigskip +\begin{tabular}{|l|p{19pc}|} +\hline +\verb+thmstyleone+ & Numbered, theorem head in bold font and theorem text in italic style \\\hline +\verb+thmstyletwo+ & Numbered, theorem head in roman font and theorem text in italic style \\\hline +\verb+thmstylethree+ & Numbered, theorem head in bold font and theorem text in roman style \\\hline +\end{tabular} +\bigskip +%%=============================================%% +%% For presentation purpose, we have included %% +%% \bigskip command. please ignore this. %% +%%=============================================%% + +For mathematics journals, theorem styles can be included as shown in the following examples: + +\begin{theorem}[Theorem subhead]\label{thm1} +Example theorem text. Example theorem text. Example theorem text. Example theorem text. Example theorem text. +Example theorem text. Example theorem text. Example theorem text. Example theorem text. Example theorem text. +Example theorem text. +\end{theorem} + +Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. + +\begin{proposition} +Example proposition text. Example proposition text. Example proposition text. Example proposition text. Example proposition text. +Example proposition text. Example proposition text. Example proposition text. Example proposition text. Example proposition text. +\end{proposition} + +Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. + +\begin{example} +Phasellus adipiscing semper elit. Proin fermentum massa +ac quam. Sed diam turpis, molestie vitae, placerat a, molestie nec, leo. Maecenas lacinia. Nam ipsum ligula, eleifend +at, accumsan nec, suscipit a, ipsum. Morbi blandit ligula feugiat magna. Nunc eleifend consequat lorem. +\end{example} + +Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. + +\begin{remark} +Phasellus adipiscing semper elit. Proin fermentum massa +ac quam. Sed diam turpis, molestie vitae, placerat a, molestie nec, leo. Maecenas lacinia. Nam ipsum ligula, eleifend +at, accumsan nec, suscipit a, ipsum. Morbi blandit ligula feugiat magna. Nunc eleifend consequat lorem. +\end{remark} + +Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. + +\begin{definition}[Definition sub head] +Example definition text. Example definition text. Example definition text. Example definition text. Example definition text. Example definition text. Example definition text. Example definition text. +\end{definition} + +Additionally a predefined ``proof'' environment is available: \verb+\begin{proof}+ \verb+...+ \verb+\end{proof}+. This prints a ``Proof'' head in italic font style and the ``body text'' in roman font style with an open square at the end of each proof environment. + +\begin{proof} +Example for proof text. Example for proof text. Example for proof text. Example for proof text. Example for proof text. Example for proof text. Example for proof text. Example for proof text. Example for proof text. Example for proof text. +\end{proof} + +Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. Sample body text. + +\begin{proof}[Proof of Theorem~{\upshape\ref{thm1}}] +Example for proof text. Example for proof text. Example for proof text. Example for proof text. Example for proof text. Example for proof text. Example for proof text. Example for proof text. Example for proof text. Example for proof text. +\end{proof} + +\noindent +For a quote environment, use \verb+\begin{quote}...\end{quote}+ +\begin{quote} +Quoted text example. Aliquam porttitor quam a lacus. Praesent vel arcu ut tortor cursus volutpat. In vitae pede quis diam bibendum placerat. Fusce elementum +convallis neque. Sed dolor orci, scelerisque ac, dapibus nec, ultricies ut, mi. Duis nec dui quis leo sagittis commodo. +\end{quote} + +Sample body text. Sample body text. Sample body text. Sample body text. Sample body text (refer Figure~\ref{fig1}). Sample body text. Sample body text. Sample body text (refer Table~\ref{tab3}). + +\section{Methods}\label{sec11} + +Topical subheadings are allowed. Authors must ensure that their Methods section includes adequate experimental and characterization data necessary for others in the field to reproduce their work. Authors are encouraged to include RIIDs where appropriate. + +\textbf{Ethical approval declarations} (only required where applicable) Any article reporting experiment/s carried out on (i)~live vertebrate (or higher invertebrates), (ii)~humans or (iii)~human samples must include an unambiguous statement within the methods section that meets the following requirements: + +\begin{enumerate}[1.] +\item Approval: a statement which confirms that all experimental protocols were approved by a named institutional and/or licensing committee. Please identify the approving body in the methods section + +\item Accordance: a statement explicitly saying that the methods were carried out in accordance with the relevant guidelines and regulations + +\item Informed consent (for experiments involving humans or human tissue samples): include a statement confirming that informed consent was obtained from all participants and/or their legal guardian/s +\end{enumerate} + +If your manuscript includes potentially identifying patient/participant information, or if it describes human transplantation research, or if it reports results of a clinical trial then additional information will be required. Please visit (\url{https://www.nature.com/nature-research/editorial-policies}) for Nature Portfolio journals, (\url{https://www.springer.com/gp/authors-editors/journal-author/journal-author-helpdesk/publishing-ethics/14214}) for Springer Nature journals, or (\url{https://www.biomedcentral.com/getpublished/editorial-policies\#ethics+and+consent}) for BMC. + +\section{Discussion}\label{sec12} + +Discussions should be brief and focused. In some disciplines use of Discussion or `Conclusion' is interchangeable. It is not mandatory to use both. Some journals prefer a section `Results and Discussion' followed by a section `Conclusion'. Please refer to Journal-level guidance for any specific requirements. + +\section{Conclusion}\label{sec13} + +Conclusions may be used to restate your hypothesis or research question, restate your major findings, explain the relevance and the added value of your work, highlight any limitations of your study, describe future directions for research and recommendations. + +In some disciplines use of Discussion or 'Conclusion' is interchangeable. It is not mandatory to use both. Please refer to Journal-level guidance for any specific requirements. + +\backmatter + +\bmhead{Supplementary information} + +If your article has accompanying supplementary file/s please state so here. + +Authors reporting data from electrophoretic gels and blots should supply the full unprocessed scans for key as part of their Supplementary information. This may be requested by the editorial team/s if it is missing. + +Please refer to Journal-level guidance for any specific requirements. + +\bmhead{Acknowledgments} + +Acknowledgments are not compulsory. Where included they should be brief. Grant or contribution numbers may be acknowledged. + +Please refer to Journal-level guidance for any specific requirements. + +\section*{Declarations} + +Some journals require declarations to be submitted in a standardised format. Please check the Instructions for Authors of the journal to which you are submitting to see if you need to complete this section. If yes, your manuscript must contain the following sections under the heading `Declarations': + +\begin{itemize} +\item Funding +\item Conflict of interest/Competing interests (check journal-specific guidelines for which heading to use) +\item Ethics approval +\item Consent to participate +\item Consent for publication +\item Availability of data and materials +\item Code availability +\item Authors' contributions +\end{itemize} + +\noindent +If any of the sections are not relevant to your manuscript, please include the heading and write `Not applicable' for that section. + +%%===================================================%% +%% For presentation purpose, we have included %% +%% \bigskip command. please ignore this. %% +%%===================================================%% +\bigskip +\begin{flushleft}% +Editorial Policies for: + +\bigskip\noindent +Springer journals and proceedings: \url{https://www.springer.com/gp/editorial-policies} + +\bigskip\noindent +Nature Portfolio journals: \url{https://www.nature.com/nature-research/editorial-policies} + +\bigskip\noindent +\textit{Scientific Reports}: \url{https://www.nature.com/srep/journal-policies/editorial-policies} + +\bigskip\noindent +BMC journals: \url{https://www.biomedcentral.com/getpublished/editorial-policies} +\end{flushleft} + +\begin{appendices} + +\section{Section title of first appendix}\label{secA1} + +An appendix contains supplementary information that is not an essential part of the text itself but which may be helpful in providing a more comprehensive understanding of the research problem or it is information that is too cumbersome to be included in the body of the paper. + +%%=============================================%% +%% For submissions to Nature Portfolio Journals %% +%% please use the heading ``Extended Data''. %% +%%=============================================%% + +%%=============================================================%% +%% Sample for another appendix section %% +%%=============================================================%% + +%% \section{Example of another appendix section}\label{secA2}% +%% Appendices may be used for helpful, supporting or essential material that would otherwise +%% clutter, break up or be distracting to the text. Appendices can consist of sections, figures, +%% tables and equations etc. + +\end{appendices} + +%%===========================================================================================%% +%% If you are submitting to one of the Nature Portfolio journals, using the eJP submission %% +%% system, please include the references within the manuscript file itself. You may do this %% +%% by copying the reference list from your .bbl file, paste it into the main manuscript .tex %% +%% file, and delete the associated \verb+\bibliography+ commands. %% +%%===========================================================================================%% + +\bibliography{sn-bibliography}% common bib file +%% if required, the content of .bbl file can be included here once bbl is generated +%%\input sn-article.bbl + + +\end{document} diff --git a/papers/preprint/sn-article-template/sn-bibliography.bib b/papers/preprint/sn-article-template/sn-bibliography.bib new file mode 100644 index 000000000..22a998eb1 --- /dev/null +++ b/papers/preprint/sn-article-template/sn-bibliography.bib @@ -0,0 +1,163 @@ +%% Journal article +@article{bib1, + author = "Campbell, S. L. and Gear, C. W.", + title = "The index of general nonlinear {D}{A}{E}{S}", + journal = "Numer. {M}ath.", + volume = "72", + number = "2", + pages = "173--196", + year = "1995" +} + +%% Journal article with DOI +@article{bib2, + author = "Slifka, M. K. and Whitton, J. L.", + title = "Clinical implications of dysregulated cytokine production", + journal = "J. {M}ol. {M}ed.", + volume = "78", + pages = "74--80", + year = "2000", + doi = "10.1007/s001090000086" +} + +%% Journal article +@article{bib3, + author = "Hamburger, C.", + title = "Quasimonotonicity, regularity and duality for nonlinear systems of + partial differential equations", + journal = "Ann. Mat. Pura. Appl.", + volume = "169", + number = "2", + pages = "321--354", + year = "1995" +} + +%% book, authored +@book{bib4, + author = "Geddes, K. O. and Czapor, S. R. and Labahn, G.", + title = "Algorithms for {C}omputer {A}lgebra", + address = "Boston", + publisher = "Kluwer", + year = "1992" +} + +%% Item 8. Book, chapter +@incollection{bib5, + author = "Broy, M.", + title = "Software engineering---from auxiliary to key technologies", + editor = "Broy, M. and Denert, E.", + booktitle = "Software Pioneers", + pages = "10--13", + address = "New {Y}ork", + publisher = "Springer", + year = "1992" +} + +%% Book, edited +@book{bib6, + editor = "Seymour, R. S.", + title = "Conductive {P}olymers", + address = "New {Y}ork", + publisher = "Plenum", + year = "1981" +} + +%% Chapter in a book in a series with volume titles +@inproceedings{bib7, + author = "Smith, S. E.", + title = "Neuromuscular blocking drugs in man", + editor = "Zaimis, E.", + volume = "42", + booktitle = "Neuromuscular junction. {H}andbook of experimental pharmacology", + pages = "593--660", + address = "Heidelberg", + publisher = "Springer", + year = "1976" +} + +%% Paper presented at a conference +@misc{bib8, + author = "Chung, S. T. and Morris, R. L.", + title = "Isolation and characterization of plasmid deoxyribonucleic acid from + Streptomyces fradiae", + year = "1978", + note = "Paper presented at the 3rd international symposium on the genetics + of industrial microorganisms, University of {W}isconsin, {M}adison, + 4--9 June 1978" +} + +%% Data citation example +@misc{bib9, + author = "Hao, Z. and AghaKouchak, A. and Nakhjiri, N. and Farahmand, A.", + title = "Global integrated drought monitoring and prediction system (GIDMaPS) data sets", + year = "2014", + note = "figshare \url{https://doi.org/10.6084/m9.figshare.853801}" +} + +%% Preprint citation example +@misc{bib10, + author = "Babichev, S. A. and Ries, J. and Lvovsky, A. I.", + title = "Quantum scissors: teleportation of single-mode optical states by means + of a nonlocal single photon", + year = "2002", + note = "Preprint at \url{https://arxiv.org/abs/quant-ph/0208066v1}" +} + +@article{bib11, + author = "Beneke, M. and Buchalla, G. and Dunietz, I.", + title = "Mixing induced {CP} asymmetries in inclusive {B} decays", + journal = "Phys. {L}ett.", + volume = "B393", + year = "1997", + pages = "132-142", + archivePrefix = "arXiv", + eprint = "0707.3168", + primaryClass = "gr-gc" +} + +@softmisc{bib12, + author = "Stahl, B.", + title = "deep{SIP}: deep learning of {S}upernova {I}a {P}arameters", + version = "0.42", + keywords = "Software", + howpublished = "Astrophysics {S}ource {C}ode {L}ibrary", + year = "2020", + month = "Jun", + eid = "ascl:2006.023", + pages = "ascl:2006.023", + archivePrefix = "ascl", + eprint = "2006.023", + adsurl = "{https://ui.adsabs.harvard.edu/abs/2020ascl.soft06023S}", + adsnote = "Provided by the SAO/NASA Astrophysics Data System" +} + +@article{bib13, + author = "Abbott, T. M. C. and others", + collaboration = "DES", + title = "{Dark Energy Survey Year 1 Results: Constraints on Extended Cosmological Models from Galaxy Clustering and Weak Lensing}", + eprint = "1810.02499", + archivePrefix = "arXiv", + primaryClass = "astro-ph.CO", + reportNumber = "FERMILAB-PUB-18-507-PPD", + doi = "10.1103/PhysRevD.99.123505", + journal = "Phys. Rev. D", + volume = "99", + number = "12", + pages = "123505", + year = "2019" +} + +%%============================================================================%% +%% while using chicago reference style, both abbreviated and expanded form of %% +%% author name format is acceptable. Refer below example for expanded form %% +%%============================================================================%% + +%% author = "{Cameron, Deborah}", - single author +%% author = "{Saito, Yukio} and {Hyuga, Hiroyuki}", - double author + +%%======================================%% +%% Example for author names with suffix %% +%%======================================%% + +%% author = "{Price, R. A. Jr} and {Curry, N. {III}} and McCann, K. E. and +%% Fielding, J. L. and {Abercrombie, E. Jr}", diff --git a/papers/preprint/sn-article-template/sn-jnl.cls b/papers/preprint/sn-article-template/sn-jnl.cls new file mode 100644 index 000000000..1295f56a7 --- /dev/null +++ b/papers/preprint/sn-article-template/sn-jnl.cls @@ -0,0 +1 @@ +%% %% This is file `sn-jnl.cls', %% generated with the docstrip utility. %% %% The original source files were: %% %% classes.dtx (with options: `sn-jnl') %% %% This is a generated file. %% %% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 %% The LaTeX3 Project and any individual authors listed elsewhere %% in this file. %% %% This file was generated from file(s) of the LaTeX base system. %% -------------------------------------------------------------- %% %% It may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c %% of this license or (at your option) any later version. %% The latest version of this license is in %% http://www.latex-project.org/lppl.txt %% and version 1.3c or later is part of all distributions of LaTeX %% version 2005/12/01 or later. %% %% This file has the LPPL maintenance status "maintained". %% %% This file may only be distributed together with a copy of the LaTeX %% base system. You may however distribute the LaTeX base system without %% such generated files. %% %% The list of all files belonging to the LaTeX base distribution is %% given in the file `manifest.txt'. See also `legal.txt' for additional %% information. %% %% The list of derived (unpacked) files belonging to the distribution %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. %% \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 \~} \NeedsTeXFormat{LaTeX2e}[1995/12/01] \ProvidesClass{sn-jnl} [2019/11/18 v0.1: An authoring template for Springer Journal articles] \newif\if@restonecol \newif\if@titlepage \@titlepagefalse \newif\if@cropmarkson \@cropmarksonfalse \newif\ifDoublecol \Doublecolfalse% \newif\ifpagebody\global\pagebodyfalse% \newif\if@iicol\global\@iicolfalse% \newif\if@bibcomment\global\@bibcommentfalse% \newif\if@referee\global\@refereefalse% \newif\if@vrulerlinenumberon\global\@vrulerlinenumberonfalse% \newif\if@pdflatex\global\@pdflatexfalse% \newif\if@remarkboxon\global\@remarkboxonfalse% \newif\if@Numbered@refstyle\global\@Numbered@refstylefalse% Namedate \newif\if@Spr@basic@refstyle\global\@Spr@basic@refstylefalse% 1.Basic Springer Nature Reference Style/Chemistry Reference Style -> sn-basic.bst \newif\if@Mathphys@refstyle\global\@Mathphys@refstylefalse% 2.Math and Physical Sciences Reference Style -> sn-mathphys.bst \newif\if@APS@refstyle\global\@APS@refstylefalse% 3.American Physical Society (APS) Reference Style -> sn-APS.bst \newif\if@Vancouver@refstyle\global\@Vancouver@refstylefalse% 4.Vancouver Reference Style -> sn-vancouver.bst \newif\if@APA@refstyle\global\@APA@refstylefalse% 5.APA-based Social Sciences/Psychology Reference Style -> sn-apacite.bst \newif\if@Chicago@refstyle\global\@Chicago@refstylefalse% 6.Chicago-based Humanities Reference Style -> sn-chicago.bst \newif\if@Standard@Nature@refstyle\global\@Standard@Nature@refstylefalse% 7.Standard Nature Research Style -> sn-nature.bst \newif\if@Default@refstyle\global\@Default@refstylefalse% 8. default reference style - no bib/bst required %% Template Options \DeclareOption{a4paper}{\PassOptionsToPackage{a4}{crop}} \DeclareOption{a3paper}{\PassOptionsToClass{a3paper}{article}\PassOptionsToPackage{a3}{crop}} \DeclareOption{centre}{\PassOptionsToPackage{center}{crop}} \DeclareOption{crop}{\PassOptionsToPackage{frame}{crop}\global\@cropmarksontrue} \DeclareOption{nocrop}{\PassOptionsToPackage{off}{crop}\global\@cropmarksontrue} \DeclareOption{info}{\PassOptionsToPackage{info}{crop}} \DeclareOption{noinfo}{\PassOptionsToPackage{noinfo}{crop}} %% Classfile Options \DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse} \DeclareOption{twoside}{\@twosidetrue \@mparswitchtrue} \DeclareOption{draft}{\setlength\overfullrule{5pt}} \DeclareOption{titlepage}{\@titlepagetrue} \DeclareOption{notitlepage}{\@titlepagefalse} \DeclareOption{onecolumn}{\@twocolumnfalse} \DeclareOption{twocolumn}{\@twocolumntrue} \DeclareOption{openbib}{\let\if@openbib\iftrue} \DeclareOption{pagegrid}{\global\pagebodytrue}% \DeclareOption{iicol}{\global\@iicoltrue}% \DeclareOption{bibcomment}{\global\@bibcommenttrue}% \DeclareOption{referee}{\global\@refereetrue}% \DeclareOption{lineno}{\global\@vrulerlinenumberontrue}% \DeclareOption{pdflatex}{\global\@pdflatextrue}% \DeclareOption{remarkboxoff}{\global\@remarkboxonfalse}% \DeclareOption{sn-basic}{\global\@Spr@basic@refstyletrue}% \DeclareOption{sn-mathphys}{\global\@Mathphys@refstyletrue}% \DeclareOption{sn-aps}{\global\@APS@refstyletrue}% \DeclareOption{sn-vancouver}{\global\@Vancouver@refstyletrue}% \DeclareOption{sn-apa}{\global\@APA@refstyletrue}% \DeclareOption{sn-chicago}{\global\@Chicago@refstyletrue}% \DeclareOption{sn-nature}{\global\@Standard@Nature@refstyletrue}% \DeclareOption{default}{\global\@Default@refstyletrue}% \DeclareOption{Numbered}{\global\@Numbered@refstyletrue}% \DeclareOption{NameDate}{\global\@Numbered@refstylefalse}% %%\ExecuteOptions{twosidecrop,crop,centre,info,croppage} \ProcessOptions \LoadClass[twoside,fleqn]{article} \gdef\refereedefns{% \if@referee% \usepackage{setspace}% \doublespacing% \fi}% \refereedefns% %% General Packages Used % \AtBeginDocument{% %%\newcommand*\ExtraParaSkip{12pt}% \SetFootnoteHook{\hspace*{-8pt}}% \DeclareNewFootnote{A}[gobble]% \setlength{\skip\footinsA}{0pt}}% % %%%%%%%%%%%%%%%%%%%%%%%%%%%% Fonts & Sizes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Fonts Used %%\RequirePackage[T1]{fontenc}% % \DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}% \DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}% \DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}% \DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}% \DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}% \DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}% \DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}% \DeclareRobustCommand*\cal{\@fontswitch\relax\mathcal}% \DeclareRobustCommand*\mit{\@fontswitch\relax\mathnormal}% % \renewcommand\normalsize{% \@setfontsize\normalsize{10bp}{12bp}% \abovedisplayskip 12\p@ \@plus2\p@ \@minus1\p@ \abovedisplayshortskip \z@ \@plus3\p@% \belowdisplayshortskip 3\p@ \@plus3\p@ \@minus3\p@% \belowdisplayskip \abovedisplayskip% \let\@listi\@listI}% \normalsize% % \newcommand\medsize{% \@setfontsize\small\@xipt{13}% \abovedisplayskip 5\p@ \@plus3\p@ \@minus4\p@ \abovedisplayshortskip \z@ \@plus2\p@ \belowdisplayshortskip 3\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}% % \renewcommand\small{% \@setfontsize\small\@ixpt{11}% \abovedisplayskip 5\p@ \@plus3\p@ \@minus4\p@ \abovedisplayshortskip \z@ \@plus2\p@ \belowdisplayshortskip 3\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}% % \renewcommand\footnotesize{% \@setfontsize\footnotesize{7}{8}% \abovedisplayskip 5\p@ \@plus2\p@ \@minus4\p@ \abovedisplayshortskip \z@ \@plus\p@ \belowdisplayshortskip 3\p@ \@plus\p@ \@minus2\p@ \def\@listi{\leftmargin\leftmargini \topsep 3\p@ \@plus\p@ \@minus\p@ \parsep 2\p@ \@plus\p@ \@minus\p@ \itemsep \parsep}% \belowdisplayskip \abovedisplayskip} % \renewcommand\scriptsize{\@setfontsize\scriptsize\@ixpt\@ixpt}% \newcommand\scrisize{\@setfontsize\scrisize{9.3}{9}}% \renewcommand\tiny{\@setfontsize\tiny\@vpt\@vipt}% \renewcommand\large{\@setfontsize\large{12}{14}}% \newcommand\larg{\@setfontsize\larg{11}{13}}% \renewcommand\Large{\@setfontsize\Large{16}{18}}% \renewcommand\LARGE{\@setfontsize\LARGE\@xviipt{22}}% \renewcommand\huge{\@setfontsize\huge\@xxpt{25}}% \renewcommand\Huge{\@setfontsize\Huge\@xxvpt{30}}% % \DeclareMathSizes{\@ixpt}{\@ixpt}{7}{5}% \DeclareMathSizes{\@xpt}{\@xpt}{7}{5}% \DeclareMathSizes{\@xipt}{\@xipt}{7}{5}% % \DeclareRobustCommand*\textsubscript[1]{% \@textsubscript{\selectfont#1}}% % \def\@textsubscript#1{% {\m@th\ensuremath{_{\mbox{\fontsize\sf@size\z@#1}}}}}% % %%%%%%%%%%%%%%%%%%%%%%%%%%%% Layout Settings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %%\RequirePackage{geometry}% % \newlength\columnhsize% % %% Regular Pages (for Opening page - redefined) % \if@iicol% % %% for double column used sn-medium design trim and page size %% % \setlength\headheight{12pt}% \setlength\headsep{5.15mm}% % \setlength\columnsep{8mm}% \setlength\columnhsize{76mm}% % \setlength\maxdepth{0pt}% \setlength\footnotesep{7\p@}% \setlength{\skip\footins}{18\p@ \@plus 6\p@ \@minus 3\p@}% % \RequirePackage[% reversemp, paperwidth=210mm, paperheight=297mm, top={26mm}, headheight={12pt}, headsep={5.15mm}, text={160mm,216mm}, marginparsep=5mm, marginparwidth=12mm, bindingoffset=6mm, footskip=10.13mm,twocolumn]{geometry}% % \renewcommand\footnoterule{% \kern3\p@% \hrule \@height.2mm \@width\columnwidth% \kern5.5\p@}% % \else% %% For single column used smallcond design trim and page size %% \RequirePackage[% reversemp, paperwidth=210mm, paperheight=297mm, top={26mm}, headheight={5.5pt}, headsep={5.6mm}, text={31pc,194.25mm}, marginparsep=5mm, marginparwidth=12mm, bindingoffset=6mm, footskip=10mm]{geometry} % \setlength\maxdepth{0pt}% \setlength\columnsep{5mm}% \setlength{\marginparsep}{5mm}% \setlength{\marginparwidth}{12mm}% \setlength\footnotesep{5.75\p@}% \setlength{\skip\footins}{8\p@ \@plus 4\p@ \@minus 0\p@}% % \renewcommand\footnoterule{% \kern3\p@% \ifodd\c@page% \hrule \@height.2mm \@width\textwidth% \else% \hrule \@height.2mm \@width37mm \fi% \kern5.5\p@}% % \fi% % % \setlength\parindent{1.5em}% % \def\StepUpCounter#1{\global\advance#1by 1\relax}% \def\StepDownCounter#1{\global\advance#1by -1\relax}% % %%%%%%%%%%%%%%%%%%%%%%%%%%%% Pagination Settings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Line spacing \setlength\lineskip{1\p@}% \setlength\normallineskip{1\p@}% %%\renewcommand\baselinestretch{1.5}% \parskip=0pt% % % Page break penalties % \@lowpenalty 51 \@medpenalty 151 \@highpenalty 301 % % Disallow widows and orphans % \clubpenalty 10000 \widowpenalty 10000 % % Disable page breaks before equations, allow pagebreaks after % equations and discourage widow lines before equations. % \displaywidowpenalty 100 \predisplaypenalty 10000 \postdisplaypenalty 0 % % Set these global demerits % \doublehyphendemerits 1000000 % corresponds to badness 800 \finalhyphendemerits 1000000 % corresponds to badness 1000 % % Allow loose lines rather than overfull lines % \vbadness=9999 \tolerance=9999 % % Allow breaking the page in the middle of a paragraph % \interlinepenalty 0 % % Disallow breaking the page after a hyphenated line \brokenpenalty 10000 % % Hyphenation; don't split words into less than three characters \lefthyphenmin=3 \righthyphenmin=3 % % Float placement parameters % % The total number of floats that can be allowed on a page. \setcounter{totalnumber}{3} % % The maximum number of floats at the top and bottom of a page. \setcounter{topnumber}{5} \setcounter{bottomnumber}{5} % % The maximum part of the top or bottom of a text page that can be % occupied by floats. This is set so that at least four lines of text % fit on the page. \renewcommand\topfraction{.921} \renewcommand\bottomfraction{.921} % The minimum amount of a text page that must be occupied by text. % This should accomodate four lines of text. \renewcommand\textfraction{.13} % The minimum amount of a float page that must be occupied by floats. \renewcommand\floatpagefraction{.887} % The same parameters repeated for double column output \renewcommand\dbltopfraction{.88} \renewcommand\dblfloatpagefraction{.88} % Space between floats \setlength\floatsep{18\p@ \@plus 4\p@ \@minus 2\p@} % Space between floats and text \setlength\textfloatsep{15\p@ \@plus 4\p@ \@minus 2\p@} % Space above and below an inline figure \setlength\intextsep {18\p@ \@plus 4\p@ \@minus 2\p@} % For double column floats \setlength\dblfloatsep {20\p@ \@plus 4\p@ \@minus 2\p@} \setlength\dbltextfloatsep{15\p@ \@plus 4\p@ \@minus 2\p@} \hyphenation{Figure Figures Table Tables Equation Equations Section Sections Appendix Theorem Lemma} % %%%%%%%%%%%%%%%%%%%%%%%%%%% Math Settings %%%%%%%%%%%%%%%%%%%%%%%%%%% % %%%%%%%%%%%%%%%%%%%%%%%%%%%% For above/below spacing \def\eqnarray{% \stepcounter{equation}% \def\@currentlabel{\p@equation\theequation}% \global\@eqnswtrue \m@th \global\@eqcnt\z@ \tabskip\@centering \let\\\@eqncr $$\everycr{}\halign to\displaywidth\bgroup \hskip\@centering$\displaystyle\tabskip\z@skip{##}$\@eqnsel &\global\@eqcnt\@ne\hskip \tw@\arraycolsep \hfil${##}$\hfil &\global\@eqcnt\tw@ \hskip \tw@\arraycolsep $\displaystyle{##}$\hfil\tabskip\@centering &\global\@eqcnt\thr@@ \hb@xt@\z@\bgroup\hss##\egroup \tabskip\z@skip \cr } \def\endeqnarray{% \@@eqncr \egroup \global\advance\c@equation\m@ne $$\@ignoretrue } % %%%%%%%%%%%%%%%%%%%%%%%%%%% Titles %%%%%%%%%%%%%%%%%%%%%%%%%%% % \renewcommand\refname{References}% \renewcommand\figurename{Fig.}% defined as per springer style \renewcommand\tablename{Table}% \renewcommand\appendixname{Appendix}% \renewcommand\abstractname{Abstract}% % %%%%%%%%%%%%%%%%%%%%%%%%%%% Article Front Matter %%%%%%%%%%%%%%%%%%%%%%%%%%% % \def\raggedleft{\leftskip0pt plus 1fil\parfillskip=0pt\relax}% \def\raggedright{\rightskip0pt plus 1fil\parfillskip=0pt\relax}% \def\raggedcenter{\leftskip=0pt plus 0.5fil\rightskip=0pt plus 0.5fil% \parfillskip=0pt\let\hb=\break}% \def\titraggedcenter{\leftskip=12pt plus 0.5fil\rightskip=12pt plus 0.5fil% \parfillskip=0pt\let\hb=\break}% \def\absraggedcenter{\leftskip=24pt plus 0.5fil\rightskip=24pt plus 0.5fil% \parfillskip=0pt\let\hb=\break}% % %%% Font Def \def\Artcatfont{\reset@font\fontsize{8bp}{10bp}\selectfont}% \def\Titlefont{\reset@font\fontsize{17bp}{22.5bp}\selectfont\titraggedcenter}% \def\SubTitlefont{\reset@font\fontsize{14bp}{16.5bp}\selectfont\titraggedcenter}% \def\Authorfont{\reset@font\fontsize{12bp}{14.5bp}\selectfont\boldmath\titraggedcenter}% \def\addressfont{\reset@font\fontsize{11bp}{13.5bp}\selectfont\titraggedcenter}% \def\abstractheadfont{\reset@font\fontsize{9bp}{11bp}\bfseries\selectfont\titraggedcenter}% \def\abstractsubheadfont{\reset@font\fontsize{9bp}{11bp}\bfseries\selectfont}% \def\abstractfont{\reset@font\fontsize{9bp}{11bp}\selectfont\leftskip=24pt\rightskip=24pt\parfillskip=0pt plus 1fil}% \def\keywordfont{\reset@font\fontsize{8bp}{9.5bp}\selectfont\leftskip=24pt\rightskip=24pt plus0.5fill}% \def\historyfont{\reset@font\fontsize{8bp}{9.5bp}\selectfont\leftskip=24pt\rightskip=24pt plus0.5fill}% %% Article Type \newbox\artcatbox% \AtBeginDocument{\definecolor{artcatboxgray}{cmyk}{0.0,0.0,0.0,0.30}}% \def\articletype#1{\if!#1!\else\setbox\artcatbox\hbox{\Artcatfont\hskip1mm#1\hskip1mm}\fi% \gdef\ArtType{\fboxsep=0pt\colorbox{artcatboxgray}{\vbox to 4mm{\vfil% {\raggedright\box\artcatbox}\vfil}}}% \gdef\@ArtType{#1}}% %%\articletype{RESEARCH ARTICLE}% \articletype{}% %% Meta Info %\def\@jyear{{0000}}% %\def\jyear#1{\gdef\@jyear{#1}}% %% Article Title \renewcommand{\title}[2][]{% \gdef\@checktitle{#1}\ifx\@checktitle\empty\gdef\@title{#2}% \gdef\s@title{#2}\else\gdef\@title{#2}\gdef\s@title{#1}\fi% \markboth{\textit{\s@title}}{\textit{\s@title}}}% \def\subtitle#1{\gdef\@subtitle{#1}}\subtitle{}% %% Cross Link for Author & Address \def\jmkLabel#1{\@bsphack\protected@write\@auxout{}{\string\Newlabel{#1}{\@currentlabel}}\@esphack}% \def\Newlabel#1#2{\expandafter\xdef\csname X@#1\endcsname{#2}}% \def\jmkRef#1{\@ifundefined{X@#1}{0}{\csname X@#1\endcsname}}% %% Article Author(s) \let\sep\@empty% \let\authorsep\@empty% \newcount\aucount% \newcount\corraucount% \newcount\punctcount% % \def\artauthors{}% \newif\if@auemail% \newif\if@corauemail% % \def\au@and{\ifnum\punctcount=2\ and\else\unskip, \advance\punctcount by -1 \fi}% % \def\author{\advance\aucount by 1\@ifstar\@@corrauthor\@@author}% % \newcommand{\@@author}[2][]{\def\@authfrstarg{#1}\@corauemailfalse% \g@addto@macro\artauthors{% \ifnum\aucount=1% \global\@auemailtrue% \else% \global\@auemailfalse% \fi% \Authorfont% \def\baselinestretch{1}% \authorsep{#2}\unskip\ifx\@authfrstarg\empty\else\textsuperscript{\smash{{% \@for\@@affmark:=#1\do{\edef\affnum{\@ifundefined{X@\@@affmark}{\@@affmark}{\jmkRef{\@@affmark}}}% \unskip\sep\affnum\let\sep=,}}}}\fi% \def\authorsep{{\au@and} }%%% \global\let\sep\@empty\global\let\@corref\@empty% }}% % \newcommand{\@@corrauthor}[2][]{\def\@authfrstarg{#1}\@corauemailtrue\advance\corraucount by 1% \g@addto@macro\artauthors{% \global\@auemailtrue% \Authorfont% \def\baselinestretch{1}% \authorsep{#2}\unskip\ifx\@authfrstarg\empty\else\textsuperscript{\smash{{% \@for\@@affmark:=#1\do{\edef\affnum{\@ifundefined{X@\@@affmark}{\@@affmark}{\jmkRef{\@@affmark}}}% \unskip\sep\affnum\let\sep=,}}}{*}\hskip-1pt}\fi\unskip% \def\authorsep{\au@and~}%%% \global\let\sep\@empty\global\let\@corref\@empty% }}% %% %% Miscellaneous macros %% %% \def\fnm#1{\leavevmode\hbox{#1}}% \def\sur#1{\unskip~\nobreak\leavevmode\hbox{#1}}% \def\spfx#1{#1}% \def\pfx#1{#1}% \def\sfx#1{#1}% \def\tanm#1{#1}% \def\dgr#1{#1}% % %% Author Email % \let\nomail\relax% \def\corrauthemail{}% \def\authemail{}% \newcount\emailcnt% \def\email#1{\global\advance\emailcnt by 1\relax% \if@corauemail% \g@addto@macro\corrauthemail{% \setcounter{footnote}{0}% \textcolor{blue}{#1};\ % }% \else% \g@addto@macro\authemail{% \setcounter{footnote}{0}% \textcolor{blue}{#1};\ % }% \fi} %% Corrseponding Address \def\@copycorthanks{}% \def\auaddress{}% \def\@auaddress{}% \newcounter{affn}% \newcount\addcount% To check the count of address \renewcommand\theaffn{\arabic{affn}}% \def\affil{\advance\addcount by 1\@ifstar\@@coraddress\@@address}% \newcommand{\@@coraddress}[2][]{%\advance\addcount by 1 \g@addto@macro\auaddress{% \stepcounter{affn}% \xdef\@currentlabel{\theaffn}% \jmkLabel{\theaffn}% {\textsuperscript{#1*}#2.\par} } } %% Macros for present address \newif\ifpresentaddress% \def\@presentaddresstxt{}% \def\presentaddresstxt#1{\gdef\@presentaddresstxt{#1:}}\presentaddresstxt{Present Address}% \newcommand{\presentaddress}[1]{\gdef\@presentaddresstext{\@presentaddresstxt\par#1}\global\presentaddresstrue}% %% Macros for equally contributed \newif\ifequalcont% %\def\@equalconttxt{}% %\def\equalcontxt#1{\gdef\@equalconttxt{#1}}\equalcontxt{These authors contributed equally to this work.}% %\newcommand{\equalcont}[1][\@equalconttxt]{\gdef\@equalconttext{#1}\g@addto@macro\artauthors{$^{\dagger}$}\global\equalconttrue}% \def\@equalconttxt{}% \def\equalcontxt#1{\gdef\@equalconttxt{#1}}\equalcontxt{}% \newcommand{\equalcont}[1]{\gdef\@equalconttext{#1}\g@addto@macro\artauthors{$^{\dagger}$}\global\equalconttrue}% %% Author Address \newcommand{\@@address}[2][]{%%\advance\addcount by 1 \g@addto@macro\auaddress{% \stepcounter{affn}% \xdef\@currentlabel{\theaffn}% \jmkLabel{\theaffn}% {\textsuperscript{#1}#2.\par} }%\theaffn } %% Address tagging \newcommand{\orgdiv}[1]{#1}% \newcommand{\orgname}[1]{#1}% \newcommand{\orgaddress}[1]{#1}% \newcommand{\street}[1]{#1}% \newcommand{\postcode}[1]{#1}% \newcommand{\city}[1]{#1}% \newcommand{\state}[1]{#1}% \newcommand{\country}[1]{#1}% %% Article notes \def\@artnote{}% \def\artnote#1{\gdef\@artnote{#1}}% %% Miscellaneous notes \def\@miscnote{}% \def\miscnote#1{\gdef\@miscnote{\par\addvspace{3pt}#1}}% %% Motto \def\mottofont{\reset@font\fontfamily{\rmdefault}\fontsize{8.5bp}{10bp}\fontshape{it}\selectfont\raggedright} % \let\@motto\@empty \def\mottoraggedright{\rightskip0mm\leftskip=42mm plus 1fil\parfillskip=0pt\relax}% \newcommand{\motto}[2][]{\gdef\@headcheck{#1}\gdef\@motto{\@headcheck\ifx\@headcheck\@empty\vskip12pt\else\fi{\mottofont\mottoraggedright#2\par}}} %% Article Abstract \newcommand\abstracthead{\@startsection {section}{1}{\z@}{-22pt \@plus0ex \@minus0ex}{3pt}{\abstractheadfont}} \newcommand\subabstracthead{\@startsection{subsection}{2}{\z@}{3pt \@plus0ex \@minus0ex}{-.5em}{\abstractsubheadfont}} \def\@abstract{}% \long\def\abstract#1{\def\@abstract{% \let\paragraph\subabstracthead% \abstractfont% \abstracthead*{\abstractname}% #1\par}}% \def\printabstract{\ifx\@abstract\empty\else\@abstract\fi\par}% \def\printkeywords{\ifx\@keywords\empty\else\@keywords\fi\par}% % %% Keywords \def\keywordname{Keywords}% \def\keywords#1{\ifx#1\empty\else\def\@keywords{\par\addvspace{10pt}{\keywordfont{\bfseries\keywordname:} #1\par}}\fi}% \def\@keywords{}% %% PACs \def\pacsbullet{\hbox{\hskip2.5pt,\hskip2.5pt}}% \def\change@commas#1,#2{% \ifx#2\@empty% #1% \else% #1\nobreak\hbox{\pacsbullet}\allowbreak\expandafter\change@commas% \fi% #2}% \newcommand\keywordhead[1]{\par\addvspace{10pt}% {{\keywordfont\bfseries#1:\ }}}% \newcommand{\pacs}[1]{\keywordhead{\pacsname}#1}% % \newcount\PacsCount% \PacsCount=0% % \newcount\PacsTmpCnt% \PacsTmpCnt=1% % \gdef\StorePacsText#1#2{% \edef\GetRoman{\romannumeral#1}% \expandafter\gdef\csname\GetRoman StorePacsTxt\endcsname{#2}% }% % \let\oldpacs\pacs% \renewcommand\pacs[2][PAC Codes]{\gdef\pacsname{{\bfseries#1}}\gdef\@pacs{\keywordfont\raggedright\oldpacs\change@commas#2,\@empty\par} \StepUpCounter{\PacsCount}% \StorePacsText{\the\PacsCount}{\gdef\pacsname{{\bfseries#1}}\keywordfont\raggedright\oldpacs\change@commas#2,\@empty}% }% \def\@pacs{}% %% Glossary \def\gloshead{Glossary}% \newenvironment{glos}[1][\gloshead]{\begingroup\parindent=0pt% \section*{#1} \def\item[##1]{##1,\ }}{% \endgroup}% % %% Article History \def\received#1{\g@addto@macro\@history{{Received #1}}}% \def\revised#1{\g@addto@macro\@history{{; revised #1}}}% \def\accepted#1{\g@addto@macro\@history{{; accepted #1}}}% %% Remark on Front page %% \newdimen\FMremarkdim% \newcommand{\FMremark}{\begingroup\parindent=0pt\parskip=0pt% \if@referee\singlespacing\fi% \fboxsep=6pt\fboxrule=0.5pt% \FMremarkdim=\textwidth%%\paperwidth% \advance\FMremarkdim-\fboxsep% \advance\FMremarkdim-2\fboxrule% \if@referee\vskip-21pt\fi% %%\fbox{\vbox{\hsize=\FMremarkdim\small% \unvbox\fmremarkbox %%}}% \endgroup} \newbox\fmremarkbox% \newenvironment{fmremark}{\begingroup\parindent=0pt% \fboxsep=6pt\fboxrule=0.5pt% \FMremarkdim=\textwidth%%\paperwidth% \advance\FMremarkdim-\fboxsep% \advance\FMremarkdim-2\fboxrule% \global\setbox\fmremarkbox\vbox\bgroup\small% }{\egroup\endgroup} %% Article Header Definition \renewcommand{\@maketitle}{\newpage\null% \if@remarkboxon\vbox to 0pt{\vspace*{-78pt}\hspace*{-18pt}\FMremark}\else\vskip21pt\fi%%\par% \hsize\textwidth\parindent0pt%%%\vskip7pt% %% Aritle Type {\hbox to \textwidth{{\Artcatfont\ArtType\hfill}\par}} %% Aritle Title \ifx\@title\empty\else% \removelastskip\vskip20pt\nointerlineskip% {\Titlefont\@title\par} %\addcontentsline{toc}{chapter}{\@title}% for bookmarks \fi% %% Aritle SubTitle \ifx\@subtitle\empty\else% \vskip9pt% {{\SubTitlefont\@subtitle\par}} \fi% %% Aritle Authors, Address and Correspondings \ifnum\aucount>0 \global\punctcount\aucount% \vskip20pt% \artauthors\par%% authors and emails {\vskip7pt\addressfont\auaddress\par%% corresponding adress \removelastskip\vskip24pt% \ifnum\emailcnt>0\relax% \ifx\corrauthemail\@empty\else{\ifnum\aucount>1*\fi}% Corresponding author(s). E-mail(s): \corrauthemail\par\fi% \ifx\authemail\@empty\else Contributing authors:\ \authemail\fi% \fi% \ifequalcont{\par$^{\dagger}$\@equalconttext\par}\fi% \removelastskip\vskip24pt% \ifpresentaddress{\par\@presentaddresstext\par}\fi% } \fi% {\printabstract\par}% {\printkeywords\par}% \ifx\@pacs\empty\else% \loop\ifnum\PacsCount>0% \csname\romannumeral\PacsTmpCnt StorePacsTxt\endcsname\par% \StepDownCounter{\PacsCount}% \StepUpCounter{\PacsTmpCnt}% \repeat% \fi% %%{\printhistory\par}% %%{\ifx\@motto\empty\else\@motto\fi}% \removelastskip\vskip36pt\vskip0pt}% \usepackage{cuted}% \@ifpackageloaded{cuted}{\gdef\@setmarks{}}{}% %% Printing Article Header \newdimen\firstpagehtcheck \renewcommand\maketitle{\par \@afterindentfalse% \begingroup \gdef\UrlFont{\rmfamily}% \renewcommand\thefootnote{\@fnsymbol\c@footnote}% \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\smash{\@thefnmark}}}}% \long\def\@makefntext##1{\parindent 1em\noindent\small\selectfont \hbox{\@textsuperscript{\normalfont\@thefnmark}}##1}% \if@twocolumn \ifnum \col@number=\@ne% \setbox0=\vbox{\@maketitle} \firstpagehtcheck=\ht0% \advance\firstpagehtcheck by \dp0% \ifdim\firstpagehtcheck>\textheight% \setbox1=\vsplit0to2\textheight% \setbox1=\vbox{\unvbox1}% \setbox2=\vbox{\unvbox0}% \unvbox1% \stripsep=0pt% \begin{strip} \unvbox2% \end{strip} \else \twocolumn[\@maketitle]% \fi \else \@maketitle \fi% \else% \newpage% \global\@topnum\z@% Prevents figures from going at top of page. \@maketitle% \fi% \endgroup% \ifx\@artnote\@empty\else\footnoteA{\@artnote}\fi% \ifx\@miscnote\@empty\else\footnoteA{\@miscnote\par}\fi% \setcounter{footnote}{0}% \global\let\thanks\relax% \global\let\artnote\relax% \global\let\maketitle\relax% \global\let\@maketitle\relax% \global\let\@thanks\@empty% \global\let\@author\@empty% \global\let\@date\@empty% \global\let\title\relax% \global\let\author\relax% \global\let\date\relax% \global\let\and\relax% \pagestyle{headings}% %%%print continuous abstract on next page \@afterheading% %%\vskip-18pt% this is included to avoid vertical space at the beginning of left column on article opening pages }% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Page Styles %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % \def\opheaderfont{\reset@font\fontsize{10bp}{0bp}\selectfont}% \def\headerfont{\reset@font\fontsize{10bp}{0bp}\selectfont}% \def\footerfont{\reset@font\fontsize{10bp}{0bp}\selectfont}% %% Regular Page Style \def\ps@headings{% \def\@oddfoot{\hfill\thepage\hfill}% \let\@evenfoot\@oddfoot% \def\@evenhead{% \vbox to 0pt{\vspace*{-48pt}% \hbox to \hsize{\hfill \relax\hfill}}\par%% \hspace*{-\textwidth}\hbox to \hsize{\hfill}}% \def\@oddhead{% \vbox to 0pt{\vspace*{-48pt}% \hbox to \hsize{\hfill \relax\hfill}}\par%% \hspace*{-\textwidth}\hbox to \hsize{\hfill}}% \let\@mkboth\markboth% }% %\newdimen\opshortpage% %\def\printcopyright#1{#1}%% %\gdef\@copyrighttext{}% %\gdef\@copyrightyear{\@jyear}% %\def\copytext#1#2{\gdef\@copyrightyear{#2}\def\@copyrighttext{\begin{minipage}[t]{\textwidth}\footerfont\textcopyright\ #1\ \@copyrightyear\end{minipage}}} %\copytext{Springer Science+Business Media B.V.}{\@jyear}% %\def\@opjournalheader{\undef\leftmark\space\ {{(\@jyear),\ \textbf{\@jvol}:\@artid}} {\thepage{--}\pageref*{LastPage}}\\ %{\@DOI}}% %% Opening Page Style \def\ps@titlepage{% %%\def\@oddhead{\vbox{\vskip-36pt\hbox to \textwidth{\hfill\includegraphics{springer-nature-logo}\hspace*{-1pt}}}}% %%\let\@oddhead\@empty\let\@evenhead\@empty% \def\@oddhead{% \vbox to 0pt{\vspace*{-38pt}% \hbox to \hsize{\hfill \hfill}}}%% \let\@evenhead\@oddhead% \def\@oddfoot{\vbox to 18pt{\vfill\reset@font\rmfamily\hfil\thepage\hfil}}%% \def\@evenfoot{}}% \def\ps@plain{\let\@mkboth\@gobbletwo% \let\@oddhead\@empty\let\@evenhead\@empty% \def\@oddfoot{\vbox to 18pt{\vfill\reset@font\rmfamily\hfil ddd\thepage\hfil}}% \let\@evenfoot\@oddfoot}% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Sections %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \def\numbered{\setcounter{secnumdepth}{3}}% \def\unnumbered{\setcounter{secnumdepth}{0}}% \numbered%% default is numbered Sections \renewcommand\thesection {\@arabic\c@section}% \renewcommand\thesubsection {\thesection.\@arabic\c@subsection}% \renewcommand\thesubsubsection{\thesubsection.\@arabic\c@subsubsection}% \renewcommand\theparagraph {\thesubsubsection.\@arabic\c@paragraph}% \renewcommand\thesubparagraph {\theparagraph.\@arabic\c@subparagraph}% %% \def\@seccntformat#1{\csname the#1\endcsname\hskip.5em}% \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 \def\@svsechd{% #6{\hskip #3\relax \@svsec #8.}% \csname #1mark\endcsname{#7}% \addcontentsline{toc}{#1}{% \ifnum #2>\c@secnumdepth \else \protect\numberline{\csname the#1\endcsname}% \fi #7}}% \fi \@xsect{#5}} % \def\sectionfont{\reset@font\fontfamily{\rmdefault}\fontsize{14bp}{16bp}\bfseries\selectfont\raggedright\boldmath}% \def\subsectionfont{\reset@font\fontfamily{\rmdefault}\fontsize{12bp}{14bp}\bfseries\selectfont\raggedright\boldmath}% \def\subsubsectionfont{\reset@font\fontsize{11bp}{13bp}\bfseries\selectfont\raggedright\boldmath}% \def\paragraphfont{\reset@font\fontsize{10bp}{12bp}\bfseries\itshape\selectfont\raggedright}% % \def\subparagraphfont{\itshape}% \def\bmheadfont{\reset@font\fontfamily{\rmdefault}\fontsize{10bp}{12bp}\bfseries\selectfont\raggedright\boldmath}% % \renewcommand\section{\@startsection{section}{1}{\z@}% {-12pt \@plus -4pt \@minus -2pt}% {9pt}% {\sectionfont}} \renewcommand\subsection{\@startsection{subsection}{2}{\z@}% {-12pt \@plus -4pt \@minus -2pt}% {6pt}% {\subsectionfont}} \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% {-12pt \@plus -4pt \@minus -2pt}% {6pt}% {\subsubsectionfont}} \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}% {-12pt \@plus -4pt \@minus-2pt}% {3pt}% {\paragraphfont}} \renewcommand\subparagraph{\@startsection{subparagraph}{5}{\z@}% {6pt \@plus1ex \@minus.2ex}% {-1em}% {\subparagraphfont}} \newcommand\bmhead{\@startsection{subparagraph}{5}{\z@}% {6pt \@plus1ex \@minus .2ex}% {-1em}% {\bmheadfont}} % \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 {\@ssect{#3}{#4}{#5}{#6}}% {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Lists %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \newdimen\labelwidthi% \newdimen\labelwidthii% \newdimen\labelwidthiii% \newdimen\labelwidthiv% \def\normal@labelsep{0.5em}% \labelsep\normal@labelsep% \settowidth{\labelwidthi}{(iii)}% \settowidth{\labelwidthii}{(d)}% \settowidth{\labelwidthiii}{(iii)}% \settowidth{\labelwidthiv}{(M)}% \leftmargini\labelwidthi \advance\leftmargini\labelsep \leftmarginii\labelwidthii \advance\leftmarginii\labelsep \leftmarginiii\labelwidthiii \advance\leftmarginiii\labelsep \leftmarginiv\labelwidthiv \advance\leftmarginiv\labelsep \def\setleftmargin#1#2{\settowidth{\@tempdima}{#2}\labelsep\normal@labelsep \csname labelwidth#1\endcsname\@tempdima \@tempdimb\@tempdima \advance\@tempdimb\labelsep \csname leftmargin#1\endcsname\@tempdimb} \def\@listI{\leftmargin\leftmargini \labelwidth\labelwidthi \labelsep\normal@labelsep \topsep \z@ \partopsep\z@ \parsep\z@ \itemsep\z@ \listparindent 1em} \def\@listii{\leftmargin\leftmarginii \labelwidth\labelwidthii \labelsep\normal@labelsep \topsep\z@ \partopsep\z@ \parsep\z@ \itemsep\z@ \listparindent 1em} \def\@listiii{\leftmargin\leftmarginiii \labelwidth\labelwidthiii \labelsep\normal@labelsep \topsep\z@ \partopsep\z@ \parsep\z@ \itemsep\z@ \listparindent 1em} \def\@listiv{\leftmargin\leftmarginiv \labelwidth\labelwidthiv \labelsep\normal@labelsep \topsep\z@ \partopsep\z@ \parsep\z@ \itemsep\z@ \listparindent 1em} \let\@listi\@listI \@listi % \setlength \labelsep {.5em} \setlength \labelwidth{\leftmargini} \addtolength\labelwidth{-\labelsep} \@beginparpenalty -\@lowpenalty \@endparpenalty -\@lowpenalty \@itempenalty -\@lowpenalty \def\labelitemi{$\bullet$} \def\labelitemii{$\cdot$} \def\labelenumi{\theenumi.} \def\theenumi{\arabic{enumi}} \def\labelenumii{(\alph{enumii})} \def\theenumii{\alph{enumii}} \def\labelenumiii{(\roman{enumiii})}\def\theenumiii{\roman{enumiii}} \def\labelenumiv{(\Alph{enumiv})} \def\theenumiv{\Alph{enumiv}} % %%%%%%%%%%%%%%%%%%%%%%%%%%% Ordered & Unordered List %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \def\listfont{\normalsize}% % \def\enumargs{% \listfont% \leftmargini0pt% \leftmarginii0pt% \leftmarginiii0pt% \ifnum\@enumdepth=3\topsep0pt\else\ifnum\@enumdepth=2\topsep0pt\else\topsep 6pt\fi\fi% \partopsep \z@% \itemsep \z@% \parsep \z@% \labelsep 0.5em% \rightmargin \z@% \raggedright% \listparindent \parindent% \itemindent \z@}% \def\enumerate{% \@ifnextchar[{\@numerate}{\@numerate[0.]}} \def\@numerate[#1]{\par% \ifnum \@enumdepth >3 \@toodeep\else \advance\@enumdepth \@ne \edef\@enumctr{enum\romannumeral\the\@enumdepth} \list{\csname label\@enumctr\endcsname}{% \enumargs% \setlength{\leftmargin}{\csname leftmargin\romannumeral\the\@enumdepth\endcsname} \usecounter{\@enumctr} \settowidth\labelwidth{#1} \addtolength{\leftmargin}{\labelwidth} \addtolength{\leftmargin}{\labelsep} \def\makelabel##1{\hss\llap{##1}}}% \fi } \let\endenumerate\endlist %%Unnumbered list%% \def\unenumargs{% \listfont% \leftmargini\parindent% \topsep6pt% \partopsep \z@% \itemsep \z@% \parsep \z@% \labelsep 0\p@% \rightmargin \z@% \raggedright% \listparindent \parindent% \itemindent -12pt}% \def\unenumerate{% \@ifnextchar[{\@unenumerate}{\@unenumerate[0.]}} \def\@unenumerate[#1]{\par% \ifnum \@enumdepth >3 \@toodeep\else \advance\@enumdepth \@ne \edef\@enumctr{enum\romannumeral\the\@enumdepth} \list{}{% \unenumargs \setlength{\leftmargin}{\csname leftmargin\romannumeral\the\@enumdepth\endcsname} \usecounter{\@enumctr} \settowidth\labelwidth{#1} \addtolength{\leftmargin}{0pt} \addtolength{\leftmargin}{0pt} \def\makelabel##1{\hss\llap{##1}}}% \fi } \let\endunenumerate\endlist% %% bulleted list \def\itemargs{% \listfont% \leftmargini0pt% \leftmarginii0pt% \ifnum\@enumdepth=3\topsep0pt\else\ifnum\@enumdepth=2\topsep0pt\else\topsep 6pt\fi\fi% \partopsep \z@% \itemsep \z@% \parsep \z@% \labelsep 0.5em% \rightmargin \z@% \raggedright% \listparindent \z@% \itemindent \z@}% \renewcommand\labelitemi{\raise1pt\hbox{\textbullet}}% \renewcommand\labelitemii{\textendash}% \def\itemize{% \@ifnextchar[{\@itemize}{\@itemize[$\bullet$]}} \def\@itemize[#1]{\par% \ifnum \@itemdepth >3 \@toodeep\else \advance\@itemdepth \@ne \edef\@itemctr{item\romannumeral\the\@itemdepth} \list{\csname label\@itemctr\endcsname}{% \itemargs \setlength{\leftmargin}{\csname leftmargin\romannumeral\the\@itemdepth\endcsname} \settowidth\labelwidth{#1} \addtolength{\leftmargin}{\labelwidth} \addtolength{\leftmargin}{\labelsep} \def\makelabel##1{\hss \llap{##1}}}% \fi } \let\enditemize\endlist % \def\quote{\list{}{\itemindent\z@ \leftmargin 1em \rightmargin \z@}% \item[]} \let\endquote\endlist % \def\descriptionlabel#1{\hspace\labelsep \itshape #1} \def\description{\list{}{\labelwidth\z@ \leftmargin \z@ \topsep6pt\itemindent \z@ %-\leftmargin \let\makelabel\descriptionlabel}} \let\enddescription\endlist % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Float %%%%%%%%%%%%%%%%%%%%%%%%%%%% \setlength\abovecaptionskip{2.25\p@}% \setlength\belowcaptionskip{6\p@}% \setlength\arraycolsep{2\p@}% \setlength\tabcolsep{6\p@}% \setlength\arrayrulewidth{.4\p@}% \setlength\doublerulesep{2\p@}% \setlength\tabbingsep{\labelsep}% \def\fnum@figure{{\bfseries\figurename\space\thefigure}}% \def\fnum@table{{\bfseries\tablename\space\thetable}}% \def\FigName{figure}% \long\def\@makecaption#1#2{% \ifx\FigName\@captype \vskip\abovecaptionskip \@figurecaption{#1}{#2} \else \@tablecaption{#1}{#2} \vskip\belowcaptionskip \fi% } %% Figure \def\figurecaptionfont{\reset@font\fontfamily{\rmdefault}\fontsize{8}{9.5}\selectfont}% \newdimen\figwidth% \newdimen\figheight% \newdimen\sidecapwidth \newdimen\wrapcapline% \newdimen\totalwrapline% \newdimen\wraptotline% %% Figures macro \newbox\figurebox% \newbox\wrapfigcapbox \def\FIG#1#2{% \setbox\figurebox\hbox{#1}% %% Figure dimensions \figwidth\wd\figurebox% \figheight\ht\figurebox% {\parbox{\hsize}{% \centerline{\box\figurebox}% %% Caption #2}}} %% Figures caption \newbox\figcapbox \newbox\capbox \long\def\@figurecaption#1#2{{\figurecaptionfont{\bfseries#1}\hskip.7em#2\par}}% \newenvironment{unnumfigure}{\begingroup\setlength{\topsep}{12pt}% \begin{center}}{\end{center}\endgroup} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \@ifpackageloaded{booktabs}{\cmidrulewidth=.15pt}{}% % \def\tablecaptionfont{\reset@font\fontsize{8bp}{9.5bp}\selectfont}% \def\tablebodyfont{\reset@font\fontsize{8bp}{9.5bp}\selectfont}% \def\tablecolheadfont{\reset@font\fontsize{8bp}{9.5bp}\selectfont\bfseries\boldmath}% \def\tablefootnotefont{\reset@font\fontsize{8bp}{9.5bp}\selectfont}% %% Table Macro \newskip\headwidthskip% \def\tabraggedcenter{\leftskip=0pt plus 0.5fil\rightskip=0pt plus 0.5fil\parfillskip=0pt}% \newenvironment{@processtable}[4]{% \setbox4=\hbox to \hsize{\hss% \begin{minipage}[t]{#4}% \tabraggedcenter% \caption{#1}\par% {\tablebodyfont\noindent\ignorespaces#2\par}\par\vglue6pt% {\if!#3!\else{\tablefootnotefont#3}\fi}% \end{minipage}% \hss}% \box4\par}% \newcommand\TBL[3]{\begingroup% % \if!#1!\let\caption\relax\fi% % \global\setbox\temptbox=\hbox{\bgroup{\tablebodyfont#2}\egroup}% \global\tempdime\wd\temptbox% \@processtable{#1}{\global\headwidthskip=\tempdime% \vbox{#2}}{#3}{\tempdime}% \endgroup}% %% Table Caption \newbox\tabcapbox% \newbox\temptbox% \newdimen\tempdime% \newdimen\tabhtdime% \long\def\@tablecaption#1#2{% \setbox\tabcapbox\vbox{\tablecaptionfont\raggedright% {\bfseries #1}{\hskip2mm}#2\vphantom{y}\par}% \box\tabcapbox% } %% Table Column Heads \def\TCH#1{{\tablecolheadfont #1}} %% Table Footnotes \newenvironment{tablenotes}{\list{}{\setlength{\labelsep}{0pt}% \setlength{\labelwidth}{0pt}% \setlength{\leftmargin}{0pt}% \setlength{\rightmargin}{0pt}% \setlength{\topsep}{-6pt}% \setlength{\itemsep}{2pt}% \setlength{\partopsep}{0pt}% \setlength{\listparindent}{0em}% \setlength{\parsep}{0pt}}% \item\relax% }{\endlist}% \def\tnote#1{$^{#1}$}%% %% Table Rules \def\toprule{%\noalign{\vskip3pt} \noalign{\ifnum0=`}\fi \hrule \@height 0\p@ \@width 0pt \hrule \@height 0.75\p@ % <- rule height \hrule \@height 5pt \@width 0pt \futurelet\@tempa\@xhline} % Middle rule \def\midrule{\noalign{\ifnum0=`}\fi% \hrule \@height 3pt \@width 0pt \hrule \@height .5pt % <- rule height \hrule \@height 5pt \@width 0pt \futurelet \@tempa\@xhline} % Bottom rule \def\botrule{\noalign{\ifnum0=`}\fi \hrule \@height 3pt \@width 0pt \hrule \@height 0.75\p@ % <- rule height \hrule \@height 3pt \@width 0pt \futurelet\@tempa\@xhline} % \def\@@@cmidrule[#1-#2]#3#4{\global\@cmidla#1\relax \global\advance\@cmidla\m@ne \ifnum\@cmidla>0\global\let\@gtempa\@cmidrulea\else \global\let\@gtempa\@cmidruleb\fi \global\@cmidlb#2\relax \global\advance\@cmidlb-\@cmidla \global\@thisrulewidth=#3 \@setrulekerning{#4} \ifnum\@lastruleclass=\z@\vskip 3\p@\fi \ifnum0=`{\fi}\@gtempa \noalign{\ifnum0=`}\fi\futurenonspacelet\@tempa\@xcmidrule} \def\@xcmidrule{% \ifx\@tempa\cmidrule \vskip-\@thisrulewidth \global\@lastruleclass=\@ne \else \ifx\@tempa\morecmidrules \vskip \cmidrulesep \global\@lastruleclass=\@ne\else \vskip 5\p@ \global\@lastruleclass=\z@ \fi\fi \ifnum0=`{\fi}} \let\cline\cmidrule \usepackage[figuresright]{rotating}% \usepackage{threeparttable} \let\tableorg\table% \let\endtableorg\endtable% \let\sidewaystableorg\sidewaystable% \let\endsidewaystableorg\endsidewaystable% \renewenvironment{table}[1][]% {\begin{tableorg}[#1]% \begin{center} \begin{threeparttable} \tablebodyfont% \renewcommand\footnotetext[2][]{{\removelastskip\vskip3pt% \let\tablebodyfont\tablefootnotefont% \hskip0pt\if!##1!\else{\smash{$^{##1}$}}\fi##2\par}}% }{\end{threeparttable}\end{center}\end{tableorg}} \renewenvironment{sidewaystable}[1][]% {\begin{sidewaystableorg}[#1]% \begin{center} \begin{threeparttable} \tablebodyfont% \renewcommand\footnotetext[2][]{{\removelastskip\vskip3pt% \let\tablebodyfont\tablefootnotefont% \hskip0pt\if!##1!\else{\smash{$^{##1}$}}\fi##2\par}}% }{\end{threeparttable}\end{center}\end{sidewaystableorg}} %%%%%%%%%%%%%%%%%%%%%%%%%%%% Other Env. %%%%%%%%%%%%%%%%%%%%%%%%% \def\quotefont{\reset@font\fontfamily{\rmdefault}\fontsize{9}{11}\selectfont}% \renewenvironment{quote} {\list{}{\topsep=0pt\topsep6pt\leftmargin=1em\raggedright\quotefont}% \item\relax} {\endlist} % %%%%%%%%%%%%%%%%%%%%%%%%%%%% Appendix %%%%%%%%%%%%%%%%%%%%%%%%% % \newif\ifbackmatter% \newcommand{\backmatter}{\global\backmattertrue}% \usepackage[title]{appendix}% \@ifpackageloaded{appendix}{% % \renewenvironment{appendices}{% \@resets@pp \if@dotoc@pp \if@dopage@pp % both page and toc \if@chapter@pp % chapters \clear@ppage \fi \appendixpage \else % toc only \if@chapter@pp % chapters \clear@ppage \fi \addappheadtotoc \fi \else \if@dopage@pp % page only \appendixpage \fi \fi \if@chapter@pp \if@dotitletoc@pp \@redotocentry@pp{chapter} \fi \else \if@dotitletoc@pp \@redotocentry@pp{section} \fi \if@dohead@pp \def\sectionmark##1{% \if@twoside \markboth{\@formatsecmark@pp{##1}}{} \else \markright{\@formatsecmark@pp{##1}}{} \fi} \fi \if@dotitle@pp \def\sectionname{\appendixname} \def\@seccntformat##1{\@ifundefined{##1name}{}{\csname ##1name\endcsname\ }% \csname the##1\endcsname\quad} \fi \fi }{% \@ppsaveapp\@pprestoresec} %% \AtBeginDocument{% % \let\oldappendices\appendices% \let\oldendappendices\endappendices% %% \renewenvironment{appendices}{% \setcounter{figure}{0}% \setcounter{table}{0}% \setcounter{equation}{0}% %% \begin{oldappendices}% \gdef\thefigure{\@Alph\c@section\arabic{figure}}% \gdef\thetable{\@Alph\c@section\arabic{table}}% \gdef\theequation{\@Alph\c@section\arabic{equation}}% }{\end{oldappendices}} } %% }{} % %%%%%%%%%%%%%%%%%%%%%%%%%%% Article History %%%%%%%%%%%%%%%%%%%% % \def\@history{} \def\printhistory{{\par\addvspace{8pt}% \historyfont\noindent% \ifx\@history\empty\gdef\@history{Received xx xxx xxxx}\fi\@history\par}}% % %%%%%%%%%%%%%%%%%%%%%%% Footnotes %%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % \renewcommand\@makefntext[1]{% \hskip8pt{\smash{\@makefnmark}}#1} % \RequirePackage{hyperref}% %%\RequirePackage{hypcap}% \gdef\breakurldefns{% \if@pdflatex\else% \RequirePackage[hyphenbreaks]{breakurl}% % \let\href\burlalt% \fi}% \breakurldefns% % \bgroup % \catcode`\&=12\relax % \hyper@normalise\burl@addtocharlistbefore{%} % \hyper@normalise\burl@addtocharlistafter{:/.?#&_,;!=+~}%% for extra breaks in url % \egroup % \burl@defifstructure % \hypersetup{% colorlinks, breaklinks=true, plainpages=false,% citecolor=blue, linkcolor=blue, urlcolor=blue, bookmarksopen=true,% bookmarksnumbered=false,% bookmarksdepth=5% } % \AtBeginDocument{\renewcommand\UrlFont{\rmfamily}}% % \AtBeginDocument{% \@ifpackageloaded{natbib}{% \renewcommand\bibsection{% \section*{\refname}% }% }{}% }% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \pagestyle{headings}% \pagenumbering{arabic}% \sloppy% \frenchspacing% \flushbottom% %%% special parameters for TeX \adjdemerits=100 \linepenalty=100 % %%%%%%%%%%%%%%% Biography % \RequirePackage{wrapfig}% % % % \begin{wrapfigure}[12]{r}[34pt]{5cm}
\end{wrapfigure} % -- - ---- --- % [number of narrow lines] {placement} [overhang] {width of figure} \newcount\wraplines% %%\wraplines=5% % \newbox\@authorfigbox% \newskip\@authorfigboxdim% % \newskip\biofigadjskip% \biofigadjskip=0pt% % \def\authbiotextfont{\reset@font\fontsize{8bp}{9.5bp}\selectfont}% % \newenvironment{biography}[2]{\par\addvspace{11.5pt plus3.375pt minus1.6875pt}%\lineno@off% \def\author##1{{\bfseries##1}}% \if!#1!\def\@authorfig{}\else\def\@authorfig{{#1}}\fi% \setbox\@authorfigbox=\hbox{#1}% \@authorfigboxdim=\wd\@authorfigbox% \if@iicol\advance\@authorfigboxdim by -10pt\else\advance\@authorfigboxdim by -2pt\fi% \wraplines=9\fboxrule=1pt\fboxsep=6pt% \noindent{% \ifx\@authorfig\@empty\else\unskip% \begin{wrapfigure}[\wraplines]{l}[0pt]{\@authorfigboxdim}%{38.25mm}% \vskip-19pt\addvspace{\biofigadjskip}% \@authorfig% \end{wrapfigure}% \fi% {\authbiotextfont#2\par}% \par% }}{\par\addvspace{10.5pt plus3.375pt minus1.6875pt}} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Theorem %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % \@ifpackageloaded{amsthm}{% % %\let\proof\relax% %\let\endproof\relax% \def\@begintheorem#1#2[#3]{% \deferred@thm@head{\the\thm@headfont \thm@indent \@ifempty{#1}{\let\thmname\@gobble}{\let\thmname\@iden}% \@ifempty{#2}{\let\thmnumber\@gobble}{\let\thmnumber\@iden}% \@ifempty{#3}{\let\thmnote\@gobble}{\let\thmnote\@iden}% \thm@swap\swappedhead\thmhead{#1}{#2}{#3}% \the\thm@headpunct \thmheadnl % possibly a newline. \hskip\thm@headsep }% \ignorespaces } \def\@endtheorem{\endtrivlist\@endpefalse} \AtBeginDocument{% % \DeclareRobustCommand{\S}{\ifmmode\mathsection\else\textsection\fi} \DeclareSymbolFont{AMSa}{U}{msa}{m}{n}% \DeclareMathSymbol{\opensquare}{\mathord}{AMSa}{"03}% \def\qedsymbol{\ensuremath{\opensquare}}% % \newenvironment{spiproof}[1][\proofname]{\par\removelastskip%\vspace*{2pt}% \pushQED{\qed}% \small\normalfont \topsep7.5\p@\@plus7.5\p@\relax% \trivlist% \item[\hskip\labelsep% \itshape% #1\@addpunct{}]\ignorespaces% }{% \popQED\endtrivlist\@endpefalse% }% % \let\proof\spiproof\let\endproof\endspiproof% % }% % \def\thm@space@setup{% \thm@preskip=12pt% \thm@postskip=12pt} % %%%%%%%%%%%%%%%%%% StyleOne % \newtheoremstyle{thmstyleone}% Numbered {18pt plus2pt minus1pt}% Space above {18pt plus2pt minus1pt}% Space below {\small\itshape}% Body font {0pt}% Indent amount {\small\bfseries}% Theorem head font {}% Punctuation after theorem head {.5em}% Space after theorem headi {\thmname{#1}\thmnumber{\@ifnotempty{#1}{ }\@upn{#2}}% \thmnote{ {\the\thm@notefont(#3)}}}% Theorem head spec (can be left empty, meaning `normal') % \newtheoremstyle{thmstyletwo}% Numbered {18pt plus2pt minus1pt}% Space above {18pt plus2pt minus1pt}% Space below {\small\normalfont}% Body font {0pt}% Indent amount {\small\itshape}% Theorem head font {}% Punctuation after theorem head {.5em}% Space after theorem headi {\thmname{#1}\thmnumber{\@ifnotempty{#1}{ }{#2}}% \thmnote{ {\the\thm@notefont(#3)}}}% Theorem head spec (can be left empty, meaning `normal') % \newtheoremstyle{thmstylethree}% Definition {18pt plus2pt minus1pt}% Space above {18pt plus2pt minus1pt}% Space below {\small\normalfont}% Body font {0pt}% Indent amount {\small\bfseries}% Theorem head font {}% Punctuation after theorem head {.5em}% Space after theorem headi {\thmname{#1}\thmnumber{\@ifnotempty{#1}{ }\@upn{#2}}% \thmnote{ {\the\thm@notefont(#3)}}}% Theorem head spec (can be left empty, meaning `normal') % \newtheoremstyle{thmstylefour}% Proof {18pt plus2pt minus1pt}% Space above {18pt plus2pt minus1pt}% Space below {\small\normalfont}% Body font {0pt}% Indent amount {\small\itshape}% Theorem head font {}% Punctuation after theorem head {.5em}% Space after theorem headi {\global\proofthmtrue\thmname{#1} \thmnote{#3}}% Theorem head spec (can be left empty, meaning `normal') % }{} %% Macros for bibliographystyles %% % \def\bibcommenthead{\if@bibcomment\begingroup\parindent=0pt\parskip=0pt% % \removelastskip\vskip13pt\nointerlineskip% % % \vbox{\bibfont If you are submitting to one of the Nature Research journals, using the eJP % submission system, please include the references within the manuscript file itself. You may % do this by copying the reference list from your .bbl file, and pasting it into the bibliography % environment of the main manuscript .tex file.}\par% % \removelastskip\nobreak\vskip13pt\nobreak% % \endgroup\fi}% \def\bibcommenthead{}% \if@Spr@basic@refstyle% \if@Numbered@refstyle% \usepackage[numbers,sort&compress]{natbib}% \gdef\NumBib{YES}% \else% \usepackage[authoryear]{natbib}% \gdef\NumBib{NO}% \fi% \bibliographystyle{sn-basic}% \setlength{\bibsep}{1em}% \def\bibfont{\reset@font\fontfamily{\rmdefault}\normalsize\selectfont}% \fi% \if@Mathphys@refstyle% \if@Numbered@refstyle% \usepackage[numbers,sort&compress]{natbib}% \gdef\NumBib{YES}% \else% \usepackage[authoryear]{natbib}% \gdef\NumBib{NO}% \fi% \bibliographystyle{sn-mathphys}% \setlength{\bibsep}{1em}% \def\bibfont{\reset@font\fontfamily{\rmdefault}\normalsize\selectfont}% \fi% \if@APS@refstyle% \usepackage[numbers,sort&compress]{natbib}% \gdef\NumBib{YES}% \bibliographystyle{sn-APS}% \setlength{\bibsep}{1em}% \def\bibfont{\reset@font\fontfamily{\rmdefault}\normalsize\selectfont}% \fi% \if@Vancouver@refstyle% \if@Numbered@refstyle% \usepackage[numbers,sort&compress]{natbib}% \gdef\NumBib{YES}% \else% \usepackage[authoryear]{natbib}% \gdef\NumBib{NO}% \fi% \bibliographystyle{sn-vancouver}% \setlength{\bibsep}{1em}% \def\bibfont{\reset@font\fontfamily{\rmdefault}\normalsize\selectfont}% \fi% \if@APA@refstyle% \if@Numbered@refstyle% \usepackage[natbibapa]{apacite}% \gdef\NumBib{YES}% \else% \usepackage[natbibapa]{apacite}% \gdef\NumBib{NO}% \fi% \bibliographystyle{sn-apacite}% \def\refdoi#1{\urlstyle{rm}\url{#1}}% \renewcommand{\doiprefix}{}% \AtBeginDocument{% \renewcommand{\BPBI}{.}% Period between initials - command from apacite.sty }% \setlength{\bibsep}{1em}% \def\bibfont{\reset@font\fontfamily{\rmdefault}\normalsize\selectfont}% \fi% \if@Chicago@refstyle% \if@Numbered@refstyle% \usepackage[numbers,sort&compress]{natbib}% \gdef\NumBib{YES}% \else% \usepackage[authoryear]{natbib}% \gdef\NumBib{NO}% \fi% \bibliographystyle{sn-chicago}% \hypersetup{urlcolor=black,colorlinks=false,pdfborder={0 0 0}}\urlstyle{same}% \setlength{\bibsep}{1em}% \def\bibfont{\reset@font\fontfamily{\rmdefault}\normalsize\selectfont}% \fi% \if@Standard@Nature@refstyle% \usepackage[numbers,sort&compress]{natbib}% \gdef\NumBib{YES}% \bibliographystyle{sn-nature}% \setlength{\bibsep}{1em}% \def\bibfont{\reset@font\fontfamily{\rmdefault}\normalsize\selectfont}% \fi% \if@Default@refstyle% \usepackage[numbers,sort&compress]{natbib}% \gdef\NumBib{YES}% \setlength{\bibsep}{1em}% \def\bibfont{\reset@font\fontfamily{\rmdefault}\normalsize\selectfont}% \fi% \AtBeginDocument{\allowdisplaybreaks}% \def\eqnheadfont{\reset@font\fontfamily{\rmdefault}\fontsize{16}{18}\bfseries\selectfont}% \newcommand{\eqnhead}[1]{\begingroup% \begin{center} {\eqnheadfont #1}\par% \end{center} \removelastskip\vskip24pt% \thispagestyle{titlepage}%% %%\thispagestyle{empty}% \endgroup} %% Macros for border matrix %% \newif\if@borderstar \def\bordermatrix{\@ifnextchar*{% \@borderstartrue\@bordermatrix@i}{\@borderstarfalse\@bordermatrix@i*}% } \def\@bordermatrix@i*{\@ifnextchar[{\@bordermatrix@ii}{\@bordermatrix@ii[()]}} \def\@bordermatrix@ii[#1]#2{% \begingroup \m@th\@tempdima8.75\p@\setbox\z@\vbox{% \def\cr{\crcr\noalign{\kern 2\p@\global\let\cr\endline }}% \ialign {$##$\hfil\kern 2\p@\kern\@tempdima & \thinspace % \hfil $##$\hfil && \quad\hfil $##$\hfil\crcr\omit\strut % \hfil\crcr\noalign{\kern -\baselineskip}#2\crcr\omit % \strut\cr}}% \setbox\tw@\vbox{\unvcopy\z@\global\setbox\@ne\lastbox}% \setbox\tw@\hbox{\unhbox\@ne\unskip\global\setbox\@ne\lastbox}% \setbox\tw@\hbox{% $\kern\wd\@ne\kern -\@tempdima\left\@firstoftwo#1% \if@borderstar\kern2pt\else\kern -\wd\@ne\fi% \global\setbox\@ne\vbox{\box\@ne\if@borderstar\else\kern 2\p@\fi}% \vcenter{\if@borderstar\else\kern -\ht\@ne\fi% \unvbox\z@\kern-\if@borderstar2\fi\baselineskip}% \if@borderstar\kern-2\@tempdima\kern2\p@\else\,\fi\right\@secondoftwo#1 $% }\null \;\vbox{\kern\ht\@ne\box\tw@}% \endgroup } %% Macros for line numbers %% \if@vrulerlinenumberon% % \usepackage{vruler}% % %%\setvruler[][][][][][][][][] \def\linenoon{%%\definecolor{blue}{gray}{0}% \def\tiny{\normalsize\color{black}}% \setvruler[12bp][1][1][3][1][1.18\textwidth][26pt][-7pt][0.99\textheight]% for even pages: left side; for odd pages: right side; %%\linkbluecolor }% \linenoon% \def\lineno@off{\unsetvruler}% \fi% %% url macros %% \gdef\orcidlogo{% \includegraphics{Orcidlogo.eps}% }% \gdef\orcid#1{\href{#1}{\orcidlogo}}% \endinput \ No newline at end of file diff --git a/papers/preprint/sn-article-template/user-manual.pdf b/papers/preprint/sn-article-template/user-manual.pdf new file mode 100644 index 000000000..26ed210fb Binary files /dev/null and b/papers/preprint/sn-article-template/user-manual.pdf differ diff --git a/papers/preprint/sn-basic.bst b/papers/preprint/sn-basic.bst new file mode 100644 index 000000000..5072a4d9d --- /dev/null +++ b/papers/preprint/sn-basic.bst @@ -0,0 +1,1798 @@ +%% +%% This is file `spbasic.bst', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% merlin.mbs (with options: `ay,nat,seq-lab,vonx,nm-rvx,ed-rev,jnrlst,dt-beg,yr-par,yrp-x,yrpp-xsp,note-yr,jxper,jttl-rm,thtit-a,pgsep-c,num-xser,ser-vol,jnm-x,btit-rm,bt-rm,pre-pub,doi,edparxc,blk-tit,in-col,fin-bare,pp,ed,abr,mth-bare,ord,jabr,xand,eprint,url,url-blk,em-x,nfss,') +%% ---------------------------------------- +%% +%%********************************************************************************%% +%% %% +%% For Springer medical, life sciences, chemistry, geology, engineering and %% +%% computer science publications. %% +%% For use with the natbib package (see below). Default is author-year citations. %% +%% When citations are numbered, please use \usepackage[numbers]{natbib}. %% +%% %% +%%********************************************************************************%% +%% +%% Copyright 1994-2004 Patrick W Daly + % =============================================================== + % IMPORTANT NOTICE: + % This bibliographic style (bst) file has been generated from one or + % more master bibliographic style (mbs) files, listed above. + % + % This generated file can be redistributed and/or modified under the terms + % of the LaTeX Project Public License Distributed from CTAN + % archives in directory macros/latex/base/lppl.txt; either + % version 1 of the License, or any later version. + % =============================================================== + % Name and version information of the main mbs file: + % \ProvidesFile{merlin.mbs}[2004/02/09 4.13 (PWD, AO, DPC)] + % For use with BibTeX version 0.99a or later + %------------------------------------------------------------------- + % This bibliography style file is intended for texts in ENGLISH + % This is an author-year citation style bibliography. As such, it is + % non-standard LaTeX, and requires a special package file to function properly. + % Such a package is natbib.sty by Patrick W. Daly + % The form of the \bibitem entries is + % \bibitem[Jones et al.(1990)]{key}... + % \bibitem[Jones et al.(1990)Jones, Baker, and Smith]{key}... + % The essential feature is that the label (the part in brackets) consists + % of the author names, as they should appear in the citation, with the year + % in parentheses following. There must be no space before the opening + % parenthesis! + % With natbib v5.3, a full list of authors may also follow the year. + % In natbib.sty, it is possible to define the type of enclosures that is + % really wanted (brackets or parentheses), but in either case, there must + % be parentheses in the label. + % The \cite command functions as follows: + % \citet{key} ==>> Jones et al. (1990) + % \citet*{key} ==>> Jones, Baker, and Smith (1990) + % \citep{key} ==>> (Jones et al., 1990) + % \citep*{key} ==>> (Jones, Baker, and Smith, 1990) + % \citep[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2) + % \citep[e.g.][]{key} ==>> (e.g. Jones et al., 1990) + % \citep[e.g.][p. 32]{key} ==>> (e.g. Jones et al., p. 32) + % \citeauthor{key} ==>> Jones et al. + % \citeauthor*{key} ==>> Jones, Baker, and Smith + % \citeyear{key} ==>> 1990 + %--------------------------------------------------------------------- + +ENTRY + { address + archive + author + booktitle + chapter + doi + edition + editor + eid + eprint + howpublished + institution + journal + key + keywords + month + note + number + organization + pages + publisher + school + series + title + type + url + volume + year + archivePrefix + primaryClass + adsurl + adsnote + version + } + {} + { label extra.label sort.label short.list } +INTEGERS { output.state before.all mid.sentence after.sentence after.block } +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} +STRINGS { s t} +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} +FUNCTION {fin.entry} +{ duplicate$ empty$ + 'pop$ + 'write$ + if$ + newline$ +} + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} +FUNCTION {add.blank} +{ " " * before.all 'output.state := +} + +FUNCTION {no.blank.or.punct} +{ "\hspace{0pt}" * before.all 'output.state := +} + +FUNCTION {date.block} +{ + add.blank +} + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} +STRINGS {z} +FUNCTION {remove.dots} +{ 'z := + "" + { z empty$ not } + { z #1 #1 substring$ + z #2 global.max$ substring$ 'z := + duplicate$ "." = 'pop$ + { * } + if$ + } + while$ +} +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} +FUNCTION {emphasize} +{ skip$ } +FUNCTION {tie.or.space.prefix} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ +} + +FUNCTION {capitalize} +{ "u" change.case$ "t" change.case$ } + +FUNCTION {space.word} +{ " " swap$ * " " * } + % Here are the language-specific definitions for explicit words. + % Each function has a name bbl.xxx where xxx is the English word. + % The language selected here is ENGLISH +FUNCTION {bbl.and} +{ "and"} + +FUNCTION {bbl.etal} +{ "et~al" } + +FUNCTION {bbl.editors} +{ "eds" } + +FUNCTION {bbl.editor} +{ "ed" } + +FUNCTION {bbl.edby} +{ "edited by" } + +FUNCTION {bbl.edition} +{ "edn." } + +FUNCTION {bbl.volume} +{ "vol" } + +FUNCTION {bbl.of} +{ "of" } + +FUNCTION {bbl.number} +{ "no." } + +FUNCTION {bbl.nr} +{ "no." } + +FUNCTION {bbl.in} +{ "in" } + +FUNCTION {bbl.pages} +{ "pp" } + +FUNCTION {bbl.incoll.pages} +{ "p" } + +FUNCTION {bbl.page} +{ "p" } + +FUNCTION {bbl.chapter} +{ "chap" } + +FUNCTION {bbl.techrep} +{ "Tech. Rep." } + +FUNCTION {bbl.mthesis} +{ "Master's thesis" } + +FUNCTION {bbl.phdthesis} +{ "PhD thesis" } + +FUNCTION {bbl.first} +{ "1st" } + +FUNCTION {bbl.second} +{ "2nd" } + +FUNCTION {bbl.third} +{ "3rd" } + +FUNCTION {bbl.fourth} +{ "4th" } + +FUNCTION {bbl.fifth} +{ "5th" } + +FUNCTION {bbl.st} +{ "st" } + +FUNCTION {bbl.nd} +{ "nd" } + +FUNCTION {bbl.rd} +{ "rd" } + +FUNCTION {bbl.th} +{ "th" } + +MACRO {jan} {"Jan."} + +MACRO {feb} {"Feb."} + +MACRO {mar} {"Mar."} + +MACRO {apr} {"Apr."} + +MACRO {may} {"May"} + +MACRO {jun} {"Jun."} + +MACRO {jul} {"Jul."} + +MACRO {aug} {"Aug."} + +MACRO {sep} {"Sep."} + +MACRO {oct} {"Oct."} + +MACRO {nov} {"Nov."} + +MACRO {dec} {"Dec."} + +FUNCTION {eng.ord} +{ duplicate$ "1" swap$ * + #-2 #1 substring$ "1" = + { bbl.th * } + { duplicate$ #-1 #1 substring$ + duplicate$ "1" = + { pop$ bbl.st * } + { duplicate$ "2" = + { pop$ bbl.nd * } + { "3" = + { bbl.rd * } + { bbl.th * } + if$ + } + if$ + } + if$ + } + if$ +} + +MACRO {acmcs} {"ACM Comput Surv"} + +MACRO {acta} {"Acta Inf"} + +MACRO {cacm} {"Commun ACM"} + +MACRO {ibmjrd} {"IBM~J~Res Dev"} + +MACRO {ibmsj} {"IBM Syst~J"} + +MACRO {ieeese} {"IEEE Trans Softw Eng"} + +MACRO {ieeetc} {"IEEE Trans Comput"} + +MACRO {ieeetcad} + {"IEEE Trans Comput Aid Des"} + +MACRO {ipl} {"Inf Process Lett"} + +MACRO {jacm} {"J~ACM"} + +MACRO {jcss} {"J~Comput Syst Sci"} + +MACRO {scp} {"Sci Comput Program"} + +MACRO {sicomp} {"SIAM J~Comput"} + +MACRO {tocs} {"ACM Trans Comput Syst"} + +MACRO {tods} {"ACM Trans Database Syst"} + +MACRO {tog} {"ACM Trans Graphic"} + +MACRO {toms} {"ACM Trans Math Softw"} + +MACRO {toois} {"ACM Trans Office Inf Syst"} + +MACRO {toplas} {"ACM Trans Program Lang Syst"} + +MACRO {tcs} {"Theor Comput Sci"} + +FUNCTION {bibinfo.check} +{ swap$ + duplicate$ missing$ + { + pop$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ pop$ + } + { swap$ + pop$ + } + if$ + } + if$ +} +FUNCTION {bibinfo.warn} +{ swap$ + duplicate$ missing$ + { + swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ "empty " swap$ * " in " * cite$ * warning$ + } + { swap$ + pop$ + } + if$ + } + if$ +} + +FUNCTION {format.eprint} +{ eprint duplicate$ empty$ + 'skip$ + { "\eprint" + archive empty$ + 'skip$ + { "[" * archive * "]" * } + if$ + "{" * swap$ * "}" * + } + if$ +} + +FUNCTION {format.archive} +{ + archivePrefix empty$ + { "" } + { archivePrefix ":" *} + if$ +} + +FUNCTION {format.primaryClass} +{ + primaryClass empty$ + { "" } + { "{[" primaryClass * "]}" *} + if$ +} + +FUNCTION {format.soft.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://arxiv.org/abs/" eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {format.softmisc.archive} +{ + archivePrefix empty$ + { "" } + { "" } + if$ +} + +FUNCTION {format.softmisc.eprint} +{ eprint empty$ + { ""} + { archive empty$ + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + {"{\href{https://ascl.net/" format.softmisc.archive * eprint * "}" * + "{{" * format.archive * eprint * "}}}" *} + if$ + } + if$ +} + +FUNCTION {format.url} +{ url empty$ + { "" } + { "\urlprefix\url{" url * "}" * } + if$ +} + +STRINGS { bibinfo} +INTEGERS { nameptr namesleft numnames } + +FUNCTION {format.names} +{ 'bibinfo := + duplicate$ empty$ 'skip$ { + 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv~}{ll}{ f{}}{jj}" + format.name$ 't := + nameptr #1 > + { + nameptr #3 + #1 + = + numnames #3 + > and + { "others" 't := + #1 'namesleft := } + 'skip$ + if$ + namesleft #1 > + { ", " * t * } + { + "," * + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal * + } + { " " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } if$ +} + +FUNCTION {format.names.ed} +{ + format.names +} +FUNCTION {format.key} +{ empty$ + { key field.or.null } + { "" } + if$ +} + +FUNCTION {format.authors} +{ author "author" format.names +} +FUNCTION {get.bbl.editor} +{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } + +FUNCTION {format.editors} +{ editor "editor" format.names duplicate$ empty$ 'skip$ + { + " " * + get.bbl.editor + "(" swap$ * ")" * + * + } + if$ +} +FUNCTION {format.doi} +{ doi "doi" bibinfo.check + duplicate$ empty$ 'skip$ + { + "\doi{" swap$ * "}" * + } + if$ +} +FUNCTION {format.note} +{ + note empty$ + { "" } + { note #1 #1 substring$ + duplicate$ "{" = + 'skip$ + { output.state mid.sentence = + { "l" } + { "u" } + if$ + change.case$ + } + if$ + note #2 global.max$ substring$ * "note" bibinfo.check + } + if$ +} + +FUNCTION {format.title} +{ title + duplicate$ empty$ 'skip$ + { "t" change.case$ } + if$ + "title" bibinfo.check +} +FUNCTION {format.full.names} +{'s := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv~}{ll}" format.name$ + 't := + nameptr #1 > + { + namesleft #1 > + { ", " * t * } + { + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal * + } + { + numnames #2 > + { "," * } + 'skip$ + if$ + bbl.and + space.word * t * + } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {author.editor.key.full} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.full.names } + if$ + } + { author format.full.names } + if$ +} + +FUNCTION {author.key.full} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.full.names } + if$ +} + +FUNCTION {editor.key.full} +{ editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.full.names } + if$ +} + +FUNCTION {make.full.names} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.full + { type$ "proceedings" = + 'editor.key.full + 'author.key.full + if$ + } + if$ +} + +FUNCTION {output.bibitem} +{ newline$ + "\bibitem[{" write$ + label write$ + ")" make.full.names duplicate$ short.list = + { pop$ } + { * } + if$ + "}]{" * write$ + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {add.period} +{ duplicate$ empty$ + 'skip$ + { "." * add.blank } + if$ +} + +FUNCTION {if.digit} +{ duplicate$ "0" = + swap$ duplicate$ "1" = + swap$ duplicate$ "2" = + swap$ duplicate$ "3" = + swap$ duplicate$ "4" = + swap$ duplicate$ "5" = + swap$ duplicate$ "6" = + swap$ duplicate$ "7" = + swap$ duplicate$ "8" = + swap$ "9" = or or or or or or or or or +} +FUNCTION {n.separate} +{ 't := + "" + #0 'numnames := + { t empty$ not } + { t #-1 #1 substring$ if.digit + { numnames #1 + 'numnames := } + { #0 'numnames := } + if$ + t #-1 #1 substring$ swap$ * + t #-2 global.max$ substring$ 't := + numnames #5 = + { duplicate$ #1 #2 substring$ swap$ + #3 global.max$ substring$ + "," swap$ * * + } + 'skip$ + if$ + } + while$ +} +FUNCTION {n.dashify} +{ +%% n.separate + 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {word.in} +{ bbl.in capitalize + ":" * + " " * } + +FUNCTION {format.date} +{ year "year" bibinfo.check duplicate$ empty$ + { + "empty year in " cite$ * "; set to ????" * warning$ + pop$ "????" + } + 'skip$ + if$ + extra.label * + before.all 'output.state := + " (" swap$ * ")" * +} +FUNCTION {format.btitle} +{ title "title" bibinfo.check + duplicate$ empty$ 'skip$ + { + } + if$ +} +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { bbl.volume volume tie.or.space.prefix + "volume" bibinfo.check * * + series "series" bibinfo.check + duplicate$ empty$ 'pop$ + { emphasize ", " * swap$ * } + if$ + "volume and number" number either.or.check + } + if$ +} +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { series empty$ + { number "number" bibinfo.check } + { output.state mid.sentence = + { bbl.number } + { bbl.number capitalize } + if$ + number tie.or.space.prefix "number" bibinfo.check * * + bbl.in space.word * + series "series" bibinfo.check * + } + if$ + } + if$ + } + { "" } + if$ +} +FUNCTION {is.num} +{ chr.to.int$ + duplicate$ "0" chr.to.int$ < not + swap$ "9" chr.to.int$ > not and +} + +FUNCTION {extract.num} +{ duplicate$ 't := + "" 's := + { t empty$ not } + { t #1 #1 substring$ + t #2 global.max$ substring$ 't := + duplicate$ is.num + { s swap$ * 's := } + { pop$ "" 't := } + if$ + } + while$ + s empty$ + 'skip$ + { pop$ s } + if$ +} + +FUNCTION {convert.edition} +{ extract.num "l" change.case$ 's := + s "first" = s "1" = or + { bbl.first 't := } + { s "second" = s "2" = or + { bbl.second 't := } + { s "third" = s "3" = or + { bbl.third 't := } + { s "fourth" = s "4" = or + { bbl.fourth 't := } + { s "fifth" = s "5" = or + { bbl.fifth 't := } + { s #1 #1 substring$ is.num + { s eng.ord 't := } + { edition 't := } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + t +} + +FUNCTION {format.edition} +{ edition duplicate$ empty$ 'skip$ + { + convert.edition + output.state mid.sentence = + { "l" } + { "t" } + if$ change.case$ + "edition" bibinfo.check + " " * bbl.edition * + } + if$ +} +INTEGERS { multiresult } +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} +FUNCTION {format.pages} +{ pages duplicate$ empty$ 'skip$ + { duplicate$ multi.page.check + { + bbl.pages swap$ + n.dashify + } + { + bbl.page swap$ + } + if$ + tie.or.space.prefix + "pages" bibinfo.check + * * + } + if$ +} +FUNCTION {format.journal.pages} +{ pages duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ + { pop$ pop$ format.pages } + { + ":" * + swap$ + n.dashify + "pages" bibinfo.check + * + } + if$ + } + if$ +} +FUNCTION {format.journal.eid} +{ eid "eid" bibinfo.check + duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ 'skip$ + { + ":" * + } + if$ + swap$ * + } + if$ +} + +FUNCTION {format.incoll.pages} +{ pages duplicate$ empty$ 'skip$ + { duplicate$ multi.page.check + { + bbl.incoll.pages swap$ + n.dashify + } + { + bbl.page swap$ + } + if$ + tie.or.space.prefix + "pages" bibinfo.check + * * + } + if$ +} + +FUNCTION {format.incoll.chapter.pages} +{ chapter empty$ + 'format.incoll.pages + { type empty$ + { bbl.chapter } + { type "l" change.case$ + "type" bibinfo.check + } + if$ + chapter tie.or.space.prefix + "chapter" bibinfo.check + * * + pages empty$ + 'skip$ + { ", " * format.incoll.pages * } + if$ + } + if$ +} + +FUNCTION {format.vol.num.pages} +{ volume field.or.null + duplicate$ empty$ 'skip$ + { + "volume" bibinfo.check + } + if$ + number "number" bibinfo.check duplicate$ empty$ 'skip$ + { + swap$ duplicate$ empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + swap$ + "(" swap$ * ")" * + } + if$ * + eid empty$ + { format.journal.pages } + { format.journal.eid } + if$ +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { bbl.chapter } + { type "l" change.case$ + "type" bibinfo.check + } + if$ + chapter tie.or.space.prefix + "chapter" bibinfo.check + * * + pages empty$ + 'skip$ + { ", " * format.pages * } + if$ + } + if$ +} + +FUNCTION {format.booktitle} +{ + booktitle "booktitle" bibinfo.check +} +FUNCTION {format.in.ed.booktitle} +{ format.booktitle duplicate$ empty$ 'skip$ + { + editor "editor" format.names.ed duplicate$ empty$ 'pop$ + { + " " * + get.bbl.editor + "(" swap$ * ") " * + * swap$ + * } + if$ + word.in swap$ * + } + if$ +} +FUNCTION {format.thesis.type} +{ type duplicate$ empty$ + 'pop$ + { swap$ pop$ + "t" change.case$ "type" bibinfo.check + } + if$ +} +FUNCTION {format.tr.number} +{ number "number" bibinfo.check + type duplicate$ empty$ + { pop$ bbl.techrep } + 'skip$ + if$ + "type" bibinfo.check + swap$ duplicate$ empty$ + { pop$ "t" change.case$ } + { tie.or.space.prefix * * } + if$ +} +FUNCTION {format.article.crossref} +{ + word.in + " \cite{" * crossref * "}" * +} +FUNCTION {format.book.crossref} +{ volume duplicate$ empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + pop$ word.in + } + { bbl.volume + capitalize + swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word * + } + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {format.incoll.inproc.crossref} +{ + word.in + " \cite{" * crossref * "}" * +} +FUNCTION {format.org.or.pub} +{ 't := + "" + address empty$ t empty$ and + 'skip$ + { + t empty$ + { address "address" bibinfo.check * + } + { t * + address empty$ + 'skip$ + { ", " * address "address" bibinfo.check * } + if$ + } + if$ + } + if$ +} +FUNCTION {format.publisher.address} +{ publisher "publisher" bibinfo.warn format.org.or.pub +} + +FUNCTION {format.organization.address} +{ organization "organization" bibinfo.check format.org.or.pub +} + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + new.sentence + crossref missing$ + { + journal + remove.dots + "journal" bibinfo.check + "journal" output.check + add.blank + format.vol.num.pages output + } + { format.article.crossref output.nonnull + format.pages output + } + if$ + new.sentence + format.doi output + format.url output + format.note output + format.soft.eprint output + add.blank + format.primaryClass output + fin.entry +} + +FUNCTION {book} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + editor format.key output + add.blank + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + format.date "year" output.check + date.block + format.btitle "title" output.check + crossref missing$ + { format.bvolume output + format.edition output + new.sentence + format.number.series output + format.publisher.address output + } + { + new.sentence + format.book.crossref output.nonnull + } + if$ + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} +FUNCTION {booklet} +{ output.bibitem + format.authors output + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + new.sentence + howpublished "howpublished" bibinfo.check output + address "address" bibinfo.check output + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} + +FUNCTION {inbook} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + editor format.key output + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + format.date "year" output.check + date.block + format.btitle "title" output.check + crossref missing$ + { + format.bvolume output + format.edition output + format.publisher.address output + format.chapter.pages "chapter and pages" output.check + new.sentence + format.number.series output + } + { + format.chapter.pages "chapter and pages" output.check + new.sentence + format.book.crossref output.nonnull + } + if$ + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + new.sentence + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.edition output + new.sentence + format.number.series output + format.publisher.address output + format.incoll.chapter.pages output + } + { format.incoll.inproc.crossref output.nonnull + format.incoll.chapter.pages output + } + if$ + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + new.sentence + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.bvolume output + new.sentence + format.publisher.address output + } + if$ + format.number.series output + format.pages output + } + { format.incoll.inproc.crossref output.nonnull + format.pages output + } + if$ + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} +FUNCTION {conference} { inproceedings } +FUNCTION {manual} +{ output.bibitem + format.authors output + author format.key output + format.date "year" output.check + date.block + format.btitle "title" output.check + new.sentence + organization "organization" bibinfo.check output + address "address" bibinfo.check output + format.edition output + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} + +FUNCTION {mastersthesis} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title + "title" output.check + new.sentence + bbl.mthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} + +FUNCTION {misc} +{ output.bibitem + format.authors output + author format.key output + format.date "year" output.check + date.block + format.title output + new.sentence + howpublished "howpublished" bibinfo.check output + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} + +FUNCTION {insert.comma} +{ duplicate$ empty$ + 'skip$ + { ", " * add.blank } + if$ +} + +FUNCTION {softmisc} +{ output.bibitem + format.authors output + author format.key output + format.date "year" output.check + date.block + format.title output + insert.comma + version output + new.sentence + howpublished "howpublished" bibinfo.check output + format.doi output + format.url output + format.note output + format.softmisc.eprint output + fin.entry +} + +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title + "title" output.check + new.sentence + bbl.phdthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} + +FUNCTION {proceedings} +{ output.bibitem + format.editors output + editor format.key output + format.date "year" output.check + date.block + format.btitle "title" output.check + format.bvolume output + format.number.series output + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} + +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title + "title" output.check + new.sentence + format.tr.number output.nonnull + institution "institution" bibinfo.warn output + address "address" bibinfo.check output + format.doi output + format.url output + format.note output + format.eprint output + fin.entry +} + +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + format.doi output + format.url output + format.note "note" output.check + format.eprint output + fin.entry +} + +FUNCTION {default.type} { misc } +READ +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} +INTEGERS { len } +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} +FUNCTION {format.lab.names} +{ 's := + "" 't := + s #1 "{vv~}{ll}" format.name$ + s num.names$ duplicate$ + #2 > + { pop$ + " " * bbl.etal * + } + { #2 < + 'skip$ + { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { + " " * bbl.etal * + } + { bbl.and space.word * s #2 "{vv~}{ll}" format.name$ + * } + if$ + } + if$ + } + if$ +} + +FUNCTION {author.key.label} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.editor.key.label} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {editor.key.label} +{ editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ +} + +FUNCTION {calc.short.authors} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.label + { type$ "proceedings" = + 'editor.key.label + 'author.key.label + if$ + } + if$ + 'short.list := +} + +FUNCTION {calc.label} +{ calc.short.authors + short.list + "(" + * + year duplicate$ empty$ + { pop$ "????" } + 'skip$ + if$ + * + 'label := +} + +FUNCTION {sort.format.names} +{ 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{ll{ }}{ f{ }}{ jj{ }}" + format.name$ 't := + nameptr #1 > + { + " " * + namesleft #1 = t "others" = and + { "zzzzz" * } + { numnames #2 > nameptr #2 = and + { "zz" * year field.or.null * " " * } + 'skip$ + if$ + t sortify * + } + if$ + } + { t sortify * } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {sort.format.title} +{ 't := + "A " #2 + "An " #3 + "The " #4 t chop.word + chop.word + chop.word + sortify + #1 global.max$ substring$ +} +FUNCTION {author.sort} +{ author empty$ + { key empty$ + { "to sort, need author or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { author sort.format.names } + if$ +} +FUNCTION {author.editor.sort} +{ author empty$ + { editor empty$ + { key empty$ + { "to sort, need author, editor, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ + } + { author sort.format.names } + if$ +} +FUNCTION {editor.sort} +{ editor empty$ + { key empty$ + { "to sort, need editor or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ +} +FUNCTION {presort} +{ calc.label + label sortify + " " + * + type$ "book" = + type$ "inbook" = + or + 'author.editor.sort + { type$ "proceedings" = + 'editor.sort + 'author.sort + if$ + } + if$ + #1 entry.max$ substring$ + 'sort.label := + sort.label + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} + +ITERATE {presort} +SORT +STRINGS { last.label next.extra } +INTEGERS { last.extra.num number.label } +FUNCTION {initialize.extra.label.stuff} +{ #0 int.to.chr$ 'last.label := + "" 'next.extra := + #0 'last.extra.num := + #0 'number.label := +} +FUNCTION {forward.pass} +{ last.label label = + { last.extra.num #1 + 'last.extra.num := + last.extra.num int.to.chr$ 'extra.label := + } + { "a" chr.to.int$ 'last.extra.num := + "" 'extra.label := + label 'last.label := + } + if$ + number.label #1 + 'number.label := +} +FUNCTION {reverse.pass} +{ next.extra "b" = + { "a" 'extra.label := } + 'skip$ + if$ + extra.label 'next.extra := + extra.label + duplicate$ empty$ + 'skip$ + { "{\natexlab{" swap$ * "}}" * } + if$ + 'extra.label := + label extra.label * 'label := +} +EXECUTE {initialize.extra.label.stuff} +ITERATE {forward.pass} +REVERSE {reverse.pass} +FUNCTION {bib.sort.order} +{ sort.label + " " + * + year field.or.null sortify + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} +ITERATE {bib.sort.order} +SORT +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" number.label int.to.str$ * "}" * + write$ newline$ + "\providecommand{\natexlab}[1]{#1}" + write$ newline$ + "\providecommand{\url}[1]{{#1}}" + write$ newline$ + "\providecommand{\urlprefix}{URL }" + write$ newline$ + %%"\expandafter\ifx\csname urlstyle\endcsname\relax" + %%write$ newline$ + %%" \providecommand{\doi}[1]{\discretionary{}{}{}https://doi.org/#1}\else" + %%write$ newline$ + %%" \providecommand{\doi}{\discretionary{}{}{}\begingroup \urlstyle{rm}\Url}\fi" + "\providecommand{\doi}[1]{\url{https://doi.org/#1}}" + write$ newline$ + "\providecommand{\eprint}[2][]{\url{#2}}" + write$ newline$ + " \bibcommenthead " + write$ newline$ +} +EXECUTE {begin.bib} +EXECUTE {init.state.consts} +ITERATE {call.type$} +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} +EXECUTE {end.bib} +%% End of customized bst file +%% +%% End of file `spbasic.bst'. + diff --git a/papers/preprint/sn-jnl.cls b/papers/preprint/sn-jnl.cls new file mode 100644 index 000000000..1295f56a7 --- /dev/null +++ b/papers/preprint/sn-jnl.cls @@ -0,0 +1 @@ +%% %% This is file `sn-jnl.cls', %% generated with the docstrip utility. %% %% The original source files were: %% %% classes.dtx (with options: `sn-jnl') %% %% This is a generated file. %% %% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 %% The LaTeX3 Project and any individual authors listed elsewhere %% in this file. %% %% This file was generated from file(s) of the LaTeX base system. %% -------------------------------------------------------------- %% %% It may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c %% of this license or (at your option) any later version. %% The latest version of this license is in %% http://www.latex-project.org/lppl.txt %% and version 1.3c or later is part of all distributions of LaTeX %% version 2005/12/01 or later. %% %% This file has the LPPL maintenance status "maintained". %% %% This file may only be distributed together with a copy of the LaTeX %% base system. You may however distribute the LaTeX base system without %% such generated files. %% %% The list of all files belonging to the LaTeX base distribution is %% given in the file `manifest.txt'. See also `legal.txt' for additional %% information. %% %% The list of derived (unpacked) files belonging to the distribution %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. %% \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 \~} \NeedsTeXFormat{LaTeX2e}[1995/12/01] \ProvidesClass{sn-jnl} [2019/11/18 v0.1: An authoring template for Springer Journal articles] \newif\if@restonecol \newif\if@titlepage \@titlepagefalse \newif\if@cropmarkson \@cropmarksonfalse \newif\ifDoublecol \Doublecolfalse% \newif\ifpagebody\global\pagebodyfalse% \newif\if@iicol\global\@iicolfalse% \newif\if@bibcomment\global\@bibcommentfalse% \newif\if@referee\global\@refereefalse% \newif\if@vrulerlinenumberon\global\@vrulerlinenumberonfalse% \newif\if@pdflatex\global\@pdflatexfalse% \newif\if@remarkboxon\global\@remarkboxonfalse% \newif\if@Numbered@refstyle\global\@Numbered@refstylefalse% Namedate \newif\if@Spr@basic@refstyle\global\@Spr@basic@refstylefalse% 1.Basic Springer Nature Reference Style/Chemistry Reference Style -> sn-basic.bst \newif\if@Mathphys@refstyle\global\@Mathphys@refstylefalse% 2.Math and Physical Sciences Reference Style -> sn-mathphys.bst \newif\if@APS@refstyle\global\@APS@refstylefalse% 3.American Physical Society (APS) Reference Style -> sn-APS.bst \newif\if@Vancouver@refstyle\global\@Vancouver@refstylefalse% 4.Vancouver Reference Style -> sn-vancouver.bst \newif\if@APA@refstyle\global\@APA@refstylefalse% 5.APA-based Social Sciences/Psychology Reference Style -> sn-apacite.bst \newif\if@Chicago@refstyle\global\@Chicago@refstylefalse% 6.Chicago-based Humanities Reference Style -> sn-chicago.bst \newif\if@Standard@Nature@refstyle\global\@Standard@Nature@refstylefalse% 7.Standard Nature Research Style -> sn-nature.bst \newif\if@Default@refstyle\global\@Default@refstylefalse% 8. default reference style - no bib/bst required %% Template Options \DeclareOption{a4paper}{\PassOptionsToPackage{a4}{crop}} \DeclareOption{a3paper}{\PassOptionsToClass{a3paper}{article}\PassOptionsToPackage{a3}{crop}} \DeclareOption{centre}{\PassOptionsToPackage{center}{crop}} \DeclareOption{crop}{\PassOptionsToPackage{frame}{crop}\global\@cropmarksontrue} \DeclareOption{nocrop}{\PassOptionsToPackage{off}{crop}\global\@cropmarksontrue} \DeclareOption{info}{\PassOptionsToPackage{info}{crop}} \DeclareOption{noinfo}{\PassOptionsToPackage{noinfo}{crop}} %% Classfile Options \DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse} \DeclareOption{twoside}{\@twosidetrue \@mparswitchtrue} \DeclareOption{draft}{\setlength\overfullrule{5pt}} \DeclareOption{titlepage}{\@titlepagetrue} \DeclareOption{notitlepage}{\@titlepagefalse} \DeclareOption{onecolumn}{\@twocolumnfalse} \DeclareOption{twocolumn}{\@twocolumntrue} \DeclareOption{openbib}{\let\if@openbib\iftrue} \DeclareOption{pagegrid}{\global\pagebodytrue}% \DeclareOption{iicol}{\global\@iicoltrue}% \DeclareOption{bibcomment}{\global\@bibcommenttrue}% \DeclareOption{referee}{\global\@refereetrue}% \DeclareOption{lineno}{\global\@vrulerlinenumberontrue}% \DeclareOption{pdflatex}{\global\@pdflatextrue}% \DeclareOption{remarkboxoff}{\global\@remarkboxonfalse}% \DeclareOption{sn-basic}{\global\@Spr@basic@refstyletrue}% \DeclareOption{sn-mathphys}{\global\@Mathphys@refstyletrue}% \DeclareOption{sn-aps}{\global\@APS@refstyletrue}% \DeclareOption{sn-vancouver}{\global\@Vancouver@refstyletrue}% \DeclareOption{sn-apa}{\global\@APA@refstyletrue}% \DeclareOption{sn-chicago}{\global\@Chicago@refstyletrue}% \DeclareOption{sn-nature}{\global\@Standard@Nature@refstyletrue}% \DeclareOption{default}{\global\@Default@refstyletrue}% \DeclareOption{Numbered}{\global\@Numbered@refstyletrue}% \DeclareOption{NameDate}{\global\@Numbered@refstylefalse}% %%\ExecuteOptions{twosidecrop,crop,centre,info,croppage} \ProcessOptions \LoadClass[twoside,fleqn]{article} \gdef\refereedefns{% \if@referee% \usepackage{setspace}% \doublespacing% \fi}% \refereedefns% %% General Packages Used % \AtBeginDocument{% %%\newcommand*\ExtraParaSkip{12pt}% \SetFootnoteHook{\hspace*{-8pt}}% \DeclareNewFootnote{A}[gobble]% \setlength{\skip\footinsA}{0pt}}% % %%%%%%%%%%%%%%%%%%%%%%%%%%%% Fonts & Sizes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Fonts Used %%\RequirePackage[T1]{fontenc}% % \DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}% \DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}% \DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}% \DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}% \DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}% \DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}% \DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}% \DeclareRobustCommand*\cal{\@fontswitch\relax\mathcal}% \DeclareRobustCommand*\mit{\@fontswitch\relax\mathnormal}% % \renewcommand\normalsize{% \@setfontsize\normalsize{10bp}{12bp}% \abovedisplayskip 12\p@ \@plus2\p@ \@minus1\p@ \abovedisplayshortskip \z@ \@plus3\p@% \belowdisplayshortskip 3\p@ \@plus3\p@ \@minus3\p@% \belowdisplayskip \abovedisplayskip% \let\@listi\@listI}% \normalsize% % \newcommand\medsize{% \@setfontsize\small\@xipt{13}% \abovedisplayskip 5\p@ \@plus3\p@ \@minus4\p@ \abovedisplayshortskip \z@ \@plus2\p@ \belowdisplayshortskip 3\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}% % \renewcommand\small{% \@setfontsize\small\@ixpt{11}% \abovedisplayskip 5\p@ \@plus3\p@ \@minus4\p@ \abovedisplayshortskip \z@ \@plus2\p@ \belowdisplayshortskip 3\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}% % \renewcommand\footnotesize{% \@setfontsize\footnotesize{7}{8}% \abovedisplayskip 5\p@ \@plus2\p@ \@minus4\p@ \abovedisplayshortskip \z@ \@plus\p@ \belowdisplayshortskip 3\p@ \@plus\p@ \@minus2\p@ \def\@listi{\leftmargin\leftmargini \topsep 3\p@ \@plus\p@ \@minus\p@ \parsep 2\p@ \@plus\p@ \@minus\p@ \itemsep \parsep}% \belowdisplayskip \abovedisplayskip} % \renewcommand\scriptsize{\@setfontsize\scriptsize\@ixpt\@ixpt}% \newcommand\scrisize{\@setfontsize\scrisize{9.3}{9}}% \renewcommand\tiny{\@setfontsize\tiny\@vpt\@vipt}% \renewcommand\large{\@setfontsize\large{12}{14}}% \newcommand\larg{\@setfontsize\larg{11}{13}}% \renewcommand\Large{\@setfontsize\Large{16}{18}}% \renewcommand\LARGE{\@setfontsize\LARGE\@xviipt{22}}% \renewcommand\huge{\@setfontsize\huge\@xxpt{25}}% \renewcommand\Huge{\@setfontsize\Huge\@xxvpt{30}}% % \DeclareMathSizes{\@ixpt}{\@ixpt}{7}{5}% \DeclareMathSizes{\@xpt}{\@xpt}{7}{5}% \DeclareMathSizes{\@xipt}{\@xipt}{7}{5}% % \DeclareRobustCommand*\textsubscript[1]{% \@textsubscript{\selectfont#1}}% % \def\@textsubscript#1{% {\m@th\ensuremath{_{\mbox{\fontsize\sf@size\z@#1}}}}}% % %%%%%%%%%%%%%%%%%%%%%%%%%%%% Layout Settings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %%\RequirePackage{geometry}% % \newlength\columnhsize% % %% Regular Pages (for Opening page - redefined) % \if@iicol% % %% for double column used sn-medium design trim and page size %% % \setlength\headheight{12pt}% \setlength\headsep{5.15mm}% % \setlength\columnsep{8mm}% \setlength\columnhsize{76mm}% % \setlength\maxdepth{0pt}% \setlength\footnotesep{7\p@}% \setlength{\skip\footins}{18\p@ \@plus 6\p@ \@minus 3\p@}% % \RequirePackage[% reversemp, paperwidth=210mm, paperheight=297mm, top={26mm}, headheight={12pt}, headsep={5.15mm}, text={160mm,216mm}, marginparsep=5mm, marginparwidth=12mm, bindingoffset=6mm, footskip=10.13mm,twocolumn]{geometry}% % \renewcommand\footnoterule{% \kern3\p@% \hrule \@height.2mm \@width\columnwidth% \kern5.5\p@}% % \else% %% For single column used smallcond design trim and page size %% \RequirePackage[% reversemp, paperwidth=210mm, paperheight=297mm, top={26mm}, headheight={5.5pt}, headsep={5.6mm}, text={31pc,194.25mm}, marginparsep=5mm, marginparwidth=12mm, bindingoffset=6mm, footskip=10mm]{geometry} % \setlength\maxdepth{0pt}% \setlength\columnsep{5mm}% \setlength{\marginparsep}{5mm}% \setlength{\marginparwidth}{12mm}% \setlength\footnotesep{5.75\p@}% \setlength{\skip\footins}{8\p@ \@plus 4\p@ \@minus 0\p@}% % \renewcommand\footnoterule{% \kern3\p@% \ifodd\c@page% \hrule \@height.2mm \@width\textwidth% \else% \hrule \@height.2mm \@width37mm \fi% \kern5.5\p@}% % \fi% % % \setlength\parindent{1.5em}% % \def\StepUpCounter#1{\global\advance#1by 1\relax}% \def\StepDownCounter#1{\global\advance#1by -1\relax}% % %%%%%%%%%%%%%%%%%%%%%%%%%%%% Pagination Settings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Line spacing \setlength\lineskip{1\p@}% \setlength\normallineskip{1\p@}% %%\renewcommand\baselinestretch{1.5}% \parskip=0pt% % % Page break penalties % \@lowpenalty 51 \@medpenalty 151 \@highpenalty 301 % % Disallow widows and orphans % \clubpenalty 10000 \widowpenalty 10000 % % Disable page breaks before equations, allow pagebreaks after % equations and discourage widow lines before equations. % \displaywidowpenalty 100 \predisplaypenalty 10000 \postdisplaypenalty 0 % % Set these global demerits % \doublehyphendemerits 1000000 % corresponds to badness 800 \finalhyphendemerits 1000000 % corresponds to badness 1000 % % Allow loose lines rather than overfull lines % \vbadness=9999 \tolerance=9999 % % Allow breaking the page in the middle of a paragraph % \interlinepenalty 0 % % Disallow breaking the page after a hyphenated line \brokenpenalty 10000 % % Hyphenation; don't split words into less than three characters \lefthyphenmin=3 \righthyphenmin=3 % % Float placement parameters % % The total number of floats that can be allowed on a page. \setcounter{totalnumber}{3} % % The maximum number of floats at the top and bottom of a page. \setcounter{topnumber}{5} \setcounter{bottomnumber}{5} % % The maximum part of the top or bottom of a text page that can be % occupied by floats. This is set so that at least four lines of text % fit on the page. \renewcommand\topfraction{.921} \renewcommand\bottomfraction{.921} % The minimum amount of a text page that must be occupied by text. % This should accomodate four lines of text. \renewcommand\textfraction{.13} % The minimum amount of a float page that must be occupied by floats. \renewcommand\floatpagefraction{.887} % The same parameters repeated for double column output \renewcommand\dbltopfraction{.88} \renewcommand\dblfloatpagefraction{.88} % Space between floats \setlength\floatsep{18\p@ \@plus 4\p@ \@minus 2\p@} % Space between floats and text \setlength\textfloatsep{15\p@ \@plus 4\p@ \@minus 2\p@} % Space above and below an inline figure \setlength\intextsep {18\p@ \@plus 4\p@ \@minus 2\p@} % For double column floats \setlength\dblfloatsep {20\p@ \@plus 4\p@ \@minus 2\p@} \setlength\dbltextfloatsep{15\p@ \@plus 4\p@ \@minus 2\p@} \hyphenation{Figure Figures Table Tables Equation Equations Section Sections Appendix Theorem Lemma} % %%%%%%%%%%%%%%%%%%%%%%%%%%% Math Settings %%%%%%%%%%%%%%%%%%%%%%%%%%% % %%%%%%%%%%%%%%%%%%%%%%%%%%%% For above/below spacing \def\eqnarray{% \stepcounter{equation}% \def\@currentlabel{\p@equation\theequation}% \global\@eqnswtrue \m@th \global\@eqcnt\z@ \tabskip\@centering \let\\\@eqncr $$\everycr{}\halign to\displaywidth\bgroup \hskip\@centering$\displaystyle\tabskip\z@skip{##}$\@eqnsel &\global\@eqcnt\@ne\hskip \tw@\arraycolsep \hfil${##}$\hfil &\global\@eqcnt\tw@ \hskip \tw@\arraycolsep $\displaystyle{##}$\hfil\tabskip\@centering &\global\@eqcnt\thr@@ \hb@xt@\z@\bgroup\hss##\egroup \tabskip\z@skip \cr } \def\endeqnarray{% \@@eqncr \egroup \global\advance\c@equation\m@ne $$\@ignoretrue } % %%%%%%%%%%%%%%%%%%%%%%%%%%% Titles %%%%%%%%%%%%%%%%%%%%%%%%%%% % \renewcommand\refname{References}% \renewcommand\figurename{Fig.}% defined as per springer style \renewcommand\tablename{Table}% \renewcommand\appendixname{Appendix}% \renewcommand\abstractname{Abstract}% % %%%%%%%%%%%%%%%%%%%%%%%%%%% Article Front Matter %%%%%%%%%%%%%%%%%%%%%%%%%%% % \def\raggedleft{\leftskip0pt plus 1fil\parfillskip=0pt\relax}% \def\raggedright{\rightskip0pt plus 1fil\parfillskip=0pt\relax}% \def\raggedcenter{\leftskip=0pt plus 0.5fil\rightskip=0pt plus 0.5fil% \parfillskip=0pt\let\hb=\break}% \def\titraggedcenter{\leftskip=12pt plus 0.5fil\rightskip=12pt plus 0.5fil% \parfillskip=0pt\let\hb=\break}% \def\absraggedcenter{\leftskip=24pt plus 0.5fil\rightskip=24pt plus 0.5fil% \parfillskip=0pt\let\hb=\break}% % %%% Font Def \def\Artcatfont{\reset@font\fontsize{8bp}{10bp}\selectfont}% \def\Titlefont{\reset@font\fontsize{17bp}{22.5bp}\selectfont\titraggedcenter}% \def\SubTitlefont{\reset@font\fontsize{14bp}{16.5bp}\selectfont\titraggedcenter}% \def\Authorfont{\reset@font\fontsize{12bp}{14.5bp}\selectfont\boldmath\titraggedcenter}% \def\addressfont{\reset@font\fontsize{11bp}{13.5bp}\selectfont\titraggedcenter}% \def\abstractheadfont{\reset@font\fontsize{9bp}{11bp}\bfseries\selectfont\titraggedcenter}% \def\abstractsubheadfont{\reset@font\fontsize{9bp}{11bp}\bfseries\selectfont}% \def\abstractfont{\reset@font\fontsize{9bp}{11bp}\selectfont\leftskip=24pt\rightskip=24pt\parfillskip=0pt plus 1fil}% \def\keywordfont{\reset@font\fontsize{8bp}{9.5bp}\selectfont\leftskip=24pt\rightskip=24pt plus0.5fill}% \def\historyfont{\reset@font\fontsize{8bp}{9.5bp}\selectfont\leftskip=24pt\rightskip=24pt plus0.5fill}% %% Article Type \newbox\artcatbox% \AtBeginDocument{\definecolor{artcatboxgray}{cmyk}{0.0,0.0,0.0,0.30}}% \def\articletype#1{\if!#1!\else\setbox\artcatbox\hbox{\Artcatfont\hskip1mm#1\hskip1mm}\fi% \gdef\ArtType{\fboxsep=0pt\colorbox{artcatboxgray}{\vbox to 4mm{\vfil% {\raggedright\box\artcatbox}\vfil}}}% \gdef\@ArtType{#1}}% %%\articletype{RESEARCH ARTICLE}% \articletype{}% %% Meta Info %\def\@jyear{{0000}}% %\def\jyear#1{\gdef\@jyear{#1}}% %% Article Title \renewcommand{\title}[2][]{% \gdef\@checktitle{#1}\ifx\@checktitle\empty\gdef\@title{#2}% \gdef\s@title{#2}\else\gdef\@title{#2}\gdef\s@title{#1}\fi% \markboth{\textit{\s@title}}{\textit{\s@title}}}% \def\subtitle#1{\gdef\@subtitle{#1}}\subtitle{}% %% Cross Link for Author & Address \def\jmkLabel#1{\@bsphack\protected@write\@auxout{}{\string\Newlabel{#1}{\@currentlabel}}\@esphack}% \def\Newlabel#1#2{\expandafter\xdef\csname X@#1\endcsname{#2}}% \def\jmkRef#1{\@ifundefined{X@#1}{0}{\csname X@#1\endcsname}}% %% Article Author(s) \let\sep\@empty% \let\authorsep\@empty% \newcount\aucount% \newcount\corraucount% \newcount\punctcount% % \def\artauthors{}% \newif\if@auemail% \newif\if@corauemail% % \def\au@and{\ifnum\punctcount=2\ and\else\unskip, \advance\punctcount by -1 \fi}% % \def\author{\advance\aucount by 1\@ifstar\@@corrauthor\@@author}% % \newcommand{\@@author}[2][]{\def\@authfrstarg{#1}\@corauemailfalse% \g@addto@macro\artauthors{% \ifnum\aucount=1% \global\@auemailtrue% \else% \global\@auemailfalse% \fi% \Authorfont% \def\baselinestretch{1}% \authorsep{#2}\unskip\ifx\@authfrstarg\empty\else\textsuperscript{\smash{{% \@for\@@affmark:=#1\do{\edef\affnum{\@ifundefined{X@\@@affmark}{\@@affmark}{\jmkRef{\@@affmark}}}% \unskip\sep\affnum\let\sep=,}}}}\fi% \def\authorsep{{\au@and} }%%% \global\let\sep\@empty\global\let\@corref\@empty% }}% % \newcommand{\@@corrauthor}[2][]{\def\@authfrstarg{#1}\@corauemailtrue\advance\corraucount by 1% \g@addto@macro\artauthors{% \global\@auemailtrue% \Authorfont% \def\baselinestretch{1}% \authorsep{#2}\unskip\ifx\@authfrstarg\empty\else\textsuperscript{\smash{{% \@for\@@affmark:=#1\do{\edef\affnum{\@ifundefined{X@\@@affmark}{\@@affmark}{\jmkRef{\@@affmark}}}% \unskip\sep\affnum\let\sep=,}}}{*}\hskip-1pt}\fi\unskip% \def\authorsep{\au@and~}%%% \global\let\sep\@empty\global\let\@corref\@empty% }}% %% %% Miscellaneous macros %% %% \def\fnm#1{\leavevmode\hbox{#1}}% \def\sur#1{\unskip~\nobreak\leavevmode\hbox{#1}}% \def\spfx#1{#1}% \def\pfx#1{#1}% \def\sfx#1{#1}% \def\tanm#1{#1}% \def\dgr#1{#1}% % %% Author Email % \let\nomail\relax% \def\corrauthemail{}% \def\authemail{}% \newcount\emailcnt% \def\email#1{\global\advance\emailcnt by 1\relax% \if@corauemail% \g@addto@macro\corrauthemail{% \setcounter{footnote}{0}% \textcolor{blue}{#1};\ % }% \else% \g@addto@macro\authemail{% \setcounter{footnote}{0}% \textcolor{blue}{#1};\ % }% \fi} %% Corrseponding Address \def\@copycorthanks{}% \def\auaddress{}% \def\@auaddress{}% \newcounter{affn}% \newcount\addcount% To check the count of address \renewcommand\theaffn{\arabic{affn}}% \def\affil{\advance\addcount by 1\@ifstar\@@coraddress\@@address}% \newcommand{\@@coraddress}[2][]{%\advance\addcount by 1 \g@addto@macro\auaddress{% \stepcounter{affn}% \xdef\@currentlabel{\theaffn}% \jmkLabel{\theaffn}% {\textsuperscript{#1*}#2.\par} } } %% Macros for present address \newif\ifpresentaddress% \def\@presentaddresstxt{}% \def\presentaddresstxt#1{\gdef\@presentaddresstxt{#1:}}\presentaddresstxt{Present Address}% \newcommand{\presentaddress}[1]{\gdef\@presentaddresstext{\@presentaddresstxt\par#1}\global\presentaddresstrue}% %% Macros for equally contributed \newif\ifequalcont% %\def\@equalconttxt{}% %\def\equalcontxt#1{\gdef\@equalconttxt{#1}}\equalcontxt{These authors contributed equally to this work.}% %\newcommand{\equalcont}[1][\@equalconttxt]{\gdef\@equalconttext{#1}\g@addto@macro\artauthors{$^{\dagger}$}\global\equalconttrue}% \def\@equalconttxt{}% \def\equalcontxt#1{\gdef\@equalconttxt{#1}}\equalcontxt{}% \newcommand{\equalcont}[1]{\gdef\@equalconttext{#1}\g@addto@macro\artauthors{$^{\dagger}$}\global\equalconttrue}% %% Author Address \newcommand{\@@address}[2][]{%%\advance\addcount by 1 \g@addto@macro\auaddress{% \stepcounter{affn}% \xdef\@currentlabel{\theaffn}% \jmkLabel{\theaffn}% {\textsuperscript{#1}#2.\par} }%\theaffn } %% Address tagging \newcommand{\orgdiv}[1]{#1}% \newcommand{\orgname}[1]{#1}% \newcommand{\orgaddress}[1]{#1}% \newcommand{\street}[1]{#1}% \newcommand{\postcode}[1]{#1}% \newcommand{\city}[1]{#1}% \newcommand{\state}[1]{#1}% \newcommand{\country}[1]{#1}% %% Article notes \def\@artnote{}% \def\artnote#1{\gdef\@artnote{#1}}% %% Miscellaneous notes \def\@miscnote{}% \def\miscnote#1{\gdef\@miscnote{\par\addvspace{3pt}#1}}% %% Motto \def\mottofont{\reset@font\fontfamily{\rmdefault}\fontsize{8.5bp}{10bp}\fontshape{it}\selectfont\raggedright} % \let\@motto\@empty \def\mottoraggedright{\rightskip0mm\leftskip=42mm plus 1fil\parfillskip=0pt\relax}% \newcommand{\motto}[2][]{\gdef\@headcheck{#1}\gdef\@motto{\@headcheck\ifx\@headcheck\@empty\vskip12pt\else\fi{\mottofont\mottoraggedright#2\par}}} %% Article Abstract \newcommand\abstracthead{\@startsection {section}{1}{\z@}{-22pt \@plus0ex \@minus0ex}{3pt}{\abstractheadfont}} \newcommand\subabstracthead{\@startsection{subsection}{2}{\z@}{3pt \@plus0ex \@minus0ex}{-.5em}{\abstractsubheadfont}} \def\@abstract{}% \long\def\abstract#1{\def\@abstract{% \let\paragraph\subabstracthead% \abstractfont% \abstracthead*{\abstractname}% #1\par}}% \def\printabstract{\ifx\@abstract\empty\else\@abstract\fi\par}% \def\printkeywords{\ifx\@keywords\empty\else\@keywords\fi\par}% % %% Keywords \def\keywordname{Keywords}% \def\keywords#1{\ifx#1\empty\else\def\@keywords{\par\addvspace{10pt}{\keywordfont{\bfseries\keywordname:} #1\par}}\fi}% \def\@keywords{}% %% PACs \def\pacsbullet{\hbox{\hskip2.5pt,\hskip2.5pt}}% \def\change@commas#1,#2{% \ifx#2\@empty% #1% \else% #1\nobreak\hbox{\pacsbullet}\allowbreak\expandafter\change@commas% \fi% #2}% \newcommand\keywordhead[1]{\par\addvspace{10pt}% {{\keywordfont\bfseries#1:\ }}}% \newcommand{\pacs}[1]{\keywordhead{\pacsname}#1}% % \newcount\PacsCount% \PacsCount=0% % \newcount\PacsTmpCnt% \PacsTmpCnt=1% % \gdef\StorePacsText#1#2{% \edef\GetRoman{\romannumeral#1}% \expandafter\gdef\csname\GetRoman StorePacsTxt\endcsname{#2}% }% % \let\oldpacs\pacs% \renewcommand\pacs[2][PAC Codes]{\gdef\pacsname{{\bfseries#1}}\gdef\@pacs{\keywordfont\raggedright\oldpacs\change@commas#2,\@empty\par} \StepUpCounter{\PacsCount}% \StorePacsText{\the\PacsCount}{\gdef\pacsname{{\bfseries#1}}\keywordfont\raggedright\oldpacs\change@commas#2,\@empty}% }% \def\@pacs{}% %% Glossary \def\gloshead{Glossary}% \newenvironment{glos}[1][\gloshead]{\begingroup\parindent=0pt% \section*{#1} \def\item[##1]{##1,\ }}{% \endgroup}% % %% Article History \def\received#1{\g@addto@macro\@history{{Received #1}}}% \def\revised#1{\g@addto@macro\@history{{; revised #1}}}% \def\accepted#1{\g@addto@macro\@history{{; accepted #1}}}% %% Remark on Front page %% \newdimen\FMremarkdim% \newcommand{\FMremark}{\begingroup\parindent=0pt\parskip=0pt% \if@referee\singlespacing\fi% \fboxsep=6pt\fboxrule=0.5pt% \FMremarkdim=\textwidth%%\paperwidth% \advance\FMremarkdim-\fboxsep% \advance\FMremarkdim-2\fboxrule% \if@referee\vskip-21pt\fi% %%\fbox{\vbox{\hsize=\FMremarkdim\small% \unvbox\fmremarkbox %%}}% \endgroup} \newbox\fmremarkbox% \newenvironment{fmremark}{\begingroup\parindent=0pt% \fboxsep=6pt\fboxrule=0.5pt% \FMremarkdim=\textwidth%%\paperwidth% \advance\FMremarkdim-\fboxsep% \advance\FMremarkdim-2\fboxrule% \global\setbox\fmremarkbox\vbox\bgroup\small% }{\egroup\endgroup} %% Article Header Definition \renewcommand{\@maketitle}{\newpage\null% \if@remarkboxon\vbox to 0pt{\vspace*{-78pt}\hspace*{-18pt}\FMremark}\else\vskip21pt\fi%%\par% \hsize\textwidth\parindent0pt%%%\vskip7pt% %% Aritle Type {\hbox to \textwidth{{\Artcatfont\ArtType\hfill}\par}} %% Aritle Title \ifx\@title\empty\else% \removelastskip\vskip20pt\nointerlineskip% {\Titlefont\@title\par} %\addcontentsline{toc}{chapter}{\@title}% for bookmarks \fi% %% Aritle SubTitle \ifx\@subtitle\empty\else% \vskip9pt% {{\SubTitlefont\@subtitle\par}} \fi% %% Aritle Authors, Address and Correspondings \ifnum\aucount>0 \global\punctcount\aucount% \vskip20pt% \artauthors\par%% authors and emails {\vskip7pt\addressfont\auaddress\par%% corresponding adress \removelastskip\vskip24pt% \ifnum\emailcnt>0\relax% \ifx\corrauthemail\@empty\else{\ifnum\aucount>1*\fi}% Corresponding author(s). E-mail(s): \corrauthemail\par\fi% \ifx\authemail\@empty\else Contributing authors:\ \authemail\fi% \fi% \ifequalcont{\par$^{\dagger}$\@equalconttext\par}\fi% \removelastskip\vskip24pt% \ifpresentaddress{\par\@presentaddresstext\par}\fi% } \fi% {\printabstract\par}% {\printkeywords\par}% \ifx\@pacs\empty\else% \loop\ifnum\PacsCount>0% \csname\romannumeral\PacsTmpCnt StorePacsTxt\endcsname\par% \StepDownCounter{\PacsCount}% \StepUpCounter{\PacsTmpCnt}% \repeat% \fi% %%{\printhistory\par}% %%{\ifx\@motto\empty\else\@motto\fi}% \removelastskip\vskip36pt\vskip0pt}% \usepackage{cuted}% \@ifpackageloaded{cuted}{\gdef\@setmarks{}}{}% %% Printing Article Header \newdimen\firstpagehtcheck \renewcommand\maketitle{\par \@afterindentfalse% \begingroup \gdef\UrlFont{\rmfamily}% \renewcommand\thefootnote{\@fnsymbol\c@footnote}% \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\smash{\@thefnmark}}}}% \long\def\@makefntext##1{\parindent 1em\noindent\small\selectfont \hbox{\@textsuperscript{\normalfont\@thefnmark}}##1}% \if@twocolumn \ifnum \col@number=\@ne% \setbox0=\vbox{\@maketitle} \firstpagehtcheck=\ht0% \advance\firstpagehtcheck by \dp0% \ifdim\firstpagehtcheck>\textheight% \setbox1=\vsplit0to2\textheight% \setbox1=\vbox{\unvbox1}% \setbox2=\vbox{\unvbox0}% \unvbox1% \stripsep=0pt% \begin{strip} \unvbox2% \end{strip} \else \twocolumn[\@maketitle]% \fi \else \@maketitle \fi% \else% \newpage% \global\@topnum\z@% Prevents figures from going at top of page. \@maketitle% \fi% \endgroup% \ifx\@artnote\@empty\else\footnoteA{\@artnote}\fi% \ifx\@miscnote\@empty\else\footnoteA{\@miscnote\par}\fi% \setcounter{footnote}{0}% \global\let\thanks\relax% \global\let\artnote\relax% \global\let\maketitle\relax% \global\let\@maketitle\relax% \global\let\@thanks\@empty% \global\let\@author\@empty% \global\let\@date\@empty% \global\let\title\relax% \global\let\author\relax% \global\let\date\relax% \global\let\and\relax% \pagestyle{headings}% %%%print continuous abstract on next page \@afterheading% %%\vskip-18pt% this is included to avoid vertical space at the beginning of left column on article opening pages }% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Page Styles %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % \def\opheaderfont{\reset@font\fontsize{10bp}{0bp}\selectfont}% \def\headerfont{\reset@font\fontsize{10bp}{0bp}\selectfont}% \def\footerfont{\reset@font\fontsize{10bp}{0bp}\selectfont}% %% Regular Page Style \def\ps@headings{% \def\@oddfoot{\hfill\thepage\hfill}% \let\@evenfoot\@oddfoot% \def\@evenhead{% \vbox to 0pt{\vspace*{-48pt}% \hbox to \hsize{\hfill \relax\hfill}}\par%% \hspace*{-\textwidth}\hbox to \hsize{\hfill}}% \def\@oddhead{% \vbox to 0pt{\vspace*{-48pt}% \hbox to \hsize{\hfill \relax\hfill}}\par%% \hspace*{-\textwidth}\hbox to \hsize{\hfill}}% \let\@mkboth\markboth% }% %\newdimen\opshortpage% %\def\printcopyright#1{#1}%% %\gdef\@copyrighttext{}% %\gdef\@copyrightyear{\@jyear}% %\def\copytext#1#2{\gdef\@copyrightyear{#2}\def\@copyrighttext{\begin{minipage}[t]{\textwidth}\footerfont\textcopyright\ #1\ \@copyrightyear\end{minipage}}} %\copytext{Springer Science+Business Media B.V.}{\@jyear}% %\def\@opjournalheader{\undef\leftmark\space\ {{(\@jyear),\ \textbf{\@jvol}:\@artid}} {\thepage{--}\pageref*{LastPage}}\\ %{\@DOI}}% %% Opening Page Style \def\ps@titlepage{% %%\def\@oddhead{\vbox{\vskip-36pt\hbox to \textwidth{\hfill\includegraphics{springer-nature-logo}\hspace*{-1pt}}}}% %%\let\@oddhead\@empty\let\@evenhead\@empty% \def\@oddhead{% \vbox to 0pt{\vspace*{-38pt}% \hbox to \hsize{\hfill \hfill}}}%% \let\@evenhead\@oddhead% \def\@oddfoot{\vbox to 18pt{\vfill\reset@font\rmfamily\hfil\thepage\hfil}}%% \def\@evenfoot{}}% \def\ps@plain{\let\@mkboth\@gobbletwo% \let\@oddhead\@empty\let\@evenhead\@empty% \def\@oddfoot{\vbox to 18pt{\vfill\reset@font\rmfamily\hfil ddd\thepage\hfil}}% \let\@evenfoot\@oddfoot}% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Sections %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \def\numbered{\setcounter{secnumdepth}{3}}% \def\unnumbered{\setcounter{secnumdepth}{0}}% \numbered%% default is numbered Sections \renewcommand\thesection {\@arabic\c@section}% \renewcommand\thesubsection {\thesection.\@arabic\c@subsection}% \renewcommand\thesubsubsection{\thesubsection.\@arabic\c@subsubsection}% \renewcommand\theparagraph {\thesubsubsection.\@arabic\c@paragraph}% \renewcommand\thesubparagraph {\theparagraph.\@arabic\c@subparagraph}% %% \def\@seccntformat#1{\csname the#1\endcsname\hskip.5em}% \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 \def\@svsechd{% #6{\hskip #3\relax \@svsec #8.}% \csname #1mark\endcsname{#7}% \addcontentsline{toc}{#1}{% \ifnum #2>\c@secnumdepth \else \protect\numberline{\csname the#1\endcsname}% \fi #7}}% \fi \@xsect{#5}} % \def\sectionfont{\reset@font\fontfamily{\rmdefault}\fontsize{14bp}{16bp}\bfseries\selectfont\raggedright\boldmath}% \def\subsectionfont{\reset@font\fontfamily{\rmdefault}\fontsize{12bp}{14bp}\bfseries\selectfont\raggedright\boldmath}% \def\subsubsectionfont{\reset@font\fontsize{11bp}{13bp}\bfseries\selectfont\raggedright\boldmath}% \def\paragraphfont{\reset@font\fontsize{10bp}{12bp}\bfseries\itshape\selectfont\raggedright}% % \def\subparagraphfont{\itshape}% \def\bmheadfont{\reset@font\fontfamily{\rmdefault}\fontsize{10bp}{12bp}\bfseries\selectfont\raggedright\boldmath}% % \renewcommand\section{\@startsection{section}{1}{\z@}% {-12pt \@plus -4pt \@minus -2pt}% {9pt}% {\sectionfont}} \renewcommand\subsection{\@startsection{subsection}{2}{\z@}% {-12pt \@plus -4pt \@minus -2pt}% {6pt}% {\subsectionfont}} \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% {-12pt \@plus -4pt \@minus -2pt}% {6pt}% {\subsubsectionfont}} \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}% {-12pt \@plus -4pt \@minus-2pt}% {3pt}% {\paragraphfont}} \renewcommand\subparagraph{\@startsection{subparagraph}{5}{\z@}% {6pt \@plus1ex \@minus.2ex}% {-1em}% {\subparagraphfont}} \newcommand\bmhead{\@startsection{subparagraph}{5}{\z@}% {6pt \@plus1ex \@minus .2ex}% {-1em}% {\bmheadfont}} % \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 {\@ssect{#3}{#4}{#5}{#6}}% {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Lists %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \newdimen\labelwidthi% \newdimen\labelwidthii% \newdimen\labelwidthiii% \newdimen\labelwidthiv% \def\normal@labelsep{0.5em}% \labelsep\normal@labelsep% \settowidth{\labelwidthi}{(iii)}% \settowidth{\labelwidthii}{(d)}% \settowidth{\labelwidthiii}{(iii)}% \settowidth{\labelwidthiv}{(M)}% \leftmargini\labelwidthi \advance\leftmargini\labelsep \leftmarginii\labelwidthii \advance\leftmarginii\labelsep \leftmarginiii\labelwidthiii \advance\leftmarginiii\labelsep \leftmarginiv\labelwidthiv \advance\leftmarginiv\labelsep \def\setleftmargin#1#2{\settowidth{\@tempdima}{#2}\labelsep\normal@labelsep \csname labelwidth#1\endcsname\@tempdima \@tempdimb\@tempdima \advance\@tempdimb\labelsep \csname leftmargin#1\endcsname\@tempdimb} \def\@listI{\leftmargin\leftmargini \labelwidth\labelwidthi \labelsep\normal@labelsep \topsep \z@ \partopsep\z@ \parsep\z@ \itemsep\z@ \listparindent 1em} \def\@listii{\leftmargin\leftmarginii \labelwidth\labelwidthii \labelsep\normal@labelsep \topsep\z@ \partopsep\z@ \parsep\z@ \itemsep\z@ \listparindent 1em} \def\@listiii{\leftmargin\leftmarginiii \labelwidth\labelwidthiii \labelsep\normal@labelsep \topsep\z@ \partopsep\z@ \parsep\z@ \itemsep\z@ \listparindent 1em} \def\@listiv{\leftmargin\leftmarginiv \labelwidth\labelwidthiv \labelsep\normal@labelsep \topsep\z@ \partopsep\z@ \parsep\z@ \itemsep\z@ \listparindent 1em} \let\@listi\@listI \@listi % \setlength \labelsep {.5em} \setlength \labelwidth{\leftmargini} \addtolength\labelwidth{-\labelsep} \@beginparpenalty -\@lowpenalty \@endparpenalty -\@lowpenalty \@itempenalty -\@lowpenalty \def\labelitemi{$\bullet$} \def\labelitemii{$\cdot$} \def\labelenumi{\theenumi.} \def\theenumi{\arabic{enumi}} \def\labelenumii{(\alph{enumii})} \def\theenumii{\alph{enumii}} \def\labelenumiii{(\roman{enumiii})}\def\theenumiii{\roman{enumiii}} \def\labelenumiv{(\Alph{enumiv})} \def\theenumiv{\Alph{enumiv}} % %%%%%%%%%%%%%%%%%%%%%%%%%%% Ordered & Unordered List %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \def\listfont{\normalsize}% % \def\enumargs{% \listfont% \leftmargini0pt% \leftmarginii0pt% \leftmarginiii0pt% \ifnum\@enumdepth=3\topsep0pt\else\ifnum\@enumdepth=2\topsep0pt\else\topsep 6pt\fi\fi% \partopsep \z@% \itemsep \z@% \parsep \z@% \labelsep 0.5em% \rightmargin \z@% \raggedright% \listparindent \parindent% \itemindent \z@}% \def\enumerate{% \@ifnextchar[{\@numerate}{\@numerate[0.]}} \def\@numerate[#1]{\par% \ifnum \@enumdepth >3 \@toodeep\else \advance\@enumdepth \@ne \edef\@enumctr{enum\romannumeral\the\@enumdepth} \list{\csname label\@enumctr\endcsname}{% \enumargs% \setlength{\leftmargin}{\csname leftmargin\romannumeral\the\@enumdepth\endcsname} \usecounter{\@enumctr} \settowidth\labelwidth{#1} \addtolength{\leftmargin}{\labelwidth} \addtolength{\leftmargin}{\labelsep} \def\makelabel##1{\hss\llap{##1}}}% \fi } \let\endenumerate\endlist %%Unnumbered list%% \def\unenumargs{% \listfont% \leftmargini\parindent% \topsep6pt% \partopsep \z@% \itemsep \z@% \parsep \z@% \labelsep 0\p@% \rightmargin \z@% \raggedright% \listparindent \parindent% \itemindent -12pt}% \def\unenumerate{% \@ifnextchar[{\@unenumerate}{\@unenumerate[0.]}} \def\@unenumerate[#1]{\par% \ifnum \@enumdepth >3 \@toodeep\else \advance\@enumdepth \@ne \edef\@enumctr{enum\romannumeral\the\@enumdepth} \list{}{% \unenumargs \setlength{\leftmargin}{\csname leftmargin\romannumeral\the\@enumdepth\endcsname} \usecounter{\@enumctr} \settowidth\labelwidth{#1} \addtolength{\leftmargin}{0pt} \addtolength{\leftmargin}{0pt} \def\makelabel##1{\hss\llap{##1}}}% \fi } \let\endunenumerate\endlist% %% bulleted list \def\itemargs{% \listfont% \leftmargini0pt% \leftmarginii0pt% \ifnum\@enumdepth=3\topsep0pt\else\ifnum\@enumdepth=2\topsep0pt\else\topsep 6pt\fi\fi% \partopsep \z@% \itemsep \z@% \parsep \z@% \labelsep 0.5em% \rightmargin \z@% \raggedright% \listparindent \z@% \itemindent \z@}% \renewcommand\labelitemi{\raise1pt\hbox{\textbullet}}% \renewcommand\labelitemii{\textendash}% \def\itemize{% \@ifnextchar[{\@itemize}{\@itemize[$\bullet$]}} \def\@itemize[#1]{\par% \ifnum \@itemdepth >3 \@toodeep\else \advance\@itemdepth \@ne \edef\@itemctr{item\romannumeral\the\@itemdepth} \list{\csname label\@itemctr\endcsname}{% \itemargs \setlength{\leftmargin}{\csname leftmargin\romannumeral\the\@itemdepth\endcsname} \settowidth\labelwidth{#1} \addtolength{\leftmargin}{\labelwidth} \addtolength{\leftmargin}{\labelsep} \def\makelabel##1{\hss \llap{##1}}}% \fi } \let\enditemize\endlist % \def\quote{\list{}{\itemindent\z@ \leftmargin 1em \rightmargin \z@}% \item[]} \let\endquote\endlist % \def\descriptionlabel#1{\hspace\labelsep \itshape #1} \def\description{\list{}{\labelwidth\z@ \leftmargin \z@ \topsep6pt\itemindent \z@ %-\leftmargin \let\makelabel\descriptionlabel}} \let\enddescription\endlist % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Float %%%%%%%%%%%%%%%%%%%%%%%%%%%% \setlength\abovecaptionskip{2.25\p@}% \setlength\belowcaptionskip{6\p@}% \setlength\arraycolsep{2\p@}% \setlength\tabcolsep{6\p@}% \setlength\arrayrulewidth{.4\p@}% \setlength\doublerulesep{2\p@}% \setlength\tabbingsep{\labelsep}% \def\fnum@figure{{\bfseries\figurename\space\thefigure}}% \def\fnum@table{{\bfseries\tablename\space\thetable}}% \def\FigName{figure}% \long\def\@makecaption#1#2{% \ifx\FigName\@captype \vskip\abovecaptionskip \@figurecaption{#1}{#2} \else \@tablecaption{#1}{#2} \vskip\belowcaptionskip \fi% } %% Figure \def\figurecaptionfont{\reset@font\fontfamily{\rmdefault}\fontsize{8}{9.5}\selectfont}% \newdimen\figwidth% \newdimen\figheight% \newdimen\sidecapwidth \newdimen\wrapcapline% \newdimen\totalwrapline% \newdimen\wraptotline% %% Figures macro \newbox\figurebox% \newbox\wrapfigcapbox \def\FIG#1#2{% \setbox\figurebox\hbox{#1}% %% Figure dimensions \figwidth\wd\figurebox% \figheight\ht\figurebox% {\parbox{\hsize}{% \centerline{\box\figurebox}% %% Caption #2}}} %% Figures caption \newbox\figcapbox \newbox\capbox \long\def\@figurecaption#1#2{{\figurecaptionfont{\bfseries#1}\hskip.7em#2\par}}% \newenvironment{unnumfigure}{\begingroup\setlength{\topsep}{12pt}% \begin{center}}{\end{center}\endgroup} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \@ifpackageloaded{booktabs}{\cmidrulewidth=.15pt}{}% % \def\tablecaptionfont{\reset@font\fontsize{8bp}{9.5bp}\selectfont}% \def\tablebodyfont{\reset@font\fontsize{8bp}{9.5bp}\selectfont}% \def\tablecolheadfont{\reset@font\fontsize{8bp}{9.5bp}\selectfont\bfseries\boldmath}% \def\tablefootnotefont{\reset@font\fontsize{8bp}{9.5bp}\selectfont}% %% Table Macro \newskip\headwidthskip% \def\tabraggedcenter{\leftskip=0pt plus 0.5fil\rightskip=0pt plus 0.5fil\parfillskip=0pt}% \newenvironment{@processtable}[4]{% \setbox4=\hbox to \hsize{\hss% \begin{minipage}[t]{#4}% \tabraggedcenter% \caption{#1}\par% {\tablebodyfont\noindent\ignorespaces#2\par}\par\vglue6pt% {\if!#3!\else{\tablefootnotefont#3}\fi}% \end{minipage}% \hss}% \box4\par}% \newcommand\TBL[3]{\begingroup% % \if!#1!\let\caption\relax\fi% % \global\setbox\temptbox=\hbox{\bgroup{\tablebodyfont#2}\egroup}% \global\tempdime\wd\temptbox% \@processtable{#1}{\global\headwidthskip=\tempdime% \vbox{#2}}{#3}{\tempdime}% \endgroup}% %% Table Caption \newbox\tabcapbox% \newbox\temptbox% \newdimen\tempdime% \newdimen\tabhtdime% \long\def\@tablecaption#1#2{% \setbox\tabcapbox\vbox{\tablecaptionfont\raggedright% {\bfseries #1}{\hskip2mm}#2\vphantom{y}\par}% \box\tabcapbox% } %% Table Column Heads \def\TCH#1{{\tablecolheadfont #1}} %% Table Footnotes \newenvironment{tablenotes}{\list{}{\setlength{\labelsep}{0pt}% \setlength{\labelwidth}{0pt}% \setlength{\leftmargin}{0pt}% \setlength{\rightmargin}{0pt}% \setlength{\topsep}{-6pt}% \setlength{\itemsep}{2pt}% \setlength{\partopsep}{0pt}% \setlength{\listparindent}{0em}% \setlength{\parsep}{0pt}}% \item\relax% }{\endlist}% \def\tnote#1{$^{#1}$}%% %% Table Rules \def\toprule{%\noalign{\vskip3pt} \noalign{\ifnum0=`}\fi \hrule \@height 0\p@ \@width 0pt \hrule \@height 0.75\p@ % <- rule height \hrule \@height 5pt \@width 0pt \futurelet\@tempa\@xhline} % Middle rule \def\midrule{\noalign{\ifnum0=`}\fi% \hrule \@height 3pt \@width 0pt \hrule \@height .5pt % <- rule height \hrule \@height 5pt \@width 0pt \futurelet \@tempa\@xhline} % Bottom rule \def\botrule{\noalign{\ifnum0=`}\fi \hrule \@height 3pt \@width 0pt \hrule \@height 0.75\p@ % <- rule height \hrule \@height 3pt \@width 0pt \futurelet\@tempa\@xhline} % \def\@@@cmidrule[#1-#2]#3#4{\global\@cmidla#1\relax \global\advance\@cmidla\m@ne \ifnum\@cmidla>0\global\let\@gtempa\@cmidrulea\else \global\let\@gtempa\@cmidruleb\fi \global\@cmidlb#2\relax \global\advance\@cmidlb-\@cmidla \global\@thisrulewidth=#3 \@setrulekerning{#4} \ifnum\@lastruleclass=\z@\vskip 3\p@\fi \ifnum0=`{\fi}\@gtempa \noalign{\ifnum0=`}\fi\futurenonspacelet\@tempa\@xcmidrule} \def\@xcmidrule{% \ifx\@tempa\cmidrule \vskip-\@thisrulewidth \global\@lastruleclass=\@ne \else \ifx\@tempa\morecmidrules \vskip \cmidrulesep \global\@lastruleclass=\@ne\else \vskip 5\p@ \global\@lastruleclass=\z@ \fi\fi \ifnum0=`{\fi}} \let\cline\cmidrule \usepackage[figuresright]{rotating}% \usepackage{threeparttable} \let\tableorg\table% \let\endtableorg\endtable% \let\sidewaystableorg\sidewaystable% \let\endsidewaystableorg\endsidewaystable% \renewenvironment{table}[1][]% {\begin{tableorg}[#1]% \begin{center} \begin{threeparttable} \tablebodyfont% \renewcommand\footnotetext[2][]{{\removelastskip\vskip3pt% \let\tablebodyfont\tablefootnotefont% \hskip0pt\if!##1!\else{\smash{$^{##1}$}}\fi##2\par}}% }{\end{threeparttable}\end{center}\end{tableorg}} \renewenvironment{sidewaystable}[1][]% {\begin{sidewaystableorg}[#1]% \begin{center} \begin{threeparttable} \tablebodyfont% \renewcommand\footnotetext[2][]{{\removelastskip\vskip3pt% \let\tablebodyfont\tablefootnotefont% \hskip0pt\if!##1!\else{\smash{$^{##1}$}}\fi##2\par}}% }{\end{threeparttable}\end{center}\end{sidewaystableorg}} %%%%%%%%%%%%%%%%%%%%%%%%%%%% Other Env. %%%%%%%%%%%%%%%%%%%%%%%%% \def\quotefont{\reset@font\fontfamily{\rmdefault}\fontsize{9}{11}\selectfont}% \renewenvironment{quote} {\list{}{\topsep=0pt\topsep6pt\leftmargin=1em\raggedright\quotefont}% \item\relax} {\endlist} % %%%%%%%%%%%%%%%%%%%%%%%%%%%% Appendix %%%%%%%%%%%%%%%%%%%%%%%%% % \newif\ifbackmatter% \newcommand{\backmatter}{\global\backmattertrue}% \usepackage[title]{appendix}% \@ifpackageloaded{appendix}{% % \renewenvironment{appendices}{% \@resets@pp \if@dotoc@pp \if@dopage@pp % both page and toc \if@chapter@pp % chapters \clear@ppage \fi \appendixpage \else % toc only \if@chapter@pp % chapters \clear@ppage \fi \addappheadtotoc \fi \else \if@dopage@pp % page only \appendixpage \fi \fi \if@chapter@pp \if@dotitletoc@pp \@redotocentry@pp{chapter} \fi \else \if@dotitletoc@pp \@redotocentry@pp{section} \fi \if@dohead@pp \def\sectionmark##1{% \if@twoside \markboth{\@formatsecmark@pp{##1}}{} \else \markright{\@formatsecmark@pp{##1}}{} \fi} \fi \if@dotitle@pp \def\sectionname{\appendixname} \def\@seccntformat##1{\@ifundefined{##1name}{}{\csname ##1name\endcsname\ }% \csname the##1\endcsname\quad} \fi \fi }{% \@ppsaveapp\@pprestoresec} %% \AtBeginDocument{% % \let\oldappendices\appendices% \let\oldendappendices\endappendices% %% \renewenvironment{appendices}{% \setcounter{figure}{0}% \setcounter{table}{0}% \setcounter{equation}{0}% %% \begin{oldappendices}% \gdef\thefigure{\@Alph\c@section\arabic{figure}}% \gdef\thetable{\@Alph\c@section\arabic{table}}% \gdef\theequation{\@Alph\c@section\arabic{equation}}% }{\end{oldappendices}} } %% }{} % %%%%%%%%%%%%%%%%%%%%%%%%%%% Article History %%%%%%%%%%%%%%%%%%%% % \def\@history{} \def\printhistory{{\par\addvspace{8pt}% \historyfont\noindent% \ifx\@history\empty\gdef\@history{Received xx xxx xxxx}\fi\@history\par}}% % %%%%%%%%%%%%%%%%%%%%%%% Footnotes %%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % \renewcommand\@makefntext[1]{% \hskip8pt{\smash{\@makefnmark}}#1} % \RequirePackage{hyperref}% %%\RequirePackage{hypcap}% \gdef\breakurldefns{% \if@pdflatex\else% \RequirePackage[hyphenbreaks]{breakurl}% % \let\href\burlalt% \fi}% \breakurldefns% % \bgroup % \catcode`\&=12\relax % \hyper@normalise\burl@addtocharlistbefore{%} % \hyper@normalise\burl@addtocharlistafter{:/.?#&_,;!=+~}%% for extra breaks in url % \egroup % \burl@defifstructure % \hypersetup{% colorlinks, breaklinks=true, plainpages=false,% citecolor=blue, linkcolor=blue, urlcolor=blue, bookmarksopen=true,% bookmarksnumbered=false,% bookmarksdepth=5% } % \AtBeginDocument{\renewcommand\UrlFont{\rmfamily}}% % \AtBeginDocument{% \@ifpackageloaded{natbib}{% \renewcommand\bibsection{% \section*{\refname}% }% }{}% }% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \pagestyle{headings}% \pagenumbering{arabic}% \sloppy% \frenchspacing% \flushbottom% %%% special parameters for TeX \adjdemerits=100 \linepenalty=100 % %%%%%%%%%%%%%%% Biography % \RequirePackage{wrapfig}% % % % \begin{wrapfigure}[12]{r}[34pt]{5cm}
\end{wrapfigure} % -- - ---- --- % [number of narrow lines] {placement} [overhang] {width of figure} \newcount\wraplines% %%\wraplines=5% % \newbox\@authorfigbox% \newskip\@authorfigboxdim% % \newskip\biofigadjskip% \biofigadjskip=0pt% % \def\authbiotextfont{\reset@font\fontsize{8bp}{9.5bp}\selectfont}% % \newenvironment{biography}[2]{\par\addvspace{11.5pt plus3.375pt minus1.6875pt}%\lineno@off% \def\author##1{{\bfseries##1}}% \if!#1!\def\@authorfig{}\else\def\@authorfig{{#1}}\fi% \setbox\@authorfigbox=\hbox{#1}% \@authorfigboxdim=\wd\@authorfigbox% \if@iicol\advance\@authorfigboxdim by -10pt\else\advance\@authorfigboxdim by -2pt\fi% \wraplines=9\fboxrule=1pt\fboxsep=6pt% \noindent{% \ifx\@authorfig\@empty\else\unskip% \begin{wrapfigure}[\wraplines]{l}[0pt]{\@authorfigboxdim}%{38.25mm}% \vskip-19pt\addvspace{\biofigadjskip}% \@authorfig% \end{wrapfigure}% \fi% {\authbiotextfont#2\par}% \par% }}{\par\addvspace{10.5pt plus3.375pt minus1.6875pt}} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Theorem %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % \@ifpackageloaded{amsthm}{% % %\let\proof\relax% %\let\endproof\relax% \def\@begintheorem#1#2[#3]{% \deferred@thm@head{\the\thm@headfont \thm@indent \@ifempty{#1}{\let\thmname\@gobble}{\let\thmname\@iden}% \@ifempty{#2}{\let\thmnumber\@gobble}{\let\thmnumber\@iden}% \@ifempty{#3}{\let\thmnote\@gobble}{\let\thmnote\@iden}% \thm@swap\swappedhead\thmhead{#1}{#2}{#3}% \the\thm@headpunct \thmheadnl % possibly a newline. \hskip\thm@headsep }% \ignorespaces } \def\@endtheorem{\endtrivlist\@endpefalse} \AtBeginDocument{% % \DeclareRobustCommand{\S}{\ifmmode\mathsection\else\textsection\fi} \DeclareSymbolFont{AMSa}{U}{msa}{m}{n}% \DeclareMathSymbol{\opensquare}{\mathord}{AMSa}{"03}% \def\qedsymbol{\ensuremath{\opensquare}}% % \newenvironment{spiproof}[1][\proofname]{\par\removelastskip%\vspace*{2pt}% \pushQED{\qed}% \small\normalfont \topsep7.5\p@\@plus7.5\p@\relax% \trivlist% \item[\hskip\labelsep% \itshape% #1\@addpunct{}]\ignorespaces% }{% \popQED\endtrivlist\@endpefalse% }% % \let\proof\spiproof\let\endproof\endspiproof% % }% % \def\thm@space@setup{% \thm@preskip=12pt% \thm@postskip=12pt} % %%%%%%%%%%%%%%%%%% StyleOne % \newtheoremstyle{thmstyleone}% Numbered {18pt plus2pt minus1pt}% Space above {18pt plus2pt minus1pt}% Space below {\small\itshape}% Body font {0pt}% Indent amount {\small\bfseries}% Theorem head font {}% Punctuation after theorem head {.5em}% Space after theorem headi {\thmname{#1}\thmnumber{\@ifnotempty{#1}{ }\@upn{#2}}% \thmnote{ {\the\thm@notefont(#3)}}}% Theorem head spec (can be left empty, meaning `normal') % \newtheoremstyle{thmstyletwo}% Numbered {18pt plus2pt minus1pt}% Space above {18pt plus2pt minus1pt}% Space below {\small\normalfont}% Body font {0pt}% Indent amount {\small\itshape}% Theorem head font {}% Punctuation after theorem head {.5em}% Space after theorem headi {\thmname{#1}\thmnumber{\@ifnotempty{#1}{ }{#2}}% \thmnote{ {\the\thm@notefont(#3)}}}% Theorem head spec (can be left empty, meaning `normal') % \newtheoremstyle{thmstylethree}% Definition {18pt plus2pt minus1pt}% Space above {18pt plus2pt minus1pt}% Space below {\small\normalfont}% Body font {0pt}% Indent amount {\small\bfseries}% Theorem head font {}% Punctuation after theorem head {.5em}% Space after theorem headi {\thmname{#1}\thmnumber{\@ifnotempty{#1}{ }\@upn{#2}}% \thmnote{ {\the\thm@notefont(#3)}}}% Theorem head spec (can be left empty, meaning `normal') % \newtheoremstyle{thmstylefour}% Proof {18pt plus2pt minus1pt}% Space above {18pt plus2pt minus1pt}% Space below {\small\normalfont}% Body font {0pt}% Indent amount {\small\itshape}% Theorem head font {}% Punctuation after theorem head {.5em}% Space after theorem headi {\global\proofthmtrue\thmname{#1} \thmnote{#3}}% Theorem head spec (can be left empty, meaning `normal') % }{} %% Macros for bibliographystyles %% % \def\bibcommenthead{\if@bibcomment\begingroup\parindent=0pt\parskip=0pt% % \removelastskip\vskip13pt\nointerlineskip% % % \vbox{\bibfont If you are submitting to one of the Nature Research journals, using the eJP % submission system, please include the references within the manuscript file itself. You may % do this by copying the reference list from your .bbl file, and pasting it into the bibliography % environment of the main manuscript .tex file.}\par% % \removelastskip\nobreak\vskip13pt\nobreak% % \endgroup\fi}% \def\bibcommenthead{}% \if@Spr@basic@refstyle% \if@Numbered@refstyle% \usepackage[numbers,sort&compress]{natbib}% \gdef\NumBib{YES}% \else% \usepackage[authoryear]{natbib}% \gdef\NumBib{NO}% \fi% \bibliographystyle{sn-basic}% \setlength{\bibsep}{1em}% \def\bibfont{\reset@font\fontfamily{\rmdefault}\normalsize\selectfont}% \fi% \if@Mathphys@refstyle% \if@Numbered@refstyle% \usepackage[numbers,sort&compress]{natbib}% \gdef\NumBib{YES}% \else% \usepackage[authoryear]{natbib}% \gdef\NumBib{NO}% \fi% \bibliographystyle{sn-mathphys}% \setlength{\bibsep}{1em}% \def\bibfont{\reset@font\fontfamily{\rmdefault}\normalsize\selectfont}% \fi% \if@APS@refstyle% \usepackage[numbers,sort&compress]{natbib}% \gdef\NumBib{YES}% \bibliographystyle{sn-APS}% \setlength{\bibsep}{1em}% \def\bibfont{\reset@font\fontfamily{\rmdefault}\normalsize\selectfont}% \fi% \if@Vancouver@refstyle% \if@Numbered@refstyle% \usepackage[numbers,sort&compress]{natbib}% \gdef\NumBib{YES}% \else% \usepackage[authoryear]{natbib}% \gdef\NumBib{NO}% \fi% \bibliographystyle{sn-vancouver}% \setlength{\bibsep}{1em}% \def\bibfont{\reset@font\fontfamily{\rmdefault}\normalsize\selectfont}% \fi% \if@APA@refstyle% \if@Numbered@refstyle% \usepackage[natbibapa]{apacite}% \gdef\NumBib{YES}% \else% \usepackage[natbibapa]{apacite}% \gdef\NumBib{NO}% \fi% \bibliographystyle{sn-apacite}% \def\refdoi#1{\urlstyle{rm}\url{#1}}% \renewcommand{\doiprefix}{}% \AtBeginDocument{% \renewcommand{\BPBI}{.}% Period between initials - command from apacite.sty }% \setlength{\bibsep}{1em}% \def\bibfont{\reset@font\fontfamily{\rmdefault}\normalsize\selectfont}% \fi% \if@Chicago@refstyle% \if@Numbered@refstyle% \usepackage[numbers,sort&compress]{natbib}% \gdef\NumBib{YES}% \else% \usepackage[authoryear]{natbib}% \gdef\NumBib{NO}% \fi% \bibliographystyle{sn-chicago}% \hypersetup{urlcolor=black,colorlinks=false,pdfborder={0 0 0}}\urlstyle{same}% \setlength{\bibsep}{1em}% \def\bibfont{\reset@font\fontfamily{\rmdefault}\normalsize\selectfont}% \fi% \if@Standard@Nature@refstyle% \usepackage[numbers,sort&compress]{natbib}% \gdef\NumBib{YES}% \bibliographystyle{sn-nature}% \setlength{\bibsep}{1em}% \def\bibfont{\reset@font\fontfamily{\rmdefault}\normalsize\selectfont}% \fi% \if@Default@refstyle% \usepackage[numbers,sort&compress]{natbib}% \gdef\NumBib{YES}% \setlength{\bibsep}{1em}% \def\bibfont{\reset@font\fontfamily{\rmdefault}\normalsize\selectfont}% \fi% \AtBeginDocument{\allowdisplaybreaks}% \def\eqnheadfont{\reset@font\fontfamily{\rmdefault}\fontsize{16}{18}\bfseries\selectfont}% \newcommand{\eqnhead}[1]{\begingroup% \begin{center} {\eqnheadfont #1}\par% \end{center} \removelastskip\vskip24pt% \thispagestyle{titlepage}%% %%\thispagestyle{empty}% \endgroup} %% Macros for border matrix %% \newif\if@borderstar \def\bordermatrix{\@ifnextchar*{% \@borderstartrue\@bordermatrix@i}{\@borderstarfalse\@bordermatrix@i*}% } \def\@bordermatrix@i*{\@ifnextchar[{\@bordermatrix@ii}{\@bordermatrix@ii[()]}} \def\@bordermatrix@ii[#1]#2{% \begingroup \m@th\@tempdima8.75\p@\setbox\z@\vbox{% \def\cr{\crcr\noalign{\kern 2\p@\global\let\cr\endline }}% \ialign {$##$\hfil\kern 2\p@\kern\@tempdima & \thinspace % \hfil $##$\hfil && \quad\hfil $##$\hfil\crcr\omit\strut % \hfil\crcr\noalign{\kern -\baselineskip}#2\crcr\omit % \strut\cr}}% \setbox\tw@\vbox{\unvcopy\z@\global\setbox\@ne\lastbox}% \setbox\tw@\hbox{\unhbox\@ne\unskip\global\setbox\@ne\lastbox}% \setbox\tw@\hbox{% $\kern\wd\@ne\kern -\@tempdima\left\@firstoftwo#1% \if@borderstar\kern2pt\else\kern -\wd\@ne\fi% \global\setbox\@ne\vbox{\box\@ne\if@borderstar\else\kern 2\p@\fi}% \vcenter{\if@borderstar\else\kern -\ht\@ne\fi% \unvbox\z@\kern-\if@borderstar2\fi\baselineskip}% \if@borderstar\kern-2\@tempdima\kern2\p@\else\,\fi\right\@secondoftwo#1 $% }\null \;\vbox{\kern\ht\@ne\box\tw@}% \endgroup } %% Macros for line numbers %% \if@vrulerlinenumberon% % \usepackage{vruler}% % %%\setvruler[][][][][][][][][] \def\linenoon{%%\definecolor{blue}{gray}{0}% \def\tiny{\normalsize\color{black}}% \setvruler[12bp][1][1][3][1][1.18\textwidth][26pt][-7pt][0.99\textheight]% for even pages: left side; for odd pages: right side; %%\linkbluecolor }% \linenoon% \def\lineno@off{\unsetvruler}% \fi% %% url macros %% \gdef\orcidlogo{% \includegraphics{Orcidlogo.eps}% }% \gdef\orcid#1{\href{#1}{\orcidlogo}}% \endinput \ No newline at end of file diff --git a/papers/JOSE/table1.jpg b/papers/preprint/table1.jpg similarity index 100% rename from papers/JOSE/table1.jpg rename to papers/preprint/table1.jpg diff --git a/papers/preprint/title_page.pdf b/papers/preprint/title_page.pdf new file mode 100644 index 000000000..6eec0dd0d Binary files /dev/null and b/papers/preprint/title_page.pdf differ diff --git a/vignettes/check_outliers.Rmd b/vignettes/check_outliers.Rmd index 906095f21..4c94fde23 100644 --- a/vignettes/check_outliers.Rmd +++ b/vignettes/check_outliers.Rmd @@ -28,8 +28,8 @@ knitr::opts_chunk$set( options(digits = 2) pkgs <- c( - "see", "performance", "datawizard", "rempsyc", - "ggplot2", "flextable", "ftExtra" + "see", "performance", "datawizard", "insight", + "ggplot2", "geomtextpath", "patchwork", "car" ) successfully_loaded <- vapply(pkgs, requireNamespace, FUN.VALUE = logical(1L), quietly = TRUE) can_evaluate <- all(successfully_loaded) @@ -49,58 +49,67 @@ if (can_evaluate) { **Reference:** -Thériault, R., Ben-Shachar, M. S., Patil, I., Lüdecke, D., Wiernik, B. M., & Makowski, D. (2024). Check your outliers! An introduction to identifying statistical outliers in R with easystats. *Behavior Research Methods*, 1-11. https://doi.org/10.3758/s13428-024-02356-w +Thériault, R., Ben-Shachar, M. S., Patil, I., Lüdecke, D., Wiernik, B. M., & Makowski, D. (2024). Check your outliers! An introduction to identifying statistical outliers in R with easystats. *Behavior Research Methods*, 1-11. https://doi.org/10.3758/s13428-024-02356-w. A preprint of this paper is available at: https://doi.org/10.31234/osf.io/bu6nt. # Summary -Beyond the challenge of keeping up-to-date with current best practices regarding the diagnosis and treatment of outliers, an additional difficulty arises concerning the mathematical implementation of the recommended methods. In this vignette, we provide an overview of current recommendations and best practices and demonstrate how they can easily and conveniently be implemented in the R statistical computing software, using the *{performance}* package of the *easystats* ecosystem. We cover univariate, multivariate, and model-based statistical outlier detection methods, their recommended threshold, standard output, and plotting methods. We conclude with recommendations on the handling of outliers: the different theoretical types of outliers, whether to exclude or winsorize them, and the importance of transparency. +Beyond the challenge of keeping up to date with current best practices regarding the diagnosis and treatment of outliers, an additional difficulty arises concerning the mathematical implementation of the recommended methods. Here, we provide an overview of current recommendations and best practices and demonstrate how they can easily and conveniently be implemented in the R statistical computing software, using the *{performance}* package of the *easystats* ecosystem. We cover univariate, multivariate, and model-based statistical outlier detection methods, their recommended threshold, standard output, and plotting methods. We conclude by reviewing the different theoretical types of outliers, whether to exclude or winsorize them, and the importance of transparency. -# Statement of Need +# Introduction -Real-life data often contain observations that can be considered *abnormal* when compared to the main population. The cause of it---be it because they belong to a different distribution (originating from a different generative process) or simply being extreme cases, statistically rare but not impossible---can be hard to assess, and the boundaries of "abnormal" difficult to define. +Real-life data often contain observations that can be considered _abnormal_ when compared to the main population. The cause of this abnormality can be hard to assess and the boundaries of "normal" difficult to define---they may truly belong to a different distribution (originating from a different generative process) or simply be extreme cases, statistically rare but not impossible. -Nonetheless, the improper handling of these outliers can substantially affect statistical model estimations, biasing effect estimations and weakening the models' predictive performance. It is thus essential to address this problem in a thoughtful manner. Yet, despite the existence of established recommendations and guidelines, many researchers still do not treat outliers in a consistent manner, or do so using inappropriate strategies [@simmons2011false; @leys2013outliers]. +Nonetheless, the improper handling of these outliers can substantially affect estimation quantities of interest, and in the context of statistical model can bias parameter estimates and weaken a models' predictive performance [@aguinis2013best]. It is thus essential to address this problem thoughtfully. Yet, despite the existence of established recommendations and guidelines, many researchers still do not treat outliers consistently, or do so using inappropriate strategies [@aguinis2013best; @simmons2011false; @leys2013outliers]. -One possible reason is that researchers are not aware of the existing recommendations, or do not know how to implement them using their analysis software. In this paper, we show how to follow current best practices for automatic and reproducible statistical outlier detection (SOD) using R and the *{performance}* package [@ludecke2021performance], which is part of the *easystats* ecosystem of packages that build an R framework for easy statistical modeling, visualization, and reporting [@easystatspackage]. Installation instructions can be found on [GitHub](https://github.com/easystats/performance) or its [website](https://easystats.github.io/performance/), and its list of dependencies on [CRAN](https://cran.r-project.org/package=performance). +Understanding the various methods for outlier detection, their differences, as well as their benefits and disadvantages, can aid researchers in choosing between them and applying them correctly [see @smiti2020critical, for an overview of pros and cons of several recently developed advanced methods]. For example, Figure 1 shows a hypothetical dataset of women’s heights and weights [based on the “women” dataset in R, @mcneil1977interactive] and how applying three different types of outlier identification methods (univariate, multivariate, and model-based; all described in detail in this vignette) can lead to different results. + +```{r fig1 parent, child=c('fig1.Rmd'), echo=FALSE} +``` + +```{r fig1, fig.cap = c("Visual representation for the most common methods in the families of outlier identification applied to a hypothetical dataset of women’s heights and weights. _Note_. In each subplot, _triangles_ are observations marked as “outliers”. (A) Univariate method: Observations are marked as outliers if they lie at some fixed or relative distance from the center of each variable (in this case, 3.29 standard-deviations from y’s mean), suggesting they are not part of the same distribution as the rest of the data; (B) Multivariate method: Observations are marked as outliers if they lie at some fixed or relative distance from the multivariate center (in this case, a Mahalanobis distance of 3.72 from the centroid defined by the means of _x_ and _y_), suggesting they are not part of the same multivariate distribution as the rest of the data; (C) Model-based method: Observations are marked as outliers if they affect the model’s estimated parameters by more than some threshold (in this case, they have a Cook’s distance of 0.71), suggesting that the inclusion of such observations biases the estimated parameters to a large degree (in the plot, this is represented as the observation with the large absolute residual [i.e., the distance from the regression line]—a concept closely related to Cook’s distance). As can be seen, although there is some overlap, the 3 methods do not agree on which observations are to be marked as outliers. Code to reproduce this figure and all analyses is available at https://osf.io/eqja6/."), echo=FALSE} +fig1 +``` + +One possible reason researchers do not employ validated strategies is that they may not be aware of existing recommendations, or do not know how to implement them using their analysis software. In this vignette, we show how to follow current best practices for automatic and reproducible statistical outlier detection (SOD) using R and the *{performance}* package [@ludecke2021performance], which is part of the _easystats_ ecosystem of packages that build an R framework for easy statistical modeling, visualization, and reporting [@easystatspackage]. Installation instructions can be found on [GitHub](https://github.com/easystats/performance) or its [website](https://easystats.github.io/performance/), and its list of dependencies on [CRAN](https://cran.r-project.org/package=performance). The instructional materials that follow are aimed at an audience of researchers who want to follow good practices, and are appropriate for advanced undergraduate students, graduate students, professors, or professionals having to deal with the nuances of outlier treatment. # Identifying Outliers -Although many researchers attempt to identify outliers with measures based on the mean (e.g., _z_ scores), those methods are problematic because the mean and standard deviation themselves are not robust to the influence of outliers and those methods also assume normally distributed data (i.e., a Gaussian distribution). Therefore, current guidelines recommend using robust methods to identify outliers, such as those relying on the median as opposed to the mean [@leys2019outliers; @leys2013outliers; @leys2018outliers]. +Although many researchers attempt to identify outliers with measures based on the mean (e.g., _z_ scores), those methods can be problematic. This is because the mean and standard deviation themselves are not robust to the influence of outliers and those methods also assume normally distributed data (i.e., a Gaussian distribution). Therefore, current guidelines recommend using robust methods to identify outliers, such as those relying on the median as opposed to the mean [@leys2019outliers; @leys2013outliers; @leys2018outliers]. Additionally, univariate methods can give false positives since they ignore the patterns in multidimensional data, which are often of interest (such as comparing conditional means or estimating correlation matrices). In such cases, multivariate outlier detection methods may be of relevance. -Nonetheless, which exact outlier method to use depends on many factors. In some cases, eye-gauging odd observations can be an appropriate solution, though many researchers will favour algorithmic solutions to detect potential outliers, for example, based on a continuous value expressing the observation stands out from the others. +Which exact outlier method to use depends on many factors. In some cases, eye-gauging odd observations can be an appropriate solution, though many researchers will favor algorithmic solutions to detect potential outliers, for example, based on a continuous value expressing the observations that stand out from the others. Indeed, relying on human intuition and “visual checks” can be rather subjective, and sometimes, even suboptimal. For example, visually communicating results containing outliers—say, on a scatter plot—has been shown to bias people’s estimations of a regression line, even when individuals correctly detect the outliers [@ciccione2023outlier]. -One of the factors to consider when selecting an algorithmic outlier detection method is the statistical test of interest. When using a regression model, relevant information can be found by identifying observations that do not fit well with the model. This approach, known as model-based outliers detection (as outliers are extracted after the statistical model has been fit), can be contrasted with distribution-based outliers detection, which is based on the distance between an observation and the "center" of its population. Various quantification strategies of this distance exist for the latter, both univariate (involving only one variable at a time) or multivariate (involving multiple variables). +One of the factors to consider when selecting an algorithmic outlier detection method is the statistical test of interest. Identifying observations where the regression model does not fit well can help find information relevant to our specific research context. This approach, known as model-based outliers detection (as outliers are extracted after the statistical model has been fit), can be contrasted with distribution-based outliers detection, which is based on the distance between an observation and the "center" of its population. Various quantification strategies of this distance exist for the latter, both univariate (involving only one variable at a time) and multivariate (involving multiple variables). -When no method is readily available to detect model-based outliers, such as for structural equation modelling (SEM), looking for multivariate outliers may be of relevance. For simple tests (_t_ tests or correlations) that compare values of the same variable, it can be appropriate to check for univariate outliers. However, univariate methods can give false positives since _t_ tests and correlations, ultimately, are also models/multivariable statistics. They are in this sense more limited, but we show them nonetheless for educational purposes. +However, we would like to emphasize that the methods listed in this vignette are not an exhaustive list of methods developed and available to researchers. For instance, Bayesian approaches that do not fully reject outliers but simply lower their “weights” have been partly formalized by @chaloner1988bayesian and recently implemented by @ciccione2023outlier. Crucially, Ciccione and colleagues also provide empirical evidence that human observers might indeed perform such forms of Bayesian re-weighting of outliers when asked to detect and reject them, making interesting parallels between statistical research methods and naive psychological mechanisms. -Importantly, whatever approach researchers choose remains a subjective decision, which usage (and rationale) must be transparently documented and reproducible [@leys2019outliers]. Researchers should commit (ideally in a preregistration) to an outlier treatment method before collecting the data. They should report in the paper their decisions and details of their methods, as well as any deviation from their original plan. These transparency practices can help reduce false positives due to excessive researchers' degrees of freedom (i.e., choice flexibility throughout the analysis). In the following section, we will go through each of the mentioned methods and provide examples on how to implement them with R. +Importantly, whatever approach researchers choose remains a subjective decision, and usage (and rationale) must be transparently documented and reproducible [@leys2019outliers]. Researchers should commit (ideally in a preregistration) to an outlier treatment method before collecting the data. They should report in the paper their decisions and details of their methods, as well as any deviation from their original plan. These transparency practices can help reduce false positives due to excessive researchers' degrees of freedom (i.e., choice flexibility throughout the analysis). In the following section, we go through each of the mentioned methods and provide examples of how to implement them with R. ## Univariate Outliers -Researchers frequently attempt to identify outliers using measures of deviation from the center of a variable's distribution. One of the most popular such procedure is the _z_ score transformation, which computes the distance in standard deviation (SD) from the mean. However, as mentioned earlier, this popular method is not robust. Therefore, for univariate outliers, it is recommended to use the median along with the Median Absolute Deviation (MAD), which are more robust than the interquartile range or the mean and its standard deviation [@leys2019outliers; @leys2013outliers]. +Researchers frequently attempt to identify outliers using measures of deviation from the center of a variable's distribution. One of the most popular of such procedures is the _z_-score transformation, which computes the distance in standard deviation (SD) from the mean. However, as mentioned earlier, this popular method is not robust. Therefore, for univariate outliers, it is recommended to use the median along with the median absolute deviation (MAD), which is more robust than the interquartile range or the mean and its standard deviation [@leys2019outliers; @leys2013outliers]. Researchers can identify outliers based on robust (i.e., MAD-based) _z_ scores using the `check_outliers()` function of the *{performance}* package, by specifying `method = "zscore_robust"`.^[Note that `check_outliers()` only checks numeric variables.] Although @leys2013outliers suggest a default threshold of 2.5 and @leys2019outliers a threshold of 3, *{performance}* uses by default a less conservative threshold of ~3.29.^[3.29 is an approximation of the two-tailed critical value for _p_ < .001, obtained through `qnorm(p = 1 - 0.001 / 2)`. We chose this threshold for consistency with the thresholds of all our other methods.] That is, data points will be flagged as outliers if they go beyond +/- ~3.29 MAD. Users can adjust this threshold using the `threshold` argument. -Below we provide example code using the `mtcars` dataset, which was extracted from the 1974 *Motor Trend* US magazine. The dataset contains fuel consumption and 10 characteristics of automobile design and performance for 32 different car models (see `?mtcars` for details). We chose this dataset because it is accessible from base R and familiar to many R users. We might want to conduct specific statistical analyses on this data set, say, _t_ tests or structural equation modelling, but first, we want to check for outliers that may influence those test results. +Below, we provide example code using the `mtcars` dataset, which was extracted from the 1974 _Motor Trend_ US magazine. The dataset contains fuel consumption and 10 characteristics of automobile design and performance for 32 different car models (see `?mtcars` for details). We chose this dataset because it is accessible from base R and familiar to many R users. We might want to conduct specific statistical analyses on this data set, say, _t_ tests or structural equation modeling, but first, we want to check for outliers that may influence those test results. -Because the automobile names are stored as column names in `mtcars`, we first have to convert them to an ID column to benefit from the `check_outliers()` ID argument. Furthermore, we only really need a couple columns for this demonstration, so we choose the first four (`mpg` = Miles/(US) gallon; `cyl` = Number of cylinders; `disp` = Displacement; `hp` = Gross horsepower). Finally, because there are no outliers in this dataset, we add two artificial outliers before running our function. +Because the automobile names are stored as column names in `mtcars`, we first have to convert them to an ID column to benefit from the `check_outliers()` ID argument. Furthermore, we only really need a few columns for this demonstration, so we pick the first four (`mpg` = Miles/(US) gallon; `cyl` = Number of cylinders; `disp` = Displacement; `hp` = Gross horsepower). Finally, because there are no outliers in this dataset, we add two artificial outliers before running our function. ```{r z_score} library(performance) # Create some artificial outliers and an ID column -data <- rbind(mtcars[1:4], 42, 55) +data <- rbind(mtcars[1:4], 12, 55) data <- cbind(car = row.names(data), data) outliers <- check_outliers(data, method = "zscore_robust", ID = "car") outliers ``` -What we see is that `check_outliers()` with the robust _z_ score method detected two outliers: cases 33 and 34, which were the observations we added ourselves. They were flagged for two variables specifically: `mpg` (Miles/(US) gallon) and `cyl` (Number of cylinders), and the output provides their exact _z_ score for those variables. +What we see is that `check_outliers()` with the robust _z_ score method detected one outlier: case 33, which is one of the observations we added ourselves. It was flagged for two variables specifically: `mpg` (miles/(US) gallon) and `cyl` (number of cylinders), and the output provides its exact _z_ score for this variable. -We describe how to deal with those cases in more details later in the paper, but should we want to exclude these detected outliers from the main dataset, we can extract row numbers using `which()` on the output object, which can then be used for indexing: +We describe how to deal with outliers in more details later in the vignette, but should we want to exclude detected outliers from the main dataset, we can extract row numbers using `which()` on the output object, which can then be used for indexing: ```{r} which(outliers) @@ -108,151 +117,136 @@ which(outliers) data_clean <- data[-which(outliers), ] ``` -All `check_outliers()` output objects possess a `plot()` method, meaning it is also possible to visualize the outliers using the generic `plot()` function on the resulting outlier object after loading the {see} package. +All `check_outliers()` output objects possess a `plot()` method, meaning it is also possible to visualize all observations in a way that highlights the outliers using the generic `plot()` function on the resulting outlier object after loading the {see} package (Figure 2). ```{r univariate, eval=FALSE} library(see) + plot(outliers) ``` -```{r univariate_implicit, fig.cap = "Visual depiction of outliers using the robust z-score method. The distance represents an aggregate score for variables mpg, cyl, disp, and hp.", echo=FALSE} +```{r univariate_implicit, fig.cap = "Visual depiction of outliers using the robust z-score method. Note. The distance represents the highest deviation score per participant for variables mpg, cyl, disp, and hp. This score represents a given participant’s (1-34) highest robust z score among the tested variables. The resulting unique value (representing one of mpg, cyl, disp, or hp for that participant) is then rescaled to a range of 0 to 1 by dividing by the value of the participant with the highest score.", echo=FALSE} library(see) -plot(outliers) + + +plot(outliers) + ggplot2::theme(axis.text.x = ggplot2::element_text( angle = 45, size = 7 - )) +)) ``` -Other univariate methods are available, such as using the interquartile range (IQR), or based on different intervals, such as the Highest Density Interval (HDI) or the Bias Corrected and Accelerated Interval (BCI). These methods are documented and described in the function's [help page](). +Other univariate methods are available, such as using the interquartile range (IQR), or based on different intervals, such as the highest density interval (HDI) or the bias corrected and accelerated interval (BCI). These methods are documented and described in the function's [help page](). ## Multivariate Outliers Univariate outliers can be useful when the focus is on a particular variable, for instance the reaction time, as extreme values might be indicative of inattention or non-task-related behavior^[ Note that they might not be the optimal way of treating reaction time outliers [@ratcliff1993methods; @van1995statistical]]. -However, in many scenarios, variables of a data set are not independent, and an abnormal observation will impact multiple dimensions. For instance, a participant giving random answers to a questionnaire. In this case, computing the _z_ score for each of the questions might not lead to satisfactory results. Instead, one might want to look at these variables together. +However, in many scenarios, the variables of a data set are not independent, and an outlying observation or participant will be reflected to various degrees on multiple variables. For instance, in the case of survey studies containing a large number of items (e.g., many Likert scales), “careless” or low-effort responding participations (e.g., participants answering at random, displaying “straight-lining”, or “zigzagging” patterns of response) becomes more common—especially when relying on online samples such as through MTurk [@aruguete2019serious; @goldammer2020careless; @ward2023dealing]. Although specific methods exist to detect these unwanted behaviors in questionnaires [e.g., @cao2018z; @curran2016methods; @carelesspackage; @zijlstra2011outliers), this issue can be framed more generally as follows: multiple “odd” observations can sum up and reveal an abnormal participant. Importantly, the deviation from the norm could potentially be low for all variables when taken independently (not meeting the rejection criteria), but strong when taken together (in other words, the likelihood of being an outlier on one variable can be independent from the probability of being an outlier on multiple variables). -One common approach for this is to compute multivariate distance metrics such as the Mahalanobis distance. Although the Mahalanobis distance is very popular, just like the regular _z_ scores method, it is not robust and is heavily influenced by the outliers themselves. Therefore, for multivariate outliers, it is recommended to use the Minimum Covariance Determinant, a robust version of the Mahalanobis distance [MCD, @leys2018outliers; @leys2019outliers]. +One common approach for this is to compute multivariate distance metrics, such as the Mahalanobis distance. Although the Mahalanobis distance is very popular, just like the regular _z_ scores method, it is not robust and is heavily influenced by the outliers themselves. Therefore, for multivariate outliers, it is recommended to use the Minimum Covariance Determinant, a robust version of the Mahalanobis distance [MCD, @leys2018outliers; @leys2019outliers]. In *{performance}*'s `check_outliers()`, one can use this approach with `method = "mcd"`.^[Our default threshold for the MCD method is defined by `stats::qchisq(p = 1 - 0.001, df = ncol(x))`, which again is an approximation of the critical value for _p_ < .001 consistent with the thresholds of our other methods.] ```{r multivariate} -outliers <- check_outliers(data, method = "mcd", verbose = FALSE) +outliers <- check_outliers(data, method = "mcd") outliers ``` -Here, we detected 9 multivariate outliers (i.e,. when looking at all variables of our dataset together). +Here, we detected nine multivariate outliers (i.e., when looking at all variables of our dataset together). We can see the result in Figure 3. ```{r multivariate_plot, eval=FALSE} plot(outliers) ``` -```{r multivariate_implicit, fig.cap = "Visual depiction of outliers using the Minimum Covariance Determinant (MCD) method, a robust version of the Mahalanobis distance. The distance represents the MCD scores for variables mpg, cyl, disp, and hp.", echo=FALSE} -plot(outliers) + +```{r multivariate_implicit, fig.cap = "Visual depiction of outliers using the minimum covariance determinant (MCD) method. Note. The MCD method is a robust version of the Mahalanobis distance. The distance represents the MCD scores for variables mpg, cyl, disp, and hp.", echo=FALSE} +plot(outliers) + ggplot2::theme(axis.text.x = ggplot2::element_text( angle = 45, size = 7 - )) +)) ``` -Other multivariate methods are available, such as another type of robust Mahalanobis distance that in this case relies on an orthogonalized Gnanadesikan-Kettenring pairwise estimator [@gnanadesikan1972robust]. These methods are documented and described in the function's [help page](https://easystats.github.io/performance/reference/check_outliers.html). +In small samples, however, the MCD method tends to be inaccurate, especially when dealing with high-dimensional data. Other multivariate methods are also available, such as the classic Mahalanobis distance and another type of robust Mahalanobis distance that relies on an orthogonalized Gnanadesikan–Kettenring pairwise estimator [@gnanadesikan1972robust]. These methods are documented and described in the function’s [help page](https://easystats.github.io/performance/reference/check_outliers.html). ## Model-Based Outliers -Working with regression models creates the possibility of using model-based SOD methods. These methods rely on the concept of *leverage*, that is, how much influence a given observation can have on the model estimates. If few observations have a relatively strong leverage/influence on the model, one can suspect that the model's estimates are biased by these observations, in which case flagging them as outliers could prove helpful (see next section, "Handling Outliers"). +Working with regression models creates the possibility of using model-based SOD methods. These methods rely on the concept of _leverage_, that is, how much influence a given observation can have on the model estimates. If few observations have a relatively strong leverage/influence on the model, one can suspect that the model's estimates are biased by these observations, in which case flagging them as outliers could prove helpful (see next section, "Handling Outliers"). -In {performance}, two such model-based SOD methods are currently available: Cook's distance, for regular regression models, and Pareto, for Bayesian models. As such, `check_outliers()` can be applied directly on regression model objects, by simply specifying `method = "cook"` (or `method = "pareto"` for Bayesian models).^[Our default threshold for the Cook method is defined by `stats::qf(0.5, ncol(x), nrow(x) - ncol(x))`, which again is an approximation of the critical value for _p_ < .001 consistent with the thresholds of our other methods.] +In {performance}, two such model-based SOD methods are currently available: Cook's distance, for regular regression models, and Pareto, for Bayesian models. As such, `check_outliers()` can be applied directly on regression model objects, by simply specifying `method = "cook"` (or `method = "pareto"` for Bayesian models).^[Our default threshold for the Cook method is defined by `stats::qf(0.5, ncol(x), nrow(x) - ncol(x))`, which again is an approximation of the critical value for _p_ < .001 consistent with the thresholds of our other methods. In this case, the value 0.5 represents the median of the implied F distribution for D, which allows us to flag D values that are “above average”.] -Currently, most lm models are supported (with the exception of `glmmTMB`, `lmrob`, and `glmrob` models), as long as they are supported by the underlying functions `stats::cooks.distance()` (or `loo::pareto_k_values()`) and `insight::get_data()` (for a full list of the 225 models currently supported by the `insight` package, see https://easystats.github.io/insight/#list-of-supported-models-by-class). Also note that although `check_outliers()` supports the pipe operators (`|>` or `%>%`), it does not support `tidymodels` at this time. We show a demo below. +Currently, most lm models are supported (except for `glmmTMB`, `lmrob`, and `glmrob` models), as long as they are supported by the underlying functions `stats::cooks.distance()` (or `loo::pareto_k_values()`) and `insight::get_data()` (for a full list of the 225 models currently supported by the `insight` package, see https://easystats.github.io/insight/#list-of-supported-models-by-class). We show a demo below. -```{r model, fig.cap = "Visual depiction of outliers based on Cook's distance (leverage and standardized residuals), based on the fitted model."} -model <- lm(disp ~ mpg * hp, data = data) +```{r model} +model <- lm(mpg ~ disp * hp, data = data) outliers <- check_outliers(model, method = "cook") outliers +``` + +Using the model-based outlier detection method, we identified a single outlier. We can see the result in Figure 4. +```{r model_fig, fig.cap = "Visual depiction of outliers based on Cook’s distance (leverage and standardized residuals). Note. This plot is based on the fitted model."} plot(outliers) ``` -Using the model-based outlier detection method, we identified two outliers. - Table 1 below summarizes which methods to use in which cases, and with what threshold. The recommended thresholds are the default thresholds. ```{r table1_prep, echo=FALSE} df <- data.frame( `Statistical Test` = c( "Supported regression model", - "Structural Equation Modeling (or other unsupported model)", - "Simple test with few variables (*t* test, correlation, etc.)" - ), + NA, + "Structural Equation Modeling (or other unsupported model)^1^", + NA, + "Simple test with few variables (*t* test, correlation, etc.)"), `Diagnosis Method` = c( "**Model-based**: Cook (or Pareto for Bayesian models)", + NA, "**Multivariate**: Minimum Covariance Determinant (MCD)", - "**Univariate**: robust *z* scores (MAD)" - ), + NA, + "**Univariate**: robust *z* scores (MAD)"), `Recommended Threshold` = c( "_qf(0.5, ncol(x), nrow(x) - ncol(x))_ (or 0.7 for Pareto)", + NA, "_qchisq(p = 1 - 0.001, df = ncol(x))_", - "_qnorm(p = 1 - 0.001 / 2)_, ~ 3.29" - ), + NA, + "_qnorm(p = 1 - 0.001 / 2)_, ~ 3.29"), `Function Usage` = c( '_check_outliers(model, method = "cook")_', + NA, '_check_outliers(data, method = "mcd")_', - '_check_outliers(data, method = "zscore_robust")_' - ), + NA, + '_check_outliers(data, method = "zscore_robust")_'), check.names = FALSE ) -``` - -### Table 1 - -_Summary of Statistical Outlier Detection Methods Recommendations_ -```{r table1_print, echo=FALSE, message=FALSE} -x <- flextable::flextable(df, cwidth = 2.25) -x <- flextable::theme_apa(x) -x <- flextable::font(x, fontname = "Latin Modern Roman", part = "all") -# x <- flextable::fontsize(x, size = 10, part = "all") -ftExtra::colformat_md(x) +options(knitr.kable.NA = "") +knitr::kable( + df, align = "l", col.names = gsub("[.]", " ", names(df)), + caption = "Summary of Statistical Outlier Detection Methods Recommendations") ``` +^1^ The Minimum Covariance Determinant (MCD) can be inaccurate for small sample sizes. In these cases, the classic Mahalanobis distance can be used instead. + ## Cook's Distance vs. MCD @leys2018outliers report a preference for the MCD method over Cook's distance. This is because Cook's distance removes one observation at a time and checks its corresponding influence on the model each time [@cook1977detection], and flags any observation that has a large influence. In the view of these authors, when there are several outliers, the process of removing a single outlier at a time is problematic as the model remains "contaminated" or influenced by other possible outliers in the model, rendering this method suboptimal in the presence of multiple outliers. -However, distribution-based approaches are not a silver bullet either, and there are cases where the usage of methods agnostic to theoretical and statistical models of interest might be problematic. For example, a very tall person would be expected to also be much heavier than average, but that would still fit with the expected association between height and weight (i.e., it would be in line with a model such as `weight ~ height`). In contrast, using multivariate outlier detection methods there may flag this person as being an outlier---being unusual on two variables, height and weight---even though the pattern fits perfectly with our predictions. - -In the example below, we plot the raw data and see two possible outliers. The first one falls along the regression line, and is therefore "in line" with our hypothesis. The second one clearly diverges from the regression line, and therefore we can conclude that this outlier may have a disproportionate influence on our model. - -```{r scatter, fig.cap = "Scatter plot of height and weight, with two extreme observations: one model-consistent (top-right) and the other, model-inconsistent (i.e., an outlier; bottom-right)."} -data <- women[rep(seq_len(nrow(women)), each = 100), ] -data <- rbind(data, c(100, 258), c(100, 200)) -model <- lm(weight ~ height, data) -rempsyc::nice_scatter(data, "height", "weight") -``` - -Using either the *z*-score or MCD methods, our model-consistent observation will be incorrectly flagged as an outlier or influential observation. +However, distribution-based approaches are not a silver bullet either, and there are cases where the usage of methods agnostic to theoretical and statistical models of interest might be problematic. For example, a very tall person would be expected to also be much heavier than average, but that would still fit with the expected association between height and weight (i.e., it would be in line with a model such as `weight ~ height`). In contrast, using multivariate outlier detection methods in such a case may flag this person as being an outlier---being unusual on two variables, height and weight---even though the pattern fits perfectly with our predictions. -```{r} -outliers <- check_outliers(model, method = c("zscore_robust", "mcd"), verbose = FALSE) -which(outliers) -``` +Refer again to Figure 1: In Panel B both an extremely tall woman, and a shorter but heavier woman are flagged as outlier due to their (Mahalanobis) distance from the group’s centroid. However, when examined in the context of the relationship between height and weight (panel C), it is clear that the taller woman’s weight falls along the regression line. That is, it is _model-consistent_—we expect an extremely tall person to weigh more, and so this observation is not marked as an outlier using a model based method, though it is when using univariate (Panel A) or multivariate (Panel B) methods. On the other hand, the second observation not only has a high Cook’s distance, meaning it has influenced the model’s estimates by a large degree, but it also clearly diverges from the regression line—it is _model-inconsistent_, and is accordingly flagged as an outlier. -In contrast, the model-based detection method displays the desired behaviour: it correctly flags the person who is very tall but very light, without flagging the person who is both tall and heavy. - -```{r model2, fig.cap = "The leverage method (Cook's distance) correctly distinguishes the true outlier from the model-consistent extreme observation), based on the fitted model."} -outliers <- check_outliers(model, method = "cook") -which(outliers) -plot(outliers) -``` +This model-based approach to outlier detection is most coherent in regression-based settings; however, sometimes we are interested in multi-dimensional outlier detection in the classical sense of a point that is far away from the general cluster of our data. We might, for example, decide to exclude a person who is extremely tall and heavy because they differ too much from the main population of study, even if they do match the general trend. In these cases, other methods such as MCD can be appropriate. Finally, unusual observations happen naturally: extreme observations are expected even when taken from a normal distribution. While statistical models can integrate this "expectation", multivariate outlier methods might be too conservative, flagging too many observations despite belonging to the right generative process. For these reasons, we believe that model-based methods are still preferable to the MCD when using supported regression models. Additionally, if the presence of multiple outliers is a significant concern, regression methods that are more robust to outliers should be considered---like _t_ regression or quantile regression---as they render their precise identification less critical [@mcelreath2020statistical]. ## Composite Outlier Score -The *{performance}* package also offers an alternative, consensus-based approach that combines several methods, based on the assumption that different methods provide different angles of looking at a given problem. By applying a variety of methods, one can hope to "triangulate" the true outliers (those consistently flagged by multiple methods) and thus attempt to minimize false positives. +To reiterate, there is not any wrong method, per se. Different methods can be judged by their usefulness to do _something_, but do so differently. Univariate methods are often good at detecting non-representative values or data-coding errors. Multivariate methods are also good at detecting non-representative values in a joint-distribution sense. Similarly, model-based methods are good for detecting values that might unrealistically bias model inference. + +The *{performance}* package offers a consensus-based approach that combines several methods, based on the assumption that different methods provide different angles of looking at a given problem. By applying a variety of methods, one can hope to "triangulate" the true outliers (those consistently flagged by multiple methods) and thus attempt to minimize false positives. -In practice, this approach computes a composite outlier score, formed of the average of the binary (0 or 1) classification results of each method. It represents the probability that each observation is classified as an outlier by at least one method. The default decision rule classifies rows with composite outlier scores superior or equal to 0.5 as outlier observations (i.e., that were classified as outliers by at least half of the methods). In *{performance}*'s `check_outliers()`, one can use this approach by including all desired methods in the corresponding argument. +In practice, this approach computes a composite outlier score, formed of the average of the binary (0 or 1) classification results of each method. It represents the probability that each observation is classified as an outlier by at least one method. The default decision rule classifies rows with composite outlier scores superior or equal to 0.5 as outlier observations (i.e., that were classified as outliers by at least half of the methods). In *{performance}*'s `check_outliers()`, one can use this approach by including all desired methods in the corresponding argument. Returning to the example model above: -```{r multimethod, fig.cap = "Visual depiction of outliers using several different statistical outlier detection methods."} -outliers <- check_outliers(model, method = c("zscore_robust", "mcd", "cook"), verbose = FALSE) +```{r multimethod"} +outliers <- check_outliers(model, method = c("zscore_robust", "mcd", "cook")) which(outliers) ``` @@ -268,37 +262,48 @@ An example sentence for reporting the usage of the composite method could be: # Handling Outliers -The above section demonstrated how to identify outliers using the `check_outliers()` function in the *{performance}* package. But what should we do with these outliers once identified? Although it is common to automatically discard any observation that has been marked as "an outlier" as if it might infect the rest of the data with its statistical ailment, we believe that the use of SOD methods is but one step in the get-to-know-your-data pipeline; a researcher or analyst's _domain knowledge_ must be involved in the decision of how to deal with observations marked as outliers by means of SOD. Indeed, automatic tools can help detect outliers, but they are nowhere near perfect. Although they can be useful to flag suspect data, they can have misses and false alarms, and they cannot replace human eyes and proper vigilance from the researcher. If you do end up manually inspecting your data for outliers, it can be helpful to think of outliers as belonging to different types of outliers, or categories, which can help decide what to do with a given outlier. +The above section demonstrated how to identify outliers using the `check_outliers()` function in the *{performance}* package. But what should we do with these outliers once identified? It is common to automatically discard any observation that has been marked as "an outlier" as if it might infect the rest of the data with its statistical ailment. However, it is important to remember that researchers do not have access to the ground truth—it is not possible to know which observations truly do not “belong” with the rest of the sample. Instead, outlier detection methods behave much like unsupervised learning methods, trying to find patterns in the data, and to mark observations that seem to have a bad “fit” with these patterns. + +Therefore, we believe that these methods should merely be used as suggestive, and advocate for researchers and analysts to use their _domain knowledge_ when deciding how to deal with observations marked as outliers using SOD. Indeed, automatic tools can help detect outliers, but they are nowhere near perfect. Although they can be useful for flagging suspect data, they can have misses and false alarms, and they cannot completely replace human eyes and proper vigilance from the researcher. That is, the use of SOD methods is but one step in the get-to-know-your-data pipeline. + +For example, in the case of reaction time analysis, @miller2023outlier systematically compared 58 SOD procedures in simulations using large datasets of real reaction times. He concluded that regardless of the selected procedure, the exclusion of outliers (reaction times too slow or too fast) generally did more harm than good compared to retaining them, as they tend to incorrectly detect outliers, reduce statistical power, and increase bias and noise. He thus recommends only excluding invalid reaction times, such as those under a fixed threshold, e.g., 150 ms, which is close to the minimal physiological limit for reacting to a visual stimulus. Setting an upper limit on very long times (e.g., 3 to 5 seconds, depending on the experimental task) to remove potential sparse artifacts can also improve model convergence and fitting. + +@miller2023outlier also suggests that it is typically better to assess outliers within specific experimental conditions or groups (a condition-specific strategy), rather than across the entire dataset at once (a pooled strategy), particularly in the case of reaction times. Additionally, common procedures such as statistical transformations (e.g., log-transformation) reportedly offer at best no benefit (being instead potentially detrimental) to statistical power [@schramm2019reaction]. Given the specific shape of a typical reaction distribution, treating them with bespoke models that take into account its skewness (thus reframing the notion of outliers and integrating the longer right tail of the distribution) should be considered. Examples of such models—referred to as sequential sampling models or evidence accumulation models—include Wald models [@anders2016shifted], log-normal race models [@rouder2015lognormal], linear ballistic accumulators [@brown2008simplest], and Drift Diffusion Models [@ratcliff2016diffusion]. + +Thus, when manually inspecting data for outliers, it can be helpful to think of outliers as belonging to different types of outliers, or categories, which can help decide what to do with a given outlier. ## Error, Interesting, and Random Outliers -@leys2019outliers distinguish between error outliers, interesting outliers, and random outliers. _Error outliers_ are likely due to human error and should be corrected before data analysis or outright removed since they are invalid observations. _Interesting outliers_ are not due to technical error and may be of theoretical interest; it might thus be relevant to investigate them further even though they should be removed from the current analysis of interest. _Random outliers_ are assumed to be due to chance alone and to belong to the correct distribution and, therefore, should be retained. +Several authors distinguish between error outliers, interesting outliers, and random outliers [@aguinis2013best; @leys2019outliers].^[Some authors provide much more detailed classifications of outliers; for example, see Table 1 in Aguinis et al. (2013), for 14 different outlier definitions based on a literature review.] _Error outliers_ are likely due to human error and should be corrected before data analysis or outright removed since they are invalid observations (e.g., physiologically implausible reaction times). _Interesting outliers_ are not due to technical error and may be of theoretical interest; it might thus be relevant to investigate them further, even though they should be removed from the current analysis of interest. _Random outliers_ are assumed to be due to chance alone and to belong to the correct distribution and, therefore, should be retained. -It is recommended to _keep_ observations which are expected to be part of the distribution of interest, even if they are outliers [@leys2019outliers]. However, if it is suspected that the outliers belong to an alternative distribution, then those observations could have a large impact on the results and call into question their robustness, especially if significance is conditional on their inclusion, so should be removed. +It is recommended to _keep_ observations which are expected to be part of the distribution of interest, even if they are outliers [@leys2019outliers]. However, if it is suspected that the outliers belong to an alternative distribution, then those observations could have a large impact on the results. These observations could then call into question the robustness of these results, especially if significance is conditional on their inclusion, so they should be removed. Some authors also report detailed decision trees for handling outliers [e.g., see Figures 1 & 2 in @aguinis2013best]. -We should also keep in mind that there might be error outliers that are not detected by statistical tools, but should nonetheless be found and removed. For example, if we are studying the effects of X on Y among teenagers and we have one observation from a 20-year-old, this observation might not be a _statistical outlier_, but it is an outlier in the _context_ of our research, and should be discarded. We could call these observations *undetected* error outliers, in the sense that although they do not statistically stand out, they do not belong to the theoretical or empirical distribution of interest (e.g., teenagers). In this way, we should not blindly rely on statistical outlier detection methods; doing our due diligence to investigate undetected error outliers relative to our specific research question is also essential for valid inferences. +We should also keep in mind that there might be error outliers that are not detected by statistical tools but should nonetheless be found and removed. For example, if we are studying the effects of X on Y among teenagers, and we have one observation from a 20-year-old, this observation might not be a _statistical outlier_, but it is an outlier in the _context_ of our research and should be discarded. We could call these observations *undetected* error outliers, in the sense that although they do not statistically stand out, they do not belong to the theoretical or empirical distribution of interest (e.g., teenagers). In this way, we should not blindly rely on statistical outlier detection methods; doing our due diligence to investigate undetected error outliers relative to our specific research question is also essential for valid inferences. ## Winsorization -_Removing_ outliers can in this case be a valid strategy, and ideally one would report results with and without outliers to see the extent of their impact on results. This approach however can reduce statistical power. Therefore, some propose a _recoding_ approach, namely, winsorization: bringing outliers back within acceptable limits [e.g., 3 MADs, @tukey1963less]. However, if possible, it is recommended to collect enough data so that even after removing outliers, there is still sufficient statistical power without having to resort to winsorization [@leys2019outliers]. +_Removing_ outliers that do not belong to the distribution of interest can in this case be a valid strategy, and ideally one would report results with and without outliers to see the extent of their impact on results. This approach however can reduce statistical power. Therefore, some propose a _recoding_ approach, namely, winsorization: bringing outliers back within acceptable limits [e.g., three MADs, @tukey1963less]. However, if possible, it is recommended to collect enough data so that even after removing outliers, there is still sufficient statistical power without having to resort to winsorization [@leys2019outliers]. -The _easystats_ ecosystem makes it easy to incorporate this step into your workflow through the `winsorize()` function of *{datawizard}*, a lightweight R package to facilitate data wrangling and statistical transformations [@patil2022datawizard]. This procedure will bring back univariate outliers within the limits of 'acceptable' values, based either on the percentile, the _z_ score, or its robust alternative based on the MAD. +The _easystats_ ecosystem makes it easy to incorporate this step into your workflow through the `winsorize()` function of *{datawizard}*, a lightweight R package to facilitate data wrangling and statistical transformations [@patil2022datawizard]. This procedure will bring back univariate outliers within the limits of 'acceptable' values, based either on the percentile, the _z_ score, or its robust alternative based on the MAD. For example, let's say we want to winsorize the univariate outlier identified before: ```{r winsorization} -data[1501:1502, ] # See outliers rows +data[33:34, 2:3] # See outliers rows + # Winsorizing using the MAD library(datawizard) -winsorized_data <- winsorize(data, method = "zscore", robust = TRUE, threshold = 3) -# Values > +/- MAD have been winsorized -winsorized_data[1501:1502, ] +winsorized_data <- winsorize(data, method = "zscore", + robust = TRUE, threshold = 3) + +# Outlier values > +/- MAD have been winsorized +winsorized_data[33:34, 2:3] ``` ## The Importance of Transparency -Once again, it is a critical part of a sound outlier treatment that regardless of which SOD method used, it should be reported in a reproducible manner. Ideally, the handling of outliers should be specified *a priori* with as much detail as possible, and preregistered, to limit researchers' degrees of freedom and therefore risks of false positives [@leys2019outliers]. This is especially true given that interesting outliers and random outliers are often times hard to distinguish in practice. Thus, researchers should always prioritize transparency and report all of the following information: (a) how many outliers were identified (including percentage); (b) according to which method and criteria, (c) using which function of which R package (if applicable), and (d) how they were handled (excluded or winsorized, if the latter, using what threshold). If at all possible, (e) the corresponding code script along with the data should be shared on a public repository like the Open Science Framework (OSF), so that the exclusion criteria can be reproduced precisely. +Finally, it is a critical part of a sound outlier treatment that regardless of which SOD method used, it should be reported in a reproducible manner. Ideally, the handling of outliers should be specified *a priori* with as much detail as possible, and preregistered, to limit researchers' degrees of freedom and therefore risks of false positives [@leys2019outliers]. This is especially true given that interesting outliers and random outliers are oftentimes hard to distinguish in practice. Thus, researchers should always prioritize transparency and report all the following information: (a) how many outliers were identified (including percentage); (b) according to which method and criteria, (c) using which function of which R package (if applicable), and (d) how they were handled (excluded or winsorized, if the latter, using what threshold). If at all possible, (e) the corresponding code along with the data should be shared in a public repository like the Open Science Framework (OSF), so that the exclusion criteria can be reproduced precisely. # Conclusion -In this vignette, we have showed how to investigate outliers using the `check_outliers()` function of the *{performance}* package while following current good practices. However, best practice for outlier treatment does not stop at using appropriate statistical algorithms, but entails respecting existing recommendations, such as preregistration, reproducibility, consistency, transparency, and justification. Ideally, one would additionally also report the package, function, and threshold used (linking to the full code when possible). We hope that this paper and the accompanying `check_outlier()` function of *easystats* will help researchers engage in good research practices while providing a smooth outlier detection experience. +In this vignette, we have shown how to investigate outliers using the `check_outliers()` function of the *{performance}* package while following current good practices. However, best practice for outlier treatment does not stop at using appropriate statistical algorithms, but entails respecting existing recommendations, such as preregistration, reproducibility, consistency, transparency, and justification. Ideally, one would additionally also report the package, function, and threshold used (linking to the full code when possible). We hope that this vignette and the accompanying `check_outliers()` function of *easystats* will help researchers engage in good research practices while providing a smooth outlier detection experience. # References diff --git a/vignettes/fig1.Rmd b/vignettes/fig1.Rmd new file mode 100644 index 000000000..08035e3f9 --- /dev/null +++ b/vignettes/fig1.Rmd @@ -0,0 +1,145 @@ + +```{r fig1_prep} + +update_geom_defaults("point", aes(size = 3, color = "black", fill = "grey80", stroke = 1)) + +theme_set( + theme_classic() + + theme( + axis.line = element_blank(), + panel.border = element_rect(colour = "black", fill = NA, linewidth = rel(2)), + legend.position = "bottom", + plot.title.position = "plot" + ) +) + +# Data -------------------------------------------------------------------- + +data("women", package = "datasets") + +# Convert units to metric +women$height <- women$height * 2.54 +women$weight <- women$weight / 2.205 + +# Make some more data +set.seed(42) +women <- rbind( + women, + # duplicate with jitter + apply(women, 2, jitter, factor = 5), + # short and overweight + c(155, 73), + # just tall + c(230, 103) +) + +# Descriptives +ranges <- lapply(women, range) +M <- sapply(women[, 1:2], mean) +V <- cov(women[, 1:2]) +s <- sqrt(diag(V)) + + + + +# Plot constants +L <- list( + scale_shape_manual(NULL, labels = c("Not an Outlier", "Outlier"), values = c(20, 24)), + coord_cartesian(ranges[["height"]], ranges[["weight"]]), + labs(x = "Height [cm]", y = "Weight [kg]") +) + + +# Univariate methods ------------------------------------------------------ + +women[["univ_outlier"]] <- check_outliers(women, method = "zscore") + +Z <- c(-3.290527, -2, -1, 0, 1, 2, 3.290527) + +uni_thresholds <- data.frame( + X = M["height"] + s["height"] * Z, + Y = M["weight"] + s["weight"] * Z, + Z_lab = Z |> + format_value(digits = "signif3", + style_positive = "plus", + style_negative = "minus") |> + paste0(" SD") |> + replace(4, "Mean") +) + +p_uni <- ggplot(women, aes(height, weight)) + + geom_texthline(aes(yintercept = Y, label = Z_lab), data = uni_thresholds, + hjust = 0.8, halign = "center", + color = "grey60", size = 3) + + + geom_point(aes(shape = univ_outlier)) + + L + + labs(title = "(A) Univariate") + + + +# Multivariate methods -------------------------------------------- + +women[["multiv_outlier"]] <- check_outliers(women[,1:2], method = "mahalanobis") + +multi_thresholds <- qchisq(p = 0.001, df = 2, lower.tail = FALSE) +Ds <- c(1, 2, sqrt(multi_thresholds)) + +ellipses <- lapply(setNames(nm = Ds), function(.D) { + coords <- ellipse( + center = M, + shape = V, + radius = .D, + segments = 100, + draw = FALSE + ) + coords <- as.data.frame(coords) + coords[["D"]] <- .D + coords +}) +ellipses <- do.call("rbind", ellipses) +colnames(ellipses)[1:2] <- colnames(women)[1:2] +ellipses[["D_lab"]] <- format_value(ellipses[["D"]], digits = "signif3") + + +p_multi <- + ggplot(women, aes(height, weight)) + + geom_point(aes(x = M["height"], y = M["weight"]), + color = "grey60", size = 4) + + geom_textcontour(aes(group = D_lab, label = D_lab), data = ellipses, + stat = "identity", hjust = 0.17, + color = "grey60", size = 3) + + + geom_point(aes(shape = multiv_outlier)) + + L + + labs(title = "(B) Multivariate") + + +# Model-specific methods ------------------------------------------------ + +model <- lm(weight ~ height, data = women) + +women[["model_outlier"]] <- check_outliers(model, method = "cook") +women[["y_hat"]] <- fitted(model) + +a <- coef(model)[1] +b <- coef(model)[2] + +p_model <- + ggplot(women, aes(height, weight)) + + geom_abline(intercept = a, slope = b, color = "grey60") + + geom_segment(aes(xend = height, yend = y_hat), + color = "grey60") + + geom_point(aes(shape = model_outlier)) + + L + + labs(title = "(C) Model") + +# Combine plots --------------------------------------------------- + +no_y <- theme(axis.text.y = element_blank(), + axis.title.y = element_blank()) + +fig1 <- p_uni + (p_multi + no_y) + (p_model + no_y) + + plot_layout(nrow = 1, guides = "collect") + +``` diff --git a/vignettes/paper.bib b/vignettes/paper.bib index 56c8ae7e1..c1ef2a746 100644 --- a/vignettes/paper.bib +++ b/vignettes/paper.bib @@ -1,3 +1,200 @@ +@article{zijlstra2011outliers, + title={Outliers in questionnaire data: Can they be detected and should they be removed?}, + author={Zijlstra, Wobbe P and van der Ark, L Andries and Sijtsma, Klaas}, + journal={Journal of Educational and Behavioral Statistics}, + volume={36}, + number={2}, + pages={186--212}, + year={2011}, + publisher={Sage Publications Sage CA: Los Angeles, CA}, + doi = {10.3102/1076998610366263} +} + +@software{carelesspackage, + title = {{careless}: Procedures for computing indices of careless responding}, + author = {Yentes, R.D. and Wilhelm, F.}, + year = {2023}, + url = {https://cran.r-project.org/package=careless} +} + +@article{curran2016methods, + title={Methods for the detection of carelessly invalid responses in survey data}, + author={Curran, Paul G}, + journal={Journal of Experimental Social Psychology}, + volume={66}, + pages={4--19}, + year={2016}, + publisher={Elsevier}, + doi = {10.1016/j.jesp.2015.07.006} +} + +@article{cao2018z, + title={Z-Glyph: Visualizing outliers in multivariate data}, + author={Cao, Nan and Lin, Yu-Ru and Gotz, David and Du, Fan}, + journal={Information Visualization}, + volume={17}, + number={1}, + pages={22--40}, + year={2018}, + publisher={SAGE Publications Sage UK: London, England}, + doi = {10.1177/1473871616686635} +} + +@article{ward2023dealing, + title={Dealing with careless responding in survey data: Prevention, identification, and recommended best practices}, + author={Ward, Mary K and Meade, Adam W}, + journal={Annual Review of Psychology}, + volume={74}, + number={1}, + pages={577--596}, + year={2023}, + publisher={Annual Reviews}, + doi = {10.1146/annurev-psych-040422-045007} +} + +@article{goldammer2020careless, + title={Careless responding in questionnaire measures: Detection, impact, and remedies}, + author={Goldammer, Philippe and Annen, Hubert and St{\"o}ckli, Peter Lucas and Jonas, Klaus}, + journal={The Leadership Quarterly}, + volume={31}, + number={4}, + pages={101384}, + year={2020}, + publisher={Elsevier}, + doi = {10.1016/j.leaqua.2020.101384} +} + +@article{aruguete2019serious, + title={How serious is the ‘carelessness’ problem on Mechanical Turk?}, + author={Aruguete, Mara S and Huynh, Ho and Browne, Blaine L and Jurs, Bethany and Flint, Emilia and McCutcheon, Lynn E}, + journal={International Journal of Social Research Methodology}, + volume={22}, + number={5}, + pages={441--449}, + year={2019}, + publisher={Taylor \& Francis}, + doi = {10.1080/13645579.2018.1563966} +} + +@article{chaloner1988bayesian, + title={A Bayesian approach to outlier detection and residual analysis}, + author={Chaloner, Kathryn and Brant, Rollin}, + journal={Biometrika}, + volume={75}, + number={4}, + pages={651--659}, + year={1988}, + publisher={Oxford University Press}, + doi = {10.1093/biomet/75.4.651} +} + +@article{ciccione2023outlier, + title={Outlier detection and rejection in scatterplots: Do outliers influence intuitive statistical judgments?}, + author={Ciccione, Lorenzo and Dehaene, Guillaume and Dehaene, Stanislas}, + journal={Journal of Experimental Psychology: Human Perception and Performance}, + volume={49}, + number={1}, + pages={129}, + year={2023}, + publisher={American Psychological Association}, + doi = {10.1037/xhp0001065} +} + +@article{mcneil1977interactive, + title={Interactive data analysis: A practical primer}, + author={McNeil, Donald R}, + journal={(No Title)}, + year={1977}, + publisher={Wiley} +} + +@article{smiti2020critical, + title={A critical overview of outlier detection methods}, + author={Smiti, Abir}, + journal={Computer Science Review}, + volume={38}, + pages={100306}, + year={2020}, + publisher={Elsevier}, + doi = {10.1016/j.cosrev.2020.100306} +} + +@article{aguinis2013best, + title={Best-practice recommendations for defining, identifying, and handling outliers}, + author={Aguinis, Herman and Gottfredson, Ryan K and Joo, Harry}, + journal={Organizational research methods}, + volume={16}, + number={2}, + pages={270--301}, + year={2013}, + publisher={Sage Publications Sage CA: Los Angeles, CA}, + doi = {10.1177/1094428112470848} +} + +@article{ratcliff2016diffusion, + title={Diffusion decision model: Current issues and history}, + author={Ratcliff, Roger and Smith, Philip L and Brown, Scott D and McKoon, Gail}, + journal={Trends in Cognitive Sciences}, + volume={20}, + number={4}, + pages={260--281}, + year={2016}, + publisher={Elsevier}, + doi = {10.1016/j.tics.2016.01.007} +} + +@article{brown2008simplest, + title={The simplest complete model of choice response time: Linear ballistic accumulation}, + author={Brown, Scott D and Heathcote, Andrew}, + journal={Cognitive Psychology}, + volume={57}, + number={3}, + pages={153--178}, + year={2008}, + publisher={Elsevier}, + doi = {10.1016/j.cogpsych.2007.12.002} +} + +@article{rouder2015lognormal, + title={The lognormal race: A cognitive-process model of choice and latency with desirable psychometric properties}, + author={Rouder, Jeffrey N and Province, Jordan M and Morey, Richard D and Gomez, Pablo and Heathcote, Andrew}, + journal={Psychometrika}, + volume={80}, + pages={491--513}, + year={2015}, + publisher={Springer}, + doi = {10.1007/s11336-013-9396-3} +} + +@article{anders2016shifted, + title={The shifted {Wald} distribution for response time data analysis.}, + author={Anders, Royce and Alario, F and Van Maanen, Leendert and others}, + journal={Psychological Methods}, + volume={21}, + number={3}, + pages={309}, + year={2016}, + publisher={American Psychological Association}, + doi = {10.1037/met0000066} +} + +@article{schramm2019reaction, + title={Are reaction time transformations really beneficial?}, + author={Schramm, Pele and Rouder, Jeffrey N}, + year={2019}, + journal={PsyArXiv}, + doi = {10.31234/osf.io/9ksa6} +} + +@article{miller2023outlier, + title={Outlier exclusion procedures for reaction time analysis: The cures are generally worse than the disease.}, + author={Miller, Jeff}, + journal={Journal of Experimental Psychology: General}, + year={2023}, + publisher={American Psychological Association}, + doi = {10.1037/xge0001450} +} + @article{leys2019outliers, title = {How to Classify, Detect, and Manage Univariate and Multivariate Outliers, With Emphasis on Pre-Registration},author = {Leys, Christophe and Delacre, Marie and Mora, Youri L. and Lakens, Daniël and Ley, Christophe}, journal = {International Review of Social Psychology}, @@ -13,19 +210,17 @@ @article{leys2013outliers number = {4}, pages = {764-766}, year = {2013}, - doi = {10.1016/j.jesp.2013.03.013}, - url = {https://doi.org/10.1016/j.jesp.2013.03.013} + doi = {10.1016/j.jesp.2013.03.013} } @article{leys2018outliers, - title = {Detecting multivariate outliers: Use a robust variant of the Mahalanobis distance}, + title = {Detecting multivariate outliers: Use a robust variant of the {Mahalanobis} distance}, journal = {Journal of Experimental Social Psychology}, volume = {74}, pages = {150-156}, year = {2018}, issn = {0022-1031}, doi = {10.1016/j.jesp.2017.09.011}, - url = {https://www.sciencedirect.com/science/article/pii/S0022103117302123}, author = {Christophe Leys and Olivier Klein and Yves Dominicy and Christophe Ley}, } @@ -37,15 +232,15 @@ @article{simmons2011false number = {11}, pages = {1359-1366}, year = {2011}, - doi = {10.1177/0956797611417632}, - URL = {https://doi.org/10.1177/0956797611417632}, + doi = {10.1177/0956797611417632} } @software{easystatspackage, title = {{easystats}: Streamline Model Interpretation, Visualization, and Reporting}, author = {Daniel Lüdecke and Dominique Makowski and Mattan S. Ben-Shachar and Indrajeet Patil and Brenton M. Wiernik and Etienne Bacher and Rémi Thériault}, - date = {2023-02-04T22:06:06Z}, - origdate = {2019-01-28T10:39:29Z}, + year = {2023}, + date = {2023-02-04}, + origdate = {2019-01-28}, url = {https://easystats.github.io/easystats/} } @@ -57,8 +252,7 @@ @Article{ludecke2021performance journal = {Journal of Open Source Software}, year = {2021}, pages = {3139}, - doi = {10.21105/joss.03139}, - url = {https://doi.org/10.21105/joss.03139} + doi = {10.21105/joss.03139} } @Article{patil2022datawizard, @@ -94,9 +288,12 @@ @book{iglewicz1993outliers @article{gnanadesikan1972robust, title = {Robust estimates, residuals, and outlier detection with multiresponse data}, author = {Gnanadesikan, R. and Kettenring, J. R}, + doi = {10.2307/2528963}, journal = {Biometrics}, pages = {81-124}, - year = {1972} + year = {1972}, + volume = {28}, + number = {1} } @article{hubert2018mcd, @@ -135,7 +332,7 @@ @article{van1995statistical @article{ratcliff1993methods, title={Methods for dealing with reaction time outliers.}, author={Ratcliff, Roger}, - journal={Psychological bulletin}, + journal={Psychological Bulletin}, volume={114}, number={3}, pages={510}, @@ -151,6 +348,17 @@ @book{mcelreath2020statistical publisher={CRC press} } +@article{theriault2023rempsyc, + title={{rempsyc}: Convenience functions for psychology}, + author={Thériault, Rémi}, + journal={Journal of Open Source Software}, + volume={8}, + number={87}, + pages={5466}, + year={2023}, + doi = {10.1037/0033-2909.114.3.510} +} + @Manual{rcore, title = {{R}: A Language and Environment for Statistical Computing}, author = {{R Core Team}},