Today we continue exploring the capabilities of Markdown mode.  Utilizing Markdown well can really help you document your studies/ code better.

  1. In MS Word, you could insert an image, right?  We must be able to do something similar in Markdown otherwise it will fall behind the competition!

Image insertion is easy if is it uploaded online.   Just write ‘!’ followed by a ‘[]’ , then the image link ( from where it is uploaded).  

Type and run ( you can copy the link actually – no need to type)

![](https://upload.wikimedia.org/wikipedia/commons/e/ea/Dhaka_21st_March_%2825870222381%29.jpg

2. If you want a image caption to appear when you hover your mouse above the image, you can put that caption in quotation before closing the parenthesis.

Type and run:

![](https://upload.wikimedia.org/wikipedia/commons/e/ea/Dhaka_21st_March_%2825870222381%29.jpg “Dhaka is pretty!”)

3. Ok now we will learn something that may actually help us annotate our study note better.  How about you want to explain or discuss some piece of code for yourself or others but you do not want to execute the code.  Sure you can take a screenshot of that code and insert it as an image like above. But there is a better way.

Type and run:

“`python

#Let’s print something

  print(“Hi, I’m a little bit of Python code!”)

“`

4. What did you see above?  All the formatting came in the output exactly like a real python code ( the colors and italics and all).   You can even insert piece of codes from C++, Java, MATLAB etc.  You just have to replace  the language name above.

Type and run:

“`c++

#include <iostream>

using namespace std;

// Let’s print something!

int main() {

   cout << “Hello, I am a tiny C++ code”;

   return 0;

}

“`

4. Type and run:

“`OCTAVE

%% This is a matrix full of zeros

M = zeros(2,2)

M = M+4  % Now this is matrix full of 4

disp(“Matlab is not recognized as a parameter  here, that’s why we are choosing the open source alternative OCTAVE”)

“`

5. And finally we could insert beautiful equations in the Markdown by using ‘$’ signs in the front and back .

Type and run:

This was a life-saver back at school!

$a^2-b^2=(a+b)(a-b)$