我读了这问题和子图环境工作正常,除了标题不在图像下方居中。相反,它看起来像这样:
有办法修复这个问题吗?到目前为止,我的 config.cfg 如下所示:
\let\origincludegraphics\includegraphics
\Preamble{xhtml,pic-tabular}
\Configure{HtmlPar}
{\EndP\Tg<p>}
{\EndP\Tg<p>}
{\HCode{</p>\Hnewline}}
{\HCode{</p>\Hnewline}}
\Configure{picture}
{\DeclareGraphicsExtensions{.eps}\Picture+[PICT]{}}
{\EndPicture}
%%%Images
\Configure{graphics*}
{jpg}
{%
\Picture[pict]{\csname Gin@base\endcsname .jpg
\space width="\the\dimexpr \expandafter\csname
Gin@req@width\endcsname *2"
}%
\special{t4ht+@File: \csname Gin@base\endcsname.jpg}
}
\Configure{graphics*}
{png}
{%
\Picture[pict]{\csname Gin@base\endcsname .png
\space width="\the\dimexpr \expandafter\csname
Gin@req@width\endcsname *2"
}%
\special{t4ht+@File: \csname Gin@base\endcsname.png}
}
\Configure{graphics*}
{eps}
{%
\openin15=\csname Gin@base\endcsname\PictExt\relax
\ifeof15
\Needs{"convert \csname Gin@base\endcsname.eps
\csname Gin@base\endcsname\PictExt"}%
\fi
\closein15
\Picture[pict]{\csname Gin@base\endcsname \PictExt
\space width="\the\dimexpr \expandafter\csname
Gin@req@width\endcsname *1.5"
}%
\special{t4ht+@File: \csname Gin@base\endcsname\PictExt}
}
\Configure{Picture*}{\let\includegraphics\origincludegraphics}{}
\Configure{Picture+}{\let\includegraphics\origincludegraphics}{}
%%%%%%Subfigure
\ConfigureEnv{subfigure}{\ifvmode\IgnorePar\fi\EndP\HCode{<div class="subfigure">}}{\ifvmode\IgnorePar\fi\EndP\HCode{</div>}}{}{}
\Css{.subfigure{display: inline-block;}}
\Css{.subfigure img{display:block;}}
\Css{.figure div.caption{text-align: center;}}
\Css{div.figure{text-align:center;clear:both;overflow:auto;width:100\%;margin-bottom:1em;}}
%%%%%MINIPAGE
\makeatletter
\def\striptextwidth#1\textwidth{#1}
\newcount\mini@count
\let\oldiimini\@iiiminipage
\def\@iiiminipage#1#2[#3]#4{%
\xdef\miniwidth{\strip@pt\dimexpr(\striptextwidth#4pt)*100\relax\%}
\oldiimini{#1}{#2}[#3]{#4}
}
\ConfigureEnv{minipage}{\advance\mini@count by 1\relax\ifvmode\IgnorePar\fi\EndP\HCode{<div class="minipage" align="center" id="minipage\the\mini@count">}}
{\ifvmode\IgnorePar\fi\EndP\HCode{</div>\Hnewline}%
\Css{\#minipage\the\mini@count{width:\miniwidth;}}%
}{}{}
\makeatother
\Css{div.minipage {
float: left;
}
}
\Css{div.minipage:last-child {
clear: none;
float: right;
}
}
\Css{div.figure{clear:both;overflow:auto;width:100\%;max-width:100\%;height:auto;}}
\begin{document}
\CssFile[custom.css]
/* css.sty */
\EndCssFile
\Configure{CoverMimeType}{image/jpg}
\DeclareGraphicsExtensions{.eps,.png,.jpg,.gif,}
\EndPreamble
编辑:只有当标题太长时才会出现此问题。解决方法是手动强制换行。