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
base: main
Are you sure you want to change the base?
Updates AMS to V6.1 #444
Conversation
$endif$ | ||
$for(authors/last)$ |
There was a problem hiding this comment.
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".
There was a problem hiding this comment.
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)$ |
There was a problem hiding this comment.
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? |
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
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"} |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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 ?
There was a problem hiding this 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")) { |
There was a problem hiding this comment.
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', ... |
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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$} |
There was a problem hiding this comment.
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)$ |
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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"} |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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
\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( |
There was a problem hiding this comment.
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)
@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 |
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/ |
Thanks for the feedback - I'll add that to my list then. Thanks for your contribution |
Replaces #348 and closes #298
Todos:
\section
entries with#
, but I was having compilation errors, so needed to go back to start.\twocolsig
and\twocolcapsule
when using twocol mode, but these are giving me undefined control sequence errors. I have commented out my conditional intemplate.tex
, but would like to get the functionality working before this is merged #helpwanted!authors/last
. e.g.authors/last.name
throws an error andauthors/last["name"]
returns "true", not "Author Eight".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: