Re: Problem with optional arguments on macros

2011-08-01 Thread Paul Rubin
Your test file compiled correctly for me every time I tried (multiple tries
within one LyX session, multiple LyX sessions, exported to .tex and compiled
outside LyX).

Paul



Problem with optional arguments on macros

2011-07-18 Thread Brandon Fogel


test3.lyx
Description: Binary data


I'm having a problem with optional arguments on macros.  They are sometimes 
written into the TeX file as
non-optional (i.e., in {} instead of []), which causes them to be ignored
by the TeX compiler.  This appears to be random -- different instances of
the same macro in the same document will render differently.  If the
instances are viewed unfolded, then it doesn't happen.  (This is not a
good solution, even as a workaround, since there is no way to unfold all
the instances in a document at once.)

Anyone had this problem, too, and know of a good workaround?

I've attached  a sample file.  The problem may not show up the first time,
so it should be compiled several times.

Here are instructions for creating a sample with this problem:

Open a new file, create a new macro, add 4 optional arguments, and then
format the TeX however you want (I used {#1^{#2^{#3^{#4}}}).

Now add a math environment and create an instance of the new command.
Copy and paste a bunch of these, say, 20, on different lines.

Compile several times.  The problem will show up intermittently with
different instances.

Thanks!

-Brandon