Seite 1 von 1

Modifikationen in algorithm2e

Verfasst: Di 14. Jun 2016, 20:37
von Sigls
Hallo,

ich versuche schon seit 2 Tagen meine Vorlage für Algorithmen zu modifizieren, bei 2 Problemen komme ich jedoch nicht weiter. Gegeben sei folgendes Minimalbeispiel.
\documentclass [fontsize = 11pt, paper=a4,  twoside=false, listof=totoc,
                bibliography=totoc, numbers=noenddot, leadsepline]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[longend, dotocloa, lined, ruled, algosection, linesnumbered]{algorithm2e}

\begin{document}

    \tableofcontents
    \listofalgorithms
    \vspace*{5ex}
    
    \begin{algorithm}[H]
        \SetAlgorithmName{Algorithmus}{}{Algorithmenverzeichnis}
        \DontPrintSemicolon
        \SetKwProg{Fn}{Funktion}{}{}
        \Fn{\textsc{FactorizationMain}(f)}{
            \While{not at end of this document} {
                read current\;
            }
            \KwRet{Test}
        }
        \caption{Test}
    \end{algorithm}
    
\end{document}
Im Anhang ist die Algorithmus compiliert.

Meine Probleme sind:

* Warum lässt sich Der Eintrag im Inhaltsverzeichnis "List of algorithm" nicht ändern? (Option ngerman ist keine Lösung, da sich dadurch die Formatierung bei den Doppelpunkten verändert)

* Wie lässt sich am Schluss das Ende der Funktion als
end Funktion anzeigen? Bisher wird das end verschluckt.

Ich hoffe ihr könnt mir helfen.

Verfasst: Mi 15. Jun 2016, 00:42
von Bartman
\documentclass[
%	fontsize = 11pt, % Voreinstellung
%	paper=a4,        % Voreinstellung
%	twoside=false,	 % Voreinstellung
	listof=totoc,
	bibliography=totoc,
	numbers=noenddot,
	leadsepline
]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage[longend, dotocloa, lined, ruled, algosection, linesnumbered]{algorithm2e}
\usepackage{hyperref}

\SetAlgorithmName{Algorithmus}{Algorithmus}{Algorithmenverzeichnis} % <- eingefügt

\begin{document}

    \tableofcontents
    \listofalgorithms

	 \section{Abschnitt}
    
    \autoref{factorizationmain}
    
    \begin{algorithm}
        \DontPrintSemicolon
        \SetKwProg{Fn}{Funktion}{}{end Funktion} % <- geändert
        \Fn{\textsc{FactorizationMain}(f)}{
            \While{not at end of this document} {
                read current\;
            }
            \KwRet{Test}
        }
        \caption{Test}
        \label{factorizationmain}
    \end{algorithm}
    
\end{document}

Danke

Verfasst: Mi 15. Jun 2016, 07:33
von Sigls
funktioniert, vielen Dank!