Martin Vermeer wrote:

On Wed, Apr 19, 2006 at 08:57:53PM +0300, Martin Vermeer wrote:
On Wed, Apr 19, 2006 at 10:20:36AM -0500, Garst R. Reese wrote:
I have done some experimenting changing the .lyx file. To reproduce the 1.3.7 results, the Box Framless insets for the critters have position "t" and inner_pos "t" but for the title it needs position "c" and inner_pos "t". The corresponding Minipage settings in 1.3.7 are position 0, inner_position 0 and position 1, inner_position 0. So, in my case, inner_position is the same for all of the Minipage insets, but position changes. I tried all combinations of 0's and 1's
around position and inner_pos in lyx_1_4.py to no avail.

Garst
I think I know what the problem is.

1.3.7 uses the combination of height = 1pt and inner_position = 0 to
indicate the defaults. These should be translated to "1\totalheight" and
"t" to function correctly. Unfortunately lyx2lyx translates it to
"1\totalheight" and "c", because 0 -> "c" and it doesn't recognize the
special case.

Have to sleep on this one, if Jose doesn't beat me to a fix :-)

Try the attached.

- Martin

Oops, hit reply instead of reply all for the last two msgs. This is to fix things.

I played with the Box Settings in 1.4.1 by right clicking on the minipages. It shows Vertical Alignment and Inner Alignment(vert). Horizontal Alignment is greyed out. The working combination is Top Top for the critters and Middle Middle for the title. Lyx2lyx sets them to Top Middle and Middle Middle. For this file, it works to change inner_pos = ["c","t","b","s"] to inner_pos = ["t","c","b","s"]. This changes the title settins to Middle Top, but still gives a correct ps output. So I reverted this change and used the dialog boxes to set Top Top and Middle Top and again got correct output. So what dictates the ordering in inner_pos?

Your new patch also works and sets the Box Settings the same way -- Top Top and Middle Top.

Garst



------------------------------------------------------------------------

Index: lyx_1_4.py
===================================================================
--- lyx_1_4.py  (revision 13657)
+++ lyx_1_4.py  (working copy)
@@ -987,10 +987,10 @@ def convert_minipage(file):

        # convert the inner_position
        if file.body[i][:14] == "inner_position":
-            file.body[i] = 'inner_pos "%s"' %  inner_pos[int(file.body[i][15])]
+           innerpos = inner_pos[int(file.body[i][15])]
+ del file.body[i] else:
-            file.body.insert('inner_pos "%s"' % inner_pos[0])
-        i = i + 1
+           innerpos = inner_pos[1]

        # We need this since the new file format has a height and width
        # in a different order.
@@ -1018,6 +1018,12 @@ def convert_minipage(file):
        else:
            status = "collapsed"

+       # Handle special default case:
+       if height == ' "1pt"' and innerpos == 'c':
+               innerpos = 't'
+
+        file.body.insert(i, 'inner_pos "' + innerpos + '"')
+        i = i + 1
        file.body.insert(i, 'use_parbox 0')
        i = i + 1
        file.body.insert(i, 'width' + width)

Reply via email to