Last active
December 18, 2015 15:49
-
-
Save ngn999/5806614 to your computer and use it in GitHub Desktop.
xeLaTeX example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% 使用xelatex, 且存成utf-8, 用%!来控制TeXShop选择xeLaTeX | |
%!TEX TS-program = xelatex | |
%!TEX encoding = UTF-8 Unicode | |
\documentclass[12pt]{article} | |
% 导言区 | |
\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots. | |
\geometry{letterpaper} % ... or a4paper or a5paper or ... | |
%\geometry{landscape} % Activate for for rotated page geometry | |
%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent | |
\usepackage{graphicx} | |
\usepackage{amssymb} | |
\usepackage{tikz} | |
% fontspec.sty可以简化字体设置, 用/Applications/Font Book可以看到更多可用字体 | |
\usepackage{fontspec,xltxtra,xunicode} | |
\defaultfontfeatures{Mapping=tex-text} | |
% \setromanfont[Mapping=tex-text]{Kai} | |
\setromanfont[Mapping=tex-text]{Songti SC Regular} %宋体 | |
\setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Gill Sans} | |
\setmonofont[Scale=MatchLowercase]{Andale Mono} | |
\title{Brief Article} | |
\author{The Author} | |
\date{} %这个可省略 | |
\begin{document} | |
\maketitle | |
% 一般人,上面的字体设置就够用了. | |
% Unicode must be typeset using a font containing the appropriate characters. | |
% Remove the comment signs below for examples. | |
% \newfontfamily{\A}{Geeza Pro} | |
% \newfontfamily{\H}[Scale=0.9]{Lucida Grande} | |
% \newfontfamily{\J}[Scale=0.85]{Osaka} | |
hello, everybody! \\ | |
大家好! 中文哈. | |
\begin{tikzpicture} | |
\shade [ball color=green] (0,0) circle (.5cm); | |
\end{tikzpicture} | |
$x_2$ $x^4$ $\sqrt{3}$ $\lambda$ $\LaTeX$ | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment