-
Notifications
You must be signed in to change notification settings - Fork 521
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
base: main
Are you sure you want to change the base?
Conversation
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.
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") { |
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 about naming glossapsycholx()
as their twitter account ? https://twitter.com/glossapsycholx
format <- pdf_document_format( | ||
"glossa", | ||
keep_tex = keep_tex, latex_engine = latex_engine, ... | ||
) |
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 it be glossapx
here ? You are not using the correct template I believe here
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 ?
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.
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.
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 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 ?
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 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?
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.
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.
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. |
That would be better yes !
Yes if the place of insertion for
This would be really good to know, to confirm that adapting from
If we can use the |
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. |
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 ! |
|
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 toR/article.R
if the output format is simple enough, otherwise create a separateR/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 viatinytex::parse_packages(files = "FILENAME"")
(e.g., whenFILENAME
isplain.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 linetest_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.