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

Glossa Psycholinguistics template #526

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Glossa Psycholinguistics template #526

wants to merge 4 commits into from

Conversation

vboyce
Copy link

@vboyce vboyce commented Apr 14, 2023

How to contribute a new output format ?

To contribute a new article template to this package, please make sure you have done the following things (note that journalname_article below is only an example name):

  • This project uses a Contributor Licence Agreement (CLA) that you'll be asked to sign when opening a PR. This is required for a significant pull request (it is fine not to sign it if a PR is only intended to fix a few typos). We use a tool called CLA assistant for that.
    You could also, unless you have done it in any other RStudio's projects before, sign the individual or corporate contributor agreement. You can send the signed copy to [email protected].

  • Add the journalname_article() function to R/article.R if the output format is simple enough, otherwise create a separate R/journalname_article.R.

  • Document your function using roxygen2. Markdown syntax is supported. Refer to https://roxygen2.r-lib.org/articles/rd-formatting.html for formatting references.

  • Add the Pandoc LaTeX template inst/rmarkdown/templates/journalname/resources/template.tex.

  • Add a skeleton article inst/rmarkdown/templates/journalname/skeleton/skeleton.Rmd.

  • Add a description of the template inst/rmarkdown/templates/journalname/template.yaml.

  • Please include the document class file (*.cls) if needed, but please do not include standard LaTeX packages (*.sty) that can be downloaded from CTAN. If you are using TinyTeX or TeX Live, you can verify if a package is available on CTAN via tinytex::parse_packages(files = "FILENAME"") (e.g., when FILENAME is plain.bst, it should return "bibtex", which means this file is from a standard CTAN package). Please keep the number of new files absolutely minimal (e.g., do not include PDF output files), and also make examples minimal (e.g., if you need a .bib example, try to only leave one or two bibliography entries in it, and don't include too many items in it without using all of them).

  • Update Rd and namespace (could be done by devtools::document()).

  • Update NEWS.

  • Update README with a link to the newly supported journal. Please add your Github username and the full name of the journal (follow other examples in the list).

  • Add a test to tests/testit/test-formats.R by adding a line test_format("journalname"). We try to keep them in alphabetical order.

  • Add your name to the list of authors Authors@R in DESCRIPTION. You don't need to bump the package version in DESCRIPTION.

Lastly, please try your best to do only one thing per pull request (e.g., if you want to add two output formats, do them in two separate pull requests), and refrain from making cosmetic changes in the code base: https://yihui.name/en/2018/02/bite-sized-pull-requests/

Thank you!


I'm new to contributing to packages, so please forgive any mistakes and let me know if there are things I need to fix! I followed the checklist, but wasn't sure how to link to the PR in the NEWS or README since I didn't know what number it would have.

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.

Thanks for your contribution !

I have one main question: What is the difference with the glossa_article() format ? What is missing from the existing format that would justify having a new one ?

We are duplicating a lot of resources and templates seems to be same ?

If glossapx_article() supposed to be identical as glossa_article() but with other defaults ?

Thanks

#' Template is adapted from the Glossa rticles template.
#' @export
#' @rdname article
glossapx_article <- function(..., keep_tex = TRUE, latex_engine = "xelatex") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

What about naming glossapsycholx() as their twitter account ? https://twitter.com/glossapsycholx

Comment on lines +232 to +235
format <- pdf_document_format(
"glossa",
keep_tex = keep_tex, latex_engine = latex_engine, ...
)
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 it be glossapx here ? You are not using the correct template I believe here

Suggested change
format <- pdf_document_format(
"glossa",
keep_tex = keep_tex, latex_engine = latex_engine, ...
)
format <- pdf_document_format(
"glossapx",
keep_tex = keep_tex, latex_engine = latex_engine, ...
)

But are the template different ?

Copy link
Author

Choose a reason for hiding this comment

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

It might be possible to do it with settings differences? I'm not sure, but here's the diff from the glossa template to get something in glossa psycholinguistics format.

  • Reference format: glossa psycholinguistics uses APA 7 , glossa template uses some non-standard bibtex files (although I now see that there exists a .csl for glossa's style)
  • Section numbering: glossa doesn't do trailing dots after the section number, glossa psycholinguistics wants a trailing dot after sections (but not subsections "1. Intro", but "1.1 Stuff")
  • Tables and figures: glossa psycholinguistics wants table captions above the table (but glossa does below), glossa psycholinguistics wants left-aligned captions (glossa template centers, although I couldn't find documentation on glossa's website for any preference, glossa's website does link to a latex .cls that centers)
  • The set of unnumbered sections at the end of the paper differ slightly between the two journals, both on which sections are included and when they are required or not.

I think if it's possible to set toggles for the table captions and section numbering in the yaml that interact with the latex template, then glossa psycholinguistics format could be added to the glossa template by

  • setting yaml toggles for tables, caption alignment, and section numbering (perhaps this should be one toggle for glossa versus glossa psycholinguistics?)
  • switching to pandoc/csl for refs, and having both apa7 and glossa as labelled options
  • adding all the unnumbered sections to the skeleton and labeling what each journal wants in them and when

If this sounds like a better way forward, I can work on adapting the glossa template to support both glossa and glossa psycholinguistics.

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 like to clarify where do you think those change go ? From what I can see in the PR, it seems nothing is different in the template.tex or the associated resources, and things are different only in the skeleton.Rmd. Is that so ?

I understand now that there may not be an easy way to :

  • Have a glossapsycholx_article() function in the package
  • but none of the resources needs to be copied from glossa as template is the same.

There should be a way to reuse the glossa template, but provide another skeleton. If this is not possible easily already, I need to provide a way for this to happen.

So, probably clear question is: Is this PR aiming to offer a skeleton.Rmd specific to Glossa Psycholinguistics journal which could use glossa_article() really ?

My understanding is that Glossa Psycholinguistics is only some configuration variations from default glossa. Is that right ?

Copy link
Author

Choose a reason for hiding this comment

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

In the PR currently, there are

  • differences in the glossa.cls file of a few lines
    diff glossa/skeleton/glossa.cls glossapx/skeleton/glossa.cls
    < \RequirePackage[font=sf,labelfont=bf,labelsep=colon,justification=raggedright,singlelinecheck=off,justification=centering]{caption}

\RequirePackage[font=sf,labelfont=bf,labelsep=colon,justification=raggedright,singlelinecheck=off]{caption}
498a499,502

\renewcommand{\thesection}{\arabic{section}.}
\renewcommand{\thesubsection}{\arabic{section}.\arabic{subsection}}
\renewcommand{\thesubsubsection}{\arabic{section}.\arabic{subsection}.\arabic{subsubsection}}

  • apa7.csl for references in the skeleton
  • differences to skeleton.Rmd

I agree that the resources/template.tex is the same, so I just need a different skeleton but it's more than just the skeleton.Rmd since it needs the different cls and csl files.

I don't know if these would count as configuration variations?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for the clarification.

I also read the following page: https://escholarship.org/uc/glossapsycholinguistics/structure_of_submission
and noticed this

Glossa Psycholinguistics follows many of the style guidelines specified for Glossa: a journal of general linguistics. However, due to important differences Glossa: General stylesheets or template files should not be used for a Glossa Psycholinguistics submission, as detailed below.

I understand there are important differences now. I need to understand the maintainance part of this.

differences in the glossa.cls file of a few lines

Did you make the adaptation ? Is there a glossapsycholx LaTeX template we can use somewhere ?
How to we maintain the file ? How to update ? What is the source of truth for this template ?

Is there anything to change to follow the guideline on their website ? I don't see any mention of original glossa.cls in their website.

I agree that the resources/template.tex is the same, so I just need a different skeleton but it's more than just the skeleton.Rmd since it needs the different cls and csl files.

I don't know if these would count as configuration variations?

Different CSL is a configuration with the csl: field in YAML.

Regarding cls, does the line need to be inserted into the CLS file explicitly ?
Can't it be in the template.tex directly ?

If this is really the same resource, but some different skeleton.Rmd and format function, I can think of how to allow that in rticles

Thanks a lot for the discussion, I think this is the first case we have like this. Really interesting.

@vboyce
Copy link
Author

vboyce commented Apr 18, 2023

Thanks for helping figure out what to do here -- I really appreciate it!

I edited the glossa.cls myself (for context, I was submitting to glossa psycholingustics, used the glossa template because it was the closest thing available on rticles, but then had to make changes at the copyediting stage and messing with the .cls was the hack I used to get the formatting to meet their rules). I understand that's not good from a transparency / maintenance standpoint.

I think I could put the latex differences in the template instead (where they would overrule the .cls). For that matter, I think it could go in a header-includes: part of the yaml in the skeleton.Rmd, and then use the same template file as glossa?

I don't know of a glossapsycholinguistics latex template (it's a new journal), but I could ask the EiCs if a template or class file exists.

@cderv
Copy link
Collaborator

cderv commented Apr 18, 2023

I think I could put the latex differences in the template instead (where they would overrule the .cls).

That would be better yes !

For that matter, I think it could go in a header-includes

Yes if the place of insertion for header-includes is fine, then this will be a good solution. Otherwise, we can tweak the glossa_article() R function and its template to add in the right place. (by adding a journal argument in the function for example, and acting on it when set to glossapx to pass new content as variables to the template)

I don't know of a glossapsycholinguistics latex template (it's a new journal), but I could ask the EiCs if a template or class file exists.

This would be really good to know, to confirm that adapting from glossa.cls is the right thing to do.

part of the yaml in the skeleton.Rmd, and then use the same template file as glossa?

If we can use the glossa_article() function, with few tweaks, it is the easiest for the package. Then we need to decide if we do a common skeleton.Rmd with some information to adapt, or I could also see if we can provide two skeleton Rmd and one would choose the desired one. Could be easier right ?

@cderv cderv added the WIP label Apr 19, 2023
@rstudio rstudio deleted a comment from CLAassistant Apr 21, 2023
@vboyce
Copy link
Author

vboyce commented Apr 27, 2023

I got in contact with the editors of Glossa Psycholinguistics, and they are in the process of making a latex template for the journal. So, I'm going to wait for there to be the journal provided template and then build the rticles skeleton/template to go with it.

@cderv
Copy link
Collaborator

cderv commented May 2, 2023

Ok let's do this then. Do they provide an ETA for such template ?

I'll move this PR as draft to track that we are waiting for more. Thanks again !

@cderv cderv marked this pull request as draft May 2, 2023 09:00
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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

Successfully merging this pull request may close these issues.

3 participants