Scribus Forums

Development => User Interface => Topic started by: steve98052 on May 23, 2021, 09:14:13 pm

Title: frames within text frames
Post by: steve98052 on May 23, 2021, 09:14:13 pm
If this is a feature that exists that I don't know about, please point the way. I'm pretty sure it is not.

There are situations where it would be very useful to be able to insert a frame into a text frame -- including another text frame -- and have the inside frame attach to the text inside the outside frame, as opposed to a location within the outside frame.

In other words, suppose I have I this text and I want to insert a frame between the sentences.

A short sentence. Another short sentence.

In current practice, I could insert a bunch of spaces between the sentences, and place the inside frame into the space.

A short sentence. | inside frame | Another short sentence.

But if I change the first sentence to "A slightly longer sentence", the inside frame doesn't move, the final word is covered by the inside frame, and the inserted blanks push the second sentence to the side.

A slightly longer | inside frame |           Another short sentence.

Additionally, if the inside frame is changed in dimensions, the extra spaces don't expand.

A short sentence. | larger inside frame | r short sentence.

The way I'd like it to work would be to make it possible to anchor the inside frame to a point in the text of the outside frame. That would remove the need to insert blanks, so that changing the text before the inside frame moves the inside frame appropriately, and changing the size of the inside frame moves the text after.

My intended application would be shortcut to equations that doesn't involve the entire TeX plug-in for just a few simple equations. For example, instead of coding this equation as three lines of text in page-layout order, they're coded in logical order.

This way works, but putting the text in as "[spaces] numerator [newline] ratio = ___________ [newline] [spaces] denominator" breaks the logical flow of the equation.

ratio = ___________

Instead, this preserves the logical flow of the equation, which is "ratio = [begin frame] numerator [newline] _________ [newline] denominator [end frame]". (Imagine this as kind of an XML pseudocode.)

ratio = <insert frame>
        <end inserted frame>

This wouldn't replace TeX for complicated stuff (and maybe not even fairly simple stuff like square root symbols), but it would probably have value for other purposes, such as inserting images for things like glyphs not present in a font.

I haven't looked at the code for Scribus, but depending on how complicated it is, I might be able to code this myself, if I get some pointers at where to start.
Title: Re: frames within text frames
Post by: ising4jesus on January 23, 2022, 12:06:55 pm
Yes, you can insert a text frame inside another text frame, however, it is buggy at the moment.  Before I go further, let me say that once you do enter the frame inside the frame, it won't be editable, so make sure it's right before you insert it.

Here's how to make it work:

1. Create your new Text Frame, and get it formatted and styled exactly as you want it to be.
    Insert menu / Text Frame,  Then draw your frame, etc.

2. Select the frame, so you can set the border handles, and then select "Cut" from the Edit menu.

3. Double-click inside the text box where you want the new one inserted, and position the cursor where you want it to be.
    NOTE:  You do NOT want to add spaces as you mentioned in your message.  Just position the cursor where you want it.

4. Paste in your frame.  It will now flow with the text inside the other frame.
    Edit Menu / Paste

This will work fine except that once it is inserted, you can't select or edit it.
Title: Re: frames within text frames
Post by: utnik on January 23, 2022, 05:51:18 pm
hi ising4jesus

why aren't you reading what jean ghali tells you?
you can edit your inline text frame. (open 'windows' → 'inline items' and right click the item you like to edit…)