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

Updates AMS to V6.1 #444

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

Updates AMS to V6.1 #444

wants to merge 7 commits into from

Conversation

ConorIA
Copy link
Contributor

@ConorIA ConorIA commented Oct 17, 2021

Replaces #348 and closes #298

Todos:

  • I have not made a great effort to make the skeleton article more "RMarkdown-y". I started replacing some of the \section entries with #, but I was having compilation errors, so needed to go back to start.
  • The AMS template says to use \twocolsig and \twocolcapsule when using twocol mode, but these are giving me undefined control sequence errors. I have commented out my conditional in template.tex, but would like to get the functionality working before this is merged #helpwanted!
  • The AMS template uses "and" before the final author name. I have used a for loop for authors (yay me), but I am not familair enough to know how to do a "if (i == length(authors)" type of statement to add the "and" before the last author entry. #helpwanted!
  • I have addressed the for loops, but I had to resort to using a for loop on the last array entry. That doesn't seem to be right, but I can't figure out how to access the values of authors/last. e.g. authors/last.name throws an error and authors/last["name"] returns "true", not "Author Eight".
  • News not updated yet because this may not make it into main for a while!

Thanks to @eliocamp as much of this was based on his work on the v5 template.

It looks like old releases of pandoc don't play nice with the pipes. For the record:

$ pandoc --version
pandoc 2.11.4
Compiled with pandoc-types 1.22, texmath 0.12.1, skylighting 0.10.2,
citeproc 0.3.0.5, ipynb 0.1.0.1

@ConorIA ConorIA changed the title Updates AMS to V5 Updates AMS to V6.1 Oct 17, 2021
$endif$
$for(authors/last)$
Copy link
Contributor Author

@ConorIA ConorIA Oct 17, 2021

Choose a reason for hiding this comment

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

I don't think this ought to be a for loop, but I can't figure out how to access the values of authors/last. e.g. authors/last.name throws an error and authors/last["name"] returns "true", not "Author Eight".

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would have tried the same syntax so if it does not work, I think you need a for loop.
I don't see any example in doc: https://pandoc.org/MANUAL.html#pipes

$endif$
$for(affiliations/last)$
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Again, this probably doesn't need to be a loop.

$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?
Copy link
Contributor Author

@ConorIA ConorIA Oct 17, 2021

Choose a reason for hiding this comment

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

I don't know if the AMS folks actually implemented this. I get an undefined control sequence. I also notice that in the example twocol article included in their bundle, the significance statement doesn't actually span two columns. (See "amssamp2V6.1.pdf" in the AMS zip.)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes it seems to be commented in there ametsocV6.1.cls class if you look at it. so the command is not defined.

The amssamp2V6.1.tex example does not contain the command.

Probably an issue with AMS article then.

- {name: Author Five, current: "Author Five's current affiliation: NCAR, Boulder, Colorado", aff: c}
- {name: Author Six, aff: d}
- {name: Author Seven, aff: d}
- {name: Author Eight, aff: "a,d"}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the AMS template, Author Eight has two affiliations. I have handled this by quoting the two (otherwise, pandoc thinks this is another array). Would it be better for an additional for loop here? (I think it would be overkill).

Copy link
Collaborator

Choose a reason for hiding this comment

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

You could write like this two

authors:
  - name: Author Eight
    aff: a,d

then no quoting is needed. Do we have to show eight authors for the example ?

Copy link
Collaborator

@cderv cderv left a comment

Choose a reason for hiding this comment

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

Hi!

Thanks for this and sorry for the delay. Here are a few comment we need to work out.

Overall it would be best in if the skeleton contains more R code examples and Markdown. That would help our test too.

@@ -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 ?

pdf_document_format(
"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.

@@ -1,118 +1,149 @@
\documentclass[$layout$]{ametsoc}
Copy link
Collaborator

Choose a reason for hiding this comment

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

We probably need to write in the NEWS files to explain the change as there is a new class used.

This will definitely break some old rticles if people update 🤔
I still don't know what the best to be done.

Here layout: will have no more effect

\documentclass[$layout$]{ametsoc}
\usepackage{color}
\usepackage{hyperref}
\journal{$journal$}
Copy link
Collaborator

Choose a reason for hiding this comment

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

journal: is no more useful right ?

$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.

\centerline{(illustration here)}
\appendcaption{B1}{Here is the appendix figure caption.}
\end{figure}
\bibliography{references}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't we put this in the template as we usually do with other formats ?

- {name: Author Five, current: "Author Five's current affiliation: NCAR, Boulder, Colorado", aff: c}
- {name: Author Six, aff: d}
- {name: Author Seven, aff: d}
- {name: Author Eight, aff: "a,d"}
Copy link
Collaborator

Choose a reason for hiding this comment

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

You could write like this two

authors:
  - name: Author Eight
    aff: a,d

then no quoting is needed. Do we have to show eight authors for the example ?

plot(1:10)
```{r setup, include=FALSE}
knitr::opts_chunk$set(fig.path = "", # AMS required
out.extra = "", # To force figure labels
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the issue exactly ?
fig_caption = TRUE in pdf_document() should be enough to have the caption 🤔

```{r,echo=FALSE,fig.cap='test the rmd output',fig.align='center',fig.width=3.17}
plot(1:10)
```{r setup, include=FALSE}
knitr::opts_chunk$set(fig.path = "", # AMS required
Copy link
Collaborator

Choose a reason for hiding this comment

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

If this is required we could probably make that part of the format function 🤔

Each table must be numbered, provided with a caption, and mentioned specifically in the text.
See below (in the .tex document) and at the end of the document for the formatting of a sample table (Table
\ref{t1}).
\section{Introduction}
Copy link
Collaborator

Choose a reason for hiding this comment

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

We would need to change to Markdown before merging

Suggested change
\section{Introduction}
# Introduction

If we are lazy to do it manually, we can probably convert the tex file body using Pandoc directly

@@ -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")) {
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)

@cderv cderv mentioned this pull request Nov 29, 2021
@cderv
Copy link
Collaborator

cderv commented Apr 19, 2023

@ConorIA do you plan to keep working on this or should I take over ?

Maybe AMS has also update to a newer version than 6.1.

Enquiring about the status of this PR following my latest review

@ConorIA
Copy link
Contributor Author

ConorIA commented Apr 20, 2023

Hi @cderv, sorry to have been unresponsive to your very detailed review. I find myself very short on free time these days, and haven't been writing much after finishing my thesis last fall. I would be happy to have you take over.

The good news is that v6.1 is still the current AMS template https://www.ametsoc.org/index.cfm/ams/publications/author-information/latex-author-info/

@cderv
Copy link
Collaborator

cderv commented Apr 20, 2023

Thanks for the feedback - I'll add that to my list then. Thanks for your contribution

@CLAassistant
Copy link

CLAassistant commented Apr 17, 2024

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

Outdated AMS template
4 participants