MathJax basic tutorial and quick reference

MathJax教程
本文介绍如何使用MathJax在网页上展示数学公式。包括内联公式和显示公式的书写方式,希腊字母、上下标、括号等特殊符号的输入方法,以及如何表示分数、积分、极限等数学表达式。

  1. To see how any formula was written in any question or answer, including this one, right-click on the expression it and choose "Show Math As > TeX Commands". (When you do this, the '$' will not display. Make sure you add these. See the next point.)

  2. For inline formulas, enclose the formula in $...$. For displayed formulas, use $$...$$.
    These render differently. For example, type
    $\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$
    to show  ni=0i2=(n2+n)(2n+1)6 ∑i=0ni2=(n2+n)(2n+1)6 (which is inline mode) or type
    $$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$$
    to show

    i=0ni2=(n2+n)(2n+1)6 ∑i=0ni2=(n2+n)(2n+1)6
    (which is display mode).

  3. For Greek letters, use \alpha\beta, …, \omega α,β,ω α,β,…ω. For uppercase, use \Gamma\Delta, …, \Omega Γ,Δ,,Ω Γ,Δ,…,Ω.

  4. For superscripts and subscripts, use ^ and _. For example, x_i^2 x2i xi2\log_2 x log2x log2⁡x.

  5. Groups. Superscripts, subscripts, and other operations apply only to the next “group”. A “group” is either a single symbol, or any formula surrounded by curly braces {}. If you do 10^10, you will get a surprise:  1010 1010. But 10^{10} gives what you probably wanted:  1010 1010. Use curly braces to delimit a formula to which a superscript or subscript applies: x^5^6 is an error; {x^y}^z is  xyz xyz, and x^{y^z} is  xyz xyz. Observe the difference between x_i^2  x2i xi2 and x_{i^2}  xi2 xi2.

  6. Parentheses Ordinary symbols ()[] make parentheses and brackets  (2+3)[4+4] (2+3)[4+4]. Use \{ and \} for curly braces  {} {}.

    These do not scale with the formula in between, so if you write (\frac{\sqrt x}{y^3}) the parentheses will be too small:  (xy3) (xy3). Using \left(\right) will make the sizes adjust automatically to the formula they enclose: \left(\frac{\sqrt x}{y^3}\right) is  (xy3) (xy3).

    \left and\right apply to all the following sorts of parentheses: ( and )  (x) (x)[ and ]  [x] [x]\{ and \}  {x} {x}|  |x| |x|\vert  |x| |x|\Vert  x ‖x‖\langle and \rangle  x ⟨x⟩\lceil and \rceil  x ⌈x⌉, and \lfloor and \rfloor  x ⌊x⌋. There are also invisible parentheses, denoted by .\left.\frac12\right\rbrace is  12} 12}.

  7. Sums and integrals \sum and \int; the subscript is the lower limit and the superscript is the upper limit, so for example \sum_1^n  n1 ∑1n. Don't forget {} if the limits are more than a single symbol. For example, \sum_{i=0}^\infty i^2 is  i=0i2 ∑i=0∞i2. Similarly, \prod  \int  \bigcup  \bigcap  \iint  .

  8. Fractions There are two ways to make these. \frac ab applies to the next two groups, and produces  ab ab; for more complicated numerators and denominators use {}\frac{a+1}{b+1} is  a+1b+1 a+1b+1. If the numerator and denominator are complicated, you may prefer \over, which splits up the group that it is in: {a+1\over b+1} is  a+1b+1 a+1b+1.

  9. Fonts

    • Use \mathbb or \Bbb for "blackboard bold":  CHNQRZ CHNQRZ.
    • Use \mathbf for boldface:  ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz.
    • Use \mathtt for "typewriter" font:  ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ  abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz.
    • Use \mathrm for roman font:  ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz.
    • Use \mathsf for sans-serif font:  ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz.
    • Use \mathcal for "calligraphic" letters:  ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ
    • Use \mathscr for script letters:  ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ
    • Use \mathfrak for "Fraktur" (old German style) letters:  ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.
  10. Radical signs Use sqrt, which adjusts to the size of its argument: \sqrt{x^3}  x3 x3\sqrt[3]{\frac xy}  xy3 xy3. For complicated expressions, consider using {...}^{1/2} instead.

  11. 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: \sin x  sinx sin⁡x, not sin x  sinx sinx. Use subscripts to attach a notation to \lim\lim_{x\to 0}

    limx0 limx→0

  12. There are a very large number of special symbols and notations, too many to list here; see this shorter listing, or this exhaustive listing. Some of the most common include:

    • \lt \gt \le \ge \neq  <> <>≤≥≠. You can use \not to put a slash through almost anything: \not\lt   but it often looks bad.
    • \times \div \pm \mp  ×÷± ×÷±∓\cdot is a centered dot:  xy x⋅y
    • \cup \cap \setminus \subset \subseteq \subsetneq \supset \in \notin \emptyset \varnothing  ∪∩∖⊂⊆⊊⊃∈∉∅∅
    • {n+1 \choose 2k} or \binom{n+1}{2k}  (n+12k) (n+12k)
    • \to \rightarrow \leftarrow \Rightarrow \Leftarrow \mapsto  →→←⇒⇐↦
    • \land \lor \lnot \forall \exists \top \bot \vdash \vDash  ¬ ∧∨¬∀∃⊤⊥⊢⊨
    • \star \ast \oplus \circ \bullet  ⋆∗⊕∘∙
    • \approx \sim \simeq \cong \equiv \prec \lhd  , ≈∼≃≅≡≺,⊲.
    • \infty \aleph_0  0 ∞ℵ0 \nabla \partial  ∇∂ \Im \Re  IR ℑℜ
    • For modular equivalence, use \pmod like this: a\equiv b\pmod n  ab(modn) a≡b(modn).
    • \ldots is the dots in  a1,a2,,an a1,a2,…,an \cdots is the dots in  a1+a2++an a1+a2+⋯+an
    • Some Greek letters have variant forms: \epsilon \varepsilon  ϵε ϵε\phi \varphi  ϕφ ϕφ, and others. Script lowercase l is \ell  .

    Detexify lets you draw a symbol on a web page and then lists the  TEX TEX symbols that seem to resemble it. These are not guaranteed to work in MathJax but are a good place to start. To check that a command is supported, note that MathJax.org maintains a list of currently supported  LATEX LATEX commands, and one can also check Dr. Carol JVF Burns's page of  TEX TEXCommands Available in MathJax.

  13. Spaces MathJax usually decides for itself how to space formulas, using a complex set of rules. Putting extra literal spaces into formulas will not change the amount of space MathJax puts in: a␣b and a␣␣␣␣b are both  ab ab. To add more space, use \, for a thin space  ab ab\; for a wider space  ab ab\quad and \qquad are large spaces:  ab ab ab ab.

    To set plain text, use \text{…} {xsx is extra large} {x∈s∣x is extra large}. You can nest $…$ inside of \text{…}.

  14. Accents and diacritical marks Use \hat for a single symbol  x^ x^\widehat for a larger formula  xyˆ xy^. If you make it too wide, it will look silly. Similarly, there are \bar  x¯  and \overline  xyz¯¯¯¯¯¯¯¯ xyz¯, and \vec  x⃗  x→ and \overrightarrow  xy xy→ and \overleftrightarrow  xy xy↔. For dots, as in  ddxxx˙=x˙2+xx¨ ddxxx˙=x˙2+xx¨, use \dot and \ddot.

  15. Special characters used for MathJax interpreting can be escaped using the \ character: \$  $ $\{  { {\_  _ _, etc. If you want \ itself, you should use \backslash  , because \\ is for a new line.


The original link:  http://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference


基于51单片机,实现对直流电机的调速、测速以及正反转控制。项目包含完整的仿真文件、源程序、原理图和PCB设计文件,适合学习和实践51单片机在电机控制方面的应用。 功能特点 调速控制:通过按键调整PWM占空比,实现电机的速度调节。 测速功能:采用霍尔传感器非接触式测速,实时显示电机转速。 正反转控制:通过按键切换电机的正转和反转状态。 LCD显示:使用LCD1602液晶显示屏,显示当前的转速和PWM占空比。 硬件组成 主控制器:STC89C51/52单片机(与AT89S51/52、AT89C51/52通用)。 测速传感器:霍尔传感器,用于非接触式测速。 显示模块:LCD1602液晶显示屏,显示转速和占空比。 电机驱动:采用双H桥电路,控制电机的正反转和调速。 软件设计 编程语言:C语言。 开发环境:Keil uVision。 仿真工具:Proteus。 使用说明 液晶屏显示: 第一行显示电机转速(单位:转/分)。 第二行显示PWM占空比(0~100%)。 按键功能: 1键:加速键,短按占空比加1,长按连续加。 2键:减速键,短按占空比减1,长按连续减。 3键:反转切换键,按下后电机反转。 4键:正转切换键,按下后电机正转。 5键:开始暂停键,按一下开始,再按一下暂停。 注意事项 磁铁和霍尔元件的距离应保持在2mm左右,过近可能会在电机转动时碰到霍尔元件,过远则可能导致霍尔元件无法检测到磁铁。 资源文件 仿真文件:Proteus仿真文件,用于模拟电机控制系统的运行。 源程序:Keil uVision项目文件,包含完整的C语言源代码。 原理图:电路设计原理图,详细展示了各模块的连接方式。 PCB设计:PCB布局文件,可用于实际电路板的制作。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值