使用微信扫一扫才能下载!!
一、🔗:texlive2021.iso下载链接
TeXLive.iso文件点击打开,然后运行bat文件进行安装
二、🔗:texstudio-4.2.2-win-qt5.exe下载链接
点击这个exe安装,安装完了之后照着下面图片操作编译运行就可以有结果啦~,末尾附上示例代码
注意:!!!
凡是tex代码里面有中文的,代码里面一定要加上这一句
%!TEX program = xelatex
示例代码1
%!TEX program = xelatex
\documentclass[11pt]{ctexart}
\usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry}
\usepackage{algorithm}
\usepackage{algorithmicx}
\usepackage{algpseudocode}
\usepackage{amsmath}
\floatname{algorithm}{算法}
\renewcommand{\algorithmicrequire}{\textbf{输入:}}
\renewcommand{\algorithmicensure}{\textbf{输出:}}
\begin{document}
\begin{algorithm}
\caption{用归并排序求逆序数}
\begin{algorithmic}[1] %每行显示行号
\Require $Array$数组,$n$数组大小
\Ensure 逆序数
\Function {MergerSort}{$Array, left, right$}
\State $result \gets 0$
\If {$left < right$}
\State $middle \gets (left + right) / 2$
\State $result \gets result +$ \Call{MergerSort}{$Array, left, middle$}
\State $result \gets result +$ \Call{MergerSort}{$Array, middle, right$}
\State $result \gets result +$ \Call{Merger}{$Array,left,middle,right$}
\EndIf
\State \Return{$result$}
\EndFunction
\State
\Function{Merger}{$Array, left, middle, right$}
\State $i\gets left$
\State $j\gets middle$
\State $k\gets 0$
\State $result \gets 0$
\While{$i<middle$ \textbf{and} $j<right$}
\If{$Array[i]<Array[j]$}
\State $B[k++]\gets Array[i++]$
\Else
\State $B[k++] \gets Array[j++]$
\State $result \gets result + (middle - i)$
\EndIf
\EndWhile
\While{$i<middle$}
\State $B[k++] \gets Array[i++]$
\EndWhile
\While{$j<right$}
\State $B[k++] \gets Array[j++]$
\EndWhile
\For{$i = 0 \to k-1$}
\State $Array[left + i] \gets B[i]$
\EndFor
\State \Return{$result$}
\EndFunction
\end{algorithmic}
\end{algorithm}
\end{document}
示例代码2
% 导言区 (进行全局设置)
%!TEX program = xelatex
\documentclass[10pt]{article} %设置normal-size的大小为10磅,此次[10pt]可不填写,一般只有10-12磅
%\documentclass引入文档类, 选择学术类article
% 其他类:book,report,letter
\usepackage{ctex} % \usepackage命令引入宏包,ctex支持中文
\title{My First LaTex Document,\heiti 源码介绍} %使用title命令输入文档的标题
%\heiti,指定黑体字体
\author{Mikowoo,\kaishu 吴} %使用author命令输入文章作者
%\kaishu,指定为楷书字体
\date{\today} %使用date命令输入文档的时间,\today表示今天
\newcommand\degree{^\circ} %使用newcommand定义一个degree命令
\newcommand{\myfont}{\textit{\textbf{\textsf{Fancy Text}}}} %自定义字体属性
% 正文区(文稿区)
\begin{document} %\begin输入一个环境,环境名称为document
\maketitle %使用maketitle输出标题,作者,时间信息
%补充:使用letter类需注释这一行
勾股定理可以用现代语言表述如下:
直角三角形斜边的平方等于两腰的平方和。
可以用符号语言表述为:设直角三角形$BC$其中$\angle C=90\degree$,则有:
\begin{equation} %引入equation环境,产生带编号的行间公式
AB^2 = BC^2 + AC^2.
\end{equation}
Hello World ! %增加空行,使输出的文本换行
Let $f(x)$ be defined by the formula $f(x)=3x^2+x-1$
%使用$符号包围起来的模式,称为数学模式,单$表示行内公式
Let $f(x)$ be defined by the formula $$f(x)=3x^2+x-1$$ which is a polynomial of degree 2. %双$符号,表示行间公式
%字体族的设置(罗马字体、无衬线字体、打字机字体)
\textrm{Roman Family} \textsf{Sans Serif Family} \texttt{Typewriter Family}
%使用text字体命令设置罗马字体
\rmfamily Roman Family {\sffamily Sans Serif Family} {\ttfamily Typewriter Family}
%使用字体声明,声明后续字体为罗马字体,大括号为字体分组,无大括号,后续字体为罗马字体
\sffamily who are you? 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?}
%字体系列设置(粗细、宽度)
\textmd{Medium Series} \textbf{Boldface Series}
{\mdseries Medium Series} {\bfseries Boldface Series}
%字体形状设置(直立、斜体、伪斜体、大型大写)
\textup{Upright Shape} \textit{Italic Shape}
\textsl{Slanted Shape} \textsc{Small Caps Shape}
{\upshape Upright Shape} {\itshape Italic Shape}
{\slshape Slanted Shape} {\scshape Small Caps Shape}
%中文字体设置
{\songti 宋体} {\heiti 黑体} {\fangsong 仿宋} {\kaishu 楷书}
{\songti 宋体} \quad {\heiti 黑体} \quad {\fangsong 仿宋} \quad {\kaishu 楷书}
中文字体的\textbf{粗体}与\textit{斜体}
%字体大小,根据开头设置的normal-size的大小相对而定
{\tiny Hello}\\ %\\只是换行,但不产生缩进
{\scriptsize Hello}\\ % \par 换行,并缩进,也就是重起一段落
{\footnotesize Hello}\\
{\small Hello}\\
{\normalsize Hello}\\
{\large Hello}\\
{\LARGE Hello}\\
{\huge Hello}\\
{\Huge Hello}\\
%中文字号设置命令,可在ctex帮助文档中具体查阅
\zihao{-0} 您好! % -0 表示小初号
\zihao{5} 您好! % 5 表示5号
\myfont
近年来,随着逆向工程和三维重建技术的发展和应用,获取现实世界中物体的二维数据的方法越来越多的关注和研究。很多研究机构和商业公司都陆续提出了自己的三维重建系统。
近年来,随着逆向工程和三维重建技术的发展和应用,获取现实世界中物体的二维数据的方法越来越多的关注和研究。\\很多研究机构和商业公司都陆续提出了自己的三维重建系统。
近年来,随着逆向工程和三维重建技术的发展和应用,获取现实世界中物体的二维数据的方法越来越多的关注和研究。\par 很多研究机构和商业公司都陆续提出了自己的三维重建系统。
\end{document}