Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
beec027
Cherry-pick @eliocamp
eliocamp Nov 9, 2020
5f12f3a
Uses xelatex in the AMS skeleton
eliocamp Nov 16, 2020
7f65495
Update for v6.1
ConorIA Oct 17, 2021
e9cd1a1
Default to twocol=FALSE
ConorIA Oct 17, 2021
5e580d8
Cleanup changes to
ConorIA Oct 17, 2021
9df3228
Redocument article.Rd
ConorIA Oct 17, 2021
c36f847
Fix last-entry cases for author and affiliation loops
ConorIA Oct 17, 2021
664ce6e
Merge branch 'main' into ams61
cderv Nov 27, 2024
29e34d2
check for old argument unsupported and warn
cderv Nov 29, 2024
3cc1fd7
Set pandoc requirment and add warning about new tempalte
cderv Nov 29, 2024
3352213
Check various metadata
cderv Nov 29, 2024
944c15a
rewrite the new for loop for auhtor
cderv Nov 29, 2024
0bd2da5
rewrite affiliation as YAML
cderv Nov 29, 2024
93c3121
Move article function to its own file
cderv Nov 29, 2024
4521383
set bibliography in the right place
cderv Nov 29, 2024
3aa21ec
Add missing part in template for Pandoc
cderv Nov 29, 2024
f013c2a
mention doc on abstract
cderv Nov 29, 2024
5409113
Use markdown in the template for most part
cderv Nov 29, 2024
ef268a7
Update bibliography file
cderv Nov 29, 2024
3b10ab5
Add a lua filter to help write expected AMS syntax
cderv Nov 29, 2024
4cd9f70
fix filter
cderv Nov 29, 2024
5ff8ffd
fix affiliation
cderv Nov 29, 2024
801be50
re-document
cderv Nov 29, 2024
3021031
Adapt test and fix citation package to natbib
cderv Nov 29, 2024
d16e04a
Fix merge problem
cderv Nov 29, 2024
f4550da
Re document
cderv Nov 29, 2024
e75fe96
Trigger warning immediately
cderv Nov 29, 2024
4ffd088
Bump version
cderv Dec 6, 2024
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
4 changes: 2 additions & 2 deletions R/article.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ amq_article <- function(
#' <https://www.ametsoc.org/ams/index.cfm/publications/authors/journal-and-bams-authors/author-resources/latex-author-info/>.
#' @export
#' @rdname article
ams_article <- function(..., keep_tex = TRUE, md_extensions = c("-autolink_bare_uris")) {
ams_article <- function(..., keep_tex = TRUE, md_extensions = c("-autolink_bare_uris", "-auto_identifiers")) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just to understand: why do we need to remove this extension here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To be honest I'm not sure what my reasoning was. It might be the sort of thing that is obvious if we put it back in and see what results.

pdf_document_format(
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to put a Pandoc requirement before running the function here - the test are failing because of this mainly

rmarkdown::pandoc_available('2.10', TRUE)

"ams", keep_tex = keep_tex, md_extensions = md_extensions, ...
"ams", keep_tex = keep_tex, md_extensions = md_extensions, citation_package = 'natbib', ...
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we need to make this also a parameter of the function so that it can be changed.

Previously it was not set - so I don't think natbib was used. Does it need to be used to work now ?

We should try to prevent things breaking if possible and this would change the default citation processing. We need to offer a way to change it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I understood that natbib is hard-coded in ametsocv6.1.cls

)
}

Expand Down
215 changes: 123 additions & 92 deletions inst/rmarkdown/templates/ams/resources/template.tex
Original file line number Diff line number Diff line change
@@ -1,118 +1,149 @@
\documentclass[$layout$]{ametsoc}
\usepackage{color}
\usepackage{hyperref}
\journal{$journal$}
% Please choose a journal abbreviation to use above from the following list:
%% Version 6.1, 1 September 2021
%
% jamc (Journal of Applied Meteorology and Climatology)
% jtech (Journal of Atmospheric and Oceanic Technology)
% jhm (Journal of Hydrometeorology)
% jpo (Journal of Physical Oceanography)
% jas (Journal of Atmospheric Sciences)
% jcli (Journal of Climate)
% mwr (Monthly Weather Review)
% wcas (Weather, Climate, and Society)
% waf (Weather and Forecasting)
% bams (Bulletin of the American Meteorological Society)
% ei (Earth Interactions)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TemplateV6.1.tex -- LaTeX-based blank template for submissions to the
% American Meteorological Society
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% PREAMBLE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Start with one of the following:
% 1.5-SPACED VERSION FOR SUBMISSION TO THE AMS
\documentclass[$if(twocol)$twocol$endif$]{ametsocV6.1}

% TWO-COLUMN JOURNAL PAGE LAYOUT---FOR AUTHOR USE ONLY
% \documentclass[twocol]{ametsocV6.1}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Citations should be of the form ``author year'' not ``author, year''
\bibpunct{(}{)}{;}{a}{}{,}

$for(header-includes)$
$header-includes$
$endfor$

%%% To be entered by author:

%% May use \\ to break lines in title:

\title{$title$}

$if(author1)$
\authors{$author1$
$if(correspondingauthor)$
\correspondingauthor{$author1$,$correspondingauthor$}
$endif$
$if(author2)$
and $author2$
$if(currentaddress)$
\thanks{$currentaddress$}
$endif$
$endif$
}
$endif$
$if(affiliation)$
\affiliation{$affiliation$}
$endif$
$if(extraauthor)$
\extraauthor{Extra Author}
$endif$
$if(exaffiliation)$
\extraaffil{$exaffiliation$}
$endif$
%% Enter authors' names and affiliations as you see in the examples below.
%
%% Use \correspondingauthor{} and \thanks{} (\thanks command to be used for affiliations footnotes,
%% such as current affiliation, additional affiliation, deceased, co-first authors, etc.)
%% immediately following the appropriate author.
%
%% Note that the \correspondingauthor{} command is NECESSARY.
%% The \thanks{} commands are OPTIONAL.
%
%% Enter affiliations within the \affiliation{} field. Use \aff{#} to indicate the affiliation letter at both the
%% affiliation and at each author's name. Use \\ to insert line breaks to place each affiliation on its own line.

$if(email)$
$email$
$endif$
%\authors{Author One,\aff{a}\correspondingauthor{Author One, email@email.com}
%Author Two,\aff{a}
%Author Three,\aff{b}
%Author Four,\aff{a}
%Author Five\thanks{Author Five's current affiliation: NCAR, Boulder, Colorado},\aff{c}
%Author Six,\aff{c}
%Author Seven,\aff{d}
% and Author Eight\aff{a,d}
%}
%
%\affiliation{\aff{a}{First Affiliation}\\
%\aff{b}{Second Affiliation}\\
%\aff{c}{Third Affiliation}\\
%\aff{d}{Fourth Affiliation}
%}

$for(exauthors)$
\extraauthor{$exauthors.name$
$if(exauthors.correspondingauthor)$
\correspondingauthor{$exauthors.name$,$exauthors.correspondingauthor$}
$endif$
$if(exauthors.currentaddress)$
\thanks{$exauthors.currentaddress$}
$endif$}
$if(exauthors.exaffiliation)$
\extraaffil{$exauthors.exaffiliation$}
$endif$
$if(exauthors.email)$
$exauthors.email$
% Credit to https://stackoverflow.com/a/67609365 for different last-author case.
\authors{
$if(authors/allbutlast)$
Copy link
Collaborator

Choose a reason for hiding this comment

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

This syntax allbutlast brings a min Pandoc requirement (at least 2.10) than we need to insure.

$for(authors/allbutlast)$
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think the if is required if you use a for, is it ? Did you have problem with that ?

$it.name$$if(it.current)$\thanks{$it.current$}$endif$,\aff{$it.aff$}$if(it.email)$\correspondingauthor{$it.name$, $it.email$}$endif$
$endfor$
and~
$endif$
$for(authors/last)$
$it.name$$if(it.current)$\thanks{$it.current$}$endif$\aff{$it.aff$}$if(it.email)$\correspondingauthor{$it.name$, $it.email$}$endif$
$endfor$
}

$if(highlighting-macros)$
% For Pandoc highlighting needs
$highlighting-macros$
Copy link
Collaborator

Choose a reason for hiding this comment

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

This needs to be kept - it is part of the required part for Pandoc processing.

Some of the thing in this template comes from Pandoc template and must be present.

As we have now a Pandoc requirement version for this PR, we could probably leverage partials: https://pandoc.org/MANUAL.html#partials

% Credit to https://stackoverflow.com/a/67609365 for different last-affiliation case.
\affiliation{
$if(affiliations/allbutlast)$
$for(affiliations/allbutlast)$
\aff{$it.aff$}{$it.name$}\\
$endfor$
$endif$
$for(affiliations/last)$
\aff{$it.aff$}{$it.name$}
$endfor$
}

$if(csl-refs)$
% Pandoc citation processing
\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$
Copy link
Collaborator

Choose a reason for hiding this comment

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

This needs to stay for Pandoc citation processing. it is part of the Pandoc template.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ABSTRACT
%
% Enter your abstract here
% Abstracts should not exceed 250 words in length!
%

% pandoc header
$for(header-includes)$
$header-includes$
$endfor$
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same it is required for Pandoc feature

\abstract{$abstract$}

\begin{document}

%% Necessary!
\maketitle

\bibliographystyle{ametsocV6}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% SIGNIFICANCE STATEMENT/CAPSULE SUMMARY
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% If you are including an optional significance statement for a journal article or a required capsule summary for BAMS
% (see www.ametsoc.org/ams/index.cfm/publications/authors/journal-and-bams-authors/formatting-and-manuscript-components for details),
% please apply the necessary command as shown below:
%
% Significance Statement (all journals except BAMS)
%
%\statement
% Enter significance statement here, no more than 120 words. See \url{www.ametsoc.org/index.cfm/ams/publications/author-information/significance-statements/} for details.
%

$if(statement)$
%$if(twocol)$\twocolsig$else$\statement$endif$
$statement$
$endif$ % FIXME, AMS template says to use twocolsig instead of sig for twocol, but there is no sig, is two col twocolstatement or twocolsig?

%% Capsule (BAMS only)
%%
%\capsule
% Enter BAMS capsule here, no more than 30 words. See \url{www.ametsoc.org/index.cfm/ams/publications/author-information/formatting-and-manuscript-components/#capsule} for details.
%

$if(capsule)$
%$if(twocol)$\twocolcapsule$else$\capsule$endif$
$capsule$
$endif$

%% * * If using twocol mode, you will need to use the commands "twocolsig" and "twocolcapsule" in place of "sig" and "capsule"
%% to ensure that the text box correctly spans across both columns.
%

$for(include-before)$
$include-before$

$endfor$

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% MAIN BODY OF PAPER
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%

$body$

$for(include-after)$
$include-after$

$endfor$

\end{document}
Binary file added inst/rmarkdown/templates/ams/skeleton/FigOne.pdf
Binary file not shown.
Binary file added inst/rmarkdown/templates/ams/skeleton/FigTwo.pdf
Binary file not shown.
Loading