如何用Latex写伪代码等
Aurora无法使用,使用在线Latex网站编写
由于本人用Aurora一直probleming running,试过网站上各种方法实在无奈最终选择用在线Latex编写
主要以下网站,而且也不需要各种查找如何加入中文的方法:
http://latex.codecogs.com/eqneditor/editor.php
https://www.sharelatex.com/project/59f985ff88ec741052f6394b
https://www.overleaf.com/read/pzfyspxjnscm#/37167460/
以下方法都是本人初学自己摸索的,如果错了还各位大佬指正!
Overleaf
这里我主要使用了overleaf,主要以此为例:
调用package,(一般以下够用):
\documentclass[11pt]{
article}
\usepackage{
CJK}
\usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{
geometry}
\usepackage{
algorithm}
\usepackage{
algorithmicx}
\usepackage{
algpseudocode}
\usepackage{
amsmath}
\usepackage{
indentfirst}
\floatname{
algorithm}{
算法}
\renewcommand{
\algorithmicrequire}{
\textbf{
输入:}}
\renewcommand{
\algorithmicensure}{
\textbf{
输出:}}
若想要输入中文,需要加上这一对代码:
\begin{
CJK*}{
UTF8}{
gkai}
\end{
CJK*} //中文代码
以一个例子说明
1、未加入中文代码
\documentclass[11pt]{
article}
\usepackage{
CJK}
\usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{
geometry}
\usepackage{
algorithm}
\usepackage{
algorithmicx}
\usepackage{
algpseudocode}<