Hot answers tagged

4

I faced with the same issue. Using Mathematica's function ExportString[…, "ExpressionJSON"] I attempted to export the whole tree of graphical functions and wrote a parser in JS. It was uploaded to GitHub, here is the link. There is a primitive construction with a lot of "switch-case" statements. Each of them implements self function like changing the color ...


3

Here is a trick to make it infinite: mark all existing new lines convert to text remove marks and not marked new lines ToInfWidthInputText[boxes_] := Module[ {tagged, mark = "ORYGINALMARK", iNL = FromCharacterCode@{62371}} , tagged = boxes /. (n : "\n" | iNL) :> mark <> n; tagged = First @ FrontEndExecute @ FrontEnd`ExportPacket[tagged, "...


1

Something like this may do it: editLine = "a * Sinc[ b*t + c*u ]"; noEdit = "# COMMENT"; text = {noEdit, noEdit, editLine, editLine, noEdit, editLine}; count = 0; newText = StringReplace[text, { "[" -> "(", "]" -> ")", "t" :> ("m.lammda" <> ToString[++count] <> "[i]*180/np.pi"), "u" :> ("m.phi" <> ToString[count] &...


Only top voted, non community-wiki answers of a minimum length are eligible