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\} \]
相关文章
相关标签/搜索