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…)

Title: Re: frames within text frames
Post by: ising4jesus on June 20, 2022, 07:33:07 pm
I understand that now... however... 

I still say that there is no normal way to select and edit the inline text frame (such as using the mouse).  Instead, you have to use a very non-intuitive, and very awkward method, by selecting windows / inline items.  This is very difficult to use - especially if you have a large number of inline text frames.  All you get is a microscopic preview, so you pretty well have to guess at what you're editing from these tiny previews.  It would make much more sense to be able to edit the text frame by selecting it with the mouse, or at least, to provide a preview large enough to recognize!  (See attachment.)

Please, someone prove me wrong!  Maybe there's a newer version that fixed this?  (I'm using 1.5.7.)

Title: Re: frames within text frames
Post by: AdmFubar on June 21, 2022, 09:05:48 pm
            x              (x)                    "This will work fine except that once it is inserted, you can't select or edit it."
Double clicking on the desired item in the inline item tab/window with bring up an edit mode. You can edit directly or right click  on it and bring up options to edit, including the story editor.
Thanks for bringing this up... I never thought to insert a text frame into another. New concept to play with.
Hopefully the developers can update the code for a more flexible editing, perhaps using LibreOffice's code for the math formula editing.
Just tried this with an image frame, this works as well. :)

            x              (x)                   
Title: Re: frames within text frames
Post by: ising4jesus on June 25, 2022, 12:14:35 am
Thanks for the reply.  Yes, I know I can open those in the edit mode by double-clicking.  The problem is that the preview images are so small that it is difficult to tell what you're editing until after you open it.  This can get rather tedious when you have lots of inline frames that look very similar in the microscopic preview.  ;-)

I had specific needs to have frames inside frames.  In particular, I want call-out boxes to flow with the main text of the story which flows from one page to the next.  It's nice that I can do this... I just hope that eventually it will become more user-friendly to do so.  As of now, it's functional, but very awkward.
Title: Re: frames within text frames
Post by: AdmFubar on June 25, 2022, 05:47:45 am
            x              (x)                    Thought I had a solution for you, by copying into the scrapbook first. But the scrapbook has the same small thumbnail issue as the inline image,