
私は古典論文テーマを使用して、アルゴリズムのリストを表と図のリストと同じ形式にしようとしています。algorithm2e
パッケージを使用しています。現時点では次のようになっています。
私は答えを試しましたこの質問しかし、おそらくパッケージを使用しているため、動作しませんalgorithm
。受け入れられた回答を使用すると、アルゴリズムのリストは図のリストの名前を取得しますが、何もリストしません。
他の答えはまったく何も変わりません。
classicthesis テンプレートは巨大なので、最小限の動作例をどのように提供すればよいかわかりません...次のコードは、classicthesis.sty
classicthesis テンプレートの元のファイルを使用して問題を再現します。
\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}
アルゴリズム テーブルからドットを削除し、ページ番号の配置を元に戻して、上記のテーブルのリストのように見えるようにしたいと思います。
答え1
鍵となるのは tocloft コマンドです\newlistof
。実際のフォーマットは によって実行されます\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}