CodeFormatter icon indicating copy to clipboard operation
CodeFormatter copied to clipboard

Power[a, b] throws $Failed

Open SilviaHyde opened this issue 11 years ago • 3 comments

a^b or Power[a, b] throws $Failed. Maybe typesetting boxes (like SuperscriptBox here and FractionBox in scdevries's example) should all be avoided?

SilviaHyde avatar Jan 31 '14 16:01 SilviaHyde

Yes, right. There is the simplified CodeFormatterMakeBoxes inside the package, which I introduced specifically for handling such cases. Use it instead of MakeBoxes for your expression, and (hopefully), it will format Ok. Have a look at the project page, there is an example there of how to use that.

lshifr avatar Feb 01 '14 00:02 lshifr

Thanks. Didn't notice the CodeFormatterMakeBoxes. I thought of reading Boxes from Input cells in a temp nb, which can handle comments as well. But then I realized UsingFrontEnd needs x-server so won't work in a pure console environment :(

SilviaHyde avatar Feb 03 '14 15:02 SilviaHyde

Yes, comments are currently not handled by the formatter. I know how to do this, it is relatively straight-forward. Hopefully, some time soon :)

lshifr avatar Feb 05 '14 23:02 lshifr