Dear all,

as I'm at the beginning of a document preparation process I do not want to
decide right now how to decorate vectors, tensors and so on.

For this reason, I chose  math macros since at the end of the preparation
I can change the decorations easily by editing only the macro.

I typed in

\newcommand{\vek}[1]{\vv{#1}}  and pressed CTRL-M for macro creation

But if I put the macro in a caption of a floating figure, the Latex compiler 
reports the error:


Argument of \...@caption has an extra }. ...

I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.


If I use a ERT with a protect-comand in the macro definition: 
\newcommand{\vek}[1]{\protect\vv{#1}}
no Latex error occurs (but then in my LyX equations the \vek -command is always 
displayed.

If I convert the same macro definition  \newcommand{\vek}[1]{\protect\vv{#1}} 
to a LyX macro
the Latex compiles again report the above mentioned error. The protect-command 
seems to be lost during conversion.

Does anybody know what's going on here?


Another question is if the math macros can lead to ambiguous equations:

If I define the macro \newcommand{\expo}[2]{#1^#2} and convert it with CTRL-M
a resulting (nonsense) Latex equation could be $\expo{ab}{cd}+\expo efg$.

Thus, only when the arguments consists of more than one character, curly braces 
are put around them.
For this reason in the Latex equation it is not distinguishable at a glance 
that the variable g does not belong to the expo-macro
since there is no space character between the f and the g.

Could this cause ambiguities in the equations?


Thanks for help in advance.

Best regards,
Jens Nellesen

Reply via email to