1

I now want to convert tex to html file. it only has some errors before but after i seems to update some package or something, it can not produce html file. the source code and the bib code is suggested to referred to another post

[Problems using htlatex and bibtex to html and then to word

The command i use is only simle as

htlatex Text.tex

the compling error are listed as below:

This is pdfTeX, Version 3.14159265-2.6-1.40.18 (MiKTeX 2.9.6350 64-bit) (preloaded format=latex 2017.10.24)  24 OCT 2017 20:55
entering extended mode
**\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx\HCode\def\HCod
e##1{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g
@addto@macro\@documentclasshook{\RequirePackage[#1,html]{tex4ht}}\let\HCode\doc
umentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname te
x4ht\endcsname{#1,html}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HC
ode}{\documentstyle[tex4ht]}}}\makeatother\HCode .a.b.c.\input  Fancypattern
(Fancypattern.tex (iopart.cls
Document Class: iopart 1996/06/10 v0.0 IOP Journals LaTeX article class
(iopart12.clo
File: iopart12.clo 1997/01/15 v1.0 LaTeX2e file (size option)
)
\c@jnl=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\indentedwidth=\skip43
\mathindent=\dimen102
\c@eqnval=\count87
)
(C:\Users\zhang\AppData\Roaming\MiKTeX\2.9\tex\generic\tex4ht\tex4ht.sty
version 2008-10-27-17:23
Package: tex4ht 
--------------------------------------
--- Note --- for _ at preamble, use the command line option `early_'
--------------------------------------
--------------------------------------
--- Note --- for ^ at preamble, use the command line option `early^'
--------------------------------------
\tmp:toks=\toks14
)
(C:\Users\zhang\AppData\Roaming\MiKTeX\2.9\tex\generic\tex4ht\usepackage.4ht
version 2009-05-21-09:32
)
("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\epstopdf.sty"
Package: epstopdf 2016/05/15 v2.6 Conversion with epstopdf on the fly (HO)

("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\epstopdf-base.sty"
Package: epstopdf-base 2016/05/15 v2.6 Base part for package epstopdf

("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty"
Package: infwarerr 2016/05/16 v1.4 Providing info/warning/error messages (HO)
)
("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\grfext.sty"
Package: grfext 2016/05/16 v1.2 Manage graphics extensions (HO)

("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\kvdefinekeys.sty"
Package: kvdefinekeys 2016/05/16 v1.4 Define keys (HO)

("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty"
Package: ltxcmds 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
)))
("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\kvoptions.sty"
Package: kvoptions 2016/05/16 v3.12 Key value format for package options (HO)

("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\keyval.sty"
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks15
)
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\kvsetkeys.sty"
Package: kvsetkeys 2016/05/16 v1.17 Key value parser (HO)

("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\etexcmds.sty"
Package: etexcmds 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)

("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifluatex.sty"
Package: ifluatex 2016/05/16 v1.4 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX not detected.
)
Package etexcmds Info: Could not find \expanded.
(etexcmds)             That can mean that you are not using pdfTeX 1.50 or
(etexcmds)             that some package has redefined \expanded.
(etexcmds)             In the latter case, load this package earlier.
)))
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\pdftexcmds.sty"
Package: pdftexcmds 2017/03/19 v0.25 Utility functions of pdfTeX for LuaTeX (HO
)

("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifpdf.sty"
Package: ifpdf 2017/03/15 v3.2 Provides the ifpdf switch
)
Package pdftexcmds Info: LuaTeX not detected.
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode is ignored in DVI mode.
)

Package epstopdf Warning: No graphics package `graphic{s,x}' loaded.

)) ("C:\Program Files\MiKTeX 2.9\tex\latex\subfigure\subfigure.sty"
Package: subfigure 2002/07/30 v2.1.4 subfigure package
\subfigtopskip=\skip44
\subfigcapskip=\skip45
\subfigcaptopadj=\dimen103
\subfigbottomskip=\skip46
\subfigcapmargin=\dimen104
\subfiglabelskip=\skip47
\c@subfigure=\count88
\c@lofdepth=\count89
\c@subtable=\count90
\c@lotdepth=\count91

****************************************
* Local config file subfigure.cfg used *
****************************************
("C:\Program Files\MiKTeX 2.9\tex\latex\subfigure\subfigure.cfg")
\subfig@top=\skip48
\subfig@bottom=\skip49
)
("C:\Program Files\MiKTeX 2.9\tex\latex\cite\cite.sty"
LaTeX Info: Redefining \cite on input line 302.
LaTeX Info: Redefining \nocite on input line 332.
Package: cite 2015/02/27  v 5.5
)
("C:\Program Files\MiKTeX 2.9\tex\latex\multirow\multirow.sty"
Package: multirow 2016/11/25 v2.2 Span multiple rows of a table
\multirow@colwidth=\skip50
\multirow@cntb=\count92
\multirow@dima=\skip51
\bigstrutjot=\dimen105
)
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphicx.sty"
Package: graphicx 2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)

("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphics.sty"
Package: graphics 2017/04/14 v1.1b Standard LaTeX Graphics (DPC,SPQR)

("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\trig.sty"
Package: trig 2016/01/03 v1.10 sin cos tan (DPC)
)
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics-cfg\graphics.cfg"
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration
)
Package graphics Info: Driver file: dvips.def on input line 99.

("C:\Program Files\MiKTeX 2.9\tex\latex\graphics-def\dvips.def"
File: dvips.def 2016/07/10 v3.1a Driver-dependent file (DPC,SPQR)
))
\Gin@req@height=\dimen106
\Gin@req@width=\dimen107
) (iopams.sty
Package: iopams 1997/02/13 v1.0

("C:\Program Files\MiKTeX 2.9\tex\latex\amsmath\amsgen.sty"
File: amsgen.sty 1999/11/30 v2.0 generic functions
\@emptytoks=\toks16
\ex@=\dimen108
)
("C:\Program Files\MiKTeX 2.9\tex\latex\amsfonts\amsfonts.sty"
Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support
\symAMSa=\mathgroup4
\symAMSb=\mathgroup5
LaTeX Font Info:    Overwriting math alphabet `\mathfrak' in version `bold'
(Font)                  U/euf/m/n --> U/euf/b/n on input line 106.
)
("C:\Program Files\MiKTeX 2.9\tex\latex\amsfonts\amssymb.sty"
Package: amssymb 2013/01/14 v3.01 AMS font symbols
)
("C:\Program Files\MiKTeX 2.9\tex\latex\amsmath\amsbsy.sty"
Package: amsbsy 1999/11/29 v1.2d Bold Symbols
\pmbraise@=\dimen109
))
("C:\Program Files\MiKTeX 2.9\tex\latex\adjustbox\adjustbox.sty"
Package: adjustbox 2012/05/21 v1.0 Adjusting TeX boxes (trim, clip, ...)

("C:\Program Files\MiKTeX 2.9\tex\latex\xkeyval\xkeyval.sty"
Package: xkeyval 2014/12/03 v2.7a package option processing (HA)

("C:\Program Files\MiKTeX 2.9\tex\generic\xkeyval\xkeyval.tex"
("C:\Program Files\MiKTeX 2.9\tex\generic\xkeyval\xkvutils.tex"
\XKV@toks=\toks17
\XKV@tempa@toks=\toks18
)
\XKV@depth=\count93
File: xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
))
("C:\Program Files\MiKTeX 2.9\tex\latex\adjustbox\adjcalc.sty"
Package: adjcalc 2012/05/16 v1.1 Provides advanced setlength with multiple back
-ends (calc, etex, pgfmath)
)
("C:\Program Files\MiKTeX 2.9\tex\latex\adjustbox\trimclip.sty"
Package: trimclip 2012/05/16 v1.0 Trim and clip general TeX material

("C:\Program Files\MiKTeX 2.9\tex\latex\collectbox\collectbox.sty"
Package: collectbox 2012/05/17 v0.4b Collect macro arguments as boxes
\collectedbox=\box26
)
\tc@llx=\dimen110
\tc@lly=\dimen111
\tc@urx=\dimen112
\tc@ury=\dimen113
Package trimclip Info: Using driver 'tc-dvips.def'.

("C:\Program Files\MiKTeX 2.9\tex\latex\adjustbox\tc-dvips.def"
File: tc-dvips.def 2012/05/13 v1.0 Clipping driver for dvips
))
\adjbox@Width=\dimen114
\adjbox@Height=\dimen115
\adjbox@Depth=\dimen116
\adjbox@Totalheight=\dimen117

("C:\Program Files\MiKTeX 2.9\tex\latex\ifoddpage\ifoddpage.sty"
Package: ifoddpage 2016/04/23 v1.1 Conditionals for odd/even page detection
\c@checkoddpage=\count94
)
("C:\Program Files\MiKTeX 2.9\tex\latex\ltxmisc\varwidth.sty"
Package: varwidth 2009/03/30 ver 0.92;  Variable-width minipages
\@vwid@box=\box27
\sift@deathcycles=\count95
\@vwid@loff=\dimen118
\@vwid@roff=\dimen119
))
("C:\Program Files\MiKTeX 2.9\tex\latex\was\upgreek.sty"
Package: upgreek 2003/02/12 v2.0 (WaS)
Package upgreek Info: Using Euler Roman for upright Greek on input line 31.
\symugrf@m=\mathgroup6
LaTeX Font Info:    Overwriting symbol font `ugrf@m' in version `bold'
(Font)                  U/eur/m/n --> U/eur/b/n on input line 38.
)
(C:\Users\zhang\AppData\Roaming\MiKTeX\2.9\tex\generic\tex4ht\tex4ht.4ht
version 2009-01-07-07:11
--------------------------------------
--- Note --- for additional information, use the command line option `info'
--------------------------------------

::::::::::::::::::::::::::::::::::::::::::
 TeX4ht info is available in the log file 
::::::::::::::::::::::::::::::::::::::::::
) (C:\Users\zhang\AppData\Roaming\MiKTeX\2.9\tex\generic\tex4ht\tex4ht.sty
version 2008-10-27-17:23

--- needs --- tex4ht Fancypattern ---
\tmp:cnt=\count96
\openout15 = `Fancypattern.tmp'.

(Fancypattern.tmp)
\tmp:dim=\skip52
--------------------------------------
--- Note --- for XML code, use the command line option `xml' or `xhtml'
--------------------------------------
 (Fancypattern.xref
Runaway argument?
{\GenericError { }{LaTeX Error: No \let \reserved@d =[\def \def docum\ETC.
! Paragraph ended before \:CrsWrd was complete.
<to be read again> 
                   \par 
l.2 ...voidb@x \futurelet \:temp \def \:temp {\par
                                                   }\:temp \relax \xdef {0}{...

? 

! LaTeX Error: Missing \begin{document} in `'.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.2 ...\futurelet \:temp \def \:temp {\par }\:temp
                                                   \relax \xdef {0}{}{{2}{{0...

? 
! Missing control sequence inserted.
<inserted text> 
                \inaccessible 
l.2 ...mp \def \:temp {\par }\:temp \relax \xdef {
                                                  0}{}{{2}{{0}{}}}}\def \bgr...

? 
! Too many }'s.
l.2 ...par }\:temp \relax \xdef {0}{}{{2}{{0}{}}}}
                                                  \def \bgroup \def \:temp {...

? 
! Too many }'s.
l.2 ...t 2\afterassignment \xdef \:temp {1}\egroup
                                                   \mth:op \tmp:cnt {\gdef \...

? 
! Undefined control sequence.
l.2 ...rassignment \xdef \:temp {1}\egroup \mth:op
                                                   \tmp:cnt {\gdef \ht:every...

? 
! Missing number, treated as zero.
<to be read again> 
                   {
l.2 ... \xdef \:temp {1}\egroup \mth:op \tmp:cnt {
                                                  \gdef \ht:everypar {\relax...

? 
! Missing control sequence inserted.
<inserted text> 
                \inaccessible 
l.2 ... \xdef \:temp {1}\egroup \mth:op \tmp:cnt {
                                                  \gdef \ht:everypar {\relax...

? 
! Too many }'s.
l.2 ...t 2\afterassignment \xdef \:temp {1}\egroup
                                                   \mth:op \tmp:cnt {\ht:eve...

? 
! Undefined control sequence.
l.2 ...rassignment \xdef \:temp {1}\egroup \mth:op
                                                   \tmp:cnt {\ht:everypar {}...

? 
! Missing number, treated as zero.
<to be read again> 
                   {
l.2 ... \xdef \:temp {1}\egroup \mth:op \tmp:cnt {
                                                  \ht:everypar {}}\xdef \glo...

? 
! Missing control sequence inserted.
<inserted text> 
                \inaccessible 
l.2 ... \xdef \:temp {1}\egroup \mth:op \tmp:cnt {
                                                  \ht:everypar {}}\xdef \glo...

? 
! Missing { inserted.
l.2 ...:cnt {\ht:everypar {}}\xdef \global \let  }
                                                   }
? 
! Too many }'s.
l.2 ...nt {\ht:everypar {}}\xdef \global \let  } }

? 
! Use of \bgroup doesn't match its definition.
\:CrossWord ->\bgroup \no:catcodes 
                                   {128}{255}{12}\catcode `\: 12 \catcode `\...
l.3 \:CrossWord
               {)Qx1-10001}{1}{2}%
? 
! Too many }'s.
\:CrsWrd #1#2#3->\egroup 
                         \sv:crs {#1}{#2}{#3}
l.3 \:CrossWord{)Qx1-10001}{1}{2}
                                 %
? 
! Missing $ inserted.
<inserted text> 
                $
l.4 \:
      CrossWord{1cAp0}{x1-10011}{4}%
? 
! Use of global doesn't match its definition.
extract@font ...@external@font global expandafter 
                                                  font font@name external@fo...
l.4 \:
      CrossWord{1cAp0}{x1-10011}{4}%
? 
! Use of global doesn't match its definition.
extract@font ...@external@font global expandafter 
                                                  font font@name external@fo...
l.4 \:
      CrossWord{1cAp0}{x1-10011}{4}%
? 
! Use of global doesn't match its definition.
extract@font ...@external@font global expandafter 
                                                  font font@name external@fo...

but there is absolutely no error when i compile it to a pdf file. anyone who can tell me what is happening? may be i should create a special configuration file for HTlatex?

  • there is some issue with \maketitle, it causes the fatal error – michal.h21 Oct 24 '17 at 19:30
  • after i comment \maketitle, there is still such problem. it seems i changed some thing, maybe the version or some package. – shqiang Oct 24 '17 at 19:47
  • Please post an example code that reproduces the problem. Without this it may be difficult for anyone to help you. – Ian Thompson Oct 24 '17 at 19:50
  • i give source code in another post tex.stackexchange.com/questions/397812/… because if i put together, the body will be too long to post it in one single file. please take a look at it. – shqiang Oct 24 '17 at 19:56
1

As I said in my previous answer, the main issue is that iopart class redefines lot of standard LaTeX macros and even change which arguments they may take. Some of these issues may be solved in the configuration file for tex4ht, but some needs fix in the class itself.

I've fixed only most obvious issues:

  • \maketitle causes tex4ht fatal error

  • titling commands produce wrong formatting

  • sectioning commands produce spurious numbers on line that precede their use

  • \br command causes compilation error

All of them except the issue with sections can be fixed in the config file.

File iopart.4ht:

\input article.4ht

\let\maketitle\relax
\let\br\hline

\NewConfigure{title}{2}
\Configure{title}{\ifvmode\IgnorePar\fi\EndP\HCode{<h2 class="titleHead">}\NoFonts}{\ifvmode\IgnorePar\fi\EndP\EndNoFonts\HCode{</h2>\Hnewline}}

\NewConfigure{author}{2}
\Configure{author}{\ifvmode\IgnorePar\fi\EndP\HCode{<div class="author">}\NoFonts}{\ifvmode\IgnorePar\fi\EndP\EndNoFonts\HCode{</div>\Hnewline}}

\NewConfigure{address}{2}
\Configure{address}{\ifvmode\IgnorePar\fi\EndP\HCode{<div class="address">}\NoFonts}{\EndNoFonts\ifvmode\IgnorePar\fi\EndP\HCode{</div>\Hnewline}}

\NewConfigure{pacs}{2}
\Configure{pacs}{\ifvmode\IgnorePar\fi\EndP\HCode{<div class="pacs">}\NoFonts}{\EndNoFonts\ifvmode\IgnorePar\fi\EndP\HCode{</div>\Hnewline}}

% \let\s:title\@stitle
\def\@stitle[#1]#2{\a:title{#2}\b:title}

% \let\f:title\@ftitle
\def\@ftitle#1{\a:title{#1}\b:title}

\def\@sauthor[#1]#2{\a:author#2\b:author}
\def\@fauthor#1{\a:author#1\b:author}

\def\pacs#1{\a:pacs PACS numbers: #1\b:pacs\par}

\renewcommand\address[1]{\a:address#1\b:address}

\renewenvironment{abstract}{\textbf{\abstractname.}}{}
\Css{div.abstract{font-size:0.8rem;}}
\Css{div.address{text-align:center;}}


\Hinput{iopart}
\endinput

The issue with sections need to be fixed in iopart.cls. It seems that default macros for sections are redefined in order to get dot after the last number in the section counter.

The following code:

\def\@sect#1#2#3#4#5#6[#7]#8{\ifnum #2>\c@secnumdepth
     \let\@svsec\@empty\else
     \refstepcounter{#1}
     \edef\@svsec{\csname the#1\endcsname. }
     \fi
     \@tempskipa #5\relax
      \ifdim \@tempskipa>\z@
        \begingroup #6\relax
          \noindent{\hskip #3\relax\@svsec
          }%
          {\interlinepenalty \@M #8\par}%
        \endgroup
       \csname #1mark\endcsname{#7}\addcontentsline
         {toc}{#1}{\ifnum #2>\c@secnumdepth \else
                      \protect\numberline{\csname the#1\endcsname}\fi
                    #7}\else
        \def\@svsechd{#6\hskip #3\relax  %% \relax added 2 May 90
                   \@svsec #8\csname #1mark\endcsname
                      {#7}\addcontentsline
                           {toc}{#1}{\ifnum #2>\c@secnumdepth \else
                             \protect\numberline{\csname the#1\endcsname}\fi
                       #7}}\fi
     \@xsect{#5}}
%
\def\@ssect#1#2#3#4#5{\@tempskipa #3\relax
   \ifdim \@tempskipa>\z@
     \begingroup #4\noindent{\hskip #1}{\interlinepenalty \@M #5\par}\endgroup
   \else \def\@svsechd{#4\hskip #1\relax #5}\fi
    \@xsect{#3}}

Can be replaced with

 \renewcommand{\@seccntformat}[1]{\csname the#1\endcsname.\quad}

which does the same thing but doesn't break tex4ht.

With these changes, the document looks like this:

enter image description here

  • thanks a lot. i just summerize the problem and prepared another post. it seems not necessary now. thanks a lot! – shqiang Oct 25 '17 at 13:09
  • @shqiang I am sure you will find much more issues, but it shouldn't be that hard to fix them. At least I hope. – michal.h21 Oct 25 '17 at 13:50
  • for the moment, it works well. there is also other issue, like the .pdf file. i remembered there was also some post before. thanks a lot. – shqiang Oct 25 '17 at 14:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.