I just updated my texlive 2014 using tlmgr to fix an older related problem with using titlesec with tex4ht.

But it seems a new problem now shows up. This show up only when using the starred version of the section. Here is MWE

\section*{$ \left(  a  \right) $}

htlatex foo.tex

! Argument of \im:g has an extra }.
<inserted text> 
l.6 \section*{$ \left(  a  \right) $}

The problem goes away when changing \section* to \section or when removing the titlesec package.

It seems the use of \left( and \right) is confusing tex4ht support for titlesec, since this works compiles with no error:


\section*{$ (a) $}


Here is '\listfiles'

>pdflatex foo2.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) 

*File List*
  report.cls    2014/09/29 v1.4h Standard LaTeX document class
  size12.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
 amsmath.sty    2013/01/14 v2.14 AMS math features
 amstext.sty    2000/06/29 v2.01
  amsgen.sty    1999/11/30 v2.0
  amsbsy.sty    1999/11/29 v1.2d
  amsopn.sty    1999/12/14 v2.01 operator names
titlesec.sty    2011/12/15 v2.10.0 Sectioning titles
  • this behavior shows with my patch for titlesec and image math, with mathml output everything is fine. the problem also shows only when section title contains only math. if text is contained, it compiles correctly. do you really use section titles containing only math? – michal.h21 Jan 1 '15 at 16:57
  • possible workaround is to use titlesec only with pdflatex. – michal.h21 Jan 1 '15 at 16:58

potential bug reports in systems should probably be raised with the maintainers rather than here but anyway you can do the following workaround.

\newcommand\zz{$\left(  a  \right) $}

Hard to think of any case when you'd actually want \left\right in a section head....

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.