Tag Info

New answers tagged

0

A rough approximation using a string toExpr[str_String] := str // StringReplace[#, "\n" :> ""] & // ToExpression; " x //f1 //f2 //f3 //f4 //f5 " // toExpr f5[f4[f3[f2[f1[x]]]]] Although, this is just a Composition Composition[f5, f4, f3, f2, f1]@x f5[f4[f3[f2[f1[x]]]]] f5@*f4@*f3@*f2@*f1@x f5[f4[f3[f2[f1[x]]]]] ...


5

Something like this?: expr = -t^Range[0, 5] // Total toΣ[expr_Plus] := Block[{n}, HoldForm[Sum[#, {n, #2}]] & @@ {FindSequenceFunction[List @@ expr, n], Length@expr}] toΣ@expr If you want to manually set the initial index: toΣ[expr_Plus, init_Integer: 1] := Block[{n, l = Length@expr}, HoldForm[Sum[#, {n, init, #2}]] & @@ ...


0

fn[args__] := Replace[ StringForm[args], x : Except[_String] :> ToString[x, InputForm], 1 ] // ToString Test: fn["SomeText=`` as well as OtherText=``.", 2.0*10^(-15), 2/5] "SomeText=2.*^-15 as well as OtherText=2/5."


1

data = Transpose@{DateRange[Today, DatePlus[{9, "Week"}], "Week"], RandomReal[{25.5, 50.8}, 10]}; Using ToString avoids the problem: DateListPlot[ Function[{pair}, Tooltip[pair, ToString[NumberForm[pair[[2]], {3, 1}]]]] /@ data, Joined -> False, Filling -> Axis] Or, more compactly: DateListPlot[Tooltip[#, ToString[NumberForm[#[[2]], {3, ...


1

It is not really an answer, but if you select this expression and go to Menu/Evaluation/EvaluateInPlace you will repair your formula. May be this helps. You might also want to define a simple function to apply it to each your expression to prevent any its unwanted reformatting. like this, for example: rE[expr_] := Rasterize[Evaluate[expr] // ...


1

Within a Text Cell you can use ParagraphIndent. A negative value will produce a hanging paragraph. A stylesheet entry: Cell[StyleData["Text"], ParagraphIndent -> -50 ] The result: See also LineIndent.


2

InputForm[ ToString@StringForm["SomeText=`` as well as OtherText=``.", "textA", "textB"]] "SomeText=textA as well as OtherText=textB." If you have version 10 you might want to try StringTemplate StringTemplate["SomeText=`` as well as OtherText=``."]["textA", "textB"] "SomeText=textA as well as OtherText=textB."


1

This is not as versatile as Chip's method but it might be sufficient: rule = {x_^a_ + y_^b_ /; Divisible[a, b] :> (x^(a/b) + y)^b}; {q^3 + r^3, f[x]^2 + f[y]^4} /. rule {(q + r)^3, (f[x] + f[y]^2)^2}


3

I think we can just use basic pattern matching: (* Freshman's dream... ahhhhh *) FrobeniusFactor[expr_] := expr //. x_^e1_ + y_^e2_ :> With[{g = PolynomialGCD[e1, e2]}, ( (x^Cancel[e1/g] + y^Cancel[e2/g])^g ) /; g =!= 1 ] FrobeniusFactor[x^a + y^a] (x + y)^a FrobeniusFactor[f[x]^2 + f[y]^4] (f[x] + f[y]^2)^2


0

As of 10.1 this is built in to Mathematica with StringPadLeft: StringPadLeft[#,2,"0"]&@*ToString/@{-6,1,3,23} {"-6", "01", "03", "23"}


17

In version 10.1, I've built something like Spelunk into GeneralUtilities`. To use it, run Needs["GeneralUtilities`"] PrintDefinitions[symbol]; This will pop up a window that shows all definitions of symbol. Here is a short summary of features: The window shows code cells containing all DownValues, OwnValues, UpValues, SubValues, and Attributes of a ...


3

As suggested i post my commend as an answer: I made a bugreport on this (March 27) and got an answer from WRI 3 days later that says: In this case, Mathematica is behaving as designed. In particular, the StyleNames item does not apply to the cells you are looking at. Further, StyleNames is an undocumented symbol, meaning that it's usage can change without ...


5

Unfortunately, the Mathematica's Copy As > LaTeX command is not (as you'd expect) a command that copies the selected expressions as LaTeX. Instead, it performs additional reformatting that can only be avoided by changing behavior of the relevant built-in function with: System`FEDump`CopyAsTeXMakeBoxes = #& Details Why copied boxes are reformatted ...


0

This is more of a workaround than a solution. This approach may be useful as a starting point to debug the notebook. I don't see this as a solution as more knowledgeable folks such as Mr. Honeychurch may have much better input. While this worked - there are probably better approaches. To locate points where equation numbering re-starts at (1) Make a ...



Top 50 recent answers are included