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

Resolve Issue 1416 #1512

Merged
merged 2 commits into from
Dec 19, 2023
Merged

Resolve Issue 1416 #1512

merged 2 commits into from
Dec 19, 2023

Conversation

kbrevoort
Copy link
Collaborator

@kbrevoort kbrevoort commented Dec 19, 2023

Summary

When creating tables in LaTeX, if there are multiple footnotes, footnotes without an explicit superscript are preceded by "\textsuperscript{NA}" when rendered. This pull request removes these NAs.

The change replaces a series of paste0 calls with calls to a new function, sprintf_unless_na, that returns an NA_character_ when an NA is passed to the function. (I switched from paste0 to sprintf because it's slightly more streamlined -- using paste0 would have required three arguments be passed each time.)

The existing tests are sufficient to cover this pull request, though the snapshots for three tests have to be modified to show results without NA's preceding the unnumbered footnotes. Those modifications are included in the pull request.

I'm assuming this is a

Related GitHub Issues and PRs

Checklist

Fixes: #1416

When the footnote mark is NA, no footnote mark is printed in LaTeX (which matches the behavior in HTML). Previously the footnote mark was printed as "NA"
Removes footnote marks equal to NA from 3 existing tests.
@rich-iannone rich-iannone merged commit b76fd28 into rstudio:master Dec 19, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LaTeX: when there are multiple footnotes, those without a superscript are added an "NA" superscript
3 participants