-
Notifications
You must be signed in to change notification settings - Fork 1
/
Info.mdma
75 lines (46 loc) · 2.59 KB
/
Info.mdma
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
## Description
Mathdown merges markdown and Latex's math mode syntax in order to provide a simple and fast way for mathematical notetaking. You can write a markdown file as usual and simply use Latex's math commands without any further declaration (like \$ signs) in the text. Mathdown has heuristics to detect this, interprets it as math and outputs a nice .pdf as well as a .tex with your notes.
## Usage
The input files have by convention the extension .mdma. With the mathdown script in your PATH, in order to create a pdf from the file `example.mdma`, just type
`mathdown example`
and the .tex as well as .pdf will be generated in the same folder.
## Example
For example you can write in a .mdma file:
```Markdown
### A mathy introduction
Let for n \in \N_0 f(n) := n^2. Then Pythagoras theorem can be written as f(a) + f(b) = f(c).
### A presentation of formatting
Also the entire Markdown elements such as
1. lists
2. code blocks
3. and more
are possible, all with
* math mode like \int_0^{2\pi} \sin(t) \dd{t} = 0 possible inside
You can also declare familiar Latex environments for the more layout-intense stuff:
\begin{align*}
\int_0^{2\pi} \sin(t) \dd{t}
&= \cos(2\pi) - \cos(0) \\
&= 1 - 1 \\
&= 0
\end{align*}
```
This then looks like this:
### A mathy introduction
Let for n \in \N_0 f(n) := n^2. Then Pythagoras theorem can be written as f(a) + f(b) = f(c).
### A presentation of formatting
Also the entire Markdown elements such as
1. lists
2. code blocks
3. and more
are possible, all with
* math mode like \int_0^{2\pi} \sin(t) \dd{t} = 0 possible inside
You can also declare familiar Latex environments for the more layout-intense stuff:
\begin{align*}
\int_0^{2\pi} \sin(t) \dd{t}
&= \cos(2\pi) - \cos(0) \\
&= 1 - 1 \\
&= 0
\end{align*}
## Components and Installation
Mathdown consists of a python script `markmath.py` to detect the math commands heuristically and mark them for the markdown compiler and a bash script `mathdown` that uses pandoc to compile the .tex and .pdf file from the input. It requires working commands pandoc, pdflatex, and python 3.
When downloading the files from this repository you can simply run `install.sh` to copy the few required files where they belong for the user running the script. The main script `mathdown` is tried to move to /usr/bin/ as well, which works only when you're allowed to sudo. Otherwise you can do that manually or put the file wherever you want. In your home folder a `.mdma` folder is created, containing the python script `markmath.py` and a custom latex template you can modify or enrich with your personal commands.