Comments (3)
I think the issue comes from this function we use for printing
knitr:::format_sci((-1)*10^7)
#> [1] "10^{7}"
We use this function in inline hooks
Lines 204 to 207 in 42f6b3a
It seems there is several issues here:
-
@yihui why do we
latex
as format and not HTML here ? It seems we should usehtml
.knitr:::format_sci_one((-1)*10^7, format = "latex") #> [1] "10^{7}" knitr:::format_sci_one((-1)*10^7, format = "html") #> [1] "10<sup>7</sup>"
Not sure I understand why we do
length(pandoc_to()) == 1L
thenlatex
-
We still loose the minus sign does not seems right...
Lines 206 to 207 in 42f6b3a
if not -1 we keep it
knitr:::format_sci_one(-2*10^7, 'html') #> [1] "-2 × 10<sup>7</sup>"
shouldn't we have a special case for -1 ?
I am in doubt with your implementation of scientific notation
Lines 227 to 229 in 42f6b3a
Should it be
"-1 × 10<sup>7</sup>"
or"-10<sup>7</sup>"
?
from knitr.
Should be fixed now. Thanks for the report!
---
title: "Inline test"
output: html_document
---
The following prints a positive(!) number: $`r (-1) * 10^7`$
Note that you need $ $
around the number.
from knitr.
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.
from knitr.
Related Issues (20)
- WISH: Make it possible to call globalCallingHandlers() in a chunk
- Animation not rendering in powerpoint HOT 1
- Error(s) in re-building vignettes: HOT 2
- table output for typst HOT 8
- html/css rendering to PDF HOT 3
- export some pandoc syntax helper HOT 2
- Make `asis_output` works for Quarto the same as `results: asis`
- output hooks and current chunk options
- write_bib producing NULL in knitr 1.45 HOT 5
- feature request: tweak non-escaped ampersand HOT 7
- fig.ncol not working with Latex HOT 2
- `* 2.` does not produce <li>2.</li> HOT 1
- catch error=TRUE chunks produced by hook_purl() HOT 5
- Problem caching instances of torch modules and datasets
- write_bib() includes multiple URLs HOT 3
- autodep regression by #2321 HOT 4
- Issue with code highlighting (RStudio/Sweave/knitr/tinytex) HOT 7
- collapse is not working since 1.46 HOT 1
- hook_purl() writes filename to the md file HOT 1
- include_app 是否可以添加一个 width 参数 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from knitr.