Skip to content

Commit

Permalink
modifying inline latex hook to account for different decimal separato…
Browse files Browse the repository at this point in the history
…rs on numeric inputs
  • Loading branch information
cmmp committed Jul 24, 2012
1 parent 1769b85 commit 7723b22
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion R/hooks-latex.R
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,13 @@ hook_plot_tex = function(x, options) {

## inline hook for tex
.inline.hook.tex = function(x) {
if (is.numeric(x)) x = format_sci(x, 'latex')
if(is.numeric(x)) {
if(getOption('OutDec') != '.') {
if(!inherits(x, 'AsIs')) x = sprintf('\\text{%s}', format_sci(x, 'latex'))
} else {
x = format_sci(x, 'latex')
}
}
.inline.hook(x)
}
# an example of a chunk hook
Expand Down

0 comments on commit 7723b22

Please sign in to comment.