tex4ht 与 expdlist 不兼容

tex4ht 与 expdlist 不兼容

我尝试转换下面的文档,htlatex不使用任何选项,但它给出了这个错误:

! LaTeX Error: Something's wrong--perhaps a missing \item.

如果我删除描述环境后面的方括号及其内容,则不会出错。如果我只包含一项,则会出现另一个错误:

! Missing number, treated as zero.
<to be read again> 
                   \c:\end:itm 
l.7   \end{description}

最小示例:

\documentclass{article}
\usepackage{expdlist}
\begin{document}                                               
  \begin{description}[\breaklabel\setleftmargin{1ex}]
    \item[test1]text1
    \item[test2]text2
  \end{description}
\end{document}

答案1

这看起来像是一个错误。

这是一个不太好的解决方法:

\usepackage{expdlist}
\begin{document}     
  \ifx\HCode\UnDef
  \begin{description}[\breaklabel\setleftmargin{1ex}]
  \else
  \begin{description}
  \fi
    \item[test1]text1
    \item[test2]text2
  \end{description}
\end{document}

更新:https://puszcza.gnu.org.ua/bugs/index.php?155

更新 2. 该错误已解决。在补丁到达您的系统之前,只需将文件添加expdlist.4ht到您的工作目录中,内容如下:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% expdlist.4ht                          2011-11-20-04:55 %
% Copyright (C) 2007--2009       Eitan M. Gurari         %
%               2009--2011       TeX Users Group         %
%                                                        %
% This work may be distributed and/or modified under the %
% conditions of the LaTeX Project Public License, either %
% version 1.3c of this license or (at your option) any   %
% later version. The latest version of this license is   %
% in                                                     %
%   http://www.latex-project.org/lppl.txt                %
% and version 1.3c or later is part of all distributions %
% of LaTeX version 2005/12/01 or later.                  %
%                                                        %
% This work has the LPPL maintenance status "maintained".%
%                                                        %
% This Current Maintainer of this work                   %
% is the TeX4ht Project <[email protected]>.                %
%                                                        %
% If you modify this program your changing its signature %
% with a directive of the following form will be         %
% appreciated.                                           %
%            \message{signature}                         %
%                                                        %
%                                        [email protected]  %
%                             http://www.tug.org/tex4ht  %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\immediate\write-1{version 2011-11-20-04:55}
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.3c of this license or (at your option) any
% later version. The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions
% of LaTeX version 2005/12/01 or later.
%
% This work has the LPPL maintenance status "maintained".
%
% The Current Maintainer of this work
% is the TeX4ht Project <http://tug.org/tex4ht>.
%
% If you modify this program, changing the
% version identification would be appreciated.
%
%
% We just ignore optional arguments to description during ht run... 
%
\let\description@orig=\description
\def\description{\@ifnextchar[% ]
{\description@ht}{\description@orig}}
\def\description@ht[#1]{\description@orig}
\Hinput{expdlist}
\endinput

答案2

这样做没有任何问题。可以使用 \Css{...} 声明来控制格式。

\documentclass{article}
\usepackage{expdlist,lipsum}

\begin{document}                                               


\def\enditem{}
\def\enditemone{\Tg</dd>}

\ConfigureList{description}
    {\Tg<dl>}
    {\enditem\Tg</dl>}
    {\enditem\Tg<dt>}
    {\Tg</dt>\Tg<dd>\let\enditem\enditemone}

  \begin{description}[\breaklabel\setleftmargin{1ex}]
    \item[test1]\lipsum[1]
    \item[test2]\lipsum[2]
  \end{description}

\end{document}

相关内容