Collapse/Expand Text inside a document

Hi all, is there a function similar to that of programming IDE’s where you can enclose a whole swath of text inside delimiters, and then expand/collapse that section of text?

The reason I would like to do this is: inside any given page I might make a statement and I don’t want to clutter the narrative with a bunch of background info/motivation/research on that statement…but I would love to be able to expand out the details when needed. Thanks!

1 Like

This would be an extremely useful capability. It’s not part of the RTF spec to my knowledge, and I don’t believe the developers would be able to provide it in quite that way.

But the ability to “windowpane” (expand and collapse) individual documents within Scrivenings would fit Scrivener’s document model and its users’ purposes quite well. It might even allow for rearrangement within the Scrivenings pane. That should be one to think about.

I’m not sure what the situation is with the toolkit on the Windows side, but I know that Keith has looked into this on the Mac side and found no way to implement it given the architecture of the system. It wouldn’t surprise me if the situation is similar, as this particular capability requires the text engine to support the concept all the way down to its roots. You can’t just slap a solution on the surface, otherwise things get extremely messy with the undo stack and so on. Coding editors have it easier since they are starting at such a very basic level of operation—that of plain text. There is less infrastructure in the way of everything you want to do when you don’t have a huge rich text editing system in the way.

So that’s more the problem rather than RTF. We can get around limitations in RTF with our own codes, much like we already do for linked images, internal cross-references and our four-way notation stream.

For most purposes, the system is already designed to make it easy to do that. Simply exclude the items from the selection and they will vanish from the Scrivenings session. For example, if you have five items selected in the Binder and are viewing them as a Scrivenings session, try Ctrl-clicking the item you want to “collapse”. Ctrl-click it again to bring it back.

Also, in the case of background research and notes that aren’t meant as part of the final document, inspector comments are helpful here as they can be attached to the relevant statement but hidden away in the inspector, so won’t clutter the document. For really lengthy notes, you might want to create a separate document in the binder and link to it from your original document.

It’s been a while since this was brought on, but I have the same wish, as it would make longer documents more manageable. Has anything changed in the programming field to make this possible or is it still a no?

Not the same … but a comment can be a kind of “collapsed” text that “expands” when you click on the link.

1 Like

The problem is I already use comments for other stuff and I need to put links in the collapsed text (you can’t put links in comments). Still, thanks for the tip anyway! :wink:

I see :man_shrugging: … maybe I can think of something else.

1 Like

Maybe a stupid idea. :joy: If there was a way to link index cards of one project with text in another project … I just opened two projects side by side here. (1) in the main text is linked to index card (1).

You could create a folder in Notes called Cards.
Create documents called 1, 2, 3, etc. in Cards.
Then set your links to open as Quick Reference Panes.
Finally use Link to Document to open Cards 1 to infinity via a link, as a Quick Reference Pane (as many as you can handle at a time), which is expandable and contractable and can contain infinite text.

That’s true. Instead of two projects, you can use two editors. If you use the freeform mode for the index cards, it is similar to Scapple and linking is also possible. :slightly_smiling_face: