Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Josis #382

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Josis #382

Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ Authors@R: c(
person("Alfredo", "Hernández", role = c("ctb"), email = "[email protected]", comment = c(ORCID = "0000-0002-2660-4545")),
person("Christophe", "Dervieux", role = c("aut"), email = "[email protected]", comment = c(ORCID = "0000-0003-4474-2498")),
person("Stefano", "Coretta", role = c("ctb"), email = "[email protected]", comment = c(ORCID = "0000-0001-9627-5532", github = "stefanocoretta")),
person("Alvaro", "Uzaheta", role = c("ctb"), email = "[email protected]", comment = c(github = "auzaheta"))
person("Alvaro", "Uzaheta", role = c("ctb"), email = "[email protected]", comment = c(github = "auzaheta")),
person("Robin", "Lovelace", role = c("ctb"), email = "[email protected]", comment = c(github = "robinlovelace"))
)
Description: A suite of custom R Markdown formats and templates for
authoring journal articles and conference submissions.
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export(frontiers_article)
export(ieee_article)
export(ims_article)
export(jasa_article)
export(josis_article)
export(joss_article)
export(journals)
export(jss_article)
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
rticles 0.20
---------------------------------------------------------------------

- New template `josis_article()` for the Journal of Spatial Information Science (thanks, @Robinlovelace, #382)

- remove warning in `joss_article()` about `citation_package` (thanks, @llrs, #389).

- fix an issue with `rjournal_article()` template to insert newline in author's block only if a field exist (thanks, @huizezhang-sherry, #387)
Expand Down
11 changes: 11 additions & 0 deletions R/article.R
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,17 @@ jasa_article <- function(
)
}

#' @section \code{josis_article}: Format for creating submissions to the
#' Journal of Spatial Information Science. Adapted from
#' \samp{https://www.overleaf.com/latex/templates/journal-of-spatial-information-science-template/bmdhbgxnhtqx}.
#' @export
#' @rdname article
josis_article <- function(..., keep_tex = TRUE, citation_package = 'default') {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See commend about bibliography in template: I believe it should be natbib here not default

pdf_document_format(
"josis", keep_tex = keep_tex, citation_package = citation_package, ...
)
}

#' @section \code{lipics_article}: Format for creating submissions to
#' LIPIcs - Leibniz International Proceedings Informatics - articles.
#' Adapted from the official Instructions for Authors at
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Currently included templates and their contributors are the following:
| [IEEE Transaction](http://www.ieee.org/publications_standards/publications/authors/author_templates.html) | [@Emaasit](https://github.com/Emaasit), [@espinielli](https://github.com/espinielli), [@nathanweeks](https://github.com/nathanweeks), [@DunLug](https://github.com/DunLug) | [#97](https://github.com/rstudio/rticles/pull/97), [#169](https://github.com/rstudio/rticles/pull/169), [#227](https://github.com/rstudio/rticles/pull/227), [#263](https://github.com/rstudio/rticles/pull/263), [#264](https://github.com/rstudio/rticles/pull/264), [#265](https://github.com/rstudio/rticles/pull/265) | `ieee_article()` |
| [IMS: Institute of Mathematical Statistics](https://imstat.org/) [AoAS: Annals of Applied Statistics](https://imstat.org/journals-and-publications/annals-of-applied-statistics/) | [@auzaheta](https://github.com/auzaheta) | [#372](https://github.com/rstudio/rticles/pull/372) | `ims_article()` |
| [JASA: Journal of the Acoustical Society of America](https://asa.scitation.org/journal/jas) | [@stefanocoretta](https://github.com/stefanocoretta) | [#364](https://github.com/rstudio/rticles/pull/364) | `jasa_article()` |
| [JOSIS: Journal of Spatial Information Science](http://www.josis.org/index.php/josis) | [@robinlovelace](https://github.com/robinlovelace) | [#382](https://github.com/rstudio/rticles/pull/382) | `josis_article()` |
| [JOSS: Journal of Open Source Software](https://joss.theoj.org/) [JOSE: Journal of Open Source Education](https://jose.theoj.org/) | [@noamross](https://github.com/noamross) | [#229](https://github.com/rstudio/rticles/pull/229) | `joss_article()` |
| [JSS: Journal of Statistical Software](https://www.jstatsoft.org) | | | `jss_article()` |
| [LIPIcs](https://www.dagstuhl.de/en/publications/lipics) | [@nuest](https://github.com/nuest) | [#288](https://github.com/rstudio/rticles/pull/288) | `lipics_article()` |
Expand Down
173 changes: 173 additions & 0 deletions inst/rmarkdown/templates/josis/resources/template.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
%% josis.tex 1.4 2016-09-15 JoSIS latex template
%------------------------------------------------------------------
% Filename: josis_template.tex
%
% This file is intended as a template for typesetting articles for the
%
% Journal of Spatial Information Science.
%
% Please edit this template to generate your own formatted manuscripts
% for submission to JOSIS. See http://josis.org for further details.
%


%%% JOSIS checks in typesetting
%%% * All titles and sections lower case *EXCEPT short title [ ]
%%% * Remove author postal addresses, only have geographic places and institutions [ ]
%%% * Consistent use of Section, Figure, Table (capitalized and in full) [ ]
%%% * 10 keywords (and all lower case) [ ]
%%% * Remove all avoidable footnotes [ ]
%%% * Use double quotation marks (``'' not "" or `') [ ]
%%% * Punctuation inside quotations [ ]
%%% * E.g. and i.e. followed by comma [ ]
%%% * cf. followed by tilde [ ]
%%% * Itemize and enumerate correctly punctuated [e.g., "1. x, 2. y, and 3. x." ]
%%% * And/or lists using American English punctuation (e.g., "x, y, and z") [ ]
%%% * Bibliography (e.g., en-dashes for number ranges, consistent "Proc.~" for Proceedings of..., etc.) []
%%% * Acknowledgment style use section* [ ]
%%% * et al. no italics, but with dot [ ]
%%% * All captions end with full stop [ ]
%%% * Table captions under, not over table [ ]
%%% * Adjust urls with burlalt [ ]
%%% * Check correct use of hyphens, emdashes, endashes [ ]
%%% * Perform spell check [ ]

%%% JOSIS checks directly before publication
%%% Check DOI, page numbers on article and web site. [ ]
%%% Update web site with final title, abstract, keywords. [ ]
%%% Build with distiller for DOI links. [ ]
Comment on lines +14 to +38
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we need to add this checklist (or adapt it) somewhere in the documentation accessible to author from R ?

Like in the R help section for the format or in the skeleton ?



% Required documentclass definition for JOSIS
\documentclass{josis}
\usepackage{hyperref}
\usepackage[hyphenbreaks]{breakurl}
\usepackage{booktabs}
\usepackage{stmaryrd}
\usepackage[T1]{fontenc}
\usepackage{cite}

% Suggested packages for algorithm formatting
\usepackage{algorithm}
%\usepackage{algorithmic}
\usepackage{algpseudocode}
Comment on lines +50 to +53
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As these are suggested, should it be make optional through a YAML option to use one or all of these ?

Using Pandoc variable can help with that as in other template.

For example, a R user won't be able to uncomment %\usepackage{algorithmic} for its Rmd file.

Or maybe should all be activated by default as it does not harm really ?



\usepackage[table]{xcolor}
\usepackage{amssymb,amsmath}

\renewcommand{\topfraction}{0.9}
\renewcommand{\textfraction}{0.1}

% Page setup and overhangs
\sloppy
\widowpenalty=10000
\clubpenalty=10000
\hyphenpenalty=75

% For figures and more when knitting from .Rmd:
% https://stackoverflow.com/questions/41052687/
$if(highlighting-macros)$
$highlighting-macros$
$endif$
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\usepackage{longtable,booktabs,array}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

booktabs is already loaded before.
https://github.com/rstudio/rticles/pull/382/files#diff-7242a8d3731225c175e35b36ec39868cee3b909d2a0c3234030cd9939d8382c8R45
I don't know if this is an issue to load it twice. Probably not

$if(csl-refs)$
\newlength{\cslhangindent}
\setlength{\cslhangindent}{1.5em}
\newlength{\csllabelwidth}
\setlength{\csllabelwidth}{3em}
\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing
{% don't indent paragraphs
\setlength{\parindent}{0pt}
% turn on hanging indent if param 1 is 1
\ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi
% set entry spacing
\ifnum #2 > 0
\setlength{\parskip}{#2\baselineskip}
\fi
}%
{}
\usepackage{calc}
\newcommand{\CSLBlock}[1]{#1\hfill\break}
\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break}
\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
$endif$
Comment on lines +76 to +97
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot to mention that this needs to be extended. I believe CI error are because of this See for example

$if(csl-refs)$
\newlength{\csllabelwidth}
\setlength{\csllabelwidth}{3em}
\newlength{\cslhangindent}
\setlength{\cslhangindent}{1.5em}
% for Pandoc 2.8 to 2.10.1
\newenvironment{cslreferences}%
{$if(csl-hanging-indent)$\setlength{\parindent}{0pt}%
\everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces$endif$}%
{\par}
% For Pandoc 2.11+
\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing
{% don't indent paragraphs
\setlength{\parindent}{0pt}
% turn on hanging indent if param 1 is 1
\ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi
% set entry spacing
\ifnum #2 > 0
\setlength{\parskip}{#2\baselineskip}
\fi
}%
{}
\usepackage{calc} % for calculating minipage widths
\newcommand{\CSLBlock}[1]{#1\hfill\break}
\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break}
\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
$endif$

The part for ealier Pandoc version needs to be added

Suggested change
$if(csl-refs)$
\newlength{\cslhangindent}
\setlength{\cslhangindent}{1.5em}
\newlength{\csllabelwidth}
\setlength{\csllabelwidth}{3em}
\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing
{% don't indent paragraphs
\setlength{\parindent}{0pt}
% turn on hanging indent if param 1 is 1
\ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi
% set entry spacing
\ifnum #2 > 0
\setlength{\parskip}{#2\baselineskip}
\fi
}%
{}
\usepackage{calc}
\newcommand{\CSLBlock}[1]{#1\hfill\break}
\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break}
\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
$endif$
$if(csl-refs)$
\newlength{\csllabelwidth}
\setlength{\csllabelwidth}{3em}
\newlength{\cslhangindent}
\setlength{\cslhangindent}{1.5em}
% for Pandoc 2.8 to 2.10.1
\newenvironment{cslreferences}%
{$if(csl-hanging-indent)$\setlength{\parindent}{0pt}%
\everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces$endif$}%
{\par}
% For Pandoc 2.11+
\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing
{% don't indent paragraphs
\setlength{\parindent}{0pt}
% turn on hanging indent if param 1 is 1
\ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi
% set entry spacing
\ifnum #2 > 0
\setlength{\parskip}{#2\baselineskip}
\fi
}%
{}
\usepackage{calc} % for calculating minipage widths
\newcommand{\CSLBlock}[1]{#1\hfill\break}
\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break}
\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
$endif$


% Article details for accepted manuscripts will be added by editorial staff
% Omit year if article in press
% Omit number if article under review
\josisdetails{%
number=N, year=YYYY, firstpage=xx, lastpage=yy,
doi={10.5311/JOSIS.YYYY.II.NNN},
received={December 24, 2015},
returned={February 25, 2016},
revised={July 13, 2016},
accepted={September 5, 2016}, }

\newcommand{\mydoi}[1]{\href{http://dx.doi.org/#1}{doi:\protect\detokenize{#1}}}

%\renewcommand{\UrlLeft}{http:\sslash}
%\DeclareUrlCommand\myurl{\def\UrlLeft{}\def\UrlRight{}%
%\urlstyle{tt}}
Comment on lines +112 to +114
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, does this needs to be activated somehow ?

If so, then a variables should be added so that it could be included in the output.


\urlstyle{rm}
\makeatletter
% Inspired by http://anti.teamidiot.de/nei/2009/09/latex_url_slash_spacingkerning/
% but slightly less kern and shorter underscore
\let\UrlSpecialsOld\UrlSpecials
\def\UrlSpecials{\UrlSpecialsOld\do\/{\Url@slash}\do\_{\Url@underscore}}%
\def\Url@slash{\@ifnextchar/{\kern-.11em\mathchar47\kern-.2em}%
{\kern-.0em\mathchar47\kern-.08em\penalty\UrlBigBreakPenalty}}
\def\Url@underscore{\nfss@text{\leavevmode \kern.06em\vbox{\hrule\@width.3em}}}
\makeatother

\hypersetup{
colorlinks=true,
linkcolor=black,
citecolor=black,
urlcolor=black
}

% Add the running author and running title information
\runningauthor{\begin{minipage}{.9\textwidth}\centering $author1$, $author2$\end{minipage}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will lead to Nameof Author1, with a trailing comma if not author2 is provided.
image

See comment about YAML header also. Maybe a logic with a for loop base on a list of authors would help.

\runningtitle{$runningtitle$}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\runningtitle{} will be inserted in the tex output if no runningtitle field is provided in YAML.
Is this ok ? Otherwise, it could be made condition with a if clause as you did with title


% Document begins
\begin{document}
%\setcounter{page}{33}


% Insert your own title
$if(title)$
\title{$title$}
$endif$

% Insert your manuscipts authors, affiliations, and addresses
$if(author1)$
\author{$author1$}\affil{$affil1$}
$endif$
$if(author2)$
\author{$author2$}\affil{$affil2$}
$endif$
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment about YAML header for authors field like in other Rmd doc.


\maketitle

% Add 5-10 keywords for every submission
\keywords{$keywords$}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment in YAML header of skeleton


% Add a short abstract of 150-250 words
\begin{abstract}
$abstract$
\end{abstract}
Comment on lines +158 to +161
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is abstract mandatory ? Should there be a if to prevent error if the field is not included in YAML ?

See comment about the YAML field in skeleton

Also as the abstract is placed just before the body in this template, this could be something written directly in the Rmd I believe

The Rmd could start with (syntax possible with rmarkdown 2.7 and above I think)

:::{.abstract latex=1}
Content that I could write using Markdown here
:::

or

\begin{abstract}
content I write in LaTeX directly
\end{abstract}

And it would be inserted correctly.

I don't know what is the more easy as as an author - I let you decide.


$body$

$if(bibliography)$
\bibliographystyle{josisacm}
\bibliography{$bibliography$}
$endif$
Comment on lines +165 to +168
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this syntax requires to use natbib as citation processing engine.
Currently, your format sets "default" meaning use Pandoc processing and biliography seems to be added twice.
See
image

See this is because one of the reference is done using Pandoc's syntax (https://pandoc.org/MANUAL.html#citations) and the others are made using \cite I believe so Pandoc
does not process them.

So maybe you need to default to "natbib" for this format.

Usually with Pandoc a CSL is used by I don't see one for ACM Josis


\end{document}
Loading