Kile allows me to fold the ocde in between begin-end blocks. However, I am interested in manually grouping parts of the text. Is there a way to do that?

To give an example from another IDE, Netbeans offers code blocks by putting code in between the specific comment lines as follows:

// <editor-fold defaultstate="collapsed">
   Your code goes here...
// </editor-fold>

Is there such a structure for Kile? I couldn't find it so far.

This will be especially useful for folding references in the bibliography file which I am editing via Kile.


1 Answer 1

<lots of stuff>

You can add stuff after the BEGIN/END, too. For example, I'll often add a label or something for easy identification.

For example, suppose my document looks like this:

custom folding: unfolded

So I've got 2 custom blocks of code which can be folded:

% BEGIN blocks
% END blocks


% BEGIN paths
% END paths

Then I can fold the code in the usual way:

custom folding: folded

  • Didn't work. Can it be a version issue? I am using Kile Version 2.1.3 Using KDE Development Platform 4.13.3 Apr 27, 2016 at 5:12
  • I have 2.1.3 with platform 4.14.19. But this has worked for a long time for me. See above - this is what you meant, isn't it?
    – cfr
    Apr 27, 2016 at 20:05
  • Exactly. It worked now. I guess, I have been trying it in the .bib file (which is what I was actually looking for). It works well with the .tex file. Thanks for the extra information and screenshots. Apr 28, 2016 at 18:01
  • I'm not sure I've tried with a .bib file. However, check in the settings what schemas Kile is applying to those files as it makes a difference to various kinds of things. (I don't know if it will change this, mind. Just it often helps.)
    – cfr
    Apr 28, 2016 at 18:45
  • I have noticed that this solution does not work just below \ section{xxx}, but it works if you put "\label{xxx}" just after the section, then you can put the "% BEGIN block ... % END block".
    – Rodrigo
    Mar 10, 2017 at 15:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .