How do I post Mathematica code in StackExchange properly? I read some instructions that told me I should copy the Mathematica code from the Mathematica notebook with Copy as > Plain text or Copy as > Input text, paste into the SE code editor pane, and put it between \$ \$,
When I did this I still did not get well-formated equations. For example, I got:
$ eq1[zz_, \[Beta]_] := 2*Subscript[\[Lambda], 1]*v1[\[Beta]]^2 $
So what did I miss?
Actually I still haven't found an answer. I followed the instruction in How to copy code from Mathematica so it looks good on this site
I did the following for a Mathematica cell that I wanted to post Mathematica.SE site. I convert the contents of the cell to Raw InputForm and then pasted intp SE editor between \$ $, like
$ eq1[zz_, \[Beta]_] := 2*Subscript[\[Lambda], 1]*v1[\[Beta]]^2 + 2*Subscript[\[Lambda], 2]*v2[\[Beta]]^2 $
Nothing, so I also tried to put between { }, like
{eq1[zz_, \[Beta]_] := 2*Subscript[\[Lambda], 1]*v1[\[Beta]]^2 + 2*Subscript[\[Lambda], 2]*v2[\[Beta]]^2 }
So I'm afraid I didn't understand the instructions in the referred post.
\$ \$, but that is wrong and don't do it.x + y. However, it is a longer piece of code or you wish it to stand alone on a line, paste it into a blank line, highlight it, and click the {} symbol about the SE code editor box. (Equivalently, separate it from text by a blank line and indent it four spaces.) In this case, do not surround it by backquotes. Do not surround it by dollar signs unless you want LaTex.InputFormcommand, and then copy and paste the result. This leaves Greek letters to format properly. For many web viewers, use Halirutan's editor. See also my earlier question.