Ask Your Question

Sage Notebook, R, & problem rendering LaTeX

asked 2013-06-17 06:51:48 +0200

rickhg12hs gravatar image

updated 2013-06-17 07:15:04 +0200

Using Sage 5.9 notebook, the output of:


... shows the LaTeX source, not the rendered LaTeX.

N.B.: My first try generated an error stating that R package 'Hmisc' was required. From:

sage -R

... seemed to go fine. The notebook was restarted and:


... showed 'Hmisc' was indeed installed.

Is there some other trick to render R LaTeX output in the notebook?

edit retag flag offensive close merge delete



Just as an aside, `r.install_packages('Hmisc')` should work from the Sage notebook, if you have permissions to install stuff.

kcrisman gravatar imagekcrisman ( 2013-06-17 10:15:04 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-06-17 10:27:55 +0200

kcrisman gravatar image

Took me a little bit to install this properly because of some unrelated bleeding-edge notebook issue, but here is what is happening:

\newcommand{\Bold}[1]{\mathbf{#1}}% latex.default(sage13, file = "") 
1st Qu.&$2.25$\tabularnewline
3rd Qu.&$6.75$\tabularnewline

Mathjax doesn't support non-math commands; here is a list of their supported environments, which does not include table or tabular (since they are better done in HTML). It probably doesn't support newcommand, either. So I think this would be something we couldn't easily fix.

You could naturally still use this code inside SageTeX or some other setting, though I'd suggest just using latex(r.summary(range(10))) in that case.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-06-17 06:51:48 +0200

Seen: 450 times

Last updated: Jun 17 '13