Closed charliejhadley closed 5 years ago
Thanks! Could you please:
clean_latex_special_characters()
@martinjhnhadley
)?Totals | |
---|---|
Change from base Build 58: | 0.4% |
Covered Lines: | 94 |
Relevant Lines: | 97 |
Thank you!
Hey @maelle I was wondering if I should reopen this and extend the namer package to check existing code chunks for LaTeX special characters?
I'm not sure I understand what the new functionality would be?
@maelle sorry for being vague. My idea was to have a function name_chunks_strictly()
which would replace LaTeX special characters with -
to ensure compatibility with advanced Rmd features. This could then be an option in a UI for the add-in.
However, this might be considered beyond scope and dangerous as we'd be potentially removing important data from the code chunk names.
Ok, thanks for clarifying! Do you however consider your (merged) PR to be dangerous too i.e. should the filename cleaning be optional too?
Hmm. I don’t think it’s dangerous because it’s inserting chunk names that are completely new, and safe. Editing names that a user has deliberately chosen is more dangerous, I think. What do you think?
On Mon, 3 Dec 2018 at 13:13, Maëlle Salmon notifications@github.com wrote:
Ok, thanks for clarifying! Do you however consider your (merged) PR to be dangerous too i.e. should the filename cleaning be optional too?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lockedata/namer/pull/18#issuecomment-443705383, or mute the thread https://github.com/notifications/unsubscribe-auth/AI7fP0O3wPJWMIFQv_Ii2bRnhAHnaI4Vks5u1SNrgaJpZM4Ys_Xe .
Ok! Feel free to open an issue about your other idea if you want!
Bookdown provides support for captions and other internal referencing via the use of chunk names.
As warned here https://bookdown.org/yihui/bookdown/markdown-extensions-by-bookdown.html#text-references it's advised not to use underscores in chunk labels as they're escaped in LateX
Jenny Bryan's excellent "how to name files" slide deck https://speakerdeck.com/jennybc/how-to-name-files encourages the following:
YYYY-MM-DD_semantic-component-1_component-2
This PR introduces
clean_latex_special_characters
which replaces all LaTeX special characters in filenames with - and also removes duplicate dashes.