Skip to content

Commit 03b308e

Browse files
Stefano Corettacderv
Stefano Coretta
andauthored
add glossa_article() (#361)
Co-authored-by: Christophe Dervieux <christophe.dervieux@gmail.com>
1 parent f1128cb commit 03b308e

17 files changed

+4459
-1
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: rticles
22
Type: Package
33
Title: Article Formats for R Markdown
4-
Version: 0.20.4
4+
Version: 0.20.5
55
Authors@R: c(
66
person("JJ", "Allaire", role = "aut", email = "jj@rstudio.com"),
77
person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")),

NAMESPACE

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export(ctex)
1616
export(ctex_article)
1717
export(elsevier_article)
1818
export(frontiers_article)
19+
export(glossa_article)
1920
export(ieee_article)
2021
export(ims_article)
2122
export(jasa_article)

NEWS.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# rticles 0.21
22

3+
- New `glossa_article()` for articles of [Glossa: a journal of general linguistics](https://www.glossa-journal.org/) (thanks, @stefanocoretta, #361).
4+
35
- All templates have now the `$highlighting-macros$` variables required for Pandoc highlighting (#435).
46

57
- Template for `tf_article()` gains a `classoption` variable (thanks, @statzhero, #434).

R/article.R

+13
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,19 @@ frontiers_article <- function(..., keep_tex = TRUE) {
176176
pdf_document_format("frontiers", keep_tex = keep_tex, ...)
177177
}
178178

179+
180+
#' @section \code{glossa_article}: Format for creating submissions to Glossa: a
181+
#' journal of general linguistics. Author Guidelines are available on
182+
#' \href{https://www.glossa-journal.org/site/author-guidelines/}{www.glossa-journal.org}.
183+
#' Template is adapted from \url{https://github.com/guidovw/Glossalatex}.
184+
#' @export
185+
#' @rdname article
186+
glossa_article <- function(..., keep_tex = TRUE, latex_engine = "xelatex") {
187+
pdf_document_format(
188+
"glossa", keep_tex = keep_tex, latex_engine = latex_engine, ...
189+
)
190+
}
191+
179192
#' @param journal one of \code{"aoas"}, \code{"aap"}, \code{"aop"}, \code{"aos"}, \code{"sts"} for \code{ims_article}
180193
#' @section \code{ims_article}: Format for creating submissions to the Institute of Mathematical Statistics
181194
#' \href{https://imstat.org/}{IMS} journals and publications. Adapted from

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Currently included templates and their contributors are the following:
8383
| [CTeX](https://ctan.org/pkg/ctex) | | | `ctex()` |
8484
| [Elsevier](https://www.elsevier.com) | [@cboettig](https://github.com/cboettig) | [#27](https://github.com/rstudio/rticles/pull/27) | `elsevier_article()` |
8585
| [Frontiers](https://www.frontiersin.org/) | [@muschellij2](https://github.com/muschellij2) | [#211](https://github.com/rstudio/rticles/pull/211) | `frontiers_article()` |
86+
| [Glossa](https://www.glossa-journal.org) | [@stefanocoretta](https://github.com/stefanocoretta) | [#361](https://github.com/rstudio/rticles/pull/361) | `glossa_article()` |
8687
| [IEEE Transaction](http://www.ieee.org/publications_standards/publications/authors/author_templates.html) | [@Emaasit](https://github.com/Emaasit), [@espinielli](https://github.com/espinielli), [@nathanweeks](https://github.com/nathanweeks), [@DunLug](https://github.com/DunLug) | [#97](https://github.com/rstudio/rticles/pull/97), [#169](https://github.com/rstudio/rticles/pull/169), [#227](https://github.com/rstudio/rticles/pull/227), [#263](https://github.com/rstudio/rticles/pull/263), [#264](https://github.com/rstudio/rticles/pull/264), [#265](https://github.com/rstudio/rticles/pull/265) | `ieee_article()` |
8788
| [IMS: Institute of Mathematical Statistics](https://imstat.org/) [AoAS: Annals of Applied Statistics](https://imstat.org/journals-and-publications/annals-of-applied-statistics/) | [@auzaheta](https://github.com/auzaheta) | [#372](https://github.com/rstudio/rticles/pull/372) | `ims_article()` |
8889
| [JASA: Journal of the Acoustical Society of America](https://asa.scitation.org/journal/jas) | [@stefanocoretta](https://github.com/stefanocoretta) | [#364](https://github.com/rstudio/rticles/pull/364) | `jasa_article()` |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
% see http://info.semprag.org/basics for a full description of this template
2+
\documentclass[$for(classoption)$$classoption$$sep$,$endfor$]{glossa}
3+
4+
% possible options:
5+
% [times] for Times font (default if no option is chosen)
6+
% [cm] for Computer Modern font
7+
% [lucida] for Lucida font (not freely available)
8+
% [brill] open type font, freely downloadable for non-commercial use from http://www.brill.com/about/brill-fonts; requires xetex
9+
% [charis] for CharisSIL font, freely downloadable from http://software.sil.org/charis/
10+
% for the Brill an CharisSIL fonts, you have to use the XeLatex typesetting engine (not pdfLatex)
11+
% for headings, tables, captions, etc., Fira Sans is used: https://www.fontsquirrel.com/fonts/fira-sans
12+
% [biblatex] for using biblatex (the default is natbib, do not load the natbib package in this file, it is loaded automatically via the document class glossa.cls)
13+
% [linguex] loads the linguex example package
14+
% !! a note on the use of linguex: in glossed examples, the third line of the example (the translation) needs to be prefixed with \glt. This is to allow a first line with the name of the language and the source of the example. See example (2) in the text for an illustration.
15+
% !! a note on the use of bibtex: for PhD dissertations to typeset correctly in the references list, the Address field needs to contain the city (for US cities in the format "Santa Cruz, CA")
16+
17+
%\addbibresource{sample.bib}
18+
% the above line is for use with biblatex
19+
% replace this by the name of your bib-file (extension .bib is required)
20+
% comment out if you use natbib/bibtex
21+
22+
\let\B\relax %to resolve a conflict in the definition of these commands between xyling and xunicode (the latter called by fontspec, called by charis)
23+
\let\T\relax
24+
\usepackage{xyling} %for trees; the use of xyling with the CharisSIL font produces poor results in the branches. This problem does not arise with the packages qtree or forest.
25+
\usepackage[linguistics]{forest} %for nice trees!
26+
\usepackage{longtable}
27+
28+
\providecommand{\tightlist}{%
29+
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
30+
31+
\title[$if(shorttitle)$$shorttitle$$endif$]{$title$$if(wordcount)$\\ \bigskip \large Word count: $wordcount$$endif$}
32+
% Optional short title inside square brackets, for the running headers.
33+
34+
% \author[Paul \& Vanden Wyngaerd]% short form of the author names for the running header. If no short author is given, no authors print in the headers.
35+
% {%as many authors as you like, each separated by \AND.
36+
% \spauthor{Waltraud Paul\\
37+
% \institute{CNRS, CRLAO}\\
38+
% \small{105, Bd. Raspail, 75005 Paris\\
39+
% waltraud.paul@ehess.fr}
40+
% }
41+
% \AND
42+
% \spauthor{Guido Vanden Wyngaerd \\
43+
% \institute{KU Leuven}\\
44+
% \small{Warmoesberg 26, 1000 Brussel\\
45+
% guido.vandenwyngaerd@kuleuven.be}
46+
% }%
47+
% }
48+
49+
\author[$if(shortauthors)$$shortauthors$$endif$]{
50+
$for(author)$
51+
\spauthor{$author.name$\\
52+
\institute{$author.affiliation$}\\
53+
\small{$author.address$}
54+
}%
55+
$sep$\AND$endfor$
56+
}
57+
58+
$if(natbib)$
59+
\usepackage{natbib}
60+
$endif$
61+
$if(biblatex)$
62+
\usepackage[$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex}
63+
$for(bibliography)$
64+
\addbibresource{$bibliography$}
65+
$endfor$
66+
$endif$
67+
68+
% Pandoc syntax highlighting
69+
$if(highlighting-macros)$
70+
$highlighting-macros$
71+
$endif$
72+
73+
% Note that pandoc citeproc is not supported by the template
74+
% and we added the following code here just in case it will be supported in
75+
% the future
76+
$if(csl-refs)$
77+
\newlength{\csllabelwidth}
78+
\setlength{\csllabelwidth}{3em}
79+
\newlength{\cslhangindent}
80+
\setlength{\cslhangindent}{1.5em}
81+
% for Pandoc 2.8 to 2.10.1
82+
\newenvironment{cslreferences}%
83+
{$if(csl-hanging-indent)$\setlength{\parindent}{0pt}%
84+
\everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces$endif$}%
85+
{\par}
86+
% For Pandoc 2.11+
87+
\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing
88+
{% don't indent paragraphs
89+
\setlength{\parindent}{0pt}
90+
% turn on hanging indent if param 1 is 1
91+
\ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi
92+
% set entry spacing
93+
\ifnum #2 > 0
94+
\setlength{\parskip}{#2\baselineskip}
95+
\fi
96+
}%
97+
{}
98+
\usepackage{calc} % for calculating minipage widths
99+
\newcommand{\CSLBlock}[1]{#1\hfill\break}
100+
\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
101+
\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break}
102+
\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
103+
$endif$
104+
105+
$if(listings)$
106+
\usepackage{listings}
107+
$endif$
108+
$if(lhs)$
109+
\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
110+
$endif$
111+
112+
$if(verbatim-in-note)$
113+
\usepackage{fancyvrb}
114+
\VerbatimFootnotes % allows verbatim text in footnotes
115+
$endif$
116+
117+
$for(header-includes)$
118+
$header-includes$
119+
$endfor$
120+
121+
\begin{document}
122+
123+
$for(include-before)$
124+
$include-before$
125+
$endfor$
126+
127+
\sffamily
128+
\maketitle
129+
130+
$if(abstract)$
131+
\begin{abstract}
132+
$abstract$
133+
\end{abstract}
134+
$endif$
135+
136+
$if(keywords)$
137+
\begin{keywords}
138+
$keywords$
139+
\end{keywords}
140+
$endif$
141+
142+
\rmfamily
143+
144+
% Body of the article
145+
$body$
146+
147+
$if(natbib)$
148+
$if(bibliography)$
149+
$if(biblio-title)$
150+
$if(book-class)$
151+
\renewcommand\bibname{$biblio-title$}
152+
$else$
153+
\renewcommand\refname{$biblio-title$}
154+
$endif$
155+
$endif$
156+
\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
157+
$endif$
158+
$endif$
159+
$if(biblatex)$
160+
\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
161+
$endif$
162+
163+
$for(include-after)$
164+
$include-after$
165+
166+
$endfor$
167+
168+
\end{document}

0 commit comments

Comments
 (0)