![将 \listofalgorithms 与 \listoftables 和 \listoffigures 视为相同(即,没有编号且不出现在目录中,但有书签)](https://linux22.com/image/400841/%E5%B0%86%20%5Clistofalgorithms%20%E4%B8%8E%20%5Clistoftables%20%E5%92%8C%20%5Clistoffigures%20%E8%A7%86%E4%B8%BA%E7%9B%B8%E5%90%8C%EF%BC%88%E5%8D%B3%EF%BC%8C%E6%B2%A1%E6%9C%89%E7%BC%96%E5%8F%B7%E4%B8%94%E4%B8%8D%E5%87%BA%E7%8E%B0%E5%9C%A8%E7%9B%AE%E5%BD%95%E4%B8%AD%EF%BC%8C%E4%BD%86%E6%9C%89%E4%B9%A6%E7%AD%BE%EF%BC%89.png)
在下面的工作示例中,我该如何
- 从“算法列表”中删除章节编号,
- 从目录中删除“算法列表”,并且
- 将书签保留到“算法列表”?
换句话说,我如何才能使“算法列表”与“图形列表”和“表格列表”得到相同的处理?
\documentclass[phd, final]{pittetd}
\usewithpatch{graphicx}
\usepackage{amsmath,amsthm}
\patch{amsmatch}
\patch{amsthm}
\usepackage{algorithmicx}
\usepackage{algorithm}
\usepackage{algpseudocode}
\title[A pittetd-thesis sample]{Sample file for a thesis with the `pittetd' class}
\author{I. M. Student}
\begin{document}
\begin{abstract}
This document is a sample file for the creation of ETD's at Pitt through \LaTeX.
\end{abstract}
\tableofcontents
\listoftables
\listoffigures
\listofalgorithms
\chapter{Introduction}
In principio erat Verbum
\chapter{Second chapter}
This is the 2nd chapter.
\begin{figure}
\centering
%\includegraphics{}
\caption{Caption: fig.}
\label{fig:my_label}
\end{figure}
\begin{table}[]
\centering
\begin{tabular}{c|c}
& \\
\end{tabular}
\caption{Caption: tab.}
\label{tab:my_label}
\end{table}
\begin{algorithm} \small
\small
\caption{Caption: alg.}
\begin{algorithmic}[1]
\Procedure {MyProcedure}{$a$}\\
\EndProcedure
\end{algorithmic}
\end{algorithm}
Important info.
\chapter{Conclusions}
Concl.
\end{document}
答案1
我找到了答案。添加如上所示的代码\listofalgorithms
:
\makeatletter
\renewcommand\listof[2]{%
\@ifundefined{ext@#1}{\float@error{#1}}{%
\@ifundefined{chapter}{\def\@tempa{\section*}}%
{\def\@tempa{\section*}}%
\@tempa{#2\@mkboth{\uppercase{#2}}{\uppercase{#2}}}%
\@namedef{l@#1}{\@dottedtocline{1}{1.5em}{2.3em}}%
\@starttoc{\@nameuse{ext@#1}}}}
\makeatother
\null\vskip 1in
\makeatletter
\hypertarget{prelim.7}{}%
\protected@write\@outlinefile{}{%
\protect\BOOKMARK
[0][]{prelim.7}{LIST OF ALGORITHMS}{}%
\protect\begingroup\protect\makeatletter
\protect\prepare@bookmarks7
\protect\@input{\jobname.loa}
\protect\endgroup}
\makeatother
\listofalgorithms
整个工作示例如下所示:
\documentclass[phd, final]{pittetd}
\usewithpatch{graphicx}
\usepackage{amsmath,amsthm}
\patch{amsmatch}
\patch{amsthm}
\usepackage{algorithmicx}
\usepackage[chapter]{algorithm}
\usepackage{algpseudocode}
\usepackage{titletoc}
\title[A pittetd-thesis sample]{Sample file for a thesis with the `pittetd' class}
\author{I. M. Student}
\begin{document}
\begin{abstract}
This document is a sample file for the creation of ETD's at Pitt through \LaTeX.
\end{abstract}
\tableofcontents
\listoftables
\listoffigures
\makeatletter
\renewcommand\listof[2]{%
\@ifundefined{ext@#1}{\float@error{#1}}{%
\@ifundefined{chapter}{\def\@tempa{\section*}}%
{\def\@tempa{\section*}}%
\@tempa{#2\@mkboth{\uppercase{#2}}{\uppercase{#2}}}%
\@namedef{l@#1}{\@dottedtocline{1}{1.5em}{2.3em}}%
\@starttoc{\@nameuse{ext@#1}}}}
\makeatother
\null\vskip 1in
\makeatletter
\hypertarget{prelim.7}{}%
\protected@write\@outlinefile{}{%
\protect\BOOKMARK
[0][]{prelim.7}{LIST OF ALGORITHMS}{}%
\protect\begingroup\protect\makeatletter
\protect\prepare@bookmarks7
\protect\@input{\jobname.loa}
\protect\endgroup}
\makeatother
\listofalgorithms
\chapter{Introduction}
In principio erat Verbum
\chapter{Second chapter}
This is the 2nd chapter.
\begin{figure}
\centering
%\includegraphics{}
\caption{Caption: fig.}
\label{fig:my_label}
\end{figure}
\begin{table}[]
\centering
\begin{tabular}{c|c}
& \\
\end{tabular}
\caption{Caption: tab.}
\label{tab:my_label}
\end{table}
\begin{algorithm} \small
\small
\caption{Caption: alg.}
\begin{algorithmic}[1]
\Procedure {MyProcedure}{$a$}\\
\EndProcedure
\end{algorithmic}
\end{algorithm}
Important info.
\chapter{Conclusions}
Concl.
\end{document}