创建软件功能索引

创建软件功能索引

我需要在软件中为 latex 手册的导出函数创建某种类型的索引。默认情况下,导出到 LaTeX 的 doxygen 功能不允许这样做。所需的格式如下:

索引:[函数名称],[函数描述] ....... [页面]

_其他功能

文本:

[函数名称[ [函数描述] [附加信息(函数参数,返回类型等...]

然而,传统索引包无法向索引添加自定义描述(或者我没有仔细查看?)或者词汇表包具有所需的功能?

以下是文件示例:

GetOperationState %function name
function returns the actual state of measurement. %function description
%below is additional information
\begin{verbatim}
unsigned short GetOperationState(unsigned short Op) 
\end{verbatim}
Parameters 
\begin{description}
    \item{Op}  Reserved for future use. 
\end{description}
Return Values 
...Some Text...

请帮忙或者指出应该查看的方向。

答案1

在此处输入图片描述

我认为你的意思是这样的,这只是使用\@starttoc底层\tableofcontents\listoffigures

\documentclass{article}

\setlength\textheight{30\baselineskip}

\makeatletter

\def\FunName#1#2#3{%
\par
\vskip 2\baselineskip plus 1fil\penalty-200\vfilneg
\noindent\hskip-5em\label{Fun-#1}\textbf{#1}%
\addcontentsline{fun}{fun}{{#1}{\detokenize{#3}}}%
\par
\nopagebreak
\noindent\ignorespaces#3\par}

\def\l@fun#1{\l@@fun#1}
\def\l@@fun#1#2#3{%
\par\noindent\parbox[t]{.3\textwidth}{#1}\quad
\parbox[t]{.6\textwidth}{\small\raggedright#2}\dotfill
#3\par}


\def\FunctionListing{%
\section*{Function Listing}%
\@starttoc{fun}}%

\makeatother

\begin{document}

\FunctionListing

\FunName{GetOperationState} %function name
\FunDesc{function returns the actual state of measurement.} %function description
%below is additional information
\begin{verbatim}
unsigned short GetOperationState(unsigned short Op) 
\end{verbatim}
Parameters 
\begin{description}
    \item{Op}  Reserved for future use. 
\end{description}
Return Values 
...Some Text...

\FunName{SetOperationState} %function name
\FunDesc{function sets the actual state of measurement.} %function description
%below is additional information
\begin{verbatim}
unsigned short SetOperationState(unsigned short Op) 
\end{verbatim}
Parameters 
\begin{description}
    \item{Op}  Reserved for future use. 
\end{description}
Return Values 
...Some Text...



\FunName{GetSomething} %function name
\FunDesc{function does something interesting.} %function description
%below is additional information
\begin{verbatim}
unsigned short GetSomething(
        unsigned short Opa,
        unsigned short Opb,
        unsigned short Opc}
\end{verbatim}
Parameters 
\begin{description}
    \item{Opa}  Reserved for future use. 
    \item{Opb}  Reserved for future use. 
    \item{Opc}  Reserved for future use. 
\end{description}
Return Values 
...Some Text...



\end{document}

相关内容