Once again Herbert scores a point... I was using another form of abbreviation,
including it in a .loa file:

\newcommand{\abbrev}[2]{%
  \if@abbrlistmissing
     \listofabbreviations
     \@abbrlistmissingfalse
  \fi
     \addtocontents{loa}{\protect\makebox[8em][l]{#1}{#2}\newline}
}

The problem was that calling \addtocontents with the unprotected first
argument did not work at all. Interestingly, Herbert's solution works
quite differently and avoids the problem.

On the other hand, now all abbreviations must be together in the
beginning of the file, and cannot be apreaded around the text.

I'll try to solve that, but this is already a much better situation!

thank you!

jb

> "Joao B. Oliveira" wrote:
> > 
> > \abbrev {SVD] {Singular Value Decomposition}
> > 
> > This ERT solution works quite well, but there is a catch: many
> > times students want to put also math abbreviations in their text:
> > 
> > \abbrev { $ x^2 + y^2 $ } {Something interesting...}
> > 
> > The problem is the following: using Meta-m or Meta-c m, for
> > example, LyX does NOT produce a $...$ pair, but \(...\) and this
> > is an UNprotected environment. So, as the macro receives the first
> > argument, it is completely messed up.
> 
> i don't really understand, why you need an protected argument.
> can you send your whole preamble, because I can do something like 
> this without any error when using alt-m-m
> 
> \newcommand\abbr[2]{%
>   \parbox{.3\textwidth}{%
>     #1}%
>   \hspace{0.05\textwidth}%
>   \parbox{.65\textwidth}{%
>   #2}%
> }
> 
> 
> Herbert
> 
> -- 
> http://www.educat.hu-berlin.de/~voss/lyx/


Reply via email to