How do I input images, code, and groovy typeset mathematics?

edited May 31 in Meta

To start a discussion, just hit the big New Discussion button that appears when you're logged into the front page. To comment on an existing discussion, just start typing in the Leave a Comment box that appears at the bottom of a discussion. This should look something like so:

Generally, input is Markdown but you've got a few buttons above the comment box to help you out. In particular, the button on the right is for uploading images. That's how included the images in this post

Code

We'll make frequent use of the computer and will need to indicate that some of our text is actually computer code so that it appears clearly as a plain, mono-spaced font. This is accomplished by simply indenting our code block four spaces. For example:

%matplotlib inline
from matplotlib import pyplot as plt

x = [0,1,2]
y = [0,1,1]
plt.plot(x,y, 'ok')
plt.plot([-1/3,7/3],[0,4/3])

Sometimes, we might want to include a brief snippet of code inline. For example, the above code block used matplotlib's pyplot package. This is accomplished by wrapping the snippet in back tick characters (`).

Typeset mathematics

Sometimes, we'd like to enter typeset mathematics. For example, the equation of a line is %y=mx+b% and the equation of the line in the figure above is
%y=1/2 x + 1/6.%
This is accomplished by wrapping the math in percentage symbols characters (%).
The specific form of the input is called AsciiMath. You can see what I typed to create the equations above by cntrl-clicking on the math and selecting Show Math As $\rhd$ AsciiMath Input.

Sign In or Register to comment.