Theses, Books, Title pagesHow to add the list of algorithms

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
Post Reply
Debzz
Posts: 3
Joined: Mon Jun 08, 2015 10:13 pm

How to add the list of algorithms

Post by Debzz »

Hello,
I'm working with the masters-doctoral-thesis template.
I would like to add the list of algorithms right after the list of tables.
I also need it to be in french "liste des algorithmes".

First i added the following line just after the list of tables:

Code: Select all

\lhead{\emph{Liste des Algorithmes}}
\listofalgorithms
Everything worked fine but the title and the entry in the table of contents is in english.

Thus i tried to add those following line in the thesis.cls file:

Code: Select all

\renewcommand\listofalgorithms{
\btypeout{Liste des Algorithmes}
\addtotoc{Liste des Algorithmes}
\begin{spacing}{1}{
    \setlength{\parskip}{1pt}
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listalgorithmname
      \@mkboth{
          \MakeUppercase\listalgorithmname}{\MakeUppercase\listalgorithmname}}
    \@starttoc{lot}
    \if@restonecol\twocolumn\fi
    \cleardoublepage
}\end{spacing}
}
Now the entry in the table of content is in french but the algorithms won't show up in the corresponding section. Furthermore the title in the section is still in english instead of french.

Do you know what I did wrong ?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Debzz
Posts: 3
Joined: Mon Jun 08, 2015 10:13 pm

How to add the list of algorithms

Post by Debzz »

I found something that seems to work.

1. At the begining of the main.tex document i added the following lines:

Code: Select all

\makeatletter
\renewcommand{\ALG@name}{Algorithme}
\renewcommand{\listalgorithmname}{
Liste des \ALG@name s}
\makeatother
2. Then under the list of table call i added the following lines:

Code: Select all

\lhead{\emph{Liste des Algorithmes}}
\listofalgorithms
\addtotoc{Liste des Algorithmes}
But i would to understand the point of the lines in the thesis.cls file. For exemple for the list of table:

Code: Select all

\renewcommand\listoftables{
\btypeout{Liste des Tableaux}
\addtotoc{Liste des Tableaux}
\begin{spacing}{1}{
    \setlength{\parskip}{1pt}
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listtablename
      \@mkboth{
          \MakeUppercase\listtablename}{\MakeUppercase\listtablename}}
    \@starttoc{lot}
    \if@restonecol\twocolumn\fi
    \cleardoublepage
}\end{spacing}
}
And i really would like to have something similar in the .cls file for the list of algorithm.
Any hint ?
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

How to add the list of algorithms

Post by Johannes_B »

The class file writes a string to the log-file and puts an entry into the table of contents. It ensures to be in one-column-mode when typesetting the chapter title. It also sets the spacing and the headers.

To achieve something similar, you would need to do something like this.

Code: Select all

\cleardoublepage% i guess
    \markboth{\emph{Liste des Algorithmes}}
    \addtotoc{Liste des Algorithmes}
    \begin{spacing}{1}{
    \setlength{\parskip}{1pt}
    \listofalgorithms
\end{spacing}
But i did not test the code.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Debzz
Posts: 3
Joined: Mon Jun 08, 2015 10:13 pm

How to add the list of algorithms

Post by Debzz »

Thank you for your answer.
I tried your solution by putting those following lines in the thesis.cls file:

Code: Select all

    \renewcommand\listofalgorithms{
    \cleardoublepage% i guess
        \markboth{\emph{Liste des Algorithmes}}
        \addtotoc{Liste des Algorithmes}
        \begin{spacing}{1}{
        \setlength{\parskip}{1pt}
        \listofalgorithms
    \end{spacing}
    }
and under the list of table call, in the main.tex file:

Code: Select all

\lhead{\emph{Liste des Algorithmes}}
\listofalgorithms
But unfortunatly it didn't work (the list of algorithm totally disappeared from the table of content) and the compilation throw me some errors:
-! File ended while scanning use of _\@argdef.
-! Undefined control sequence
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: How to add the list of algorithms

Post by Johannes_B »

That is not the code i posted. Use my code in your document, not the class file. Changing stuff in class and package files is for experienced users only and should in general be avoided.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply