软件: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} \]