所以我在乳胶中用捷克语写论文,每次我写伪代码时,它都会显示算法(英文)
有没有办法将伪代码名称从“algorithm”重写为“algoritmus”?
\documentclass{article}
\usepackage[top=25mm,bottom=25mm,right=35mm,left=36mm,head=12.5mm,foot=12.5mm]{geometry}
\let\openright=\cleardoublepage
\usepackage{amsmath}
\usepackage{algpseudocode}
\usepackage{algorithm}
\begin{algorithm}
\caption{NN}
\begin{algorithmic}[1]
\State náhodný výběr \textit{$i$}, pro \textit{$i \in V$}
\While {navštíveno $\neq \textit{\{$1, \dots, n$\}}$}
\State $j: = $ arming \textit{\{$v_i_j$ | $j$ \notin navštíveno\}}
\State navštíveno: = navštíveno \textit{$\cup$} \textit{\{$ j$\}}
\State \textit{$i: = j$}
\EndWhile
\end{algorithmic}
\end{algorithm}
答案1
在序言中添加以下几行:
\AtBeginDocument{%
\floatname{algorithm}{Algorithmus}%
}
答案2
您的代码中有一些奇怪的东西,例如双索引和\textit{$<math stuff>}
。(您不应该更改文本的字体来尝试更改数学字体)。我已经更改为我认为您想要的。要更改算法的名称,可以通过重新定义\ALG@name
(可能是重复的)来完成。
\documentclass{article}
\usepackage[top=25mm,bottom=25mm,right=35mm,left=36mm,head=12.5mm,foot=12.5mm]{geometry}
\let\openright=\cleardoublepage
\usepackage{amsmath}
\usepackage[utf8]{inputenc} % To have strange letters
\usepackage[T1]{fontenc}. %
\usepackage{algpseudocode}
\usepackage{algorithm}
\makeatletter
\renewcommand{\ALG@name}{Algoritmus}
\makeatother
\begin{document}
\begin{algorithm}
\caption{NN}\label{alg:Nice}
\begin{algorithmic}[1]
\State náhodný výběr $i$, pro $i \in V$
\While {navštíveno $\neq \{$1, \dots, n$\}$}
\State $j: = $ arming $\{v_{ij} | j \notin \text{navštíveno}\}$
\State navštíveno: = navštíveno $\cup \{j\}$
\State $i: = j$
\EndWhile
\end{algorithmic}
\end{algorithm}
In Algoritmus~\ref{alg:Nice} bla bla bla
\end{document}