编译命令

.tex 文件编译成 PDF –> pdf

  1. xelatex your_file.tex
  2. pdflatex your_file.tex

bibtex 参考文件类 tex 编译 (.tex + bibtex.aux –> pdf)

步骤:

  1. 处理参考文献文件 .aux

    • bibtex yourbibfile.aux
  2. .tex 编译成 pdf

    • xelatex yourfile.tex

中文问题

转换工具

  1. LateXML

xeLatex

注意:ctex 宏包只识别 UTF-8.

commands

\-hyphen
\hyphenation{Hy-phen-a-tion}
\mbox{text}keep several words on one line
\fbox{text}has a visible box, frame box
typesetter
quatation marks("")
grave accentback quote (`)
opening quotation marks
closing quotation marks
vertical quotenormal single quote(')

Dashes and Hyphens

hyphen-in words
en-dashbetween numbers–> 16–20 ==> 16~20
em-dashbetween words
minus signfor mathematics minus

Tilde

tilde 波浪线(~)
\~{}

Splash (/)

\splash(/)

Degree Symbol (度数符号)

$-30\,{\circ}\mathrm{C}$零下 30 度,-30*C
package
textcomp
\textcelsius{}摄氏度
\textdegree{}度数符号
\textdegree{}F*F, 华氏度

The Euro Currency Symbol 欧元符号

package
textcomp
\texeuroeuro symbol
\usepackage[official]{eurosym}choose a special one

Ellipsis 省略号

ellipsis(…)省略号
\ldots省略号
(low dots)

Ligatures

prohibit ligatures with \mbox{}

Accents and Special Characters

used for western world languages

\^
\"
\'
\o
!'
\~
\ss

Tabular environment

重复格式

格式参数重复的写法 *{⟨n⟩}{⟨column-spec⟩} 将 column-spec 重复 n 遍

辅助格式

array 宏包提供,> 和 <, 用于修饰列,如下, >{\itshape}r<{*}, –> “>{}” 和 “<{}” 都是用来修饰中间的列(r)

1
2
3
4
5
6
  \begin{tabular}{>{\itshape}r<{*}l}
    \hline
    italic & normal \\
    column & column \\
    \hline
  \end{tabular}

Inernational Language Support

packages and commands

package polyglossia fontspec —> for xelatex and Luatex

csquotes —> before load language support

1
2
3
  \usepackage[autostyle=true]{csquotes}
  \setdefaultlanguage{english}
  \setotherlanguage{german}

Fonts

Computer Modern Unicode font

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
  \setmainfont{CMU Serif}
  \setsansfont{CMU Sans Serif}
  \setmonofont{CMU Typewriter Text}

  For XƎLATEX you have to be a bit more explicit:

  \setmainfont{cmun}[
  Extension=.otf,UprightFont=*rm,ItalicFont=*ti,
  BoldFont=*bx,BoldItalicFont=*bi,
  ]
  \setsansfont{cmun}[
  Extension=.otf,UprightFont=*ss,ItalicFont=*si,
  BoldFont=*sx,BoldItalicFont=*so,
  ]
  \setmonofont{cmun}[
  Extension=.otf,UprightFont=*btl,ItalicFont=*bto,
  BoldFont=*tb,BoldItalicFont=*tx,
  ]

for Right to Left Languages

packages bidi —> load after all packages, even after hperref —> not support LuaTeX

for Chines, Japanese and Korean (CJK)

packages xeCJK —> for font and punctuation

the Space between Words

\@指定,大写字母后的(.)period,是用来结束句子的,不是类似(No.)
.~产生一个不能放大的空格

数学符号

  • 求和 \sum_{a}^{b}

Demo

$$y= x^2 - 2x + 1$$

化学符号

标准状态符号 standard state (⦵)

参考:

用法:

  1. 在 latex 中使用
  2. 在 markdown 中使用

    • \minuso : 即,符号 + O

带 accent 的符号