% \subsubsection{Images} % \DescribeEnv{image}{Place images inside an |image| environment. On paper, this centers the image. On the web, this provides additional benefits.} % \begin{macrocode} %<*classXimera> %\newenvironment{image}[1][]{\begin{center}}{\end{center}} \NewEnviron{image}[1][3in]{% \begin{center}\resizebox{#1}{!}{\BODY}\end{center}% resize and center } % % \end{macrocode} % \DescribeMacro{\alt}{Inside an |image| environment, |\alt| provides alt-text for assistive technology like screenreaders.} % \begin{macrocode} %<*classXimera> \newcommand{\alt}[1]{} % % \end{macrocode} % The |image| environment doesn't actually work in tex4ht as defined % with NewEnviron; so this renewenvironment is needed. % image-environment also gets formatted in a well, and when the user % clicks on the image, it zooms in. % \begin{macrocode} %<*htXimera> \newcounter{imagealt} \setcounter{imagealt}{0} \renewenvironment{image}[1][]{\stepcounter{imagealt}% \ifvmode \IgnorePar\fi \EndP% \HCode{}} \renewcommand{\alt}[1]{\HCode{}} % % \end{macrocode} % Although we accept many formats, SVG is preferred on the web. % Since we have a different mechanism for producing |alt| text, we % want to ignore tex4ht's own method fo producing alt text. % \begin{macrocode} %<*cfgXimera> \DeclareGraphicsExtensions{.jpg,.png,.gif,.svg} \Configure{graphics*} {svg}{ {\Configure{Needs}{File: \Gin@base.svg}\Needs{}} \Picture[]{\csname Gin@base\endcsname.svg \csname a:Gin-dim\endcsname}% } % % \end{macrocode} % This is a hack to kill |includegraphics| commands in % |\documentclass{standalone}| files % \begin{macrocode} %<*cfgXimera> \ifcsname ifstandalone\endcsname \ifstandalone \renewcommand\includegraphics[2][]{} \fi % % \end{macrocode} % PGF sometimes causes trouble, but we simply don't care in tex4ht mode. % \begin{macrocode} %<*htXimera> \newcommand{\pgfsyspdfmark}[3]{} % % \end{macrocode}