部分标签不起作用 Make4ht

部分标签不起作用 Make4ht

我使用TeXLive 2023Windows,运行时make4ht -ux -m draft -a debug filename.texmake4ht 不起作用,系统挂起。我的 MWE 是:

\documentclass[utf8]{FrontiersinHarvard} 
\usepackage{url,hyperref,lineno,microtype,subcaption,algorithmic,algorithm}
\usepackage[onehalfspacing]{setspace}
\DeclareMathOperator*{\argmax}{argmax}
\DeclareMathOperator*{\argmin}{argmin}
\newtheorem{definition}{Definition}
\newtheorem{theorem}{Theorem} 
\newtheorem{lemma}{Lemma}
\renewcommand{\algorithmiccomment}[1]{\bgroup\hfill~#1\egroup}
\newcommand\scalemath[2]{\scalebox{#1}{\mbox{\ensuremath{\displaystyle #2}}}}
\def\keyFont{\fontsize{9}{11}\helveticabold }
\def\firstAuthorLast{} %use et al only if is more than 1 author
\def\Authors{Yu Zhu\,$^{*}$ and Santiago Segarra}
\def\Address{Department of Electrical and Computer Engineering, Rice University, Houston, TX, United States}
\def\corrAuthor{Yu Zhu}
\def\corrEmail{[email protected]}
\begin{document}
\onecolumn
\firstpage{1}
\title[Hypergraphs with Vertex Weights]{Hypergraphs with Vertex Weights: $p$-Laplacians Clustering} 
\author[\firstAuthorLast ]{\Authors} %This field will be automatically populated
\address{} %This field will be automatically populated
\correspondance{} %This field will be automatically populated
\extraAuth{}
\maketitle

\begin{abstract}
We study world data demonstrate the effectiveness of combining spectral clustering based on the $1$-Laplacian and EDVW.

\keyFont{ \textbf{Keywords:} hypergraphs, $p$-Laplacian, clustering, edge-dependent weights}
\end{abstract}

\section{Introduction}\label{s1:intro}
Spectral clustering makes use of eigenvalues and eigenvectors of graph Laplacians to group vertices in a graph.

\end{document}

LaTeX 模板可用https://www.frontiersin.org/design/zip/Frontiers_LaTeX_Templates.zip

答案1

这里的问题在于自定义类,它不加载任何标准类,而是手动定义章节、标题和所有其他元素。自定义类通常在内部加载 Article 或 Book,并仅重新定义与文档设计相关的元素。这样,即使 TeX4ht 本身不支持自定义类,它仍然可以插入基本的 HTML 标签。

幸运的是,我发现你仍然可以加载 TeX4ht 定义来获取 Article 的基本标签。你只需要重新定义一些导致问题的命令。以下是文件FrontiersinHarvard.4ht

\ifdefined\listoffigures\else\def\listoffigures{\relax}\fi
\ifdefined\listoftables\else\def\listoftables{\relax}\fi

\def\section{%
  \@startsection{section}{1}{\z@}
  {-10\p@ plus -3\p@}{3\p@}
  {\reset@font\raggedright\helveticabold\fontsize{13}{13}\color{black}\selectfont}}
\renewenvironment{subfigure}{\ifsub@@figure\global\sub@@figurefalse\stepcounter{figure}\fi%
 \@float{subfigure}}{\end@float}
\renewenvironment{subfigure*}{\ifsub@@figure\global\sub@@figurefalse\stepcounter{figure}\fi%
 \@float{subfigure}}{\end@float}

\input article.4ht

我必须修复几个问题:\listoftables\listoffigures未被定义FrontiersinHarvard.cls但在中重新定义article.4ht,因此我们需要声明此命令的虚拟版本以防止运行时错误。我还必须修复命令,\section因为来自类的版本导致了无限循环。我还必须添加subfiguresubfigure*环境;这些也会导致错误。

使用此文件,您可以编译您的文件:

在此处输入图片描述

相关内容