3

I've written a knitr engine to process Maxima code (as part of a package), which works for "regular" chunks just fine, e.g.:

```{maxima}
1+1;
```

results in

(%i1) 1+1;
# (%o1) 2

However, when I try to get the output printed inline, such as

`maxima 1+1;`

It gets printed literally: maxima 1+1;

The R Markdown Cookbook explicitly says

inline: processing output from inline R expressions.

So I guess this is not meant be working (yet), but I wanted to ask here if there is a way to do this/ workaround before filing a feature request at github.

rcst
  • 175
  • 9
  • 1
    All I could find suggests that inline chunks are always evaluated in `R`. You would have to provide a wrapper function to call `maxima` from `R` as it is done for e.g., Python. See https://stackoverflow.com/a/65344688/5028841. But I might be wrong... – JBGruber Jul 07 '21 at 11:01
  • Ah it seems you already did! So this would be a sensible workaround: r rim::maxima.get("1+1;")`. However, I see that it would be good to know if this is the only way and maybe also why. – JBGruber Jul 07 '21 at 11:04
  • 2
    That would be one way, indeed. However, `rim::maxima.get()` uses a different Maxima session than the knitr engine. Thus you wouldn’t be able to use previous inputs and results. – rcst Jul 07 '21 at 11:49

0 Answers0