
estou usando otese clássicatema e estou tentando fazer com que minha lista de algoritmos tenha o mesmo formato de minhas listas de tabelas e figuras. Estou usando o algorithm2e
pacote. Aqui está como está no momento.
Eu tentei as respostas paraessa questãomas eles não funcionam, provavelmente porque usam o algorithm
pacote. Usando a resposta aceita, a lista de algoritmos leva o nome da lista de figuras, mas não lista nada:
A outra resposta simplesmente não muda nada.
Como o modelo de tese clássica é enorme, não tenho certeza de como fornecer um exemplo funcional mínimo... O código a seguir reproduz o problema, com o classicthesis.sty
arquivo original do modelo de tese clássica.
\documentclass{scrreprt}
\usepackage{classicthesis}
\usepackage{algorithm2e}
\begin{document}
\listoftables
\listofalgorithms
\newpage
Here is Algorithm \ref{alg:some_alg}.
\begin{algorithm}
\For{something}{
something else
}
\caption{Some algorithm.}\label{alg:some_alg}
\end{algorithm}
Here is Table \ref{tab:some_table}.
\begin{table}
\centering
\begin{tabular}{cc}
some line & some content \\
some other line & some other content \\
\end{tabular}
\caption{Some table.}
\label{tab:some_table}
\end{table}
\end{document}
Desejo retirar os pontos da tabela de algoritmos, bem como desfazer o alinhamento dos números das páginas para que fique parecido com a lista de tabelas acima.
Responder1
A chave é o comando tocloft \newlistof
. A formatação real é realizada por \l@algocf
.
\documentclass{scrreprt}
\usepackage{classicthesis}
\usepackage{algorithm2e}
\makeatletter
\newlistof{algorithms}{loa}{\listalgorithmcfname}%
\renewcommand{\cftalgorithmsleader}{\hspace{1.5em}}%
\renewcommand{\cftalgorithmsafterpnum}{\cftparfillskip}%
\renewcommand{\cftalgorithmspresnum}{\algorithmcfname~}%
\newlength{\algorithmslabelwidth}%
\settowidth{\algorithmslabelwidth}{\cftalgorithmspresnum~999}%
\addtolength{\algorithmslabelwidth}{2.5em}%
\cftsetindents{algorithms}{0em}{\algorithmslabelwidth}%
\let\l@algocf\l@algorithms
\makeatother
\begin{document}
\listoftables
\listofalgorithms
\newpage
Here is Algorithm \ref{alg:some_alg}.
\begin{algorithm}
\For{something}{
something else
}
\caption{Some algorithm.}\label{alg:some_alg}
\end{algorithm}
Here is Table \ref{tab:some_table}.
\begin{table}
\centering
\begin{tabular}{cc}
some line & some content \\
some other line & some other content \\
\end{tabular}
\caption{Some table.}
\label{tab:some_table}
\end{table}
\end{document}