0

This is the initial part of my thesis:

\documentclass[12pt, a4paper, openright]{report}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{graphicx}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{hyperref}
\usepackage{fancyhdr}
\usepackage{color}
\usepackage{rotating}
\usepackage{subfigure}
\usepackage{eucal}
\usepackage{booktabs} % To thicken table lines

%\usepackage[algo2e,ruled,vlined,linesnumbered]{algorithm2e}
\usepackage{setspace}
\usepackage{morefloats}
%\usepackage{algorithm2e}
\usepackage{algpseudocode}
\usepackage{varwidth}
\usepackage{float}

\usepackage{amsfonts}
\usepackage{ragged2e}
\usepackage{color}
\usepackage{mdwtab}
\usepackage{bm}
\usepackage[nottoc]{tocbibind}



\newcommand{\todo}[1]{{\color{blue} #1}}


\selectlanguage{english}
\setcounter{secnumdepth}{5}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{assumption}{Assumption}[section]
\newtheorem{proposition}{Proposition}[section]
\newtheorem{oss}{Observation}[section]
\newtheorem{cor}{Corollary}[section]
\newtheorem{lemma}{Lemma}[section]


\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
\newtheorem{algorithm}{Algorithm}[section]
\newtheorem{dataset}{Dataset}[section]
\newtheorem{ex}{Example}[section]


\floatstyle{boxed}
\newfloat{Pseudocode}{hbtp}{lop}[section]
\floatname{Pseudocode}{Pseudocode}

\DeclareMathOperator*{\argmin}{\arg\!\min}
\DeclareMathOperator*{\argmax}{\arg\!\max}
\DeclareMathOperator\kdist{\mathit{k}-distance}




\title{Computational Intelligence for Data Analysis with OES Data in Semiconductor Manufacturing}
\author{Luca Puggini}
\date{\today}




\begin{document}
\maketitle


\begin{titlepage}
Luca Puggini


\end{titlepage}

\clearpage

\pagestyle{empty}

\clearpage

\pagestyle{plain}
\pagenumbering{roman}



\chapter*{Acknowledgements}
\thispagestyle{empty}
Thesis


\tableofcontents                             % indice

\listoffigures
\listoftables
\listof{Pseudocode}{List of Pseudocodes}

\clearpage
\pagestyle{plain}
\pagenumbering{arabic}


%\begin{titlepage}
%\maketitle
%\end{titlepage}







\pagestyle{plain}
\pagenumbering{roman}

%\tableofcontents                             % indice

\clearpage
\pagestyle{plain}
\pagenumbering{arabic}

\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhf{}
\fancyhead[LE,RO]{\bfseries\thepage}
\fancyhead[LO]{\bfseries\rightmark}
\fancyhead[RE]{\bfseries\leftmark}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
\addtolength{\headheight}{0.5pt}
\fancypagestyle{plain}{
    \fancyhead{}
        \renewcommand{\headrulewidth}{0pt}}

\parindent 0pt

\chapter*{Practical Information} 
....

Everything works but in my content only \listoffigures \listoftables are referenced while \listof{Pseudocode}{List of Pseudocodes} is not.

How can I add a reference to the \listof{Pseudocode}{List of Pseudocodes} in the table of content?

EDIT: The answer partially works. List of pseudocodes is now in the table of contents but the layout of the list of pseudocodes page is bad and different from the tableoffigure one.

enter image description here

EDIT 2: This is an example reproducing the problem:

    \documentclass[12pt, a4paper, openright]{report}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{graphicx}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{hyperref}
\usepackage{fancyhdr}
\usepackage{color}
\usepackage{rotating}
\usepackage{subfigure}
\usepackage{eucal}
\usepackage{booktabs} % To thicken table lines

%\usepackage[algo2e,ruled,vlined,linesnumbered]{algorithm2e}
\usepackage{setspace}
\usepackage{morefloats}
%\usepackage{algorithm2e}
\usepackage{algpseudocode}
\usepackage{varwidth}
\usepackage{float}

\usepackage{amsfonts}
\usepackage{ragged2e}
\usepackage{color}
\usepackage{mdwtab}
\usepackage{bm}
\usepackage[nottoc]{tocbibind}



\newcommand{\todo}[1]{{\color{blue} #1}}


\selectlanguage{english}
\setcounter{secnumdepth}{5}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{assumption}{Assumption}[section]
\newtheorem{proposition}{Proposition}[section]
\newtheorem{oss}{Observation}[section]
\newtheorem{cor}{Corollary}[section]
\newtheorem{lemma}{Lemma}[section]


\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
\newtheorem{algorithm}{Algorithm}[section]
\newtheorem{dataset}{Dataset}[section]
\newtheorem{ex}{Example}[section]


\floatstyle{boxed}
\newfloat{Pseudocode}{hbtp}{lop}[section]
\floatname{Pseudocode}{Pseudocode}

\DeclareMathOperator*{\argmin}{\arg\!\min}
\DeclareMathOperator*{\argmax}{\arg\!\max}
\DeclareMathOperator\kdist{\mathit{k}-distance}


\newcommand{\listofpseudocodes}{
\tocfile{List of Pseudocodes}{lop}
\listof{Pseudocode}{List of Pseudocodes}
}


\title{Title}
\author{author}
\date{\today}




\begin{document}
\maketitle


\begin{titlepage}
title 

\end{titlepage}

\clearpage

\pagestyle{empty}

\clearpage

\pagestyle{plain}
\pagenumbering{roman}



\chapter*{Acknowledgements}
\thispagestyle{empty}
Thesis


\tableofcontents                             % indice

\listoffigures
\listoftables
%\listof{Pseudocode}{List of Pseudocodes}
\listofpseudocodes

\clearpage
\pagestyle{plain}
\pagenumbering{arabic}


%\begin{titlepage}
%\maketitle
%\end{titlepage}







\pagestyle{plain}
\pagenumbering{roman}

%\tableofcontents                             % indice

\clearpage
\pagestyle{plain}
\pagenumbering{arabic}

\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhf{}
\fancyhead[LE,RO]{\bfseries\thepage}
\fancyhead[LO]{\bfseries\rightmark}
\fancyhead[RE]{\bfseries\leftmark}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
\addtolength{\headheight}{0.5pt}
\fancypagestyle{plain}{
    \fancyhead{}
        \renewcommand{\headrulewidth}{0pt}}

\parindent 0pt

\chapter{Ch 1}

\begin{table}

\caption{table 1 }
\end{table} 


\section{Sec 1}

\chapter{Ch 2}

\begin{Pseudocode}

\caption{pseudocode 1}
\end{Pseudocode}

\begin{table}
\caption{table2}
\end{table}



\begin{Pseudocode}

\caption{pseudocode 2}
\end{Pseudocode}



 \end{document}
2
  • \listof by the float package is not designed to have a ToC entry. – user31729 Mar 30 '16 at 11:15
  • How can I emulate the behviour of list of figure for my custom float? – Donbeo Mar 30 '16 at 11:16
1

The \listof feature by the float does not add an entry to the ToC. This can be changed by wrapping a command around this, that automatically adds the contentsline to the ToC`;

\newcommand{\listofpseudocodes}{%
\phantomsection
\listof{Pseudocode}{List of Pseudocodes}
\addcontentsline{toc}{chapter}{List of Pseudocodes}
}

Here's the 'MWE' by the O.P.

    \documentclass[12pt, a4paper, openright]{report}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{graphicx}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{hyperref}
\usepackage{fancyhdr}
\usepackage{color}
\usepackage{rotating}
\usepackage{subfigure}
\usepackage{eucal}
\usepackage{booktabs} % To thicken table lines

%\usepackage[algo2e,ruled,vlined,linesnumbered]{algorithm2e}
\usepackage{setspace}
\usepackage{morefloats}
%\usepackage{algorithm2e}
\usepackage{algpseudocode}
\usepackage{varwidth}
\usepackage{float}

\usepackage{amsfonts}
\usepackage{ragged2e}
\usepackage{color}
\usepackage{mdwtab}
\usepackage{bm}
\usepackage[nottoc]{tocbibind}



\newcommand{\todo}[1]{{\color{blue} #1}}


\selectlanguage{english}
\setcounter{secnumdepth}{5}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{assumption}{Assumption}[section]
\newtheorem{proposition}{Proposition}[section]
\newtheorem{oss}{Observation}[section]
\newtheorem{cor}{Corollary}[section]
\newtheorem{lemma}{Lemma}[section]


\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
\newtheorem{algorithm}{Algorithm}[section]
\newtheorem{dataset}{Dataset}[section]
\newtheorem{ex}{Example}[section]


\floatstyle{boxed}
\newfloat{Pseudocode}{hbtp}{lop}[section]
\floatname{Pseudocode}{Pseudocode}

\DeclareMathOperator*{\argmin}{\arg\!\min}
\DeclareMathOperator*{\argmax}{\arg\!\max}
\DeclareMathOperator\kdist{\mathit{k}-distance}


\newcommand{\listofpseudocodes}{%
\phantomsection
\listof{Pseudocode}{List of Pseudocodes}
\addcontentsline{toc}{chapter}{List of Pseudocodes}
}


\title{Title}
\author{author}
\date{\today}




\begin{document}
\maketitle


\begin{titlepage}
title 

\end{titlepage}

\clearpage

\pagestyle{empty}

\clearpage

\pagestyle{plain}
\pagenumbering{roman}



\chapter*{Acknowledgements}
\thispagestyle{empty}
Thesis


\tableofcontents                             % indice

\listoffigures
\listoftables
%\listof{Pseudocode}{List of Pseudocodes}
\listofpseudocodes

\clearpage
\pagestyle{plain}
\pagenumbering{arabic}


%\begin{titlepage}
%\maketitle
%\end{titlepage}







\pagestyle{plain}
\pagenumbering{roman}

%\tableofcontents                             % indice

\clearpage
\pagestyle{plain}
\pagenumbering{arabic}

\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhf{}
\fancyhead[LE,RO]{\bfseries\thepage}
\fancyhead[LO]{\bfseries\rightmark}
\fancyhead[RE]{\bfseries\leftmark}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
\addtolength{\headheight}{0.5pt}
\fancypagestyle{plain}{
    \fancyhead{}
        \renewcommand{\headrulewidth}{0pt}}

\parindent 0pt

\chapter{Ch 1}

\begin{table}

\caption{table 1 }
\end{table} 


\section{Sec 1}

\chapter{Ch 2}

\begin{Pseudocode}

\caption{pseudocode 1}
\end{Pseudocode}

\begin{table}
\caption{table2}
\end{table}



\begin{Pseudocode}

\caption{pseudocode 2}
\end{Pseudocode}



 \end{document}
7
  • Thanks this is almost a solution. Now the list is in the table of content but the List of Pseudocodes page has a terrible layout. It is different from the one in the List of tables page. In addition all the entries are in the same line making it unreadable. – Donbeo Mar 30 '16 at 11:25
  • @Donbeo: Which layout? Your 'fragmented' code has no layout stuff etc. for the Pseudocode list of page ;-) You cannot complain about things in your own code which we are not responsible for. – user31729 Mar 30 '16 at 11:26
  • I have edited the question. This is how page list of pseudocodes looks now – Donbeo Mar 30 '16 at 11:33
  • @Donbeo: Well, I can't reproduce it here without having code. Try to remove the \begingroup....\endgroup} in \listofpseudocodes – user31729 Mar 30 '16 at 11:35
  • 1
    @Donbeo: Apparently, tocfile screws up the formatting really. I changed the approach, more low-level right now – user31729 Mar 30 '16 at 12:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.