效果展示
基本操作
說明:%表示後面内容為注釋,不運作;代碼中空行或者加“\\”表示輸出結果另起一行,否則表示輸出在同一行;可以編輯Latex的軟體很多,這裡我用到了Texstudio。
%導言區
%\documentclass{ctexart}%除了article類還有book、report、letter等類
\documentclass[12pt]{article}
\title{\heiti LaTex入門}
%\title{My first document}
\author{\kaishu 都挺好}
%\author{Dou Tinghao}
\date{\today}
%自定義指令
\newcommand\degree{^\circ}
\newcommand{\myfont}{\textit{\textbf{\textsf{Fancy Text}}}}
\usepackage{ctex}%進行中文
%正文區(文稿區)
%document為環境名稱
\begin{document}
\maketitle
%字型族設定(羅馬字型、無襯線字型、打字機字型)
\textrm{Roman Family} \textsf{Sans Serif Family} \texttt{Typewriter Family}
{\rmfamily Roman Family} {\sffamily Sans Serif Family} {\ttfamily Typewriter Family}
{\sffamily who you are?you find self on everyone around.take you as the same as others!}
{\ttfamily Are you wiser than others?definitely no.in some ways,may it is true.What can you achieve?a luxurious house? a brillilant car? an admirable career?who knows?}
Hello World!
%字型系列設定(粗細、寬度)
\textmd{Medinum Series} \textbf{Boldface Series}
{\mdseries Medium Series} {\bfseries Boldface Series}
%字型形狀設定(直立、斜體、僞斜體、小型小寫)
\textup{Upriht Shape} \textit{Italic Shape}
\textsl{Slanted Shape} \textsc{Small Caps Shape}
{\upshape Upriht Shape} {\itshape Italic Shape}
{\slshape Slanted Shape} {\scshape Small Caps Shape}
%中文字型
{\songti 宋體} \quad {\heiti 黑體} \quad {\fangsong 仿宋} \quad {\kaishu 楷書}
中文字型的\textbf{粗體}與\textit{斜體}
Let $f(x)$ be defined by the formula
$$f(x)=3x^2+x-1$$
which is a polynomial of degree 2.%雙美元符号表示組間公式
勾股定理,可以用符号表述為:設直角三角形$ABC$,其中$\angle C=90\degree$,則有:
\begin{equation}
AB^2=BC^2=AC^2.
\end{equation}
%字型大小
{\tiny Hello}\\
{\scriptsize Hello}\\
{\footnotesize Hello}\\
{\small Hello}\\
{\normalsize Hello}\\
{\large Hello}\\
{\Large Hello}\\
{\LARGE Hello}\\
{\huge Hello}\\
{\Huge Hello}\\
%中文字号設定指令
\zihao{-0} 你好
\myfont
\end{document}