軟件:texstudioide
notepad test.tex
由於有自動補全功能比記事本好不少函數
\documentclass{article} \begin{document} Hello \LaTeX \end{document}
latex test.tex
dvipdfmx test.dvi
xelatex test.tex
cd.>build_pdf.bat
del是刪除學習
cd F cd F:\file\latex_file\ex\Latex_learn_cmd latex test.tex dvipdfmx test.dvi del *.aux *.dvi *.log
F:\file\latex_file\ex\Latex_learn_cmd cd F cd F:\file\latex_file\ex\Latex_learn_cmd xelatex test.tex del *.aux *.dvi *.log
(1) 使用記事本的另存爲改變爲uft-8編碼字體
(2)在tex裏面設置ui
\documentclass[11pt,UTF8,twoside,a4paper]{article}
\documentclass[11pt,UTF8,twoside,a4paper]{article} \usepackage{ctex} %中文
F5到F9編碼
%註釋的內容 %導言區 \documentclass[11pt,UTF8,a4paper]{article} %book,report,letter \usepackage{ctex}%中文包 %標題頁 \title{My First Document}%標題 \author{lim}%做者 \date{\today}%日期 %正文區 \begin{document} \maketitle %輸出標題 你好,\LaTeX Let $f(x)$ be defined by the formula $f(x)=3x^2+2x-1$ $$y=1$$ \end{document}
設置默認編譯器
spa
設置utf-8模式code
這個是源文件的格式orm
\usepackage{ctex}%中文包
%使用文檔類宏包 \documentclass[11pt,UTF8,a4paper]{ctexart} %ctexart,ctexrep,ctexbook %就不用如下 %\usepackage{ctex}%中文包 %\documentclass[11pt,UTF8,a4paper]{article}
%字體族的設置 %羅馬數字,無襯線字體,打印機字體 %兩種格式 %\textrm{文字} %\rmfamily 後面的文字都是這個字體 %羅馬字體 \textrm{Roman Family} \rmfamily Roman Family %無襯線字體 \textsf{Sans Serif Family} \sffamily Sans Serif Family %打印機字體 \texttt{Typewriter Family} \ttfamily Typewriter Family
%字體系列設置 %粗細,寬度 \textmd{Medium Series} {\mdseries Medium Series} \textbf{Boldface Series} {\bfseries Boldface Series}
%字體形狀設置 %直立,斜體,僞斜體,小型大寫 %直立 \textup{Upright Shape} {\upshape Upright Shape} %斜體 \textit{Italic Shape} {\itshape Italic Shape} %僞斜體 \textsl{Slanted Shape} {\slshape Slanted Shape} %小型大寫 \textsc{Small Caps Shape} {\scshape Small Caps Shape}
%中文字體設置 %宋體 {\songti 宋體} %黑體 {\heiti 黑體} %仿宋體 {\fangsong 仿宋} %楷書 {\kaishu 楷書}
%中文的粗體和斜體 %粗體 \textbf{粗體} %斜體 \textit{斜體}
%字體大小設置 %這是相對的大小 %在文檔的導言區設置字體大小,10磅 %只有10,11,12磅 %\documentclass[10pt]{article} {\tiny Hello}\\ {\scriptsize Hello}\\ {\footnotesize Hello}\\ {\small Hello}\\ {\normalsize Hello}\\ {\large Hello}\\ {\Large Hello}\\ {\LARGE Hello}\\ {\huge Hello}\\ {\Huge Hello}\\
%中文字號 %-表示是小 %-4表示小四號 %能夠定義一個命令 %\newcommand{\myfont}{\textif{\textbf{\textsf{Fancy Text}}}} \zihao{-0} 你好! \zihao{-4} 你好! \myfont
%文章的基本結構 %帶章節的大綱 %\chapter{緒論} \section{引言} \subsection{子小節} \subsubsection{下下小節} \subsection{子小節} %\chapter{結果} \section{方法} \subsection{子小節} \subsubsection{下下小節} %進行換行 %\\ %\par %空行
%輸出標題 \maketitle %輸出目錄 \tableofcontents
%設置標題的格式 \CTEXsetup[ format+={\zihao{1}\heiti \raggedbottom}, name = {,、}, number = \chinese{section}, beforeskip = 1.0ex plus 0.2ex minus .2ex, afterskip = 1.0ex plus 0.2ex minus .2ex, aftername = \hspace{0pt} ]{section} \CTEXsetup[ format+={\zihao{5} \heiti \raggedbottom}, name = {,.}, number = \arabic{section} \arabic {subsection}, beforeskip = 1.0ex plus 0.2ex minus .2ex, afterskip = 1.0ex plus 0.2ex minus .2ex, aftername = \hspace{0pt} ]{subsection}
- 空行分段,多個空行就是1個
- 自動縮進,不能使用空格代替
- 英文中多個空格處理爲1個空格,中文中的空格將被忽略
- 漢字與其餘字符的間距會自動由Xelatex處理
- 禁止使用中文的全角空格
% 1.空格 % 1em,當前字體M的寬度 a\quad b % 2em a\qquad b % 約1/6各em a\,b a\thinspace b %0.5個em a\enspace b %空格 a\ b %硬空格 a~b % 1pc=12pt=4.218mm a\kern 1pc b a\kern -1em b a\hskip 1em b %佔位寬度 a\hphantom{xyz}b % 彈性寬度 a\hfill b
%2. 控制符 \# \$ \% \{ \} \~{} \_{} \^{} \& %這是反斜槓/ \textbackslash
%3. \Tex 標誌符號 \TeX{} \LaTeX{} \LaTeXe{} %4.排版特殊符號? \S \P \dag \ddag \copyright \pounds
% 5.引號 ` ' `` '' ``你好'' ``雙引號'' `單引號'
%語法 %\includegraphics[<選項>]{<文件名>} %格式 %EPS,PDF,PNG,JPEG,BMP %插入圖片的宏包 \usepackage{graphicx} %圖片在當前目錄下的figures文件夾 \graphicspath{{figures/}}
%使用圖片 %指定縮放因子 \includegraphics[scale=0.3]{Screenshot1} %指定高度 \includegraphics[height=10cm]{Screenshot1} \includegraphics[height=0.1\textheight]{Screenshot1} %指定寬度 \includegraphics[width=10cm]{Screenshot1} \includegraphics[width=0.1\textwidth]{Screenshot1} %指定旋轉角度 \includegraphics[ angle=-45, width=0.1\textwidth ]{Screenshot1} \includegraphics[ angle=85, width=0.1\textwidth ]{Screenshot1}
%表格 %對齊方式 %l 左對齊 %c 居中對齊 %r 右對齊 %p{1.5cm} 指定寬度的格子 % |是表格的豎線 % \hline 是表格的橫線 % \hline \hline 是雙橫線 % || 是雙豎線 \begin{tabular}{|l|| c |c| c| p{1.5cm}|} \hline 姓名&語文&數學&外語&備註\\ \hline \hline 劉津志&105&150&135&666\\ \hline \end{tabular}
%浮動體禁止浮動 %避免浮動體跨過 \section \usepackage[section]{placeins} %禁止浮動 \usepackage{float}
%浮動體 %設置相對引用,跳到這個圖 見圖\ref{fig-圖1} \begin{figure}[htbp]%浮動體的排版對值 \centering %居中 \includegraphics[scale=0.3]{Screenshot1} \caption{圖1}%標題 \label{fig-圖1}%設置標籤 \end{figure} 見表\ref{tab-表1} \begin{table}[H] \centering %居中 \caption{表1}%標題 \label{tab-表1} \begin{tabular}{|l|| c |c| c| p{1.5cm}|} \hline 姓名&語文&數學&外語&備註\\ \hline \hline 劉津志&105&150&135&666\\ \hline \end{tabular} \end{table}
%數學公式 %格式1 $a+b=b+a$ %格式2,行內公式 \(a+b=b+a\) %格式3 \begin{math} a+b=b+a \end{math} %格式4和上下標 $$3x^{20}_{11}-x_{11}+2=0$$ %格式5,行間公式 \[x+1=2\] %格式6 ,行間公式 \begin{displaymath} x+1=2 \label{eq:eq1} \end{displaymath} % 這兩個是爲了按章節編號 \usepackage{amsmath} \numberwithin{equation}{section} % 格式7 帶編號的數學環境,行間公式 見公式\ref{eq:eq1} \begin{equation} x+1=2 \label{eq:eq1} \end{equation} %格式8,不帶編號 見公式\ref{eq:eq2} \begin{equation*} x+1=2 \label{eq:eq2} \end{equation*} %希臘字母 $\alpha$ $\beta$ $\gamma$ $\epsilon$ $\pi$ $\omega$ $\Gamma$ $\Delta$ $\Theta$ $\Pi$ $\Omega$ %數學函數 $\log$ $\sin$ $\cos x$ $\arcsin$ $\arccos$ $\ln x$ $\log_2 x$ $\sqrt{2}$ $\sqrt[4]{x}$%指定開方的次數 $\frac{2}{x}$
%矩陣 %無括號 \[ \begin{matrix} 0 & 1\\ 1& 0 \end{matrix}\qquad %小括號 \begin{pmatrix} 0 & 1\\ 1& 0 \end{pmatrix} \qquad %中括號 \begin{bmatrix} 0 & 1\\ 1& 0 \end{bmatrix}\qquad %大括號 \begin{Bmatrix} 0 & 1\\ 1& 0 \end{Bmatrix}\qquad %單豎線 \begin{vmatrix} 0 & 1\\ 1& 0 \end{vmatrix}\qquad %雙豎線 \begin{Vmatrix} 0 & 1\\ 1& 0 \end{Vmatrix} \] %經常使用的省略號 %\dots \vdots \ddots %矩陣的下標 %_{n \times n} \[ A = \begin{bmatrix} a_{11}&\dots &a_{1n}\\ \vdots&\ddots &\vdots \\ 0 & \dots &a_{nn} \end{bmatrix}_{n \times n} \]