Latex安装使用
1.安裝TexLive
TexLive
下載完成以后,解壓到當(dāng)前文件夾
利用管理員身份打開
接下來耐心等待安裝,當(dāng)出現(xiàn)以下界面說明安裝成功
2.下載相關(guān)會議、期刊的Latex模板
比如:我下載的plos one期刊模板
2.將我們下載安裝成功的Tex works editor打開
文件—》打開—》找到plos one期刊的latex模板打開
3.點擊運行按鈕
3.Latex寫偽代碼
%必要的包,一定是放在模板的最前面 \documentclass[sigconf]{acmart} \usepackage{epsfig} \usepackage{algorithm} \usepackage{algpseudocode} \usepackage{algorithmicx,algorithm} \usepackage{caption} \renewcommand{\algorithmicrequire}{\textbf{Input:}} % Use Input in the format of Algorithm \renewcommand{\algorithmicensure}{\textbf{Output:}} % Use Output in the format of Algorithm %必要的環(huán)境配置,可以放在任意位置 \makeatletter \newenvironment{breakablealgorithm} {% \begin{breakablealgorithm}\begin{center}\refstepcounter{algorithm}% New algorithm\hrule height.8pt depth0pt \kern2pt% \@fs@pre for \@fs@ruled\renewcommand{\caption}[2][\relax]{% Make a new \caption{\raggedright\textbf{\ALG@name~\thealgorithm} ##2\par}%\ifx\relax##1\relax % #1 is \relax\addcontentsline{loa}{algorithm}{\protect\numberline{\thealgorithm}##2}%\else % #1 is not \relax\addcontentsline{loa}{algorithm}{\protect\numberline{\thealgorithm}##1}%\fi\kern2pt\hrule\kern2pt}}{% \end{breakablealgorithm}\kern2pt\hrule\relax% \@fs@post for \@fs@ruled\end{center} } \makeatother \begin{document}%開始寫自己的偽代碼,可以放在任意位置\begin{breakablealgorithm} \caption{ VBNet Unicast Routing Algorithm} \label{alg1} \rm \begin{algorithmic}[1]\Require${\rm{Src}} = {a_k}{a_{k - 1}}...{a_0}$,$\Pi = [{\pi _k},{\pi _{k - 1}},...{\pi _0}]$,//$\Pi $ is a permutation of $[k,k - 1,...1,0]$;\Ensurepath(Src, Des) \label{alg1} \rm \If {$H(Src, Des){\rm{ = }}1$} \State return (Src, Des); \ElsIf {${\rm{Wir}}(A \cap B) = 1$ } //intersection is not empty \par //set A is a wireless link connected to Src \par //set B is a wireless link connected to Des \State return (Src, Des); // wireless link connection \If {${\rm{Wir}}(A \cap B) = 0$} \For {$i = k;i \ge 0$} \State $I\_Node[{\pi _i}] = Des[{\pi _i}]$//fix one, find the middle node \If {$H(I\_Node,Des){\rm{ = }}1$} \State $return(Src,I\_Node,Des);$ \ElsIf {${\rm{Wir}}(B \cap C) = 1$} //set C is a wireless link connected to $I\_Node$ \State $return(Src,I\_Node,Des);$ \ElsIf {${\rm{Wir}}(B \cap C) = 0$} \State $i--$; \EndIf \EndFor \State $path = path1(Src,I\_Node) + path2(I\_Node,Des);$ \EndIf \EndIf \State \Return path\end{algorithmic} \end{breakablealgorithm} \end{document} \endinput跑出來長這樣,可以根據(jù)自己需要,進行更改
總結(jié)
- 上一篇: mcgs组态软件中字体如果从左到右变化_
- 下一篇: na+mb与gcd