markdown語法和數學公式

Markdown簡介

Markdown 是一種輕量級標記語言,它容許人們使用易讀易寫的純文本格式編寫文檔,而後轉換成格式豐富的HTML頁面。 —— 維基百科java

代碼塊

import java.util.*;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
//這是一個註釋
public class Main{
	public static void main(String[] args){
		Scanner input = new Scanner(System.in);
		int num = input.nextInt();
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
		String str = "2013/03/24";
		Date date = sdf.parse(str, new ParsePosition(0));
		Calendar calendar = Calendar.getInstance();
		calendar.setTime(date);
		calendar.add(Calendar.DATE,num);
		Date date1 = calendar.getTime();
		String out = sdf.format(date1);
		calendar.add(Calendar.DATE,-(num)*2);
		Date date2 = calendar.getTime();
		String in = sdf.format(date2);
		System.out.print(out+" ");
		System.out.println(in);
	}
}

LaTeX 公式

能夠建立行內公式,例如 \(\Gamma(n) = (n-1)!\quad\forall n\in\mathbb N\)。或者塊級公式:markdown

\[x = \dfrac{-b \pm \sqrt{b^2 - 4ac}}{2a} \]

希臘字母:
\(\Gamma\)\(\iota\)\(\sigma\)\(\phi\)\(\upsilon\)\(\Pi\)\(\Bbbk\)\(\heartsuit\)\(\int\)\(\oint\)函數

三角函數、對數、指數:
\(\tan\)\(\sin\)\(\cos\)\(\lg\)\(\arcsin\)\(\arctan\)\(\min\)\(\max\)\(\exp\)\(\log\)ui

集合符號:
\(\cup\)\(\cap\)\(\in\)\(\notin\)\(\ni\)\(\subset\)\(\subseteq\)\(\supset\)\(\supseteq\)\(\infty\)spa

運算符:
\(+\)\(-\)\(=\)\(>\)\(<\)\(\times\)\(\div\)\(\equiv\)\(\leq\)\(\geq\)\(\neq\)\(\sqrt{x}\)\(x^2\)code

求和公式:orm

\[\sum_{n=1}^{i=n} x \]

極限公式:ip

\[\lim\limits_{x \to 0} \frac{\sin(x)}{x} = 1 \]

表格

Item Value Qty
Computer 1600 USD 5
Phone 12 USD 12
Pipe 1 USD 234

LaTeX 矩陣公式

普通無邊界矩陣:文檔

\[\begin{matrix} a & b & c & d & e\\ f & g & h & i & j \\ k & l & m & n & o \\ p & q & r & s & t \end{matrix} \]

帶框矩陣:get

\[\left[ \begin{matrix} a & b & c & d & e\\ f & g & h & i & j \\ k & l & m & n & o \\ p & q & r & s & t \end{matrix} \right] \]

大括號矩陣:

\[\left\{ \begin{matrix} a & b & c & d & e\\ f & g & h & i & j \\ k & l & m & n & o \\ p & q & r & s & t \end{matrix} \right\} \]

中間有省略號的矩陣:

\[A= \left\{ \begin{matrix} a & b & \cdots & e\\ f & g & \cdots & j \\ \vdots & \vdots & \ddots & \vdots \\ p & q & \cdots & t \end{matrix} \right\} \]

中間加根橫線的矩陣:

\[A= \left\{ \begin{array}{cccc|c} a & b & c & d & e\\ f & g & h & i & j \\ k & l & m & n & o \\ p & q & r & s & t \end{array} \right\} \]
相關文章
相關標籤/搜索