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

Alternative text for figures: Requirements / best practices? #268

Open
SOLV-Code opened this issue Oct 30, 2024 · 4 comments
Open

Alternative text for figures: Requirements / best practices? #268

SOLV-Code opened this issue Oct 30, 2024 · 4 comments
Assignees

Comments

@SOLV-Code
Copy link

SOLV-Code commented Oct 30, 2024

While chasing the table formatting issue (#266) I came across these guidelines from the hake assessment repo, which lay out the code for the alternative figure text, but I don't see that in the default templates generated by csasdown. I also don't see it in a recent Res Doc, unless the alternative text only shows up with special pdf readers. I didn't see anything pop up when hovering the mouse over the figures.

  • Is this still needed?
  • If not, just disregard all the questions below
  • If so:
    • what is the minimum required text to include? Can it just be something like "scatterplot of recruits vs. spawners", or can I use the plot caption, or does it have to be a description of the plot. This could be quite complex for some figures, and would duplicate text in the body of the report.
    • Regardless of how short or long the alternative text is, if it is something different from the figure caption it would require a separate submission for translation. How have you handled this in the past?
@cgrandin
Copy link
Contributor

csasdown does not yet have the ability to add alt text properly. I coded it in the hake repo and my plan was to add it to csasdown when I have time. It allows one to add a (ref:chunk-name-alt) for alt text for a knitr chunk of the name chunk-name. Here is how the tex code is parsed and modified in the hake repo:

Example:

(ref:es-survey-biomass-cap) Acoustic survey biomass index of age-2$+$ fish
(Mt). Approximate 95% confidence intervals are based on
sampling variability (intervals without the additional squid/`r sp`
apportionment uncertainty included in 2009, black line).

(ref:es-survey-biomass-alt) This figure shows that the survey estimate has
decreased from 2019 to 2021.

```{r es-survey-biomass-fig, fig.cap = "(ref:es-survey-biomass-cap)"}

plot_survey_biomass(base_model, index = "age2")
```

https://github.com/pacific-hake/hake-assessment/blob/master/R/utils-alt-text-inject-tags.R

And there's a header that has to be added to tell TexLive to use the tagging codes (this is bleeding edge and you need the newest TeXLive distro, you cannot use tinytex):

https://github.com/pacific-hake/hake-assessment/blob/master/R/post-process-add-alt-text.R

Thanks for reminding me about this, I wrote this out in detail so I can refer to it when I get to doing the implementation

@SOLV-Code
Copy link
Author

Thank you for the clarification and example. I can see in your example that you did use a very short description, and in the next Res Doc I do, I'll put these in from the beginning.
In the meantime, however, considering that some recent Res Docs don't seem to have this, is the alternative text still optional? We're almost ready to submit for publication. Writing, translating, and implementing these would take quite a bit of time and effort for a long res doc. Or does it just depend on what the review folks flag?

@kellijohnson-NOAA
Copy link

Actually, you can do it with TinyTeX, you just have to use tinytex::install_tinytex(bundle = "TinyTex-2")

@cgrandin
Copy link
Contributor

I've always been told alt-text was required for CSAS docs, and now that there are new accessibility standards I would venture a guess that it will be required 100%. Probably best to ask CSAS office though.

@cgrandin cgrandin self-assigned this Oct 31, 2024
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

No branches or pull requests

3 participants