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

Subtitles #480

Closed
dicook opened this issue Mar 6, 2023 · 4 comments · Fixed by #482
Closed

Subtitles #480

dicook opened this issue Mar 6, 2023 · 4 comments · Fixed by #482

Comments

@dicook
Copy link

dicook commented Mar 6, 2023

Hi @cderv This issue was posted on the rjtools site two weeks ago. Its not clear that we generally want to have subtitles but the news items for the journal, which is slightly different in format than a regular article, sometimes have subtitles.

@cderv
Copy link
Collaborator

cderv commented Mar 6, 2023

Hi !

Sure I can look how to add subtitles and see where it should be placed in the distill template. Today we have description that will be place right under the title (see example source and HTML

image

it is put as paragraph right below the title in the title block, but after categories and tag if any

<div class="d-title">
<h1>$pagetitle$</h1>
<!--radix_placeholder_categories-->
$if(categories)$
<div class="dt-tags">
$for(categories)$
<div class="dt-tag">$categories$</div>
$endfor$
</div>
$endif$
<!--/radix_placeholder_categories-->
$if(description)$<p>$description$</p>$endif$
</div>

In this part we also allow description to be not provided and in that case not included.

However, it was tweaked by @mitchelloharawild in rjtools specifically to be an abstract: https://github.com/rjournal/rjtools/blob/8ff12f0f38355ea9249dffe119310c68ab8fa885/inst/rjdistill.html#L23

We need to see what should be done in distill and what in rjtools.

Regarding format, how would the subtitle looks like ? I tried to see about "Changes on CRAN" I don't see one I think in https://journal.r-project.org/issues/2022-4/2022-4.pdf for example ? Is this the "by" in
image

A paragraph of text just below the title, before any categories and tag ?

I did a quick branch (#482) to add in template and this is a demo doc

---
title: "Untitled"
subtitle: demo article
description: |
  A new article created using the Distill format.
categories:
  - portfolios
  - demo
author:
  - name: John Doe
date: "`r Sys.Date()`"
output: 
  distill::distill_article:
    keep_md: true
---

Content

We get this for no subtitle support:
image

and without categories
image

Now with the branch
image

and
image

Would that work for you ? Simple change on this side.


On a side note, I believe from rjournal/rjtools#58 that we should add also in rticles (https://github.com/rstudio/rticles/blob/main/inst/rmarkdown/templates/rjournal/resources/template.tex)

We still have a R Journal template and format in rticles package - it seems like rjtools is replacing that. but that is another topic to discuss.

@zeileis
Copy link

zeileis commented Mar 8, 2023

The latest "Changes on CRAN" unfortunately does not have a subtitle because support wasn't added in time for the release of the issue. So the editors had to decide whether they prefer having a HTML version or the usual PDF with subtitle and no abstract. For the desired format see the PDF from a previous issue: https://journal.R-project.org/news/RJ-2022-3-cran/RJ-2022-3-cran.pdf

The subtitle is the date range: "2022-07-01 to 2022-10-31".

@dicook
Copy link
Author

dicook commented Mar 8, 2023

The subtitle format looks great @cderv

@zeileis
Copy link

zeileis commented Jun 20, 2023

Thanks for this, very much appreciated! 👍

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

Successfully merging a pull request may close this issue.

3 participants