疑难解答 \PrintIndex \PrintChanges

疑难解答 \PrintIndex \PrintChanges

下面的代码包含一个更改标记,目的是将其打印出来。我得到:

错误:LaTeX 错误:\verb 已在行末结束。

我该如何修复它?

foo.dtx

% \iffalse meta-comment
% !TEX program  = pdfLaTeX
%<*internal> 
\iffalse
%</internal> 
%<*readme> 
-----------------------------------------------------------------------------------
##### foo --- dummy dtx file
------------------------------------------------------------------------------------
%</readme> 
%<*internal> 
\fi
\def\nameofplainTeX{plain}
\ifx\fmtname\nameofplainTeX\else
\expandafter\begingroup
\fi
%</internal> 
%<*install> 
\input l3docstrip.tex
\keepsilent
\askforoverwritefalse
\preamble
------------------------------------------------------------------------------
foo --- dummy dtx file
------------------------------------------------------------------------------

\endpreamble
\postamble

Copyright (C) 2021 by Author

\endpostamble
\generate{
  \file{\jobname.sty}{\from{\jobname.dtx}{package}}
}
%</install> 
%<install> \endbatchfile
%<*internal> 
\generate{
  \file{\jobname.ins}{\from{\jobname.dtx}{install}}
}
\nopreamble\nopostamble
\generate{
  \file{README.md}{\from{\jobname.dtx}{readme}}
}
\ifx\fmtname\nameofplainTeX
\expandafter\endbatchfile
\else
\expandafter\endgroup
\fi
%</internal> 
%<package> \NeedsTeXFormat{LaTeX2e}[2021-06-01]
%<package> \ProvidesExplPackage
%<package> {foo}                                              % Package name
%<package> {2021-08-03}                                       % Release date
%<package> {1.0}                                              % Release version
%<package> {foo --- dummy dtx file }
%<*driver> 
\documentclass[show-notes]{l3doc}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\usepackage{foo}
\usepackage{hyperref}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
%</driver> 
% \fi
% 
% \GetFileInfo{\jobname.sty}
% \begin{documentation}
% 
% \changes{Version 1.0}
% {2020/08/03}
% {Initial version}
%^^A {\DTMdate{2020-08-03}}
% 
% \StopEventually{\clearpage{}\PrintChanges\PrintIndex}
% \end{documentation}
% \begin{implementation}
%    \begin{macrocode}
%<*package>      
%<@@=foo>      
\ExplSyntaxOn
%    \end{macrocode}
%    \begin{macrocode}
\ExplSyntaxOff
%</package> 
%    \end{macrocode}
% \end{implementation}
% \Finale
% ^^A\PrintIndex \PrintChanges
\endinput

/latex-dev/base/doc.dtx

% \DescribeMacro\PrintIndex
% To read in and print the sorted index, just put the
% |\PrintIndex| command as the last (commented-out, and thus
% executed during the documentation pass through the file) command
% in your package file.  Precede it by any bibliography commands
% necessary for your citations.
% Alternatively, it may be more convenient to put all such calls
% amongt the arguments of the |\StopEventually| macro, in
% which case a |\Finale| command should appear at the end of
% your file.

PS:唯一的\PrintIndex问题是

答案1

您可能正在使用如下调用来运行 MakeIndex

 makeindex -o foo.ind foo.idx

这将使用默认样式。你需要的是

 makeindex -o foo.ind -s gind.ist foo.idx

它将使用正确的索引样式文件来转换.idx由生成的文件doc

相关内容