3

I found interesting problem. In my tex4ht configuration file, I have the line that says

 \catcode`\:=11 \catcode`\@=11

It have been there forever. I think it was to solve a problem from this answer. Or I might got it from another place. I do not remember now. It never caused a problem, except now.

But I just found out that htlatex fails on one tikz picture. Here is the MWE

\documentclass[12pt]{article}
\ifdefined\HCode
\def\pgfsysdriver{pgfsys-tex4ht.def}
\fi 
\usepackage{tikz}
\usetikzlibrary{arrows,calc,decorations.markings,math}
\begin{document}
\begin{tikzpicture}
\draw let \n1={2} in (0,0) -- (30:\n1);
\end{tikzpicture}
\end{document}

Only on the above example, with the polar coordinate. If I use normal coordinates, no error:

\begin{tikzpicture}
\draw let \n1={2} in (0,0) -- (1,\n1);
\end{tikzpicture}

The polar coordinates example compiles fine with pdflatex. But with htlatex it gives this error

 htlatex foo.tex "nma"

and the error

(/usr/local/texlive/2014/texmf-dist/tex/generic/tex4ht/html4.4ht)
(/usr/local/texlive/2014/texmf-dist/tex/generic/tex4ht/html4-math.4ht))
(./foo.aux))

! Package pgf Error: No shape named 30:2 is known.    
See the pgf package documentation for explanation.
Type  H <return>  for immediate help.

l.11 \draw let \n1={2} in (0,0) -- (30:\n1)
                                       ;
? x

The file nma.cfg used above just has this catcode command: (my .cfg file is much larger, but I narrowed it down to this one line) Here is the nma.cfg file to use to reproduce the error.

\Preamble{ext=htm,charset="utf-8",p-width,pic-align} 
\catcode`\:=11 \catcode`\@=11
\begin{document}
\EndPreamble

Without using the .cfg file, htlatex compiles the polar coordinates example ok and generated the image

 htlatex foo.tex

I think I will end up removing this catcode line from my .cfg file, since I do not know now exactly why it is there and hope nothing else breaks.

But I was wondering if someone have an idea why would this happen. It might indicate a more serious problem somewhere else, this is why I posted this.

I also just updated to the latest TL 2014. Here is the filelist for reference

*File List*
 article.cls    2014/09/29 v1.4h Standard LaTeX document class
  size12.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
  tex4ht.sty    
    tikz.sty    2013/12/13 v3.0.0 (rcs-revision 1.142)
     pgf.sty    2013/12/18 v3.0.0 (rcs-revision 1.14)
  pgfrcs.sty    2013/12/20 v3.0.0 (rcs-revision 1.28)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
  pgfrcs.code.tex
 pgfcore.sty    2010/04/11 v3.0.0 (rcs-revision 1.7)
graphicx.sty    2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
graphics.sty    2014/10/28 v1.0p Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live
graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live
   dvips.def    2014/10/14 v3.0j Driver-dependent file (DPC,SPQR)
   dvips.def    2014/10/14 v3.0j Driver-dependent file (DPC,SPQR)
  pgfsys.sty    2013/11/30 v3.0.0 (rcs-revision 1.47)
  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    2007/01/21 v2.11 LaTeX color extensions (UK)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
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    2013/12/13  (rcs-revision 1.23)
pgfcorescopes.code.tex    2013/10/09  (rcs-revision 1.44)
pgfcoregraphicstate.code.tex    2013/09/19  (rcs-revision 1.11)
pgfcoretransformations.code.tex    2013/10/10  (rcs-revision 1.17)
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    2013/11/07  (rcs-revision 1.40)
pgfcoreshade.code.tex    2013/07/15  (rcs-revision 1.15)
pgfcoreimage.code.tex    2013/07/15  (rcs-revision 1.18)
pgfcoreexternal.code.tex    2013/07/15  (rcs-revision 1.20)
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    2013/10/31  (rcs-revision 1.34)
pgfmoduleplot.code.tex    2013/07/31  (rcs-revision 1.12)
pgfcomp-version-0-65.sty    2007/07/03 v3.0.0 (rcs-revision 1.7)
pgfcomp-version-1-18.sty    2007/07/23 v3.0.0 (rcs-revision 1.1)
  pgffor.sty    2013/12/13 v3.0.0 (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.0 (rcs-revision 1.20)
pgfmodulematrix.code.tex    2013/09/17  (rcs-revision 1.8)
tikzlibrarytopaths.code.tex    2008/06/17 v3.0.0 (rcs-revision 1.2)
tikzlibraryarrows.code.tex    2008/01/09 v3.0.0 (rcs-revision 1.1)
pgflibraryarrows.code.tex    2013/09/23 v3.0.0 (rcs-revision 1.16)
tikzlibrarycalc.code.tex    2013/07/15 v3.0.0 (rcs-revision 1.9)
 ***********
3
  • 2
    The colon is a syntax character in TikZ, if the category code is changed, then the TikZ parser for polar coordinates will not see the colon anymore. Maybe it helps to restore the category code inside tikzpicture via \catcode`\:=12, before the statement with the polar coordinate. May 28, 2015 at 0:30
  • @HeikoOberdiek Ok, thanks. If you like to show how to do this, will accept and close this.
    – Nasser
    May 28, 2015 at 1:27
  • @Nasser I imagine it would just be including that command right after the \begin{tikzpicture} and its arguments; effectively the same thing you did above, just scoped to the environment. May 28, 2015 at 4:04

1 Answer 1

6

The colon is a syntax character in TikZ, if the category code is changed, then the TikZ parser for polar coordinates will not see the colon anymore. Maybe it helps to restore the category code inside tikzpicture via \catcode`\:=12, before the statement with the polar coordinate.

Example:

\documentclass[12pt]{article}
\ifdefined\HCode
\def\pgfsysdriver{pgfsys-tex4ht.def}
\fi 
\usepackage{tikz}
\usetikzlibrary{arrows,calc,decorations.markings,math}
\begin{document}
\begin{tikzpicture}
  \catcode`\:=12
  \draw let \n1={2} in (0,0) -- (30:\n1);
\end{tikzpicture}
\end{document}

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.