Skip to content

在使用\begin{algorithm}的时候,怎么把内置的input/output等转换成中文? #868

Answered by LogCreative
bakulaibuji asked this question in 提问
Discussion options

You must be logged in to vote

参考 algorithm2e 文档 的第 11.1 节,使用 \SetKwInput{}{} 命令。

\documentclass{ctexrep}
\usepackage[ruled,vlined,linesnumbered]{algorithm2e}
\SetKwInput{KwIn}{输入}
\SetKwInput{KwOut}{输出}
\begin{document}
\begin{algorithm}
    \KwIn{长度为 $n$ 的数组}
    \KwOut{降序排列的数组}
\end{algorithm}
\end{document}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bakulaibuji
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
提问
Labels
None yet
2 participants