% $Id: tex4ht-svg.tex 472 2018-12-30 17:39:42Z karl $ % compile 3 times: latex tex4ht-svg % or xhlatex tex4ht-svg "html,3,sections+" % % Copyright 2009-2018 TeX Users Group % Copyright 2000-2009 Eitan M. Gurari % Released under LPPL 1.3c+. % See tex4ht-cpright.tex for license text. %%%%%%%%%%%%%%%%%% load style files %%%%%%%%%%%%%%%%%%%%%%%%%% \ifx \HTML\UnDef \def\HTML{svg-option,html4-svg} \def\CONFIG{\jobname} \def\MAKETITLE{\author{Eitan M. Gurari}} \def\next{\input mktex4ht.4ht \endinput} \expandafter\next \fi \input{common.tex} \input{tex4ht-cpright.tex} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Preamble} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \<<< % svg-option.4ht (|version), generated from |jobname.tex % Copyright 2009-2018 TeX Users Group % Copyright |CopyYear.2001. Eitan M. Gurari | >>> % 2017-05-05 Michal % Change DTD and other stuff only for svg-inline % this is legacy option which will hold the original `svg` option behaviour \<<< \:CheckOption{svg-inline}\if:Option \Configure{VERSION} {\IgnorePar\HCode{ ?> \Hnewline}} \Configure{DOCTYPE}{\HCode {"\Hnewline "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">\Hnewline \Hnewline }} >>> \<<< encoding="\expandafter\ifx \csname a:charset\endcsname\relax \expandafter\:encoding\A:charset \else \expandafter\:encoding\a:charset\fi" >>> \<<< \Configure{@DOCTYPE} {"\Hnewline "http://www.w3.org/TR/2001/PR-SVG-20010719/DTD/svg10.dtd">\Hnewline \%svg.dtd; \Hnewline} >>> \<<< % hmtl-svg.4ht (|version), generated from |jobname.tex % Copyright 2009-2018 TeX Users Group % Copyright |CopyYear.2001. Eitan M. Gurari | \Configure{@DOCTYPE} {\Hnewline} >>> \<<< \expandafter \ifx \csname a:dtd-lang\endcsname\relax EN\else \csname a:dtd-lang\endcsname \fi >>> \<<< \Configure{@HTML} {\Hnewline xmlns:svg="http://www.w3.org/2000/svg"\Hnewline } \fi >>> %%%%%%%%%%%%%%%%%% \chapter{Code} %%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%% \section{DVI Images} %%%%%%%%%%%%%%%%%% \<<< \Configure{Picture}{.svg} \:CheckOption{svg-obj} \if:Option | \else \:CheckOption{svg-} \if:Option | \else \Log:Note{for external SVG files try the command line options `svg-obj' and 'svg-'} \:CheckOption{svg-inline}\if:Option | \fi \fi\fi >>> \<<< \Configure{IMG} {\special{t4ht=}}
  {}} >>> \<<< \csname a:Gin-dim\endcsname >>> %%%%%%%%%%%%%%%%%% \section{Support for th4:draw} %%%%%%%%%%%%%%%%%% \<<< \:CheckOption{draw} \if:Option \:CheckOption{th4} \if:Option \Configure{Fig} {\Svg} {\EndSvg} \:CheckOption{svg-} \if:Option | \else | \fi \fi \fi >>> \<<< \HAssign\:svgN = 0 \def\Svg{% \gHAdvance\:svgN by 1 \HCode{}% |% |% \bgroup\Canvas \x:SUBOff \x:SUPOff \let\Picture=\empty \everymath{}\everydisplay{}% } \def\EndSvg{\EndCanvas\egroup |% |} >>> \<<< \def\Svg{\HCode{\Hnewline \Hnewline}% \bgroup\Canvas \x:SUBOff \x:SUPOff \let\Picture=\empty \everymath{}\everydisplay{}% } \def\EndSvg{\EndCanvas\egroup \HCode{}} >>> \<<< \let\:svg=\empty \NewConfigure{Canvas}[4]{\ht:special{t4ht"% *% *d\Hnewline% **\Hnewline<\:svg text x="\%.1f" y="\%.1f" >% *% *\Hnewline<\:svg rect x="\%.1f#4" y="\%.1f#4" width="\%.1f#4" height="\%.1f#4" />% *#1*#2*#1*#2*#3}} \Configure{Canvas}{0.0000152587890625}{0.0}{0.5}{} >>> 65536 scaled units = 1 pt. 1 / 65536 = 0.0000152587890625. \<\><<< \NewConfigure{Canvas}[4]{\ht:special{t4ht"% *% *d\Hnewline\Hnewline % % **% % *\Hnewline % **% *\Hnewline % % *\Hnewline% *\Hnewline% *#1*#2*#1*#2*#3*2}} >>> \<<< \ht:special{t4ht>\jobname\:svgN.svg}% \HCode{\Hnewline "\Hnewline "http://www.w3.org/TR/2001/PR-SVG-20010719/DTD/svg10.dtd"> \Hnewline} >>> \<<< \ht:special{t4ht<\jobname\:svgN.svg}% >>> \<<< \HCode{<\:svg svg>\Hnewline <\:svg g style="stroke-width:0; fill:black;">\Hnewline}% >>> \<<< \HCode{}% >>> %%%%%%%%%%%%%%%%%% \chapter{Notes} %%%%%%%%%%%%%%%%%% Requires two compilations (e.g., with \verb!mzlatex try "html,svg"!) for importing the SVG code. \endinput