Skip to content

Resolve Issue 1416#1512

Merged
rich-iannone merged 2 commits intorstudio:masterfrom
kbrevoort:issue-1416
Dec 19, 2023
Merged

Resolve Issue 1416#1512
rich-iannone merged 2 commits intorstudio:masterfrom
kbrevoort:issue-1416

Conversation

@kbrevoort
Copy link
Copy Markdown
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
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