-
Notifications
You must be signed in to change notification settings - Fork 0
Add demo of mathematical notation in roxygen2 comments #15
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
base: main
Are you sure you want to change the base?
Conversation
|
@copilot try again |
|
@copilot can we use the $$ LaTeX notation in roxygen2 comments? |
Codecov Report✅ All modified and coverable lines are covered by tests.
|
Co-authored-by: d-morrison <[email protected]>
Yes, you can use Important limitations:
I've added a demonstration in commit 358bc6f showing both approaches. The Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
📖 https://ucd-serg.github.io/rpt/preview/pr15 |
|
Demonstrates the various ways to include mathematical notation in roxygen2 documentation, including both cross-format compatible syntax and HTML-only LaTeX notation.
Changes Made
example_function.R: Added comprehensive examples showing different mathematical notation approaches in roxygen2 comments:\eqn{}for inline math (works in all output formats: HTML, PDF, man pages)\deqn{}for display equations (works in all output formats)$$for display math (HTML/pkgdown only, requires roxygen2 >= 7.0.0)$for inline math (HTML/pkgdown only, requires roxygen2 >= 7.0.0).Rdfile showing how each notation is processedImportant Notes
The
$$and$LaTeX notation work beautifully for HTML output (pkgdown sites) where they render with MathJax/KaTeX, but they generate R CMD check warnings for PDF/man page generation because raw LaTeX macros aren't recognized outside of\eqn{}/\deqn{}tags.For maximum compatibility across all documentation formats, use
\eqn{}and\deqn{}. Use$$and$notation when targeting primarily HTML documentation.Testing
devtools::document()$$notation in R CMD check (HTML-only feature)Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.