Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Glossa Psycholinguistics template#526

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
vboyce wants to merge4 commits intorstudio:main
base:main
Choose a base branch
Loading
fromvboyce:main
Draft

Conversation

@vboyce
Copy link

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 thatjournalname_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 theindividual orcorporate contributor agreement. You can send the signed copy tocontribute@rstudio.com.

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

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

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

  • Add a skeleton articleinst/rmarkdown/templates/journalname/skeleton/skeleton.Rmd.

  • Add a description of the templateinst/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 bydevtools::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 totests/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 authorsAuthors@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

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

Ifglossapx_article() supposed to be identical asglossa_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 namingglossapsycholx() 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 beglossapx 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 thetemplate.tex or the associated resources, and things are different only in theskeleton.Rmd. Is that so ?

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

  • Have aglossapsycholx_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 theglossa 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 askeleton.Rmd specific toGlossa Psycholinguistics journal which could useglossa_article() really ?

My understanding is thatGlossa 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 differencesGlossa: 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 aglossapsycholx 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 originalglossa.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 thecsl: field in YAML.

Regardingcls, does the line need to be inserted into the CLS file explicitly ?
Can't it be in thetemplate.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 inrticles

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

@vboyce
Copy link
Author

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

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 forheader-includes is fine, then this will be a good solution. Otherwise, we can tweak theglossa_article() R function and its template to add in the right place. (by adding ajournal argument in the function for example, and acting on it when set toglossapx 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 fromglossa.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 theglossa_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 ?

@cdervcderv added the WIP labelApr 19, 2023
@rstudiorstudio deleted a comment fromCLAassistantApr 21, 2023
@vboyce
Copy link
Author

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

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 !

@cdervcderv marked this pull request as draftMay 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 ourContributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let usrecheck it.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@cdervcdervcderv left review comments

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@vboyce@cderv@CLAassistant

[8]ページ先頭

©2009-2025 Movatter.jp