mailRe: latex_mf_table.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Edward d'Auvergne on March 10, 2009 - 20:48:
On Tue, Mar 10, 2009 at 8:44 PM, Sébastien Morin
<sebastien.morin.1@xxxxxxxxx> wrote:
Please see below...


Edward d'Auvergne wrote:
On Tue, Mar 10, 2009 at 7:26 PM, Sébastien Morin
<sebastien.morin.1@xxxxxxxxx> wrote:

Hi Ed,

Your proposal works for not crashing when a spin is not selected.

However, for this not selected spin, the printout is something like:

   :3\&:LEU@N           & \


Oh, that is strange.  It should produce:

   :3\&:LEU@N           & \\

hence terminating the table row.



Hence, it doesn't compile with latex.

Something like this compiles without problem:

   :3\&:LEU@N           & \multicolumn{11}{c}{} \\


Hence, I would add the following change to you fix:

           # The spin is not selected.
           if not spin.select:
               self.file.write("\\multicolumn{11}{c}{} \\\\\n")
               continue


This should fix the problem!



The same could fix things if a spin has no model...

               # The model-free model.
               if hasattr(spin, 'model'):
                   self.file.write("$%s$ & " % spin.model)
               else:
                   self.file.write("\\multicolumn{11}{c}{} \\\\\n")


This one will cause problems as the rest of the spin info will be
printed on the next line, producing a broken table.  You would need a
continue statement at the end of the 'else' section to avoid this
breakage.

In fact, this has not to be changed. The changed was needed before I
fixed the not selected spins issue... Now, if a spin is selected, it
will be associated with a model... The only exception I see is when a
spin has all its models eliminated... Should then changed the code to
cover this potential issue with:

           # The model-free model.
           if hasattr(spin, 'model'):
               self.file.write("$%s$ & " % spin.model)
           else:
               self.file.write("\\multicolumn{11}{c}{} \\\\\n")
               continue

???

That should catch all the problems I can currently think of.  Would
you like to make these fixes?

Cheers,

Edward



Related Messages


Powered by MHonArc, Updated Tue Mar 10 21:01:05 2009