[Tex/LaTex] Can one “fold” part of the paragraphs in LyX

code foldinglyx

By "folding", I mean condense some part of the codes, and by one click , you can unfold them.

Best Answer

While LyX has not yet "traditional" functionality for general editor folding, it can relatively easy be simulated by using LyX branches. As branches are insets, they can be folded within LyX. (By activating/deactivating them, you could even fold them in the output, but that is another story.)

enter image description here

To fold some content, just select it and then choose Insert->Branch from the menu. If you do this the first time, you have to create the respective branch (e.g., "Folded"); afterwards, you can just put more content into the "Folded" branch. For quick access, it is possible and recommended to bind this function to a keyboard shortcut.

Note that a new branch is deactivated by default, which means that its content will not appear in the output. You can change this by right-clicking on the inset.