2

See the following code:

\documentclass{amsart}

\usepackage[matrix,arrow,curve,cmtip]{xy}

\begin{document}
\newcommand\test{
  \xymatrix{{a} \ar^-{b}[r] & {c} \ar@<0.7ex>^-{d}[r]\ar@<-0.7ex>_-{e}[r] & {f}}
}
\tracingmacros=1
Compare
\[
  \test
\]
and
\[
  \xymatrix{{a} \ar^-{b}[r] & {c} \ar@<0.7ex>^-{d}[r]\ar@<-0.7ex>_-{e}[r] & {f}}
\]
\end{document}

It is very weird that if I put \xymatrix part in a macro as above, then tex4ht will generate messy pictures. I look for a workaround of this.

2

The issue is with superscripts, as they are patched by tex4ht at \begin{document}. Your sample compiles correctly when you move definition of the \test macro before \begin{document}. Another possibility is to use the no^ and no_ command line options, but this may broke other things.

% https://tex.stackexchange.com/q/499677/2891
\documentclass{amsart}

\usepackage[matrix,arrow,curve,cmtip]{xy}

\newcommand\test{%
  \xymatrix{{a} \ar^-{b}[r] & {c} \ar@<0.7ex>^-{d}[r]\ar@<-0.7ex>_-{e}[r] & {f}}
}

\begin{document}
\tracingmacros=1
Compare
\[
  \test
\]
and
\[
  \xymatrix{{a} \ar^-{b}[r] & {c} \ar@<0.7ex>^-{d}[r]\ar@<-0.7ex>_-{e}[r] & {f}}
\]
\end{document}

enter image description here

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.