For Programmers: Free Programming Magazines  


Home > Archive > Tex > July 2006 > A xypic macro definition produces error when separate, no error when









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author A xypic macro definition produces error when separate, no error when
Filip Miletic

2006-07-27, 7:03 pm

Greetings.

I stumbled upon a problem when using xypic within \newcommand in LaTeX,
as follows.

The following short file compiles without problems.

\documentclass{article}
\usepackage[all]{xypic}

\newcommand{\xyphil}{
\xymatrix@=1.5{ a & b}
}

\begin{document}

Hello.

\xyphil

\end{document}

However, if I put the \newcommand in a separate style file, an error
occurs. How can I keep the definition of \xyphil in a style file?

The error message, and the two files are given below.

> ERROR: Undefined control sequence.
>
> --- TeX said ---
> \xyphil -> \xymatrix@
> =1.5cm{ a & b }
> l.13 \xyphil
>



%% File: xyttest.sty
\newcommand{\xyphil}{
\xymatrix@=1.5{ a & b}
}
%% End file

%% File: xyt.tex
\documentclass{article}
\usepackage[all]{xypic}
\usepackage{xyttest}

\begin{document}

Hello.

\xyphil

\end{document}
%% End file
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com