1

I am using latest update of TexLive on Linux. I just found one of my large files has all the math generated by tex4ht corrupted or missing from the web page. This only affects the math itself. Nothing else.

After many long hrs of debugging, I managed to make a MWE. It turns out the corruption happens when using adjustbox and lstlisting, like this

\begin{adjustbox}{max width=1\linewidth}
\begin{lstlisting}
AAAAAAAAAAAAAAAAAAA
\end{lstlisting} 
\end{adjustbox}

After the above, all math generated by tex4ht is corrupted. The math before the above is fine. But anything afterwords, is bad.

I show example below. This also happens when using SVG images for math (not png). So it seems it is corrupting something with the SVG math image generation, as png math is OK. MWE

\documentclass[11pt]{article}                      
\usepackage{array}
\usepackage{listings}
\usepackage[most]{tcolorbox}
\tcbuselibrary{listings}
\usepackage{adjustbox}

\begin{document} 
\ifdefined\HCode 
\Configure{Picture}{.svg}
\fi 

\begin{adjustbox}{max width=1\linewidth}
\begin{lstlisting}
AAAAAAAAAAAAAAAAAAA
\end{lstlisting} 
\end{adjustbox}


\[ 
3\frac{d^{2}y}{dt^{2}}+2\frac{dy}{dt}+y\left(  t\right) = u(t)
\]
do you see above?

\[ 
3\frac{d^{2}y}{dt^{2}}+2\frac{dy}{dt}+y\left(  t\right) = u(t)
\]
do you see above?

\[ 
\sin(x)=\frac{1}{2}
\]
do you see above?

\[ 
\sin(x)=\frac{1}{2}
\]
do you see above?
\end{document}

Compiled using

 make4ht --lua -u  KERNEL.tex

Here is the HTML screen shot

Mathematica graphics

To compile math to png, I removed (or commented) these lines from the MWE

\ifdefined\HCode 
\Configure{Picture}{.svg}
\fi 

Here is the result when when using png for math:

Mathematica graphics

Why is this math corruption happens when using SVG for images? I will remove adjustbox for now from my code, and will remove \tcbuselibrary when in tex4ht mode as it seems to cause problems.

Here is the file listing

*File List*
 article.cls    2014/09/29 v1.4h Standard LaTeX document class
  size11.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
  tex4ht.sty    
   array.sty    2016/10/06 v2.4d Tabular extension package (FMi)
listings.sty    2015/06/04 1.6 (Carsten Heinz)
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
 lstmisc.sty    2015/06/04 1.6 (Carsten Heinz)
 lstmisc.sty    2015/06/04 1.6 (Carsten Heinz)
listings.cfg    2015/06/04 1.6 listings configuration
listings.cfg    2015/06/04 1.6 listings configuration
tcolorbox.sty    2016/11/18 version 3.96 text color boxes
     pgf.sty    2015/08/07 v3.0.1a (rcs-revision 1.15)
  pgfrcs.sty    2015/08/07 v3.0.1a (rcs-revision 1.31)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
  pgfrcs.code.tex
 pgfcore.sty    2010/04/11 v3.0.1a (rcs-revision 1.7)
graphicx.sty    2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty    2016/10/09 v1.0u Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg    2016/06/04 v1.11 sample graphics configuration
graphics.cfg    2016/06/04 v1.11 sample graphics configuration
   dvips.def    2016/07/10 v3.1a Driver-dependent file (DPC,SPQR)
   dvips.def    2016/07/10 v3.1a Driver-dependent file (DPC,SPQR)
  pgfsys.sty    2014/07/09 v3.0.1a (rcs-revision 1.48)
  pgfsys.code.tex
     pgf.cfg    2008/05/14  (rcs-revision 1.7)
pgfsys-tex4ht.def    2013/08/06  (rcs-revision 1.25)
pgfsys-common-svg.def    2013/08/28  (rcs-revision 1.24)
  xcolor.sty    2016/05/11 v2.12 LaTeX color extensions (UK)
   color.cfg    2016/01/02 v1.6 sample color configuration
   color.cfg    2016/01/02 v1.6 sample color configuration
pgfsyssoftpath.code.tex    2013/09/09  (rcs-revision 1.9)
pgfsyssoftpath.code.tex    2013/09/09  (rcs-revision 1.9)
pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)
pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)
 pgfcore.code.tex
pgfcorepoints.code.tex    2013/10/07  (rcs-revision 1.27)
pgfcorepathconstruct.code.tex    2013/10/07  (rcs-revision 1.29)
pgfcorepathusage.code.tex    2014/11/02  (rcs-revision 1.24)
pgfcorescopes.code.tex    2015/05/08  (rcs-revision 1.46)
pgfcoregraphicstate.code.tex    2014/11/02  (rcs-revision 1.12)
pgfcoretransformations.code.tex    2015/08/07  (rcs-revision 1.20)
pgfcorequick.code.tex    2008/10/09  (rcs-revision 1.3)
pgfcoreobjects.code.tex    2006/10/11  (rcs-revision 1.2)
pgfcorepathprocessing.code.tex    2013/09/09  (rcs-revision 1.9)
pgfcorearrows.code.tex    2015/05/14  (rcs-revision 1.43)
pgfcoreshade.code.tex    2013/07/15  (rcs-revision 1.15)
pgfcoreimage.code.tex    2013/07/15  (rcs-revision 1.18)
pgfcoreexternal.code.tex    2014/07/09  (rcs-revision 1.21)
pgfcorelayers.code.tex    2013/07/18  (rcs-revision 1.7)
pgfcoretransparency.code.tex    2013/09/30  (rcs-revision 1.5)
pgfcorepatterns.code.tex    2013/11/07  (rcs-revision 1.5)
pgfmoduleshapes.code.tex    2014/03/21  (rcs-revision 1.35)
pgfmoduleplot.code.tex    2015/08/03  (rcs-revision 1.13)
pgfcomp-version-0-65.sty    2007/07/03 v3.0.1a (rcs-revision 1.7)
pgfcomp-version-1-18.sty    2007/07/23 v3.0.1a (rcs-revision 1.1)
verbatim.sty    2014/10/28 v1.5q LaTeX2e package for verbatim enhancements
 environ.sty    2014/05/04 v0.3 A new way to define environments
trimspaces.sty    2009/09/17 v1.1 Trim spaces around a token list
etoolbox.sty    2017/01/02 v2.4 e-TeX tools for LaTeX (JAW)
    tikz.sty    2015/08/07 v3.0.1a (rcs-revision 1.151)
  pgffor.sty    2013/12/13 v3.0.1a (rcs-revision 1.25)
 pgfkeys.sty    
 pgfkeys.code.tex
 pgfmath.sty    
 pgfmath.code.tex
  pgffor.code.tex
    tikz.code.tex
pgflibraryplothandlers.code.tex    2013/08/31 v3.0.1a (rcs-revision 1.20)
pgfmodulematrix.code.tex    2013/09/17  (rcs-revision 1.8)
tikzlibrarytopaths.code.tex    2008/06/17 v3.0.1a (rcs-revision 1.2)
 amsmath.sty    2016/11/05 v2.16a AMS math features
 amstext.sty    2000/06/29 v2.01 AMS text
  amsgen.sty    1999/11/30 v2.0 generic functions
  amsgen.sty    1999/11/30 v2.0 generic functions
  amsbsy.sty    1999/11/29 v1.2d Bold Symbols
  amsopn.sty    2016/03/08 v2.02 operator names
  xparse.sty    2016/11/21 v6760 L3 Experimental document command parser
   expl3.sty    2016/11/21 v6760 L3 programming layer (loader) 
expl3-code.tex    2016/11/21 v6760 L3 programming layer 
 l3dvips.def    2016/08/18 v6679 L3 Experimental driver: dvips
 l3dvips.def    2016/08/18 v6679 L3 Experimental driver: dvips
listingsutf8.sty    2016/05/16 v1.3 Allow UTF-8 in listings input (HO)
pdftexcmds.sty    2016/05/21 v0.22 Utility functions of pdfTeX for LuaTeX (HO)
infwarerr.sty    2016/05/16 v1.4 Providing info/warning/error messages (HO)
ifluatex.sty    2016/05/16 v1.4 Provides the ifluatex switch (HO)
 ltxcmds.sty    2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
   ifpdf.sty    2016/05/14 v3.1 Provides the ifpdf switch
stringenc.sty    2016/05/16 v1.11 Convert strings between diff. encodings (HO)
pdfescape.sty    2016/05/16 v1.14 Implements pdfTeX's escape features (HO)
shellesc.sty    2016/06/07 v0.02a unified shell escape interface for LaTeX
tikzlibraryfadings.code.tex    2009/11/15 v3.0.1a (rcs-revision 1.2)
pgflibraryfadings.code.tex    2008/02/07 v3.0.1a (rcs-revision 1.3)
adjustbox.sty    2012/05/21 v1.0 Adjusting TeX boxes (trim, clip, ...)
 xkeyval.sty    2014/12/03 v2.7a package option processing (HA)
 xkeyval.tex    2014/12/03 v2.7a key=value parser (HA)
 xkeyval.tex    2014/12/03 v2.7a key=value parser (HA)
 adjcalc.sty    2012/05/16 v1.1 Provides advanced setlength with multiple back-
ends (calc, etex, pgfmath)
trimclip.sty    2012/05/16 v1.0 Trim and clip general TeX material
collectbox.sty    2012/05/17 v0.4b Collect macro arguments as boxes
tc-dvips.def    2012/05/13 v1.0 Clipping driver for dvips
tc-dvips.def    2012/05/13 v1.0 Clipping driver for dvips
ifoddpage.sty    2016/04/23 v1.1 Conditionals for odd/even page detection
varwidth.sty    2009/03/30 ver 0.92;  Variable-width minipages
inputenc.sty    2015/03/17 v1.2c Input encoding file
 ***********

Update

Here is the log file. It is too long to paste here, the site complains. So here is a link to it: KERNEL.txt

  • When I compile your code in the indicated way with make4ht I get errors since the pgf code is not understood. Do you have any error reports from the compilation? – Andrew Swann Jan 27 '17 at 8:05
  • @AndrewSwann Thanks for looking at it. I'll add the log file now to my post. It is little long, 1000 lines, I hope this is OK. I looked at it, but many of the messages I do not understand, but did not spot any obvious error messages. But I am posting it now. – Nasser Jan 27 '17 at 8:23
  • @Nasser I guess you use some custom function in the build file to get SVG? I think there will be some issue – michal.h21 Jan 27 '17 at 9:44
  • @michal.h21 Sorry, I do not understand. I showed all the code I am using, and as you can see, I am not using my own cfg file or my own main.mk4. Everything I use is listed above as is. I also did full update of TL before. I can ask you in chat if you prefer. thanks. – Nasser Jan 27 '17 at 9:55
  • 1
    your \listfiles output looks a bit odd with packages and def fiels appaering twice (amsgen.sty, dvips.def etc) – David Carlisle Jan 27 '17 at 10:57

Your Answer

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

Browse other questions tagged or ask your own question.