본문으로 바로가기

【LaTex】Mathjax Library (2)

category Coding/LaTex 2020. 6. 30. 07:04

 

 

 

In previous posts, we first tested if the syntax from Latex Cheatsheet worked in html setting. We found that most of the syntax yielded error. To see the type of errors, you could referred to the first post of this series.

 

 

【LaTex】Cheat Sheet Test

It appears that not all LaTex commands work in Mathjax set-up. We will experiment with the commands listed in the Cheat Sheet and discern what works and what not. Symbols Script Output \& $\&$ \_ $..

quant-curiosity.tistory.com

 

After additional research, I found an online resource, a stackexchange discussion, with a detailed list of syntax that can be used in lieu of cheatsheet's syntax. In the last post, I demonstrated the first 6 tips that covered:

 

     1. Viewing LaTex code used for a mathematical expression.

     2. Writing mathematical expression in (a) in-line Mode and (2) display mode.

     3. Greek Letters.

     4. Super- and Subscripts.

     5. Groups.

     6. Brackets.

 

 

 

【LaTex】Mathjax Library (1)

In the last post, we tested some of Latex Cheatsheet's syntax to check if they are transferrable in Mathjax-html environment. However, most of the test turned out to be failure, with most syntax not..

quant-curiosity.tistory.com

 

In this post, we will continue looking at tips #7 through 12.

 

번역본은 밑에 있는 링크를 통해 보실 수 있습니다.

 

 

 

 

Mathjax
Working Syntax (#7~12)

 

7. Sums and Intergrals: \sum and \int

 

The subscript is the lower limit and the superscript is the upper limit. For example:

 

 

\sum_1^n

prints as:


$\sum_1^n$

 

 

Note not to forget curly braket {   } if the limits are more than a single symbol. For example:

 

 

\sum_{i=0}^\infty i^2

 

will print as:

 

$\sum_{i=0}^\infty i^2$

 

Similarly, other mathematical notations such as product, integral, etc can be typed using:

 

 

 \prod
 \int
 \bigcup
 \bigcap
 \iint
 \iiint
 \idotsint

 

Results:

 

$$\prod $$
$$\int $$
$$\bigcup $$
$$\bigcap $$
$$ \iint $$
$$ \iiint $$
$$ \idotsint$$

 

 

8. Fractions: 

 

There are three ways to make fractions.

 

     a. \frac ab : applies to the next two groups and products $\frac ab$.

 

           For more complicated dfranctions, use {   }: \frac{a+1}{b+1} = $\frac{a+1}{b+1}$.

 

     b. \over : for example, {a+1\over b+1} = ${a+1\over b+1}$.

 

     c. \cfrac : continued fractions, to be used when there are multiple layers of fractions.

 

 

The primary upside to \cfrac is the adjustment of font size. Please take a look at the difference below.

 

# \frac
x = a_0 + \frac{1^2}{a_1
			+ \frac{2^2}{a_2
          		+ \frac{3^2}{a_3 
            		+ \frac{4^4}{a_4 
                		+ \cdots
 	                	}
    	            }
        	    }
            }


# \cfrac
x = a+0 + \cfrac{1^2}{a_1
			+ \cfrac{2^2}{a_2
				+ \cfrac{3^2}{a_3
					+ \cfrac{4^4}{a_4
						+ \cdots
						}
					}
				}
			}

results in:

 

# \frac

 

$$x = a_0 + \frac{1^2}{a_1
+ \frac{2^2}{a_2
           + \frac{3^2}{a_3 
             + \frac{4^4}{a_4 
                 + \cdots
                   }
                 }
             }
            }$$

 

# \cfrac

$$x = a+0 + \cfrac{1^2}{a_1
             + \cfrac{2^2}{a_2
              + \cfrac{3^2}{a_3
                   + \cfrac{4^4}{a_4
                      + \cdots
                      }
                   }
                }
             }$$

 

 

9. Fonts: \[fontname] {    }

 

  • \mathbb or \bb: $\mathbb{ABCDEFGabcdefg}$
  • \mathbf: $\mathbf{ABCDEFGabcdefg}$
  • \mathit: $\mathit{ABCDEFGabcdefg}$
  • \mathbf: $\mathbf{ABCDEFGabcdefg}$
  • \mathtt: $\mathtt{ABCDEFGabcdefg}$
  • \mathrm: $\mathrm{ABCDEFGabcdefg}$
  • \mathsf: $\mathsf{ABCDEFGabcdefg}$
  • \mathcal: $\mathcal{ABCDEFGabcdefg}$
  • \mathscr: $\mathscr{ABCDEFGabcdefg}$
  • \mathfrak: $\mathfrak{ABCDEFGabcdefg}$

 

10. Radical Signs

Use \sqrt, which adjusts to the size of its argument:

 

  • \sqrt{x^3} :               $\sqrt{x^3}$;
  • \sqrt[3]{\frac xy} :   $\sqrt[3]{\frac xy}$;

 

11. Special Functions

Some special functions such as "lim", "sin", "max", "ln", and so on are normally set in roman font instead of italic font. Use \lim, \sin, etc. to make these:

 

  • \lim: $\lim$
  • \sin: $\sin$

Use subscripts to attach a notation:

 

  • \lim_{x\to 0 } : $\lim_{x\to 0 }$

 

12. Special Symbols and Notations

There are very large number of special symbols and notations, too many to list. Comprehensive list is available in this pdf document. Some of the symbons/notations introduced in the discussion include:

 

  • \lt \gt \le \leq \leqq \leqslant \ge \geq \geqq \geqslant \neq. You can use \not to put a slash through almost anything: \not\lt ≮≮ but it often looks bad.

$$\lt \gt \le \leq \leqq \leqslant \ge \geq \geqq \geqslant \neq$$

 

  • \times \div \pm \mp. 

$$\times \div \pm \mp$$

  • \cdot is a centered dot:

$$\cdot$$

  • \cup \cap \setminus \subset \subseteq \subsetneq \supset \in \notin \emptyset \varnothing

$$\cup \cap \setminus \subset \subseteq \subsetneq \supset \in \notin \emptyset \varnothing$$

 

  • {n+1 \choose 2k} or \binom{n+1}{2k} (n+12k)(n+12k)

 

$${n+1 \choose 2k}$$

or

$$\binom{n+1}{2k} (n+12k)(n+12k)$$

 

  • \to \rightarrow \leftarrow \Rightarrow \Leftarrow \mapsto

$$\to \rightarrow \leftarrow \Rightarrow \Leftarrow \mapsto$$

 

  • \land \lor \lnot \forall \exists \top \bot \vdash \vDash 

$$\land \lor \lnot \forall \exists \top \bot \vdash \vDash$$

 

  • \star \ast \oplus \circ \bullet

$$\star \ast \oplus \circ \bullet$$

 

 

  • \approx \sim \simeq \cong \equiv \prec \lhd \therefore

 

$$\approx \sim \simeq \cong \equiv \prec \lhd \therefore$$

 

  • \infty \aleph_0 ∞ℵ0∞ℵ0 \nabla \partial

$$\infty \aleph_0 ∞ℵ0∞ℵ0 \nabla \partial$$

 

  • For modular equivalence, use \pmod like this: a\equiv b\pmod n a≡b(modn)a≡b(modn).

 

$$a\equiv b\pmod n a≡b(modn)a≡b(modn)$$

 

  • \ldots is the dots in a1,a2,…,ana1,a2,…,an \cdots is the dots in a1+a2+⋯+ana1+a2+⋯+an

Idots: $\ldots$

Cdots: $\cdots$

 

  • Some Greek letters have variant forms: \epsilon \varepsilon $\epsilon \varepsilon$, \phi \varphi $\phi \varphi$, and others. Script lowercase l is \ell $\ell$.

 

 

At this point, we have sufficient information and references to print most types of mathematical expressions, notations, and characters. Upon writing other posts, if I feel the need to share anything, I will update as a follow up to this series. Until then, I hope these posts serve you well.

 

 

 


Previous Posts

2020/06/22 - [Programming/LaTex] - 【LaTex】 How to set-up LaTex in Tistory Blog

2020/06/23 - [Programming/LaTex] - 【LaTex】Cheat Sheet Test

2020/06/30 - [Programming/LaTex] - 【LaTex】Mathjax Library (1)

'Coding > LaTex' 카테고리의 다른 글

【LaTex】Mathjax Library (1) :: 한글 ver.  (0) 2020.07.18
【LaTex】Mathjax Library (1)  (0) 2020.06.30
【LaTex】Cheat Sheet Test  (0) 2020.06.23
【LaTex】 How to set-up LaTex in Tistory Blog  (0) 2020.06.22