Minipage idea for Lyx 1.5 Was Re: Business letter (on letterhead) template for LyX
john wrote: Another suggestion from Ross Moore works brilliantly. Instead of a protected blank in the 1st line of each minipage, instead put a TeX \null. \null is a macro for \hbox{} which creates an empty box of zero dimensions. This effectively forces the minipages to top align with the very top of the minipage (rather than the baseline of a space with a physical size. I had never heard of this, but found it in Knuth's TeXbook (Appendix A, 12.6). Testing \null I tried this. A \null followed by a forced line break doesn't work, because TeX says no line here to end. A \null followed by a paragraph break works though. But there is no difference from the protected space case. It seems that a protected space have zero height, so the effect is the same as \null, with the advantage that the space is supported by LyX where \null need a bulky ERT box. Technically, there is the difference that a protected space has _length_, but in this case (and in most cases, I expect) the minipage was wider than the width of a single spave anyway. Try different characters instead of the protected space, and you'll see that tex uses the height of the character itself for computing the minipage height. An f is taller than an a which is taller than a . which is taller than the zero-height protected space. Idea for LyX 1.5 == Ability to line minipages up by the real top of the minipage (rather than the topmost baseline) is very useful. So how about adding support for it? The current Top remains, maybe it should be renamed to Top baseline for clarity. Or maybe not, for user compatibility. Then a new Top of box alignment is added. When this is used, LyX produce a latex minipage with the usual top alignment, and puts \null\par{} as the first thing inside the minipage environment. This goes before any user specified contents The sequence should work for all cases. No matter what comes next (picture, text, ...) the minipage/box will line up by the very top. I don't know if a similiar trick is needed for aligning by the bottom of the box. Bottom alignment seems to align by the real bottom - using letters like j that extends beyond the baseline still aligns the boxes by the bottom (and the texts are _not_ aligned) I believe this is something I could implement myself, once 1.5 starts up. Helge Hafting
Minipage idea for Lyx 1.5 Was Re: Business letter (on letterhead) template for LyX
john wrote: Another suggestion from Ross Moore works brilliantly. Instead of a protected blank in the 1st line of each minipage, instead put a TeX \null. \null is a macro for \hbox{} which creates an empty box of zero dimensions. This effectively forces the minipages to top align with the very top of the minipage (rather than the baseline of a space with a physical size. I had never heard of this, but found it in Knuth's TeXbook (Appendix A, 12.6). Testing \null I tried this. A \null followed by a forced line break doesn't work, because TeX says no line here to end. A \null followed by a paragraph break works though. But there is no difference from the protected space case. It seems that a protected space have zero height, so the effect is the same as \null, with the advantage that the space is supported by LyX where \null need a bulky ERT box. Technically, there is the difference that a protected space has _length_, but in this case (and in most cases, I expect) the minipage was wider than the width of a single spave anyway. Try different characters instead of the protected space, and you'll see that tex uses the height of the character itself for computing the minipage height. An f is taller than an a which is taller than a . which is taller than the zero-height protected space. Idea for LyX 1.5 == Ability to line minipages up by the real top of the minipage (rather than the topmost baseline) is very useful. So how about adding support for it? The current Top remains, maybe it should be renamed to Top baseline for clarity. Or maybe not, for user compatibility. Then a new Top of box alignment is added. When this is used, LyX produce a latex minipage with the usual top alignment, and puts \null\par{} as the first thing inside the minipage environment. This goes before any user specified contents The sequence should work for all cases. No matter what comes next (picture, text, ...) the minipage/box will line up by the very top. I don't know if a similiar trick is needed for aligning by the bottom of the box. Bottom alignment seems to align by the real bottom - using letters like j that extends beyond the baseline still aligns the boxes by the bottom (and the texts are _not_ aligned) I believe this is something I could implement myself, once 1.5 starts up. Helge Hafting
Minipage idea for Lyx 1.5 Was Re: Business letter (on letterhead) template for LyX
john wrote: Another suggestion from Ross Moore works brilliantly. Instead of a protected blank in the 1st line of each minipage, instead put a TeX \null. \null is a macro for \hbox{} which creates an empty box of zero dimensions. This effectively forces the minipages to top align with the very top of the minipage (rather than the baseline of a space with a physical size. I had never heard of this, but found it in Knuth's TeXbook (Appendix A, 12.6). Testing \null I tried this. A \null followed by a forced line break doesn't work, because TeX says "no line here to end". A \null followed by a paragraph break works though. But there is no difference from the protected space case. It seems that a protected space have zero height, so the effect is the same as \null, with the advantage that the space is supported by LyX where \null need a bulky ERT box. Technically, there is the difference that a protected space has _length_, but in this case (and in most cases, I expect) the minipage was wider than the width of a single spave anyway. Try different characters instead of the protected space, and you'll see that tex uses the height of the character itself for computing the minipage height. An "f" is taller than an "a" which is taller than a "." which is taller than the zero-height protected space. Idea for LyX 1.5 == Ability to line minipages up by the real top of the minipage (rather than the topmost baseline) is very useful. So how about adding support for it? The current "Top" remains, maybe it should be renamed to "Top baseline" for clarity. Or maybe not, for user compatibility. Then a new "Top of box" alignment is added. When this is used, LyX produce a latex minipage with the usual top alignment, and puts "\null\par{}" as the first thing inside the minipage environment. This goes before any user specified contents The sequence should work for all cases. No matter what comes next (picture, text, ...) the minipage/box will line up by the very top. I don't know if a similiar trick is needed for aligning by the bottom of the box. Bottom alignment seems to align by the real bottom - using letters like "j" that extends beyond the baseline still aligns the boxes by the bottom (and the texts are _not_ aligned) I believe this is something I could implement myself, once 1.5 starts up. Helge Hafting