0

So I'am writting paper in czech language in latex and every time I write Pseudocode - it shows Algorithm (in english)

Is there a way to rewrite pseudocode name from 'algorithm' to '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
  • Your code is not compilable.
    – Bernard
    Apr 14, 2019 at 16:36

2 Answers 2

1

Adding these lines in the preamble works:

\AtBeginDocument{%
\floatname{algorithm}{Algorithmus}%
}
2

There are some strange things in your code, like double index and \textit{$<math stuff>}. (You should not change the font of the text to try to change the math font). I have changed to what I assume you want to have. To change the name of Algorithm can be done by redefining \ALG@name (which is probably a duplicate).

\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}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .