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

scientific notation for \Sexpr{} #33

Closed
yihui opened this issue Dec 3, 2011 · 5 comments
Closed

scientific notation for \Sexpr{} #33

yihui opened this issue Dec 3, 2011 · 5 comments
Labels
feature Feature requests

Comments

@yihui
Copy link
Owner

yihui commented Dec 3, 2011

may want this in the inline hook: http://stackoverflow.com/q/8366324

@yihui yihui closed this as completed in 7793947 Dec 7, 2011
yihui added a commit that referenced this issue Dec 7, 2011
@mhermans
Copy link

Can someone provide an example of how to disable this scientific formatting for \Sexpr{}?

@ramnathv
Copy link
Contributor

you can do this by redefining the inline hook in your document by adding the following chunk

<<disable-sci-format, echo = F>>=
knit_hooks$set(inline = function(x) identity(x))
@

@yihui
Copy link
Owner Author

yihui commented Jan 31, 2012

Yes that is one way to do it. Another (more natural) way is to set the option scipen; see ?options

Basically larger scipen (default 0) will bias towards fixed notation, e.g. options(scipen = 8) (use fixed notation unless it is greater than 10^{8+4} or less than 10^{-12})

@mhermans
Copy link

mhermans commented Feb 1, 2012

Thanks, that worked.

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Feature requests
Projects
None yet
Development

No branches or pull requests

3 participants